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 .rs files 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() or expect() in source code — use Result and ?
- 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 feature
- fix — bug fix
- docs — documentation changes
- refactor — restructuring without behavior change
- test — adding or updating tests
- chore — maintenance tasks
Examples:
- feat(docx-reader): support nested lists
- fix(html-writer): correct attribute escaping for empty values
- docs: 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
Event Model and Specification Changes
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.md and any affected crate READMEs
Include:
- Version (cargo pkgid docspec or 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).