Thank you for your interest in contributing! This project blends Python (CLI/TUI, orchestration) with Rust (HTML parsing and conversion) via PyO3 bindings.
- Python entrypoints:
markdown_lab/__main__.pyroutes to the modern CLI (markdown_lab/cli.py) and TUI (markdown_lab/tui.py). - Core services: HTTP client, caching, throttling, sitemap parsing, and chunking live under
markdown_lab/core/*andmarkdown_lab/utils/*. - Rust engine: The PyO3 module
markdown_lab_rs(fromsrc/lib.rs) exposes conversion (convert_html_to_format,convert_html_to_markdown), chunking, simple HTML utilities, and optional JS rendering. - Bridge layer:
markdown_lab/core/rust_backend.pywraps the Rust module and centralizes error handling and fallbacks.
- Modern CLI:
mlabwith rich output and subcommands (convert,sitemap,batch,status,config). - TUI:
mlab-tuiprovides an interactive interface using Textual. - Legacy: Set
MARKDOWN_LAB_LEGACY=1or usemlab-legacyto invoke the older scraper-based interface when needed.
just setup(requires Python 3.12+, Rust, and uv). This creates.venv, installs deps, and builds the Rust extension viamaturin.- Run linting and typing with
just lintandjust typecheck. - Run tests with
just testorjust test-coverage.
- Unit tests must be hermetic (no network). Use mocks in Python and avoid external HTTP in Rust tests.
- Network or environment-dependent tests must be marked
@pytest.mark.integration(Python) or#[ignore]/feature-gated (Rust). - A feature
offline_testsenables an offline path forrender_js_pageby allowing inline HTML viainline://URLs in tests.
- Python: black (88), ruff, isort profile=black, mypy strict on public APIs.
- Rust:
cargo fmtandclippy -D warnings.
- CI runs
safetyfor Python andcargo auditfor Rust. High/critical issues fail the build. - Dependabot tracks both
pipandcargoecosystems.
- Follow Conventional Commits (e.g.,
feat(cli): ...,fix(core): ...). Keep subjects imperative and concise.