DocSpec is a streaming document-conversion library built in Rust. Documents flow as typed events, one at a time, in constant memory. Contributions that keep that discipline intact are welcome.
- Report bugs — found something broken? Open an issue
- Suggest features — have an idea? Start a discussion
- Improve documentation — clearer docs help everyone
- Submit code — fix bugs or implement features
- Review PRs — a second pair of eyes matters
- Fork the repository
- Clone your fork locally
- Create a branch for your changes (
git checkout -b feat/my-thing) - Make your changes following the guidelines below
- Test your changes
- Submit a pull request
DocSpec is a Cargo workspace. Before committing:
- Run
cargo fmt— all.rsfiles must be formatted - Run
cargo clippy— zero warnings, no#[allow]patches in source code - Run
cargo test— all tests must pass
Source code holds the strict line. Test files (tests/ and #[cfg(test)] modules) may suppress specific clippy lints at crate level when the lint doesn't apply to test code, but source code is never patched around.
- No
unwrap()orexpect()in source code — useResultand? - No
unsafe— the workspace forbids it entirely - Never buffer a full document — stream always, event by event
- All public items need doc comments
- Keep functions focused; add comments where the logic isn't obvious
DocSpec uses Conventional Commits. Format:
type(scope): description
[optional body]
[optional footer(s)]
Common types:
feat— new featurefix— bug fixdocs— documentation changesrefactor— restructuring without behavior changetest— adding or updating testschore— maintenance tasks
Examples:
feat(docx-reader): support nested listsfix(html-writer): correct attribute escaping for empty valuesdocs: clarify EventSink contract in docspec-core
Reference issues where applicable: fix(pipe): handle source error mid-stream (#123)
Changelogs are generated automatically from conventional commits by release-plz. Don't edit CHANGELOG.md by hand.
- Fill out the PR template completely
- Keep PRs focused on a single change
- Update documentation if the public API or behavior changes
- Ensure all tests pass and coverage holds
- Be responsive to review feedback
Changes to the DocSpec event model — the Event type and its well-formedness rules — need extra care. The event stream is the contract every reader and writer speaks. Breaking it breaks everything downstream.
- Discuss first — open an issue before writing code
- Backward compatibility — consider impact on existing documents and crates
- Update the spec — reflect changes in
docspec-core's event documentation and on docs.rs - Document the change — update
ARCHITECTURE.mdand any affected crate READMEs
Include:
- Version (
cargo pkgid docspecor commit hash) - Steps to reproduce
- Expected vs. actual behavior
- A minimal sample document, if applicable
- Error output or logs
Describe:
- The problem you're solving
- Your proposed solution
- Alternatives you've considered
- Examples or mockups, if helpful
- Open a discussion
- Check existing issues for similar questions
By contributing, you agree that your contributions will be licensed under the same license as the project (MIT).