Skip to content

Commit

Permalink
fixup! Chore(web): Allow duplicate headings in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
literat committed Dec 11, 2024
1 parent 6351a84 commit 5eb45f8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .remarkrc.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,21 @@ export default {
// @see: https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-list-item-spacing
['remark-lint-list-item-spacing', false],

/**
* There are generic headings which can be repeated across sections.
* For example "API", "Options", "Theming".
* If we are describing a few subcomponents in the same document, that's the case.
* In Header, there were two "Navigation" headings for example.
*
* It turns out that IDEs and Git hosts handle the duplicate headings the same way,
* that is, in case of conflict when generating HTML, they add a number suffix
* to their ID (at least PhpStorm and GH do it).
*
* Tt's more a question of linking the headings than the duplication itself.
* The question is whether it's more comfortable and sustainable for us to link to headings like `#card-1`
* (and, for a human reading the document, "Card" is what we want to see), or to be
* more specific and future proof in cases like `#cardbody-api` instead of #api-4
*/
// Allow duplicate headings as it is completely valid to have headings of the same name in a document.
// @see: https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-no-duplicate-headings
['remark-lint-no-duplicate-headings', false],
Expand Down

0 comments on commit 5eb45f8

Please sign in to comment.