Skip to content

docs: update heading levels - #15631

Merged
kgryte merged 2 commits into
developfrom
philipp/drift-tools-remark-plugins-2026-09-28
Sep 28, 2026
Merged

kgryte merged 2 commits into
developfrom
philipp/drift-tools-remark-plugins-2026-09-28

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Description

What is the purpose of this pull request?

This pull request promotes three README API signature headings from level 3 to level 4, so that the primary signature heading inside <section class="usage"> sits at level 4 as it does in 6194 of 6200 (99.90%) stdlib package READMEs carrying an API heading in their usage section, and in 12 of 14 (86%) packages in _tools/remark/plugins.

The corrected condition is specific: a primary signature heading at level 3 with no level-4 heading above it. Level-3 headings remain correct elsewhere in stdlib as sub-grouping headings (### Properties, ### Methods) nested beneath a level-4 API heading — 199 READMEs use them that way, and this change is not a licence to demote those.

@stdlib/_tools/remark/plugins/remark-lint-expected-html-sections

Demotes the plugin() and plugin.factory( [options] ) API signature headings in the <section class="usage"> block from level 3 to level 4 (lines 41 and 57). remark-lint-eslint exposes an identical plugin() and plugin.factory( [options] ) API — same main.js + factory.js + setReadOnly shape — and already documents both at level 4, so the deviation does not track a difference in API shape. Documentation-only; no behavior, signature, or test expectation changes.

@stdlib/_tools/remark/plugins/remark-lint-html-section-structure

Updates the sectionStructure() API signature heading in the <section class="usage"> block from level 3 to level 4 (line 45). Sibling single-function plugins document their exported function the same way: remark-lint-equations uses #### lint() and remark-namespace-toc uses #### insertTOC(). The usage section has no sub-headings, so nothing nests beneath the changed heading. Documentation-only; no behavior, signature, or test expectation changes.

Related Issues

Does this pull request have any related issues?

None.

Questions

Any questions for reviewers of this pull request?

Two, both about scope rather than the change itself:

  1. Two open pull requests, feat: add _tools/remark/plugins/remark-img-figures #13895 and feat: add _tools/remark/plugins/remark-img-figures-src-urls #13907, add new packages to this namespace. Neither modifies an existing member, so neither collides with this change — but the drift routine's collision gate is written to trip on any open PR naming the same namespace. This run treated the gate as being about file-level collision and proceeded. Flagging it in case you would rather such runs stand down whenever the namespace is otherwise active.
  2. Four array/base packages (without, take-map, to-inserted-at, with) carry level-3 signature headings for their .assign variants and are the only remaining instances of this pattern repo-wide. They are outside this run's namespace and so outside this PR. Happy to follow up with a separate array/base PR if you want them swept.

Other

Any other information relevant to this pull request?

Scope. Three lines across two files; hash count only. Bracket escaping was left verbatim (\[options] matches remark-lint-eslint; the namespace is split 1–1 on \[options] vs \[options\], so there is no majority to normalize toward). The <!-- /.usge --> string at remark-lint-html-section-structure/README.md:82 is untouched — it is a deliberate lint-violation demo inside a fenced example.

Lint safety. remark-lint-heading-increment is set to 'off' in etc/remark/plugins/lint/index.js:297-300, so the resulting ## → #### jump cannot be flagged; this is why 6202 packages already do it. first-heading-level, heading-style, maximum-heading-length and no-duplicate-headings-in-section were each checked against the new state and none is violated. This was verified by reading the remark configuration rather than by executing remark, which is not installed in the working environment.

Deliberately excluded.

  • Adding a <section class="related"> block to both packages (12/14 = 86% majority). The section is generator-owned — it carries Do not manually edit this section, as it is automatically populated. — and this namespace's own linter schema (remark-lint-expected-html-sections/lib/defaults.json) lists related as optional, not required, so its absence violates nothing.
  • Replacing the bare package-name H1 in both READMEs with a human-readable title (siblings use # ESLint, # Lint Equations; 86% majority). A conforming title has to be invented per package, so the fix is not mechanical and the majority pattern does not determine the replacement text. Real drift, left for a maintainer.
  • Normalizing error construction to format: nothing to do. All 20 throw new sites across all 14 members already use @stdlib/string/format.
  • Features without a clear majority, and therefore not treated as drift: entry-impl filename (lib/attacher.js 57% vs lib/main.js 43%), test/ directory presence (28%), ## Notes heading (43%), mdast and html keywords (64% each).

Correction to an intermediate figure. An earlier pass of this analysis reported 99.95% conformance with only three exceptions repo-wide. That undercounted: the scan classified a README as conforming whenever any #### was present, which hid four mixed-level array/base files. The 99.90% / six-exception figures above come from a corrected scan that distinguishes signature headings from grouping headings.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

This pull request was authored by Claude Code on behalf of @Planeshifter as an automated cross-package API-drift detection run against the @stdlib/_tools/remark/plugins namespace. Structural and semantic features were extracted from all 14 members, a per-feature majority pattern was computed at a 75% threshold, and candidate corrections were filtered through pre-validation gates and a three-agent validation pass (semantic review, cross-reference for test/consumer dependencies, structural review). Every correction that survived is documented above; everything dropped is listed with its reason. This PR is opened as a draft for a human to audit and promote.


@stdlib-js/reviewers


🤖 Generated with Claude Code

https://claude.ai/code/session_019GHyxM56Nqjq3iY7UZ4Tdq


Generated by Claude Code

Promote the `plugin()` and `plugin.factory( [options] )` signature
headings inside the README usage section from level 3 to level 4.
Level 4 is used at this position by 12 of 14 packages (86%) in
`_tools/remark/plugins`, and by 6194 of 6200 stdlib package READMEs
(99.90%) that carry an API heading inside their usage section.

`remark-lint-eslint` exposes an identical `plugin()` plus
`plugin.factory( [options] )` API and already documents both at
level 4, so the deviation does not track a difference in API shape.

The corrected condition is a primary signature heading at level 3
with no level-4 heading above it. Level-3 headings remain correct
elsewhere as sub-grouping headings beneath a level-4 API heading.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019GHyxM56Nqjq3iY7UZ4Tdq
Promote the `sectionStructure()` signature heading inside the README
usage section from level 3 to level 4. Level 4 is used at this
position by 12 of 14 packages (86%) in `_tools/remark/plugins`, and
by 6194 of 6200 stdlib package READMEs (99.90%) that carry an API
heading inside their usage section.

Sibling single-function plugins document their exported function the
same way: `remark-lint-equations` uses `#### lint()` and
`remark-namespace-toc` uses `#### insertTOC()`. This package exports
a single plugin function of exactly that kind, and its usage section
has no sub-headings, so nothing nests beneath the changed heading.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019GHyxM56Nqjq3iY7UZ4Tdq
@stdlib-bot stdlib-bot added the Tools Issue or pull request related to project tooling. label Sep 28, 2026
@kgryte kgryte added the Documentation Improvements, additions, or changes to documentation. label Sep 28, 2026
@kgryte
kgryte marked this pull request as ready for review September 28, 2026 21:53
@kgryte
kgryte requested a review from a team September 28, 2026 21:53
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Sep 28, 2026
@kgryte kgryte changed the title docs: use level-4 API headings in two _tools/remark/plugins READMEs docs: update heading levels Sep 28, 2026
@kgryte
kgryte merged commit e6bd64e into develop Sep 28, 2026
65 checks passed
@kgryte
kgryte deleted the philipp/drift-tools-remark-plugins-2026-09-28 branch September 28, 2026 21:54
@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Improvements, additions, or changes to documentation. Tools Issue or pull request related to project tooling.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants