Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions examples/app-showcase/src/coverage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ export const COVERAGE = {
i18nThemingPortals: {
coveredBy: 'translations/index.ts (en + zh-CN), themes/index.ts (light + dark), portals/index.ts',
},
docs: {
source: 'ADR-0046 (doc metadata)',
coveredBy: 'src/docs/*.md — flat Markdown compiled to `doc` items: frontmatter title + first-heading title, cross-references with anchors, namespace-prefixed names',
},
} as const;

/** Collect every field `type` used across a set of object definitions. */
Expand Down
31 changes: 31 additions & 0 deletions examples/app-showcase/src/docs/showcase_docs_guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
title: Documentation Guide
---

# Writing package docs

Rules this very file follows (each one is enforced by `os build`):

- **Flat directory** — every doc lives directly in `src/docs/`;
subdirectories fail the build. Flatness is what keeps references
stable: a link is resolved by basename, never by path.
- **Namespace-prefixed filename** — the stem becomes the doc name
(`showcase_docs_guide.md` → `showcase_docs_guide`), globally unique
inside a running instance, so the console URL needs no package
coordinate.
- **Title** — frontmatter `title:` wins (this file uses it); otherwise
the first `#` heading; otherwise the name.
- **Pure Markdown** — CommonMark + GFM only. MDX and image references
are rejected at build time (trust boundary + version immutability).

## Cross-references

Link to a sibling doc with a plain relative link:

```md
See the [overview](./showcase_index.md).
```

The console rewrites it to `/docs/showcase_index`; in an editor or on
GitHub the same link just works. Broken same-package links fail the
build. Back to the [overview](./showcase_index.md).
16 changes: 16 additions & 0 deletions examples/app-showcase/src/docs/showcase_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Showcase

The living conformance fixture for the ObjectStack protocol: every field
type, view type, chart type, report type, and action location appears at
least once, and the coverage test fails when the platform gains a
feature this package does not yet demonstrate.

This manual itself demonstrates one of those features — **package docs
as metadata** (ADR-0046). Every Markdown file in the flat `src/docs/`
directory compiles into a `doc` metadata item at build time, ships
inside the package artifact, and renders in the console at
`/docs/<name>`.

For the authoring rules this page must itself obey, see the
[documentation guide](./showcase_docs_guide.md) — or jump straight to
its [cross-reference section](./showcase_docs_guide.md#cross-references).