Thank you for your interest in contributing to coOCR/HTR! This project is developed as an open-source community tool using the Promptotyping methodology -- we welcome contributions from domain experts, developers, and digital humanists.
coOCR/HTR follows a few core principles that guide all contributions:
- Expert-in-the-Loop: The human expert decides, the machine assists
- Documentation before code: Design decisions are documented in knowledge/
- Minimal, readable code: Vanilla JavaScript, no build process, no framework dependencies
- Promptotyping: Iterative development through AI-assisted dialogue
git clone https://github.com/YOUR_USERNAME/co-ocr-htr.git
cd co-ocr-htrgit checkout -b feat/my-feature
# or: fix/my-bugfix, docs/my-documentation- Follow the Code Standards below
- Add tests for new features
- Update documentation if behavior changes
cd docs
npm install
npm test # Unit tests (Vitest)
npx serve . -l 3000 # Manual testing- One feature per PR -- keep PRs focused and reviewable
- Write a clear description of what changed and why
- Include screenshots for UI changes
- Reference related issues if applicable
We use Conventional Commits:
| Prefix | Usage |
|---|---|
feat: |
New feature |
fix: |
Bug fix |
docs: |
Documentation only |
chore: |
Maintenance, dependencies |
refactor: |
Code restructuring without behavior change |
test: |
Adding or updating tests |
Examples:
feat: add Azure Mistral OCR provider
fix: prevent dialog close on text selection
docs: update architecture with i18n system
test: add unit tests for project rules export
- Vanilla JavaScript (ES6+) -- no TypeScript, no JSX
- No runtime npm dependencies -- the app runs without
node_modules - ES6 modules (
import/export) -- native browser modules - CSS Custom Properties for theming (see
docs/css/variables.css) - Comments explain "why", code explains "what"
- HTML escaping for any user-provided or LLM-generated content (
escapeHtml())
- No build systems (webpack, vite, rollup, etc.)
- No CSS preprocessors (sass, less, etc.)
- No UI frameworks (React, Vue, Svelte, etc.)
- No runtime npm packages
- State:
AppState extends EventTargetwithCustomEventdispatch - Services: Singleton pattern (e.g.,
export const llmService = new LLMService()) - Storage: IndexedDB for large data, localStorage for settings
- API Keys: Memory-only by default, optional IndexedDB persistence with user consent
- Clear title and description
- Focused scope (one feature or fix)
- Tests for new functionality
- Updated documentation if the feature is user-facing
- Screenshots for UI changes
- PRs that add build systems or transpilers
- PRs that add runtime npm dependencies
- PRs that break existing tests without explanation
- PRs with unrelated formatting changes
- Submit your PR against the
mainbranch - Maintainer reviews -- Christopher Pollin (@chpollin) reviews all PRs
- Feedback & iteration -- expect constructive feedback, please be patient
- Merge -- once approved, the maintainer merges your contribution
Contributors are credited in:
- The merge commit message (via
Co-Authored-By) - The Contributors section in README.md
- The development journal (knowledge/JOURNAL.md)
- Bug reports: GitHub Issues
- Feature requests: GitHub Issues with
enhancementlabel - Questions: GitHub Discussions
# Clone
git clone https://github.com/DigitalHumanitiesCraft/co-ocr-htr.git
cd co-ocr-htr
# Install dev dependencies (tests only)
cd docs && npm install
# Run tests
npm test
# Serve locally
npx serve . -l 3000
# Optional: Configure API keys for development
cp config.local.example.js config.local.js
# Edit config.local.js with your API keys (gitignored)By contributing, you agree that your contributions will be licensed under the CC BY 4.0 license.