From f6c6b59dcc4c1de9faf84d3bfa7290bdae30fcc1 Mon Sep 17 00:00:00 2001 From: Jan Gleixner Date: Mon, 16 Nov 2026 16:30:43 +0100 Subject: [PATCH 1/4] Footer: the commit, release tag and changes since the release of each spec page build.py resolves, for the content and the data model text of each build, the commit it comes from, its date and the release tag of its version (storage-format-, data-model-), and passes them to Sphinx (SPEC_SOURCE). The content footer of every specification page then says where its text comes from: the file at that commit, the file as released, and a compare link with the changes since the release; a page built from its release tag says "as released". The storage format page, which includes the data model text, names both. Previews from a checkout show its commit (and uncommitted changes); a directory that is no checkout gets no footer line. --- build.py | 39 +++++++++++++++++++++++++++++ pages/contributing.md | 4 ++- site/_templates/.gitkeep | 0 site/_templates/spec-source.html | 21 ++++++++++++++++ site/conf.py | 43 ++++++++++++++++++++++++++++++++ 5 files changed, 106 insertions(+), 1 deletion(-) delete mode 100644 site/_templates/.gitkeep create mode 100644 site/_templates/spec-source.html diff --git a/build.py b/build.py index e486a4c..cf6dcf8 100644 --- a/build.py +++ b/build.py @@ -83,6 +83,35 @@ def overlay(content, dest): tar.extractall(dest, members=members, filter="data") +def provenance(content, tag): + """The commit the text of a build comes from ({"ref": ...} or {"source": ...}), its date, and + the release tag of its version if that exists: the footer of each specification page links + them (site/_templates/spec-source.html). None when no commit is known, e.g. for a directory + that is not a git checkout.""" + if content.get("source"): + source = Path(content["source"]).resolve() + run = subprocess.run(["git", "-C", str(source), "rev-parse", "--show-toplevel"], capture_output=True, text=True) + if run.returncode or Path(run.stdout.strip()).resolve() != source: # not a checkout of its own + return None + head = subprocess.run( + ["git", "-C", str(source), "log", "-1", "--format=%H %cs"], capture_output=True, text=True + ) + status = subprocess.run(["git", "-C", str(source), "status", "--porcelain"], capture_output=True, text=True) + ref, dirty = None, bool(status.stdout.strip()) + else: + head = git("log", "-1", "--format=%H %cs", resolve(content["ref"]), check=False) + ref, dirty = content["ref"], False + if head.returncode or not head.stdout.strip(): + return None + commit, date = head.stdout.split() + info = {"ref": ref, "commit": commit, "date": date, "dirty": dirty} + tagged = git("rev-parse", "--verify", "--quiet", f"refs/tags/{tag}^{{commit}}", check=False) if tag else None + if tagged and tagged.returncode == 0: + info["tag"] = tag + info["released"] = tagged.stdout.strip() == commit and not dirty + return info + + PAGES = HERE / "pages" # pages of the site itself, built only at the root (latest) @@ -162,6 +191,7 @@ def build(version, listed, out, tmp, site_url, strict, preview_pr, preview_of): "SPEC_LATEST": "1" if version.get("latest") else "0", "SPEC_PREVIEW_PR": preview_pr, "SPEC_PREVIEW_OF": preview_of, + "SPEC_SOURCE": json.dumps(version.get("provenance", {})), "SITE_URL": site_url, } cmd = [sys.executable, "-m", "sphinx", "-b", "html", "-d", str(src / "_doctrees"), str(docs), str(out / path)] @@ -421,10 +451,19 @@ def main(): rfcs = {"source": args.rfcs_source} if args.rfcs_source else listing["rfcs"] latest = {"ref": preferred["ref"], "source": preferred.get("source"), "latest": True, "rfcs_from": rfcs} versions = [latest, *data_models(versions), *versions] + # the release tag of each storage format version, by the branch its text comes from + release_tags = {v["ref"]: f"storage-format-{v['storage_format']}" for v in listing["version"]} for version in versions: # the root and a preview show the data model of the preferred version model = version.get("data_model") or preferred["data_model"] if model in data_model_from: version["data_model_from"] = data_model_from[model] + sources = { + "content": provenance(version, release_tags.get(version["ref"])), + "data_model": provenance(version["data_model_from"], f"data-model-{model}") + if version.get("data_model_from") + else None, + } + version["provenance"] = {k: v for k, v in sources.items() if v} shutil.rmtree(args.out, ignore_errors=True) args.out.mkdir(parents=True, exist_ok=True) # a server may hold the emptied directory open diff --git a/pages/contributing.md b/pages/contributing.md index 07b92f2..54a253c 100644 --- a/pages/contributing.md +++ b/pages/contributing.md @@ -109,7 +109,9 @@ moved. Each branch holds the current version of its part, with the corrections made since its release: bug fixes to the prose, clarifications and non-normative additions, which do not open a new version. -They are pull requests against the branch, and the website shows them once merged. Older versions +They are pull requests against the branch, and the website shows them once merged. The footer of +each specification page names the commit its text was built from and links the release tag and the +changes since the release. Older versions stay as tagged; a correction to one, if needed, goes into a branch `maintenance/storage-format-` (or `maintenance/data-model-`) made from its tag, which the website then shows. A correction that touches both parts is two pull requests, one diff --git a/site/_templates/.gitkeep b/site/_templates/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/site/_templates/spec-source.html b/site/_templates/spec-source.html new file mode 100644 index 0000000..4556b6f --- /dev/null +++ b/site/_templates/spec-source.html @@ -0,0 +1,21 @@ +{#- Where the text of a specification page comes from (conf.py _sources): the commit it was built + from, the release tag of its version, and the changes since that release. -#} +{%- for s in spec_sources %} +

+ {{ s.label }}: + {%- if s.released %} + as released, tag {{ s.tag }} + (commit {{ s.commit }}, {{ s.date }}). + {%- else %} + {% if s.ref %}branch {{ s.ref }} at {% endif -%} + commit {{ s.commit }}, {{ s.date }} + {%- if s.dirty %}, with uncommitted changes{% endif %}. + {%- if s.tag %} + As released: tag {{ s.tag }}; + changes since the release. + {%- else %} + Not released yet. + {%- endif %} + {%- endif %} +

+{%- endfor %} diff --git a/site/conf.py b/site/conf.py index 4a064ce..02ee02c 100644 --- a/site/conf.py +++ b/site/conf.py @@ -45,6 +45,8 @@ spec_doc_path = os.environ.get("SPEC_DOC_PATH", "docs") # branch or tag the text of the data model comes from (empty: the content's own) spec_data_model_ref = os.environ.get("SPEC_DATA_MODEL_REF", "") +# the commit, date and release tag of the content and of the data model text (build.py provenance) +spec_source = json.loads(os.environ.get("SPEC_SOURCE", "{}")) DATA_MODEL_PAGES = ("data-model", "data-model-versions") SPEC_PAGES = (*DATA_MODEL_PAGES, "storage-format", "storage-format-versions", "storage-format-conformance") @@ -180,6 +182,8 @@ def _editable(ref): "show_toc_level": 2, "footer_start": [], # the content footer already holds the author and the copyright "footer_end": [], + # where the text of a specification page comes from: commit, release tag, changes since + "footer_content_items": ["author.html", "copyright.html", "spec-source.html"], "announcement": announcement, "logo": { "text": "SpatialData specifications", @@ -272,7 +276,46 @@ def walk(buttons): context["header_buttons"] = walk(context["header_buttons"]) +def _sources(pagename): + """The texts a specification page shows, each with the links of its footer line: the file at the + commit it was built from, the file as released, and the changes since the release. The storage + format page includes the data model text, so it has two.""" + if pagename not in SPEC_PAGES: + return [] + parts = ["data_model"] if pagename in DATA_MODEL_PAGES else ["content"] + if pagename == "storage-format": + parts.append("data_model") + sources = [] + for part in parts: + source = spec_source.get(part) + if part == "data_model" and source is None and pagename in DATA_MODEL_PAGES: + part, source = "content", spec_source.get("content") # no data model branch: its own + if source is None: + continue + # the data model branch holds its pages at the top level; the content in spec_doc_path + path = f"{'data-model' if pagename == 'storage-format' and part == 'data_model' else pagename}.md" + if part == "content" and spec_doc_path: + path = f"{spec_doc_path}/{path}" + commit, tag = source["commit"], source.get("tag") + sources.append( + { + "label": "Data model text" if part == "data_model" and pagename == "storage-format" else "Text", + "ref": source.get("ref"), + "commit": commit[:7], + "date": source["date"], + "dirty": source.get("dirty"), + "url": f"{repository_url}/blob/{commit}/{path}", + "tag": tag, + "released": source.get("released"), + "tag_url": f"{repository_url}/blob/{tag}/{path}" if tag else None, + "compare_url": f"{repository_url}/compare/{tag}...{commit}" if tag else None, + } + ) + return sources + + def _page_context(app, pagename, templatename, context, doctree): + context["spec_sources"] = _sources(pagename) toctree = context.get("generate_toctree_html") if toctree is not None: From 1afebc2686928bed428654c535a94d13f818e2aa Mon Sep 17 00:00:00 2001 From: Jan Gleixner Date: Mon, 16 Nov 2026 16:46:18 +0100 Subject: [PATCH 2/4] Show the source of each spec page under its authors instead of in the footer The line moves from the content footer to under the byline (or the title, where a page has none), where readers see whether the text is as released or corrected since: a source-read hook in conf.py adds it as a spec-source container after the one of _ext/spec_authors.py. --- pages/contributing.md | 4 ++-- site/_static/css/custom.css | 11 +++++++++ site/_templates/.gitkeep | 0 site/_templates/spec-source.html | 21 ----------------- site/conf.py | 40 ++++++++++++++++++++++++++++---- 5 files changed, 48 insertions(+), 28 deletions(-) create mode 100644 site/_templates/.gitkeep delete mode 100644 site/_templates/spec-source.html diff --git a/pages/contributing.md b/pages/contributing.md index 54a253c..1d8b651 100644 --- a/pages/contributing.md +++ b/pages/contributing.md @@ -109,8 +109,8 @@ moved. Each branch holds the current version of its part, with the corrections made since its release: bug fixes to the prose, clarifications and non-normative additions, which do not open a new version. -They are pull requests against the branch, and the website shows them once merged. The footer of -each specification page names the commit its text was built from and links the release tag and the +They are pull requests against the branch, and the website shows them once merged. Under its +title, each specification page names the commit its text was built from and links the release tag and the changes since the release. Older versions stay as tagged; a correction to one, if needed, goes into a branch `maintenance/storage-format-` (or `maintenance/data-model-`) made from its tag, diff --git a/site/_static/css/custom.css b/site/_static/css/custom.css index aba7b41..1922c81 100644 --- a/site/_static/css/custom.css +++ b/site/_static/css/custom.css @@ -350,6 +350,17 @@ h1 img.heading-icon { font-size: 1.05rem; } +/* Where the text of a specification page comes from, under the authors (conf.py _add_source) */ +.spec-source { + margin-top: -0.75rem; + margin-bottom: 1.5rem; + color: var(--pst-color-text-muted); + font-size: 0.9rem; +} +.spec-authors + .spec-source { + margin-top: -1rem; +} + /* ORCID iD and GitHub icons after a name (_ext/spec_authors.py) */ .bd-content img.person-icon { display: inline; diff --git a/site/_templates/.gitkeep b/site/_templates/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/site/_templates/spec-source.html b/site/_templates/spec-source.html deleted file mode 100644 index 4556b6f..0000000 --- a/site/_templates/spec-source.html +++ /dev/null @@ -1,21 +0,0 @@ -{#- Where the text of a specification page comes from (conf.py _sources): the commit it was built - from, the release tag of its version, and the changes since that release. -#} -{%- for s in spec_sources %} -

- {{ s.label }}: - {%- if s.released %} - as released, tag {{ s.tag }} - (commit {{ s.commit }}, {{ s.date }}). - {%- else %} - {% if s.ref %}branch {{ s.ref }} at {% endif -%} - commit {{ s.commit }}, {{ s.date }} - {%- if s.dirty %}, with uncommitted changes{% endif %}. - {%- if s.tag %} - As released: tag {{ s.tag }}; - changes since the release. - {%- else %} - Not released yet. - {%- endif %} - {%- endif %} -

-{%- endfor %} diff --git a/site/conf.py b/site/conf.py index 02ee02c..cdc2d5f 100644 --- a/site/conf.py +++ b/site/conf.py @@ -4,6 +4,7 @@ import dataclasses import json import os +import re import sys from datetime import datetime from importlib.metadata import metadata @@ -182,8 +183,6 @@ def _editable(ref): "show_toc_level": 2, "footer_start": [], # the content footer already holds the author and the copyright "footer_end": [], - # where the text of a specification page comes from: commit, release tag, changes since - "footer_content_items": ["author.html", "copyright.html", "spec-source.html"], "announcement": announcement, "logo": { "text": "SpatialData specifications", @@ -277,7 +276,7 @@ def walk(buttons): def _sources(pagename): - """The texts a specification page shows, each with the links of its footer line: the file at the + """The texts a specification page shows, each with the links of its source line: the file at the commit it was built from, the file as released, and the changes since the release. The storage format page includes the data model text, so it has two.""" if pagename not in SPEC_PAGES: @@ -299,7 +298,9 @@ def _sources(pagename): commit, tag = source["commit"], source.get("tag") sources.append( { - "label": "Data model text" if part == "data_model" and pagename == "storage-format" else "Text", + "label": ("Data model text" if part == "data_model" else "Storage format text") + if pagename == "storage-format" + else "This text", "ref": source.get("ref"), "commit": commit[:7], "date": source["date"], @@ -314,8 +315,36 @@ def _sources(pagename): return sources +def _source_line(s): + commit = f"[`{s['commit']}`]({s['url']})" + if s["released"]: + return f"**{s['label']}:** as released, tag [`{s['tag']}`]({s['tag_url']}) (commit {commit}, {s['date']})" + where = f"branch `{s['ref']}` at commit {commit}" if s["ref"] else f"commit {commit}" + line = f"**{s['label']}:** {where}, {s['date']}" + (", with uncommitted changes" if s["dirty"] else "") + if s["tag"]: + return line + f"; released as tag [`{s['tag']}`]({s['tag_url']}), [changes since]({s['compare_url']})" + return line + "; not released yet" + + +_BYLINE = re.compile(r"^:::\{container\} spec-authors\n.*?^:::\n", re.S | re.M) +_H1 = re.compile(r"^# .+$", re.M) + + +def _add_source(app, docname, source): + """Under the authors (_ext/spec_authors.py), or the title if there are none, of each + specification page: where its text comes from, and whether it was corrected since its release.""" + lines = [_source_line(s) for s in _sources(docname)] + if not lines: + return + block = "\n\n:::{container} spec-source\n" + "\\\n".join(lines) + "\n:::\n" + byline = _BYLINE.search(source[0]) + if byline: + source[0] = source[0][: byline.end()] + block + source[0][byline.end() :] + else: + source[0] = _H1.sub(lambda m: m.group(0) + block, source[0], count=1) + + def _page_context(app, pagename, templatename, context, doctree): - context["spec_sources"] = _sources(pagename) toctree = context.get("generate_toctree_html") if toctree is not None: @@ -336,6 +365,7 @@ def navigation(kind, *args, **kwargs): def setup(app): + app.connect("source-read", _add_source, priority=600) # after spec_authors adds the byline # after the post-transforms, which is where MyST adds the footnotes app.connect("doctree-resolved", _footnotes_into_notes) app.connect("html-page-context", _page_context, priority=900) # after the theme adds its functions From 4d5e1806cb89a7262aecb44134ecd08bf1936a60 Mon Sep 17 00:00:00 2001 From: Jan Gleixner Date: Mon, 16 Nov 2026 16:54:14 +0100 Subject: [PATCH 3/4] Spec pages: the source line above the authors, directly under the title --- site/_static/css/custom.css | 4 ++-- site/conf.py | 16 +++++----------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/site/_static/css/custom.css b/site/_static/css/custom.css index 1922c81..849616a 100644 --- a/site/_static/css/custom.css +++ b/site/_static/css/custom.css @@ -350,14 +350,14 @@ h1 img.heading-icon { font-size: 1.05rem; } -/* Where the text of a specification page comes from, under the authors (conf.py _add_source) */ +/* Where the text of a specification page comes from, under its title (conf.py _add_source) */ .spec-source { margin-top: -0.75rem; margin-bottom: 1.5rem; color: var(--pst-color-text-muted); font-size: 0.9rem; } -.spec-authors + .spec-source { +.spec-source + .spec-authors { margin-top: -1rem; } diff --git a/site/conf.py b/site/conf.py index cdc2d5f..3bde04a 100644 --- a/site/conf.py +++ b/site/conf.py @@ -326,21 +326,15 @@ def _source_line(s): return line + "; not released yet" -_BYLINE = re.compile(r"^:::\{container\} spec-authors\n.*?^:::\n", re.S | re.M) _H1 = re.compile(r"^# .+$", re.M) def _add_source(app, docname, source): - """Under the authors (_ext/spec_authors.py), or the title if there are none, of each - specification page: where its text comes from, and whether it was corrected since its release.""" + """Under the title of each specification page, above the authors (_ext/spec_authors.py): where + its text comes from, and whether it was corrected since its release.""" lines = [_source_line(s) for s in _sources(docname)] - if not lines: - return - block = "\n\n:::{container} spec-source\n" + "\\\n".join(lines) + "\n:::\n" - byline = _BYLINE.search(source[0]) - if byline: - source[0] = source[0][: byline.end()] + block + source[0][byline.end() :] - else: + if lines: + block = "\n\n:::{container} spec-source\n" + "\\\n".join(lines) + "\n:::\n" source[0] = _H1.sub(lambda m: m.group(0) + block, source[0], count=1) @@ -365,7 +359,7 @@ def navigation(kind, *args, **kwargs): def setup(app): - app.connect("source-read", _add_source, priority=600) # after spec_authors adds the byline + app.connect("source-read", _add_source, priority=600) # after spec_authors: above its byline # after the post-transforms, which is where MyST adds the footnotes app.connect("doctree-resolved", _footnotes_into_notes) app.connect("html-page-context", _page_context, priority=900) # after the theme adds its functions From d83e65b8c26a4a82d6e37298014d1ea53a6e8e9f Mon Sep 17 00:00:00 2001 From: Jan Gleixner Date: Mon, 16 Nov 2026 16:58:13 +0100 Subject: [PATCH 4/4] Spec pages: a short status under the title, the permalinks in the footer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Under the title: "Storage format 0.4, corrected 16 Nov 2026 · Data model 1.0, corrected 16 Nov 2026" (or "as released"), the date linking to the changes since the release. The commit, branch and release tag of each text, for citing it exactly, go back into the content footer, as plain text. --- pages/contributing.md | 4 ++-- site/_static/css/custom.css | 8 +++---- site/_templates/.gitkeep | 0 site/_templates/spec-source.html | 17 +++++++++++++++ site/conf.py | 37 ++++++++++++++++++++------------ 5 files changed, 46 insertions(+), 20 deletions(-) delete mode 100644 site/_templates/.gitkeep create mode 100644 site/_templates/spec-source.html diff --git a/pages/contributing.md b/pages/contributing.md index 1d8b651..8caa4f9 100644 --- a/pages/contributing.md +++ b/pages/contributing.md @@ -110,8 +110,8 @@ moved. Each branch holds the current version of its part, with the corrections made since its release: bug fixes to the prose, clarifications and non-normative additions, which do not open a new version. They are pull requests against the branch, and the website shows them once merged. Under its -title, each specification page names the commit its text was built from and links the release tag and the -changes since the release. Older versions +title, each specification page says whether its text is as released or corrected since, linking the +changes; its footer names the commit the text was built from and the release tag. Older versions stay as tagged; a correction to one, if needed, goes into a branch `maintenance/storage-format-` (or `maintenance/data-model-`) made from its tag, which the website then shows. A correction that touches both parts is two pull requests, one diff --git a/site/_static/css/custom.css b/site/_static/css/custom.css index 849616a..1fb44f7 100644 --- a/site/_static/css/custom.css +++ b/site/_static/css/custom.css @@ -350,14 +350,14 @@ h1 img.heading-icon { font-size: 1.05rem; } -/* Where the text of a specification page comes from, under its title (conf.py _add_source) */ -.spec-source { +/* Version and status of a specification page, under its title (conf.py _add_status) */ +.spec-status { margin-top: -0.75rem; margin-bottom: 1.5rem; color: var(--pst-color-text-muted); - font-size: 0.9rem; + font-size: 0.95rem; } -.spec-source + .spec-authors { +.spec-status + .spec-authors { margin-top: -1rem; } diff --git a/site/_templates/.gitkeep b/site/_templates/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/site/_templates/spec-source.html b/site/_templates/spec-source.html new file mode 100644 index 0000000..534e2c4 --- /dev/null +++ b/site/_templates/spec-source.html @@ -0,0 +1,17 @@ +{#- Where the text of a specification page comes from (conf.py _sources), for citing it exactly: + the commit it was built from, the release tag of its version, the changes since the release. -#} +{%- for s in spec_sources %} +

