-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
## Table of Contents |
Line 8 in 4d3e87d
## Table of Contents |
## Table of Contents |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.