[all-commits] [llvm/llvm-project] 0ed795: [docs] Rewrite the ghlink Sphinx plugin to use doc...

Reid Kleckner via All-commits all-commits at lists.llvm.org
Fri May 29 13:33:11 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0ed795a70b9df40d08a08e70acb889eaba5f8713
      https://github.com/llvm/llvm-project/commit/0ed795a70b9df40d08a08e70acb889eaba5f8713
  Author: Reid Kleckner <rnk at llvm.org>
  Date:   2026-05-29 (Fri, 29 May 2026)

  Changed paths:
    M clang/docs/ghlinks.py

  Log Message:
  -----------
  [docs] Rewrite the ghlink Sphinx plugin to use doctree (#199076)

Previously we did a simple reST-based textual rewrite during the
source-read Sphinx phase. This did the wrong thing for markdown sources,
and would rewrite #GH123 in escaped code blocks.

The new implementations does a DFS walk over the doctree AST and does
targetted replacements in text nodes matching the pattern. This makes it
more accurate and portable between markup languages.

This does renumber the #idN anchors that refer back to the table of
contents because inline reST links consume internal id numbers. However,
the #id numbers aren't stable, they change any time we add a new
heading, so I don't see this as a blocker.

An LLM did the first draft of the script, and I tuned it up from there.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list