Thanks for contributing to md-genedai / website2markdown.
This project is maintained by a solo maintainer. During the open-source launch period, pull requests are typically reviewed within 1 week.
Requirements:
- Node.js with npm
- Cloudflare Workers tooling through the repo's local dependencies
Install dependencies:
npm installStart local development:
npm run devRun the test suite:
npm testUseful extra checks before opening a PR:
npm run typecheck
npm run test:coverage- Keep changes focused. Small, well-scoped PRs are easier to review and merge.
- Match the existing architecture and naming patterns instead of introducing parallel abstractions.
- This codebase uses TypeScript
strictmode. New code should compile cleanly without weakening type safety. - Follow the existing style in
src/rather than reformatting unrelated files.
Site adapters live in src/browser/adapters/. Follow the existing adapter shape defined by SiteAdapter in src/types.ts.
Typical steps:
- Add a new adapter file in
src/browser/adapters/. - Implement the standard adapter surface:
match(url)alwaysBrowserconfigurePage(page, capturedImages?)extract(page, capturedImages)- optional
postProcess(html) - optional
transformUrl(url) - optional
fetchDirect(url)
- Register the adapter in
src/browser/index.ts. - Keep
genericAdapterlast in the adapter list. - Reuse existing patterns from current adapters instead of inventing a new lifecycle.
Guidelines:
- Keep URL matching narrow and deterministic.
- Prefer the simplest working path:
- use
transformUrlwhen a stable alternate URL is enough - use
fetchDirectonly when an API-style path is clearly better than browser rendering - use
postProcessfor HTML cleanup that should happen before Readability/Turndown
- use
- Avoid adapter-specific behavior in unrelated modules unless it is broadly reusable.
- If the adapter needs browser rendering, keep
configurePageminimal and site-specific.
Adapter PRs must include tests.
At minimum, add or update tests in the existing adapter test suites:
src/__tests__/adapters.test.tssrc/__tests__/adapters-behavior.test.tssrc/__tests__/adapters-edge.test.ts
Choose the right coverage for the adapter:
- URL matching and
alwaysBrowser transformUrlbehaviorpostProcessbehaviorfetchDirectbehavior- edge cases specific to the target site
- Fork the repository.
- Create a topic branch from your fork.
- Make your changes.
- Run tests locally.
- Open a pull request with a clear description of the change and why it is needed.
Recommended branch naming:
feat/<short-description>fix/<short-description>docs/<short-description>
Before opening a PR, make sure:
npm testpasses- any adapter change includes tests
- the change matches existing patterns
- docs are updated if behavior or supported sites changed
- Use TypeScript idiomatically and keep
strictcompatibility. - Prefer explicit, readable control flow over clever abstractions.
- Preserve current module boundaries and file responsibilities.
- Avoid unrelated refactors in the same PR.
- Keep comments concise and only where they add real context.
- For bugs and feature requests, use GitHub issues.
- For security reports, do not open a public issue. Follow
SECURITY.md.