-
Notifications
You must be signed in to change notification settings - Fork 840
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
Add ZERO WIDTH SPACE to TOC yml #1496
Comments
It's nice to insert the SPACE when constructing the toc DOM in DocFX's theme. |
@hellosnow w I thought you added a comment too (according to the e-mail notification I got, as well as @vicancy). I took another look at the .NET Core API docs. If you look at the source of the menu at the left you will see. <li aria-expanded="false" tabindex="1" aria-treeitem="true" class="noSubs">
<a tabindex="1" href="/en-us/aspnet/core/api/microsoft.aspnet.identity.corecompat" data-text="microsoft.aspnet.identity.corecompat">Microsoft​.AspNet​.Identity​.CoreCompat</a>
<ul aria-treegrid="true">
<!-- hidden for clarity -->
</li>
</ul>
</li> The most important part here is the text between the var breakDots = function(str) {
if(str && str.length){
return str.split('.').join('\u200B.');
}
return str;
}; Maybe that is the way to go instead of implementing this in the backend. In order to answer your question @hellosnow |
@qinezh , what about search? |
@qinezh @vwxyzh nice catch, let's change the display |
@vicancy sounds a good approach. 👍 |
I'm using DocFX to generate our API documentation. I'm currently working on styling our own theme. The problem is our namespace are quite long so they disappear from the menu. When I was looking at the Microsoft .NET Core API documentation I saw they added the ZERO WIDTH SPACE character to the a href. Trying to do something like this for our documentation ended up in editing the toc.yml in the /api directory. But since this file is generated in a build on VSTS this will not work.
Now I'm figuring out how I can add this ZERO WIDTH SPACE before the dots in our namespace. Together with adding
word-wrap: break-word;
to the CSS will result in nice word breaking in the menu.Curious if it's a useful edit to docfx or if it should be in a plugin.
Related to:
#234 (comment)
#1222 (comment)
The text was updated successfully, but these errors were encountered: