-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal for custom templating #758
Conversation
Pass the input folder to the Generate render functions.
- Move creategroup implementation to Menu file - Cleanup menu file - After cleanup Still need to figure out how to convert LiterateDocMode llist type to our new type, maybe with a partial active pattern? - WIP namespace implementation
Add function to create menuItem elemetns TBD: items showing wrong data
- Merge upstream - Implemented All namespaces item render from html template - Add and modified reviewed files - Add .Ds_Store to .gitignore (First mac contributor?)
- Implemented changes from last feedback - Implemented namespaces custom templating for GenerateMarkdown.fs - Some code cleanup
Regenerate files when templates are updated.
- Added docs for new features - Replace blank spaces in function 'snakeCase' so HTML ids wont fail
2fa72cd
to
1b13e58
Compare
docs/styling.md
Outdated
## Customizing menu items by template | ||
|
||
You can add advanced stylings to the sidebar generated menu items by creating a new template for it. | ||
For adding a template via command line you can use the `--input` option or alternatively add them to the docs/ folder. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is slightly confusing. What you basically want to say is that the fsdocs
will look for menu templates in the --input
folders. This folder defaults to docs
.
You are not really adding any template via the command line.
Also, make it clear that both templates need to exist before. Otherwise, it won't work.
|
||
type MenuItem = { Link: string; Content: string } | ||
|
||
let private snakeCase (v: string) = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still produces kinda funky identifiers.
Consider "End-user documentation" being transformed to "_end-userdocumentation".
I would trim the leading and trailing _
and replace spaces with -
or _
instead.
And may even replace all _
to -
or vice versa, so you don't have a mix.
Feel free to revisit this entire helper function if that makes more sense.
- Added html format to markdown samples
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, @dsyme this is ready for review.
Could we have some tests added as well please? e.g. in https://github.com/fsprojects/FSharp.Formatting/blob/main/tests/FSharp.ApiDocs.Tests/ApiDocsTests.fs? |
Great! |
Related to #754
FYI: @nojaf