How to add a new resource to the internal service documentation
This guide explains how to add a new resource to the internal service documentation.
Directory tree
docs/internal/
├── README.html # Entry: overview, service scope, ADRs, links (API hub, etc.)
├── STRUCTURE.md # Stub → links to this page (howto)
├── service-overview.html # Redirect stub → README.html (bookmarks)
└── api/
├── README.html # HTTP API hub — list of resources
└── user/ # One folder per API resource name
├── index.html # Hub: business, contract, technical spec, method index
├── user-http-api.html # Optional redirect stub → index.html (bookmarks)
└── operations/ # One HTML file per HTTP endpoint (not per operationId)
├── post-api-v1-user.html
├── get-api-v1-user-system_uuid-system_user_id.html
├── put-api-v1-user-system_uuid-system_user_id.html
└── patch-api-v1-user-system_uuid-system_user_id.html
Shared chrome
| Asset | Role |
|---|---|
docs/assets/internal-layout.css |
Two-column layout + sidebar chrome + HTTP “tablet” on operation pages |
docs/assets/internal-sidebar.js |
Single source of truth for the left nav — edit INTERNAL_SIDEBAR_NAV when
adding pages |
docs/assets/docs-nav.js |
Top “pill” navigation across all docs |
Every internal page that should show the sidebar: load internal-layout.css +
internal-sidebar.js, include #internal-sidebar-mount, and use the shell markup (see
internal/README.html).
Page structure (On this page, Overview, sections)
Multi-section pages that use the internal sidebar layout should follow one predictable skeleton so navigation
and scanning stay consistent. Canonical example:
docs/internal/README.html.
Recommended order inside .container
-
<h1>— page title. If this file is the sidebar entry labeled Overview (internal/README.html), prefer a title that matches that role (e.g. “Welcome — Internal docs”). <div id="docs-top-nav"></div>— top “pill” navigation (fromdocs-nav.js).-
Optional
<p class="lead">— one short paragraph when the page needs a hook before the table of contents. -
Overview — on hub / landing pages, the first substantive block is usually
<section id="overview" class="card">with<h2>Overview</h2>: who the page is for, what to open next, and links to System design, Developers Docs, API hub, OpenAPI, etc. Omit or replace with a different first<h2>when the document is not a map (e.g. System design uses numbered top-level sections). -
Additional topics — more
<section id="..." class="card">blocks, one main subject per card. -
<div class="docs-inpage-toc-mount" data-inpage-toc="auto"></div>near the end of the container — injects the auto-generated On this page TOC from headings. If this mount is missing,docs-nav.jsadds it automatically.
How to add a new resource (e.g. Order)
- Create
docs/internal/api/<resource>/index.html(hub) anddocs/internal/api/<resource>/operations/for endpoint pages. - Name operation files from HTTP method + path template, e.g.
get-api-v1-orders--order_id.html— not from PythonoperationId. - Extend
INTERNAL_SIDEBAR_NAVininternal-sidebar.js(paths fromdocs/root, e.g.internal/api/order/index.html). - Add a card + link on
internal/api/README.html. -
Put business + technical narrative on the resource
index.html(seeinternal/api/user/index.html). Add<resource>-http-api.htmlonly as a redirect stub if you rename later — follow ADR 0026 (same PR as behavior changes).
How to edit existing pages
- Sidebar: change labels or paths in
INTERNAL_SIDEBAR_NAVininternal-sidebar.js. - Top navigation (Home, Internal, …): edit
renderTopNavindocs-nav.js. - Page body: edit the HTML file; run
make docs-fixif your workflow includes doc sync and format checks.
Removed / obsolete
docs/internal/user/— removed; the canonical User hub isapi/user/index.html.details.internal-doc-mapstyles were removed fromdocs.css(old collapsible map on README).internal-doc-demo.css/internal-doc-nav.js— removed; they only served a deleted prototype page.
Related
- Page structure (On this page, Overview, sections) — on this page
- Documentation style guide and audit standard — cross-doc rules and templates
- Internal service documentation — index
- ADR 0025 — external vs internal API documentation
- ADR 0026 — internal narrative as source of truth
- How-to guides — index
Page history
| Date | Change | Author |
|---|---|---|
| Added Page history section (repository baseline). | Ivan Boyarkin |