Wordwrap for SideNav/TOC when using statictoc #9080
-
I am looking for a way to do an automatic line break in the side navigation bar/toc (where the namespaces are) when opening the documentation files in a browser over the file explorer. Everything worked fine when serving the page over docfx with
Before I added the statictoc template, too long entries automatically went over serveral lines so that the whole namespace or class was readable. Now I have the same problem as it is described in discussion #7575, that the namespaces (and classes) are too long and exceeding the available space of the side nav bar and thus are not readable anymore. Disabling CORS or running it via a web server is unfortunately no option, I need it to be locally. Regarding the referenced discussion: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Solved it by making a custom template where I overwrite the file partials/li.tmpl.partial of the statictoc template. My li.tmpl.partial file now looks like this:
|
Beta Was this translation helpful? Give feedback.
Solved it by making a custom template where I overwrite the file partials/li.tmpl.partial of the statictoc template.
Essentially, the only thing missing was the xref class for the items in the TOC. With adding this the linebreaks are done via the existing breakText() function which is located in the docfx.js.
My li.tmpl.partial file now looks like this: