web2md converts returned HTML into Markdown for researchers and content teams. Use source-attributed files to retain readable inputs for records and retrieval.
Requirements: Python 3.11 or later.
git clone https://github.com/b2bvic/owned-record.git
cd owned-record/components/web2md
python3 -m venv .venv
.venv/bin/python -m pip install -r requirements-dev.txt.venv/bin/python - <<'PY'
import runpy
tool = runpy.run_path('web2md')
print(tool["html_to_markdown"](tool["clean_html"]("<h1>Demo</h1><p>Portable text.</p>")))
PYThis example uses synthetic input without fetching a website.
- Fetch HTML with a bounded request timeout.
- Remove configured boilerplate tags and matching elements.
- Write Markdown with the source URL and fetch date.
- The tool does not execute JavaScript or bypass access controls.
- Boilerplate matching can remove useful content.
- Images are omitted, and relative links are not rewritten to absolute URLs.
.venv/bin/python -m pytest -q
.venv/bin/python -m ruff check --select E9,F63,F7,F82 web2md testsCI runs the portable tests and checks syntax-related Python lint rules.
MIT. See LICENSE.