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
fix(docs-infra): do not include GitHub links in Table of Content #32418
Conversation
scripts/git/commit-msg.js
Outdated
console.error( | ||
'\nCheck CONTRIBUTING.md at the root of the repo for more information.' + | ||
'\n' + | ||
'\n(In case you need the invalid commit message, it should be stored in \'.git/COMMIT_EDITMSG\'.)'); |
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.
LOL did you get bitten by this?
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.
More times than I want to admit 😇
(I thought I had removed this change from this PR. I submitted #32420.)
You can preview 129dee6 at https://pr32418-129dee6.ngbuilds.io/. |
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.
Actually there seem to be a bunch of legitimate failures.
129dee6
to
cab10e0
Compare
You can preview cab10e0 at https://pr32418-cab10e0.ngbuilds.io/. |
You can preview 48fabd5 at https://pr32418-48fabd5.ngbuilds.io/. |
48fabd5
to
dea05af
Compare
You can preview dea05af at https://pr32418-dea05af.ngbuilds.io/. |
It turns out there was another issue with tooltips ( @petebacondarwin: PTAL 👀 |
The Table of Contents (ToC) is auto-generated based on the content of heading elements on the page. At the same time, anchor links are auto-generated and added to each heading element. Note that the Material Icons used for the anchor icon make use of ligatures, which means that the icons are specified by using their textual name as text content of the icon element. As a result, the name of the icon is included in the parent element's `textContent`. Previously, the `TocService` used to strip off these anchor elements when generating the content of ToC items, but not when generating the content of their tooltips. Thus, tooltips for ToC items would confusingly include a `link` suffix (`link` is the textual name of the icon used in heading anchor links). This commit fixes this by deriving the tooltip content from the transformed text content (which already has anchor links stripped off), instead of from the original heading content.
The docs template for cli commands ([cli-command.template.html][1]) includes an `h2` element with GitHub links for [long description][2]. Since the content of `h2` elements is replicated in the auto-generated Table of Contents, the GitHub links were replicated as well (which is undesirable). This commit fixes it by explicitly excluding `.github-links` elements, when extracting the content for the ToC (in [TocService#extractHeadingSafeHtml()][3]). This is similar to what we do for the auto-generated `.header-link` anchors. [1]: https://github.com/angular/angular/blob/1537791f0/aio/tools/transforms/templates/cli/cli-command.template.html [2]: https://github.com/angular/angular/blob/1537791f0/aio/tools/transforms/templates/cli/cli-command.template.html#L18 [3]: https://github.com/angular/angular/blob/1537791f0/aio/src/app/shared/toc.service.ts#L56
dea05af
to
0dd6d5a
Compare
You can preview 0dd6d5a at https://pr32418-0dd6d5a.ngbuilds.io/. |
) The docs template for cli commands ([cli-command.template.html][1]) includes an `h2` element with GitHub links for [long description][2]. Since the content of `h2` elements is replicated in the auto-generated Table of Contents, the GitHub links were replicated as well (which is undesirable). This commit fixes it by explicitly excluding `.github-links` elements, when extracting the content for the ToC (in [TocService#extractHeadingSafeHtml()][3]). This is similar to what we do for the auto-generated `.header-link` anchors. [1]: https://github.com/angular/angular/blob/1537791f0/aio/tools/transforms/templates/cli/cli-command.template.html [2]: https://github.com/angular/angular/blob/1537791f0/aio/tools/transforms/templates/cli/cli-command.template.html#L18 [3]: https://github.com/angular/angular/blob/1537791f0/aio/src/app/shared/toc.service.ts#L56 PR Close #32418
…32418) The Table of Contents (ToC) is auto-generated based on the content of heading elements on the page. At the same time, anchor links are auto-generated and added to each heading element. Note that the Material Icons used for the anchor icon make use of ligatures, which means that the icons are specified by using their textual name as text content of the icon element. As a result, the name of the icon is included in the parent element's `textContent`. Previously, the `TocService` used to strip off these anchor elements when generating the content of ToC items, but not when generating the content of their tooltips. Thus, tooltips for ToC items would confusingly include a `link` suffix (`link` is the textual name of the icon used in heading anchor links). This commit fixes this by deriving the tooltip content from the transformed text content (which already has anchor links stripped off), instead of from the original heading content. PR Close #32418
) The docs template for cli commands ([cli-command.template.html][1]) includes an `h2` element with GitHub links for [long description][2]. Since the content of `h2` elements is replicated in the auto-generated Table of Contents, the GitHub links were replicated as well (which is undesirable). This commit fixes it by explicitly excluding `.github-links` elements, when extracting the content for the ToC (in [TocService#extractHeadingSafeHtml()][3]). This is similar to what we do for the auto-generated `.header-link` anchors. [1]: https://github.com/angular/angular/blob/1537791f0/aio/tools/transforms/templates/cli/cli-command.template.html [2]: https://github.com/angular/angular/blob/1537791f0/aio/tools/transforms/templates/cli/cli-command.template.html#L18 [3]: https://github.com/angular/angular/blob/1537791f0/aio/src/app/shared/toc.service.ts#L56 PR Close #32418
…ngular#32418) The Table of Contents (ToC) is auto-generated based on the content of heading elements on the page. At the same time, anchor links are auto-generated and added to each heading element. Note that the Material Icons used for the anchor icon make use of ligatures, which means that the icons are specified by using their textual name as text content of the icon element. As a result, the name of the icon is included in the parent element's `textContent`. Previously, the `TocService` used to strip off these anchor elements when generating the content of ToC items, but not when generating the content of their tooltips. Thus, tooltips for ToC items would confusingly include a `link` suffix (`link` is the textual name of the icon used in heading anchor links). This commit fixes this by deriving the tooltip content from the transformed text content (which already has anchor links stripped off), instead of from the original heading content. PR Close angular#32418
…ular#32418) The docs template for cli commands ([cli-command.template.html][1]) includes an `h2` element with GitHub links for [long description][2]. Since the content of `h2` elements is replicated in the auto-generated Table of Contents, the GitHub links were replicated as well (which is undesirable). This commit fixes it by explicitly excluding `.github-links` elements, when extracting the content for the ToC (in [TocService#extractHeadingSafeHtml()][3]). This is similar to what we do for the auto-generated `.header-link` anchors. [1]: https://github.com/angular/angular/blob/1537791f0/aio/tools/transforms/templates/cli/cli-command.template.html [2]: https://github.com/angular/angular/blob/1537791f0/aio/tools/transforms/templates/cli/cli-command.template.html#L18 [3]: https://github.com/angular/angular/blob/1537791f0/aio/src/app/shared/toc.service.ts#L56 PR Close angular#32418
…ngular#32418) The Table of Contents (ToC) is auto-generated based on the content of heading elements on the page. At the same time, anchor links are auto-generated and added to each heading element. Note that the Material Icons used for the anchor icon make use of ligatures, which means that the icons are specified by using their textual name as text content of the icon element. As a result, the name of the icon is included in the parent element's `textContent`. Previously, the `TocService` used to strip off these anchor elements when generating the content of ToC items, but not when generating the content of their tooltips. Thus, tooltips for ToC items would confusingly include a `link` suffix (`link` is the textual name of the icon used in heading anchor links). This commit fixes this by deriving the tooltip content from the transformed text content (which already has anchor links stripped off), instead of from the original heading content. PR Close angular#32418
…ular#32418) The docs template for cli commands ([cli-command.template.html][1]) includes an `h2` element with GitHub links for [long description][2]. Since the content of `h2` elements is replicated in the auto-generated Table of Contents, the GitHub links were replicated as well (which is undesirable). This commit fixes it by explicitly excluding `.github-links` elements, when extracting the content for the ToC (in [TocService#extractHeadingSafeHtml()][3]). This is similar to what we do for the auto-generated `.header-link` anchors. [1]: https://github.com/angular/angular/blob/1537791f0/aio/tools/transforms/templates/cli/cli-command.template.html [2]: https://github.com/angular/angular/blob/1537791f0/aio/tools/transforms/templates/cli/cli-command.template.html#L18 [3]: https://github.com/angular/angular/blob/1537791f0/aio/src/app/shared/toc.service.ts#L56 PR Close angular#32418
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
The docs template for cli commands (cli-command.template.html) includes an
h2
element with GitHub links for long description. Since the content ofh2
elements is replicated in the auto-generated Table of Contents, the GitHub links were replicated as well (which is undesirable).This commit fixes it by explicitly excluding
.github-links
elements, when extracting the content for the ToC (in TocService#extractHeadingSafeHtml()). This is similar to what we do for the auto-generated.header-link
anchors.