docs(readme): align API blocks to <details> pattern with Types group#41
Merged
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Align the API section with the Coroboros canonical per-method block format (uri-style):
### Typesgroup leads## API.CloneOptions,CloneError,CloneErrorCodeeach get a<details><summary><code>Name</code></summary>block. The per-field option table moves intoCloneOptionsso theclone()block carries onlyoptions?referencing the type.clone(thing, options?)andfreeze(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.#### Supported types,#### Cycle handling,#### Fast clone for plain JSON-shaped data,#### Skipped types) become**Bold-labeled**blocks inside the function<details>.Pure docs. No source, no behavior change. Part of a Coroboros-wide doc alignment so
uri/clone/sparkline/location-timezoneall use the same shape.Test plan
[CloneOptions](#types),[clone](#cloning)) navigate correctly on GitHub.<details>blocks fold and unfold on the GitHub renderer and the npm page.bench/baseline.mdlink still works (relative path unchanged).