Skip to content

docs(readme): align API blocks to <details> pattern with Types group#41

Merged
ob-aion merged 1 commit into
mainfrom
docs/api-format-alignment
May 20, 2026
Merged

docs(readme): align API blocks to <details> pattern with Types group#41
ob-aion merged 1 commit into
mainfrom
docs/api-format-alignment

Conversation

@ob-aion
Copy link
Copy Markdown
Collaborator

@ob-aion ob-aion commented May 20, 2026

Summary

Align the API section with the Coroboros canonical per-method block format (uri-style):

  • New ### Types group leads ## API. CloneOptions, CloneError, CloneErrorCode each get a <details><summary><code>Name</code></summary> block. The per-field option table moves into CloneOptions so the clone() block carries only options? referencing the type.
  • clone(thing, options?) and freeze(thing) move to <details>. Signatures in <summary> carry function name and parameters only — generics, defaults, and return type live in the structured Parameters / Returns / Throws sections below.
  • Sub-section headers (#### Supported types, #### Cycle handling, #### Fast clone for plain JSON-shaped data, #### Skipped types) become **Bold-labeled** blocks inside the function <details>.
  • Every function now has an Examples block (4–6 lines of realistic calls) and an explicit Throws line where applicable.

Pure docs. No source, no behavior change. Part of a Coroboros-wide doc alignment so uri / clone / sparkline / location-timezone all use the same shape.

Test plan

  • CI preflight green.
  • README anchors still resolve — internal links ([CloneOptions](#types), [clone](#cloning)) navigate correctly on GitHub.
  • <details> blocks fold and unfold on the GitHub renderer and the npm page.
  • bench/baseline.md link still works (relative path unchanged).

Reshape the API section to match the Coroboros canonical API doc format
(uri-style):

- Lead with `### Types` listing `CloneOptions`, `CloneError`,
  `CloneErrorCode` in `<details><summary><code>Name</code></summary>`
  blocks. CloneOptions's per-field table moves here from inside the
  clone() block so the function signature stays scannable.
- `clone(thing, options?)` and `freeze(thing)` move to
  `<details><summary><code>...</code></summary>` under `### Cloning`.
  Summary carries the signature only (no generics, no return type) —
  Returns / Throws lines below the parameter table carry the type info.
- Sub-section headers (`#### Supported types` etc.) become
  `**Bold-labeled**` blocks inside the function `<details>`.
- Every function block now has a `**Throws**` line (where applicable)
  and an `**Examples**` block — 4–6 lines of realistic calls.

No code changes; descriptions and information preserved verbatim except
where consolidation removed inline duplication (the per-field option
detail now lives once in CloneOptions, not also in the clone() block).
Copy link
Copy Markdown
Collaborator Author

@ob-aion ob-aion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

@ob-aion ob-aion merged commit 3e5749c into main May 20, 2026
5 checks passed
@ob-aion ob-aion deleted the docs/api-format-alignment branch May 20, 2026 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant