Skip to content

Commit 9598225

Browse files
authored
docs: phase 9 � nav polish + About section + collapsible-table fix (#11)
* docs: phase 9 — nav polish, About section, collapsible-table fix Three independent docs-site improvements bundled into one PR because all three touch properdocs.yml. == Material navigation upgrade == theme.features picks up: * navigation.tabs — top-level sections render as a sticky tab bar always visible in the header * navigation.tabs.sticky — tabs stay pinned on scroll * navigation.path — breadcrumbs above every page heading * navigation.tracking — URL hash follows the active heading on scroll so deep-links remain accurate after a refresh / share * navigation.indexes — section names link to per-section index.md landing pages instead of being inert headers To back navigation.indexes, four new section landing pages: docs/{overview,comparisons,explanation,reference}/index.md, each a 30-second TOC for that section. (examples/index.md predates this PR.) properdocs.yml nav reordered to put each section's index.md first so the section name itself becomes the landing-page link. == About section == New top-level "About" section in the nav exposing the repo-root governance files on the docs site without duplicating content: * docs/about/index.md — section TOC + framing * docs/about/contributing.md — ``--8<-- "CONTRIBUTING.md"`` * docs/about/changelog.md — ``--8<-- "CHANGELOG.md"`` * docs/about/security.md — ``--8<-- "SECURITY.md"`` * docs/about/code-of-conduct.md — ``--8<-- "CODE_OF_CONDUCT.md"`` Each page is a single-line ``pymdownx.snippets`` directive that re-renders the corresponding root file inline at build time. Single source of truth: the repo root. ``pymdownx.snippets`` joins markdown_extensions with ``base_path: ["."]`` so the snippet base is the repo root, not the docs_dir. Two relative ``SECURITY.md`` links in CONTRIBUTING.md and CODE_OF_CONDUCT.md become absolute GitHub URLs so they resolve correctly under both renderings (GitHub-native and snippet-included into docs/about/). rumdl MD041 is per-file-ignored for the four snippet-wrapper files since the H1 lives in the included file, not the wrapper. == Compliance report: collapsible tables now render == scripts/generate_compliance_report.py emitted ``<details>`` which wrapped per-suite case tables in a block-level HTML element — per CommonMark, the content of such an element is *not* re-parsed as Markdown, so the inner ``| col | col |`` tables stayed as text. The ``md_in_html`` extension (already in our markdown_extensions list) re-enters Markdown parsing when the element has ``markdown="1"``; we now emit ``<details markdown='1'>``. Built site goes from 1 ``<table>`` (the summary at top of /wpt-compliance/) to 6 (summary + 5 per-suite case tables). Confirmed locally. * ci(artifact): exclude .git/ from wpt-corpus to avoid Windows digest-mismatch actions/download-artifact@v8 changed the default digest-mismatch behavior to 'error' (it was 'warn' in earlier versions). The wpt-corpus artifact includes a sparse-checkout .git/ directory (HEAD ref, refs/, packed objects, occasional symlinks) which is a known source of chunked-archive digest mismatches on Windows runners — small files + special git entries trip the v8 strict digest check intermittently. Windows / Python 3.14 hit it on the Phase 9 PR run; Windows / Python 3.12 and 3.13 did not. Fix: exclude .git from the *artifact* via upload-artifact's path filter syntax. The actions/cache step still saves .git for the next workflow run, so cache-hits keep their git rev-parse HEAD verification path. Only the artifact (which matrix consumers read) is .git-less — and they don't need it. --------- Co-authored-by: chad-loder <26261238+chad-loder@users.noreply.github.com>
1 parent b78ce03 commit 9598225

16 files changed

Lines changed: 158 additions & 12 deletions

File tree

.github/workflows/ci.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,19 @@ jobs:
166166
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
167167
with:
168168
name: wpt-corpus
169-
path: reference/wpt
169+
# Sparse-checkout leaves a populated ``.git/`` (HEAD ref, refs/,
170+
# packed objects, occasional symlinks) — used by the SHA-verify
171+
# step above but unused by matrix consumers, and a known source
172+
# of digest-mismatch errors under ``download-artifact@v8`` on
173+
# Windows runners (small files + special git entries trip the
174+
# chunked archive digest check, which v8 defaults to ``error``).
175+
# Excluding ``.git`` from the artifact (but not from the cache!)
176+
# keeps the next workflow run's cache-hit fast while making the
177+
# cross-OS download deterministic.
178+
path: |
179+
reference/wpt
180+
!reference/wpt/.git
181+
!reference/wpt/.git/**
170182
retention-days: 1
171183
if-no-files-found: error
172184

CODE_OF_CONDUCT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ project's maintainers represent it publicly.
1515
## Enforcement
1616

1717
Please report concerns to the maintainers via GitHub's private reporting
18-
channels (see [`SECURITY.md`](SECURITY.md) for the disclosure link,
18+
channels (see [`SECURITY.md`](https://github.com/chad-loder/yarlpattern/blob/main/SECURITY.md) for the disclosure link,
1919
which doubles as a private contact path until a dedicated address is
2020
published).
2121

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,5 +167,5 @@ you push.
167167

168168
## Reporting security issues
169169

170-
See [`SECURITY.md`](SECURITY.md) for scope and how to report (including
170+
See [`SECURITY.md`](https://github.com/chad-loder/yarlpattern/blob/main/SECURITY.md) for scope and how to report (including
171171
**public PRs or issues** if you prefer an open fix).

docs/about/changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--8<-- "CHANGELOG.md"

docs/about/code-of-conduct.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--8<-- "CODE_OF_CONDUCT.md"

docs/about/contributing.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--8<-- "CONTRIBUTING.md"

docs/about/index.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# About
2+
3+
Project governance, contribution guide, change log, security policy,
4+
and code of conduct.
5+
6+
- [**Contributing**](contributing.md) — how to set up a dev
7+
environment, run the linters and the full WPT corpus locally, the
8+
commit-message convention, and what `just check` runs.
9+
- [**Changelog**](changelog.md) — release notes (Keep a Changelog
10+
format; auto-stamped by python-semantic-release).
11+
- [**Security policy**](security.md) — the threat model, what's in
12+
and out of scope, and how to report a vulnerability privately.
13+
- [**Code of Conduct**](code-of-conduct.md) — the community standards
14+
for contributors and maintainers.
15+
16+
These pages are rendered directly from the corresponding files at the
17+
repo root, so what you see here is the same content `git clone`
18+
shows. No second copy to drift.

docs/about/security.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--8<-- "SECURITY.md"

docs/comparisons/index.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Comparisons
2+
3+
Where yarlpattern fits next to the routing tools Python developers
4+
already know.
5+
6+
- [**vs. `aiohttp.web.UrlDispatcher`**](aiohttp.md) — yarlpattern is a
7+
predicate (the pattern *is* the API; no server context needed) and
8+
matches across all eight URL components, not just the path.
9+
`UrlDispatcher` is the right choice if you're building an aiohttp
10+
service; yarlpattern is the right choice outside one — or when you
11+
need hostname / port / scheme constraints alongside path.
12+
- [**vs. yarl**](yarl.md) — yarl is a URL parser/builder; yarlpattern
13+
is a URLPattern matcher built on top of it. Covers the three places
14+
yarlpattern is *stricter* than yarl (case-preserving `%XX`,
15+
U+FFFD substitution, hostname truncation), the component-name
16+
mapping (`scheme`/`host`/`path``protocol`/`hostname`/`pathname`),
17+
and the yarl-style ergonomics (`yarl.URL` accepted directly,
18+
`with_*` derivers).
19+
20+
If you want to see yarlpattern *replace* a hand-rolled solution from
21+
some other framework — FastAPI, Starlette, Django, MCP servers,
22+
LiteLLM, KServe — those live under [Examples](../examples/index.md).

docs/explanation/index.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Explanation
2+
3+
How yarlpattern is built and why it's built that way.
4+
5+
- [**Architecture**](architecture.md) — module layout, the
6+
compile-time and match-time pipelines, the pluggable
7+
regex-engine `Protocol` seam (stdlib `re` is the default; opt
8+
into the `regex` package for full WPT conformance; a future
9+
PyO3-backed engine plugs in next to those), and the three
10+
places yarlpattern's implementation deliberately diverges from
11+
the simplest possible shape (`yarl.URL` fast path, `with_*`
12+
derivers, the WHATWG-strictness rules).

0 commit comments

Comments
 (0)