doc: remove TOC summary for pages with no TOC#37043
Conversation
|
Currently, index.html has a |
| .use(htmlStringify) | ||
| .processSync(toc).toString(); | ||
| if (toc !== '') { | ||
| file.toc = '<details id="toc" open><summary>Table of contents</summary>' + |
There was a problem hiding this comment.
This PR also removes the capitalisation of Contents. That's fine with me, but I wanted to point it out in case it was not on purpose. Other occurrences uses the capitalization:
node/doc/guides/cpp-style-guide.md
Line 6 in 7794d36
Line 8 in 4d3e87d
There was a problem hiding this comment.
It was indeed on purpose. Our documentation style guide indicates the use of sentence case for document headings. This isn't exactly a heading (but the other things you point to are). However, the style guide also says to refer to Microsoft's style guide for things it (our style guide) doesn't cover, and Microsoft's style guide recommends sentence case for situations like this.
| .processSync(toc).toString() + | ||
| '</details>'; | ||
| } else { | ||
| file.toc = '<!-- TOC -->'; |
There was a problem hiding this comment.
Alternatively, we could rollback to <h2> for the Index:
| file.toc = '<!-- TOC -->'; | |
| file.toc = '<div id="toc"><h2>Table of contents</h2></div>'; |
It would let us revert the changes in tools/doc/allhtml.js, but also means the all.html page would not have a retractable TOC anymore.
There was a problem hiding this comment.
all.js is the most useful place for this feature so I'm inclined to do the extra work to keep the <details> tag there.
|
Welp, the does-nothing-useful-on-the-main-index-page-for-docs @nodejs/website |
Remove the table of contents summary for pages with no table of contents. Currently, this affects at least index.html. PR-URL: nodejs#37043 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
4be7773 to
683754c
Compare
|
Landed in 683754c |
Remove the table of contents summary for pages with no table of contents. Currently, this affects at least index.html. PR-URL: #37043 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Remove the table of contents summary for pages with no table of contents. Currently, this affects at least index.html. PR-URL: #37043 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Remove the table of contents summary for pages with no table of
contents. Currently, this affects at least index.html.