dotnet / docfx

Static site generator for .NET API documentation.
https://dotnet.github.io/docfx/
MIT License
4.07k stars 865 forks source link

Dividers in Navbar defined in the TOC file #1143

Open Nick-Lucas opened 7 years ago

Nick-Lucas commented 7 years ago

It would be really helpful if you could define a divider in the TOS file, to separate out similar links.

This would look something like:

- name: Item 1
  href: item1/
- name: Item 2
  href: item2/
- divider
- name: Item 3
  href: item3/

Example use case:

separating off-site links from documentation links.

You can kind of fake it right now with an item like:

- name: " "

however, this inserts a link, the vertical height is wrong, and it's possibly too wide

image

vicancy commented 7 years ago

Prosposal:

- name: Item 1
  href: item1/
- name: Item 2
  href: item2/
- name: "---"
- name: Item 3
  href: item3/

And modify https://github.com/dotnet/docfx/blob/dev/src/docfx.website.themes/default/styles/docfx.js#L343 to transform "---" into "divider"

JimBobSquarePants commented 6 years ago

Can this not be achieved using CSS? :nth-of-type() or :nth-child(). Using empty divs is a poor fix.

danatcofo commented 5 years ago

sure it could be, but one of the main purposes of having a divider is to provide contextual separation. doing that in a toc makes sense and easy to find, doing it purely in css is much harder to find. Not a bad idea IMO.