Convert readthedocs to markdown
Project description
Docs-to-Markdown [D2M]
Docs-to-Markdown[D2M] is a tool using Jina.ai
api or openai
api (default: ollama: reader-lm
) to convert project documentation to markdown
.
For now, it only supports readthedocs
project, but it will add more project type in the future.
Usage
Install
pip install docs-to-md
Convert the documentation of a readthedocs project to markdown
d2m --help
Usage: d2m [OPTIONS]
Options:
-u, --url TEXT Root url of the documentation project
-p, --project-name TEXT Name of the project
-t, --target-path TEXT Path to save the html and md files
-nj, --no_jina Use open-based api (default: ollama reader-lm) to
parse html to markdown, if true, --token is
required, and will ignore --api and --model
--api TEXT Base url of the openai/jina api, only works when
--no_jina is false
--token TEXT Api key of the openai/jina api
--model TEXT Model to use for parsing html to markdown
--help Show this message and exit.
Example:
# use jina api
d2m -u https://example-sphinx-basic.readthedocs.io/en/latest/ -t saved/demo
# use openai api
# not recommend, seems like ollama reader-lm is not good enough compare to jina api
# make sure you have installed `ollama` and run ollama with `ollama run reader-lm`
d2m -u https://example-sphinx-basic.readthedocs.io/en/latest/ -t saved/demo-local -nj -a http://localhost:11434/v1 -m reader-lm
Jina API Limitation
You can get the api_key
from Jina.
Endpoint | Description | Rate limit with API key (premium plan) | Rate limit with API key | Rate limit w/o API key |
---|---|---|---|---|
r.jina.ai | Reader Read | 1000 RPM | 200 RPM | 20 RPM |
s.jina.ai | Reader Search | 100 RPM | 40 RPM | 5 RPM |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
docs_to_md-0.1.2.tar.gz
(8.6 kB
view details)
Built Distribution
File details
Details for the file docs_to_md-0.1.2.tar.gz
.
File metadata
- Download URL: docs_to_md-0.1.2.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc4471c5587bf2fd164a6118a8d8901b262319ab98f83924e9ae5606d62278ef |
|
MD5 | b5631ee3ccd1a0ae46532b54ada88c6a |
|
BLAKE2b-256 | 2c09d31925014993640190a5965a7070412bd66b6552fd542d2110bc72918393 |
File details
Details for the file docs_to_md-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: docs_to_md-0.1.2-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3447d8806bcb735ee072cabe213eaaaa7783729c42e3ac8fa07e5a77dc53c06 |
|
MD5 | c3e6f55bb1dcc5a48f88c65073f335bb |
|
BLAKE2b-256 | 28faddd71ce0f7bf35b11c70f6cd6f4582f95e37be5ad13817140cee37238940 |