This guide defines concise, practical conventions for repository documentation and Rust doc-comments used across the NOTEARS codebase.
-
Markdown files
- Use GitHub Flavored Markdown (GFM).
- Top-level headings:
# Titlefor major pages,##for sections. - Keep front-matter minimal: short summary first (2–4 lines), then examples.
- Use fenced code blocks with language tags (
rust,bash, ```json).
-
Rust doc-comments
- Use
///for public API documentation and//!for module-level docs. - Start with a one-line summary, followed by a blank line and details.
- Include
# Examplesand# Errorssections when relevant. - Keep examples small and copy-paste runnable where possible.
- Use
-
API Examples
- Prefer small, idiomatic examples using library re-exports (e.g.
use notears::...). - Mark long-running examples with
no_run.
- Prefer small, idiomatic examples using library re-exports (e.g.
-
File organization
- Docs live in
/docs/for long-form content; top-level READMEs present quick-starts. - Add cross-links to relevant guide pages (Quick Reference, Implementation Guide).
- Docs live in
-
CHANGELOG and Release notes
- Keep CHANGELOG.md concise: include breaking changes, new features, bug fixes.
-
Commit messages
- Short summary (50 chars), blank line, longer description.
- Use imperative mood:
docs: add ...,fix: correct ...,chore: format ....
-
Accessibility & readability
- Use simple language; prefer active voice and present tense.
- Prefer bullets for steps; use code blocks for commands and examples.
-
CI & WASM docs
- Document platform dependencies (Chromium libs) in
DEPLOYMENT.mdanddocs/. - Provide a small browser usage example for
notears-wasm.
- Document platform dependencies (Chromium libs) in
This guide is intentionally short — extend topic-specific documents (e.g. CONTRIBUTING.md) when detailed workflows are required.