Skip to content

Commit 2fba896

Browse files
Publish docs/guide as GitHub Pages with MkDocs Material (#402)
Add the MkDocs + GitHub Actions pipeline to publish docs/guide as a browsable site at https://microsoft.github.io/microsoft-ui-reactor/. Compiler: - DocAssembler.Assemble now takes the page's topicId so screenshot:// refs in subdir pages (recipes/*) emit correct ../images/ paths. - The compiler also writes README.md alongside index.md so GitHub's directory browser renders the landing page at docs/guide/. Template fixes (for both raw GitHub MD viewing and the MkDocs site): - Convert out-of-tree refs (../specs/*, ../contributing/*, ../reference/async-system.md, _pipeline/ai-author-skill.md) to absolute https://github.com/microsoft/microsoft-ui-reactor/blob/main/ URLs so links work after docs/guide is published as a standalone site. - Redirect stale async-resources-cookbook.md references to async-resources.md (page was renamed per topic table in docs/_pipeline/ai-author-skill.md). - Drop the broken reference/elements/index.md link in components.md.dt (that reference axis category has not been generated yet). - Rename readme.md.dt -> index.md.dt so the compiled site root URL resolves, and update the three inbound readme.md links accordingly. Stale generated output: - Remove docs/guide/async-resources-cookbook.md (no template; renamed). Adds: - mkdocs.yml with Material theme and curated nav matching the readme's 10-section structure. - docs/requirements.txt pinning mkdocs, mkdocs-material, pymdown. - .github/workflows/docs.yml building with --strict on push to main (paths-filtered to docs/guide/**, mkdocs.yml, requirements.txt, the workflow itself) and deploying via actions/deploy-pages@v4. After merging, enable Pages in Settings -> Pages -> Source: GitHub Actions. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent e300256 commit 2fba896

59 files changed

Lines changed: 588 additions & 423 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/docs.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Publish docs
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'docs/guide/**'
8+
- 'mkdocs.yml'
9+
- 'docs/requirements.txt'
10+
- '.github/workflows/docs.yml'
11+
workflow_dispatch:
12+
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
concurrency:
19+
group: pages
20+
cancel-in-progress: false
21+
22+
jobs:
23+
build:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v4
27+
- uses: actions/setup-python@v5
28+
with:
29+
python-version: '3.12'
30+
cache: pip
31+
cache-dependency-path: docs/requirements.txt
32+
- run: pip install -r docs/requirements.txt
33+
- run: mkdocs build --strict
34+
- uses: actions/upload-pages-artifact@v3
35+
with:
36+
path: site
37+
38+
deploy:
39+
needs: build
40+
runs-on: ubuntu-latest
41+
environment:
42+
name: github-pages
43+
url: ${{ steps.deployment.outputs.page_url }}
44+
steps:
45+
- id: deployment
46+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,3 +238,6 @@ tests/stress_perf/baselines/**/per-rep.csv
238238
# output, both regenerated on every build.
239239
tests/stress_perf_rn/**/Bundle/
240240
tests/stress_perf_rn/**/Generated Files/
241+
242+
# MkDocs build output
243+
/site/

docs/_pipeline/templates/_skeletons/stub.md.dt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ tier: stub
2929
# {{REPLACE_ME: human-readable title}}
3030

3131
Coming soon — this page documents {{REPLACE_ME: feature or topic}}. See
32-
[the AI Author Skill](../../_pipeline/ai-author-skill.md) for the planned
32+
[the AI Author Skill](https://github.com/microsoft/microsoft-ui-reactor/blob/main/docs/_pipeline/ai-author-skill.md) for the planned
3333
surface area and the spec-041 §7.1 layout it slots into.
3434

3535
In the meantime, the closest existing coverage is

docs/_pipeline/templates/async-resources.md.dt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ unmount, shared caching across siblings, and stale-while-revalidate by default.
2828
| `PendingFactory.Pending` | Hold a fallback in place until every nested resource leaves `Loading` |
2929

3030
For the full state-machine reference, see
31-
[async-system.md](../reference/async-system.md). This page is task-oriented:
31+
[async-system.md](https://github.com/microsoft/microsoft-ui-reactor/blob/main/docs/reference/async-system.md). This page is task-oriented:
3232
each section is a recipe you can copy.
3333

3434
## Porting UseEffect + UseState → UseResource

docs/_pipeline/templates/collections.md.dt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ receive is the full current selection, not the change since the last call.
218218
Passing `null` to the fluent clears any previously-set handler.
219219

220220
> `TreeView` multi-select is intentionally deferred — see
221-
> [spec 039](../specs/039-property-and-event-scrub.md) §5.8 for the
221+
> [spec 039](https://github.com/microsoft/microsoft-ui-reactor/blob/main/docs/specs/039-property-and-event-scrub.md) §5.8 for the
222222
> rationale. Use single-select `OnItemInvoked` until then.
223223

224224
## Stable Identity with WithKey

docs/_pipeline/templates/components.md.dt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ with a `Render()` method that returns an element tree describing its UI.
4646
Override `ShouldUpdate(TProps? old, TProps? new)` to make a `Component<TProps>`
4747
ignore certain prop changes (cosmetic-only label updates, for example). The
4848
default `Equals()`-based check on records is the right call for most cases.
49-
The auto-generated [components reference](reference/elements/index.md) covers
50-
every member; the rest of this page is the narrative.
49+
The auto-generated components reference covers every member (coming soon —
50+
see the [Hooks reference](reference/hooks/index.md) for the existing
51+
prototype); the rest of this page is the narrative.
5152

5253
## Basic Component
5354

docs/_pipeline/templates/dev-tooling.md.dt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ subcommands map one-to-one to the workflows below.
116116
| `mur pack-local` / `mur clean-local` | Package / clean the local NuGet feed for samples that consume `Microsoft.UI.Reactor` as a package | `mur pack-local` |
117117

118118
`mur docs compile` is the workflow you reach for most often. See
119-
[the doc-pipeline contributor guide](../contributing/doc-pipeline.md)
119+
[the doc-pipeline contributor guide](https://github.com/microsoft/microsoft-ui-reactor/blob/main/docs/contributing/doc-pipeline.md)
120120
for the full surface and the `--validate-only`, `--skip-screenshots`,
121121
`--skip-diagrams`, `--skip-reference`, and `--tier=<stub|solid|comprehensive>`
122122
flags that make the inner loop fast.
@@ -132,7 +132,7 @@ you launch it explicitly when you want agent integration.
132132

133133
The deeper protocol surface lives in
134134
[DevTools Internals](devtools-internals.md). The
135-
[`docs/contributing/devtools.md`](../contributing/devtools.md) guide is
135+
[`docs/contributing/devtools.md`](https://github.com/microsoft/microsoft-ui-reactor/blob/main/docs/contributing/devtools.md) guide is
136136
the operational reference (how to plug it into Claude Desktop / VS Code).
137137

138138
## VS Code Panel
@@ -279,7 +279,7 @@ to a dozen flags without a config UI.
279279
The same preview-mode plumbing the doc pipeline uses is available to
280280
your own app: pass `preview: true` to `ReactorApp.Run` and the doc-
281281
pipeline screenshot harness can capture the window. See
282-
[`docs/contributing/doc-pipeline.md`](../contributing/doc-pipeline.md)
282+
[`docs/contributing/doc-pipeline.md`](https://github.com/microsoft/microsoft-ui-reactor/blob/main/docs/contributing/doc-pipeline.md)
283283
for the harness contract. This is how every page in the docset gets
284284
its screenshots automatically without an author launching the app by
285285
hand.

docs/_pipeline/templates/docking.md.dt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,4 +187,4 @@ control yourself.
187187
`WindowPersistedScope` that docking layouts route through.
188188
- **[Components](components.md)** — `Key` rules and the reconciler
189189
identity model that `DockableContent.Key` plugs into.
190-
- **[Reactor](readme.md)** — back to the docset index.
190+
- **[Reactor](index.md)** — back to the docset index.

docs/_pipeline/templates/effects-scheduling.md.dt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ This page is about when [`UseEffect`](hooks.md) fires and why.
3434
Surface-level usage is on the [Effects](effects.md) page; the
3535
async-resource pipeline — `UseResource`, `UseInfiniteResource`,
3636
`Pending`, `QueryCache` — has its own deep walk in the
37-
[async-system reference](../reference/async-system.md). What
37+
[async-system reference](https://github.com/microsoft/microsoft-ui-reactor/blob/main/docs/reference/async-system.md). What
3838
follows is the render-loop view of the same callbacks.
3939

4040
## The render → commit → flush sequence
@@ -119,7 +119,7 @@ paths don't collide:
119119

120120
`PendingScope` is one place the cleanup contract is load-bearing. A
121121
`UseResource` hook registers its token with the nearest ancestor
122-
[`Pending`](async-resources-cookbook.md) scope at mount, updates
122+
[`Pending`](async-resources.md) scope at mount, updates
123123
loading state through its lifecycle, and unregisters in cleanup.
124124
Skip the unregister and the `Pending` fallback never clears — the
125125
fallback subtree stays rendered after the resource resolves because
@@ -148,7 +148,7 @@ UseEffect(async () => { // async void lambda
148148
The async-resource hooks (`UseResource`, `UseInfiniteResource`,
149149
`UseMutation`) wrap this pattern correctly — they own the cancellation
150150
token, marshal completions back to the UI thread, and clean up their
151-
[`QueryCache`](async-resources-cookbook.md) subscription on unmount.
151+
[`QueryCache`](async-resources.md) subscription on unmount.
152152
Reach for them before writing async-effect glue by hand. When you do
153153
need a raw `UseEffect` for an async operation, the cleanup function
154154
is your only chance to cancel the in-flight task — capture a
@@ -260,7 +260,7 @@ the next render leaks the resource.
260260
**Don't await directly in the lambda.** `UseEffect(async () => ...)`
261261
detaches from the flush ordering; capture a `CancellationTokenSource`,
262262
kick off a `Task.Run`, and cancel in cleanup. Or use
263-
[`UseResource`](async-resources-cookbook.md), which already does this.
263+
[`UseResource`](async-resources.md), which already does this.
264264

265265
**Treat the dep array as a value-equality contract.** Records,
266266
primitives, and stable setter identities are safe. Freshly-allocated
@@ -276,6 +276,6 @@ before my body did?" question.
276276

277277
- **[Effects](effects.md)** — Previous: the surface lifecycle of `UseEffect`.
278278
- **[Reconciliation](reconciliation.md)** — Next: the commit phase that flush runs after.
279-
- **[Async resources](async-resources-cookbook.md)** — Hooks built on top of this scheduling.
280-
- **[async-system reference](../reference/async-system.md)** — Deep walk through cache, refcount, and revalidation.
279+
- **[Async resources](async-resources.md)** — Hooks built on top of this scheduling.
280+
- **[async-system reference](https://github.com/microsoft/microsoft-ui-reactor/blob/main/docs/reference/async-system.md)** — Deep walk through cache, refcount, and revalidation.
281281
- **[Threading and dispatch](threading-and-dispatch.md)** — Why effect bodies always run on the UI thread.

docs/_pipeline/templates/forms.md.dt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ so you rarely need `.Set(...)`. The named-input shapes set the appropriate
103103

104104
These fluents chain freely; the named-input shapes are the canonical way to
105105
hint mobile / touch keyboards instead of reaching for `.Set(c => c.InputScope = ...)`.
106-
See [spec 039](../specs/039-property-and-event-scrub.md) §2.3 and §4.7 for the
106+
See [spec 039](https://github.com/microsoft/microsoft-ui-reactor/blob/main/docs/specs/039-property-and-event-scrub.md) §2.3 and §4.7 for the
107107
rationale.
108108

109109
## Simple Validation

0 commit comments

Comments
 (0)