Skip to content

[chore] Switch toc generation to doctoc#3463

Merged
lmolkova merged 5 commits into
open-telemetry:mainfrom
thompson-tomo:chore/switch_to_doctoc
Apr 27, 2026
Merged

[chore] Switch toc generation to doctoc#3463
lmolkova merged 5 commits into
open-telemetry:mainfrom
thompson-tomo:chore/switch_to_doctoc

Conversation

@thompson-tomo

@thompson-tomo thompson-tomo commented Feb 21, 2026

Copy link
Copy Markdown
Contributor

Changes

This switches to doctoc for toc generation.

The benefit of this switch includes:

Important

Pull requests acceptance are subject to the triage process as described in Issue and PR Triage Management.
PRs that do not follow the guidance above, may be automatically rejected and closed.

Merge requirement checklist

  • CONTRIBUTING.md guidelines followed.
  • Change log entry added, according to the guidelines in When to add a changelog entry.
    • If your PR does not need a change log, start the PR title with [chore]
  • Links to the prototypes or existing instrumentations (when adding or changing conventions)

@thompson-tomo
thompson-tomo requested a review from a team as a code owner February 21, 2026 00:49
@thompson-tomo
thompson-tomo requested review from a team as code owners February 21, 2026 00:49
@thompson-tomo
thompson-tomo requested review from a team as code owners February 21, 2026 00:49
@thompson-tomo thompson-tomo changed the title [chore] Switch to doctoc [chore] Switch toc generation to doctoc Feb 21, 2026

@chalin chalin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

I'd prefer to keep the current markers <!-- toc --> and <!-- tocstop --> without any extra comments, at least for this PR -- it would help us focus on the essential change in this PR (which is very minimal). Besides, IMHO folks generally know that the toc is generated by now. I like to keep things DRY and avoid repeating update instructions in every file.

Comment thread .github/workflows/checks.yml
@github-project-automation github-project-automation Bot moved this from Untriaged to Blocked in Semantic Conventions Triage Feb 23, 2026
@thompson-tomo

Copy link
Copy Markdown
Contributor Author

No worries @chalin, Totally agree with you about keeping things dry, unfortunately those comments are currently hard code by doctoc. 😔

When reviewing this PR I did have a similiar concern about the noise from those comments hence I raised thlorenz/doctoc#315

In relation to the indicator start doctoc vs toc this is also fixed and when we could eventually control the header I am not sure this would be needed.

Comment thread Makefile Outdated
@chalin

chalin commented Feb 23, 2026

Copy link
Copy Markdown
Contributor

Btw, great job on the improvements you contributed to doctoc -- https://github.com/thlorenz/doctoc/commits?author=thompson-tomo! Thanks for doing that 🙌🏻

Totally agree with you about keeping things dry, unfortunately those comments are currently hard code by doctoc. 😔

I see 🤔

When reviewing this PR I did have a similiar concern about the noise from those comments hence I raised thlorenz/doctoc#315

Ok, I 👍🏻 that issue. Might you be planning a PR to fix that? If so, what's the usual turnaround?

@thompson-tomo

Copy link
Copy Markdown
Contributor Author

Thanks, hopefully the updates makes thing easier/more efficient and importantly more reliable for users.

Yes I was thinking about tackling it after a refactor which included breaking changes as it became clear all the additional settings are not scaling nicely and it caused me grief when adding due to merge conflicts.

I could do a partial implementation ie the remove option if we needed to sooner but a review usually takes weeks with nudges.

Let me know your preference as who knows we might get lucky.

@chalin

chalin commented Feb 23, 2026

Copy link
Copy Markdown
Contributor

I'd like to keep this PR (and our git history) as clean as we can. We probably don't want to wait a few more weeks. Let's assume that thlorenz/doctoc#315 will get fixed ... in the meantime, to streamline this PR, we can resort to a simple Perl search/replace for prep- and post-processing before/after calling doctoc. (I'd prefer Perl over sed because it's more portable, but given that that Makefile has a SED variable, we can use that.

@thompson-tomo

Copy link
Copy Markdown
Contributor Author

@chalin just following up on this PR.

@lmolkova lmolkova moved this from Blocked to Awaiting codeowners approval in Semantic Conventions Triage Mar 9, 2026
@thompson-tomo
thompson-tomo force-pushed the chore/switch_to_doctoc branch from 9d5f937 to eff1636 Compare March 18, 2026 02:17
@thompson-tomo

Copy link
Copy Markdown
Contributor Author

@chalin could you please take another review of this.

@github-actions

github-actions Bot commented Apr 1, 2026

Copy link
Copy Markdown

This PR has been labeled as stale due to lack of activity. It will be automatically closed if there is no further activity over the next 7 days.

@github-actions github-actions Bot added Stale and removed Stale labels Apr 1, 2026
@thompson-tomo
thompson-tomo force-pushed the chore/switch_to_doctoc branch from 5bc334a to 20025a4 Compare April 7, 2026 02:48
@thompson-tomo
thompson-tomo requested a review from jsuereth April 7, 2026 03:01
@thompson-tomo

Copy link
Copy Markdown
Contributor Author

@chalin i have now removed the scripts as doctoc now natively supports the compact pragma like we were achieving using the scripts.

@chalin chalin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thompson-tomo - thanks for sticking with this and following up. My earlier concerns look addressed now:

  • compact/doctoc markers without the extra noise
  • markdown-toc kept as the mutating target
  • separate markdown-toc-check for CI validation
  • temporary workaround scripts removed

As final prep, pls:

  • rebase, and
  • regenerate a new package lock file

Note: using . as the target path shouldn't cause problems, but we might need to adjust that if it does.

@thompson-tomo
thompson-tomo force-pushed the chore/switch_to_doctoc branch from d216d80 to 8a1a8aa Compare April 25, 2026 01:36
@thompson-tomo

Copy link
Copy Markdown
Contributor Author

No worries at all @chalin i have just performed a rebase & updated doctoc to the latest which includes updating the lock file.

@chalin chalin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎉

@jsuereth et all: can we get this merged soon?

@lmolkova
lmolkova enabled auto-merge April 27, 2026 12:45
@lmolkova lmolkova moved this from Awaiting codeowners approval to Needs More Approval in Semantic Conventions Triage Apr 27, 2026
@lmolkova
lmolkova added this pull request to the merge queue Apr 27, 2026
Merged via the queue into open-telemetry:main with commit 7b0c0fe Apr 27, 2026
22 of 23 checks passed
@chalin

chalin commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

Woot! 🎉 Thanks you @thompson-tomo! Thanks all!

@thompson-tomo
thompson-tomo deleted the chore/switch_to_doctoc branch April 28, 2026 00:42
@thompson-tomo

Copy link
Copy Markdown
Contributor Author

No worries @chalin i have updated the successor pr's & split the original pr into 2 (#2971 & #3671) to make it easier to review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants