Skip to content

Wordwrap for SideNav/TOC when using statictoc #9080

Answered by sahra-marie
sahra-marie asked this question in Q&A
Discussion options

You must be logged in to vote

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:

<ul class="nav level{{level}}">
{{#items}}
  <li>
    {{^leaf}}
    <span class="expand-stub"></span>
    {{/leaf}}
    {{#href}}
    <a href="{{href}}" title="{{name}}" class="xref {{#active}}active{{/active}}">{{name}}</a>
    {{/href}}
    {{^href}}
    <a class="{{#active}}active{{/active}}></a>
    {{/href}}
    {{^leaf}}
      {{>par…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by sahra-marie
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant