Skip to content

Commit 19fdc4b

Browse files
xuyushun441-sysos-zhuangclaude
authored
feat(showcase): ADR-0046 — package docs coverage (flat src/docs/*.md) (#1793)
Two cross-referencing docs demonstrating every doc-metadata authoring rule the build enforces — flat directory, namespace-prefixed filename stems, frontmatter-title vs first-heading title derivation, relative cross-references with anchors, code blocks keeping link syntax literal — plus a COVERAGE entry so the dimension is tracked like every other showcase feature. Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent 249395a commit 19fdc4b

3 files changed

Lines changed: 51 additions & 0 deletions

File tree

examples/app-showcase/src/coverage.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ export const COVERAGE = {
7373
i18nThemingPortals: {
7474
coveredBy: 'translations/index.ts (en + zh-CN), themes/index.ts (light + dark), portals/index.ts',
7575
},
76+
docs: {
77+
source: 'ADR-0046 (doc metadata)',
78+
coveredBy: 'src/docs/*.md — flat Markdown compiled to `doc` items: frontmatter title + first-heading title, cross-references with anchors, namespace-prefixed names',
79+
},
7680
} as const;
7781

7882
/** Collect every field `type` used across a set of object definitions. */
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
title: Documentation Guide
3+
---
4+
5+
# Writing package docs
6+
7+
Rules this very file follows (each one is enforced by `os build`):
8+
9+
- **Flat directory** — every doc lives directly in `src/docs/`;
10+
subdirectories fail the build. Flatness is what keeps references
11+
stable: a link is resolved by basename, never by path.
12+
- **Namespace-prefixed filename** — the stem becomes the doc name
13+
(`showcase_docs_guide.md``showcase_docs_guide`), globally unique
14+
inside a running instance, so the console URL needs no package
15+
coordinate.
16+
- **Title** — frontmatter `title:` wins (this file uses it); otherwise
17+
the first `#` heading; otherwise the name.
18+
- **Pure Markdown** — CommonMark + GFM only. MDX and image references
19+
are rejected at build time (trust boundary + version immutability).
20+
21+
## Cross-references
22+
23+
Link to a sibling doc with a plain relative link:
24+
25+
```md
26+
See the [overview](./showcase_index.md).
27+
```
28+
29+
The console rewrites it to `/docs/showcase_index`; in an editor or on
30+
GitHub the same link just works. Broken same-package links fail the
31+
build. Back to the [overview](./showcase_index.md).
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Showcase
2+
3+
The living conformance fixture for the ObjectStack protocol: every field
4+
type, view type, chart type, report type, and action location appears at
5+
least once, and the coverage test fails when the platform gains a
6+
feature this package does not yet demonstrate.
7+
8+
This manual itself demonstrates one of those features — **package docs
9+
as metadata** (ADR-0046). Every Markdown file in the flat `src/docs/`
10+
directory compiles into a `doc` metadata item at build time, ships
11+
inside the package artifact, and renders in the console at
12+
`/docs/<name>`.
13+
14+
For the authoring rules this page must itself obey, see the
15+
[documentation guide](./showcase_docs_guide.md) — or jump straight to
16+
its [cross-reference section](./showcase_docs_guide.md#cross-references).

0 commit comments

Comments
 (0)