+ {{ s.name }} {{ s.version }} text: + {%- if s.released %} + as released, tag {{ s.tag }} (commit {{ s.commit }}). + {%- else %} + commit {{ s.commit }} of {{ s.date }}{% if s.ref %} (branch {{ s.ref }}){% endif %} + {%- if s.dirty %}, with local changes{% endif %} + {%- if s.tag %}; released as {{ s.tag }}, + changes since. + {%- else %}; not released yet. + {%- endif %} + {%- endif %} +

+{%- endfor %} diff --git a/site/conf.py b/site/conf.py index 3bde04a..bad8844 100644 --- a/site/conf.py +++ b/site/conf.py @@ -183,6 +183,8 @@ def _editable(ref): "show_toc_level": 2, "footer_start": [], # the content footer already holds the author and the copyright "footer_end": [], + # where the text of a specification page comes from: commit, release tag, changes since + "footer_content_items": ["author.html", "copyright.html", "spec-source.html"], "announcement": announcement, "logo": { "text": "SpatialData specifications", @@ -296,8 +298,11 @@ def _sources(pagename): if part == "content" and spec_doc_path: path = f"{spec_doc_path}/{path}" commit, tag = source["commit"], source.get("tag") + own_version = spec_data_model if part == "data_model" else spec_storage_format sources.append( { + "name": "Data model" if part == "data_model" else "Storage format", + "version": tag.rsplit("-", 1)[1] if tag else own_version, "label": ("Data model text" if part == "data_model" else "Storage format text") if pagename == "storage-format" else "This text", @@ -315,30 +320,34 @@ def _sources(pagename): return sources -def _source_line(s): - commit = f"[`{s['commit']}`]({s['url']})" +def _status(s): + """One part of the status line: "Storage format 0.4, corrected 16 Nov 2026", the date linking + to the changes since the release; the commits and tags are in the footer (spec-source.html).""" + date = datetime.strptime(s["date"], "%Y-%m-%d") + day = f"{date.day} {date:%b %Y}" + what = f"{s['name']} {s['version']}".strip() + local = ", with local changes" if s["dirty"] else "" if s["released"]: - return f"**{s['label']}:** as released, tag [`{s['tag']}`]({s['tag_url']}) (commit {commit}, {s['date']})" - where = f"branch `{s['ref']}` at commit {commit}" if s["ref"] else f"commit {commit}" - line = f"**{s['label']}:** {where}, {s['date']}" + (", with uncommitted changes" if s["dirty"] else "") + return f"{what}, [as released]({s['tag_url']})" if s["tag"]: - return line + f"; released as tag [`{s['tag']}`]({s['tag_url']}), [changes since]({s['compare_url']})" - return line + "; not released yet" + return f'{what}, [corrected {day}]({s["compare_url"]} "Changes since the release"){local}' + return f"{what}, [draft of {day}]({s['url']}){local}" _H1 = re.compile(r"^# .+$", re.M) -def _add_source(app, docname, source): - """Under the title of each specification page, above the authors (_ext/spec_authors.py): where - its text comes from, and whether it was corrected since its release.""" - lines = [_source_line(s) for s in _sources(docname)] - if lines: - block = "\n\n:::{container} spec-source\n" + "\\\n".join(lines) + "\n:::\n" +def _add_status(app, docname, source): + """Under the title of each specification page, above the authors (_ext/spec_authors.py): its + version, and whether its text is as released or corrected since.""" + parts = [_status(s) for s in _sources(docname)] + if parts: + block = "\n\n:::{container} spec-status\n" + " · ".join(parts) + "\n:::\n" source[0] = _H1.sub(lambda m: m.group(0) + block, source[0], count=1) def _page_context(app, pagename, templatename, context, doctree): + context["spec_sources"] = _sources(pagename) toctree = context.get("generate_toctree_html") if toctree is not None: @@ -359,7 +368,7 @@ def navigation(kind, *args, **kwargs): def setup(app): - app.connect("source-read", _add_source, priority=600) # after spec_authors: above its byline + app.connect("source-read", _add_status, priority=600) # after spec_authors: above its byline # after the post-transforms, which is where MyST adds the footnotes app.connect("doctree-resolved", _footnotes_into_notes) app.connect("html-page-context", _page_context, priority=900) # after the theme adds its functions