Skip to content

add docs#1380

Open
Nickersoft wants to merge 7 commits intomainfrom
claude/odict-documentation-Ehhbe
Open

add docs#1380
Nickersoft wants to merge 7 commits intomainfrom
claude/odict-documentation-Ehhbe

Conversation

@Nickersoft
Copy link
Member

No description provided.

Nickersoft and others added 7 commits September 15, 2025 13:03
- Scaffold Starlight (Astro) project in docs/ with sidebar navigation
- Add build-time scripts that auto-generate schema reference from odict.xsd
  and CLI reference from clap source definitions
- Write Getting Started guides: introduction, installation, and quickstart
  (creating, compiling, and querying your first dictionary)
- Write full Python API documentation (theopendictionary package)
- Write full JavaScript API documentation (@odict/node package)
- Add Rust API page linking to docs.rs with feature flag documentation
- Document complete XML schema with element hierarchy, attribute tables,
  and parts-of-speech reference
- Document all CLI commands including serve HTTP endpoints

https://claude.ai/code/session_0152q1rpTnXqZGQ5B85AhjXs
…e API docs

- Add four new guide pages using Starlight Tabs component:
  - Compiling Dictionaries: compile from string/file, compression options, loading
  - Looking Up Entries: basic/multi/case-insensitive lookup, cross-references, splitting
  - Searching Dictionaries: indexing, full-text search, search vs lookup comparison
  - Tokenizing Text: CJK/Latin tokenization, follow/insensitive options
- Update Python API docs: follow is now bool, constructor accepts str, new LoadOptions
- Update JavaScript API docs: follow is now bool, constructor accepts Buffer|string,
  new LoadOptions/RemoteLoadOptions, senses is Array<Sense>
- Add Guides section to sidebar navigation, rename API to API Reference

https://claude.ai/code/session_0152q1rpTnXqZGQ5B85AhjXs
Replace hardcoded arrays in both generation scripts with actual
source-file parsers:

- generate-cli-docs.mjs now parses clap #[arg(...)] attributes,
  doc comments, and Commands enum from Rust CLI source files
- generate-schema-docs.mjs now tokenizes odict.xsd with a
  stack-based parser that correctly handles deeply nested inline
  complexTypes, named type references, and produces accurate
  attribute/child-element tables plus a hierarchy tree

https://claude.ai/code/session_0152q1rpTnXqZGQ5B85AhjXs
Adds /// doc comments to all Python binding source files (structs, fields,
methods) with descriptions derived from the existing manual documentation.
Includes a Python script (scripts/rustdoc-to-md.py) that extracts these
doc comments and generates Markdown documentation, with proper Rust-to-Python
type mapping (Option<T> -> T | None, Vec<T> -> list[T], etc.).

This enables a single-source-of-truth workflow where API documentation
lives in the Rust source and can be extracted to Markdown for the docs site.
The script works without compilation (no nightly toolchain required).

For environments with nightly Rust, the rustdoc-md tool can also be used:
  RUSTC_BOOTSTRAP=1 cargo rustdoc -p odict_python -- -Z unstable-options --output-format json
  rustdoc-md target/doc/theopendictionary.json -o docs/python-api.md

https://claude.ai/code/session_0152q1rpTnXqZGQ5B85AhjXs
Add "rlib" alongside "cdylib" in both python/Cargo.toml and
node/Cargo.toml. This enables `cargo rustdoc --output-format json`
to work on the binding crates (rustdoc requires rlib metadata).
The cdylib output is unchanged — the rlib is just an extra build
artifact in target/.

Include docs/rustdoc-json-output.md as sample output from
rustdoc-md, for comparison with the custom script approach.

https://claude.ai/code/session_0152q1rpTnXqZGQ5B85AhjXs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants