-
Use PyPI as the single installation location of your Python project tooling
-
Run downdoc from the CLI within your virtual environment
-
Use the API to convert files using your own Python code/scripts
-
Use the Hatch plugin to convert your project’s README.adoc file to Markdown, when building your package
uvx --from Pydowndoc -- downdoc --version
uv add Pydowndoc
uv tool install Pydowndoc
path/to/venv/python -m pip install Pydowndoc
Warning
|
These commands will only work correctly either after installation as a permenant uv tool, or after activating a virtual environment with Pydowndoc installed.
Replace the command name |
downdoc --version
downdoc --help
.md
file-extension)downdoc MyNotes.adoc
downdoc MyNotes.adoc -o output.md
downdoc MyNotes.adoc -o -
cat MyNotes.adoc | downdoc - -o MyNotes.md
.md
file-extension)from pathlib import Path
import pydowndoc
pydowndoc.run(Path("MyNotes.adoc"))
from pathlib import Path
import pydowndoc
converted_file_contents: str = pydowndoc.run(
Path("MyNotes.adoc"),
output="-",
process_capture_output=True,
).stdout.decode()
from pathlib import Path
import pydowndoc
converted_file_contents: str = pydowndoc.run(
Path("MyNotes.adoc"),
output=Path("output.md"),
process_check_return_code=True,
).stdout.decode()
-
Ensure the
readme
field is added to yourproject.dynamic
list within yourpyproject.toml
file[project] name = "my-cool-project" version = "0.1.0" dynamic = ["readme"]
-
Set up your build backend, within your
pyproject.toml
file[build-system] build-backend = "hatchling.build" requires = ["hatchling", "Pydowndoc"]
-
Include the hook name, so that processing ocurrs
[tool.hatch.metadata.hooks.downdoc-readme]
-
Using a path to a custom README file
[tool.hatch.metadata.hooks.downdoc-readme] path = "README2.adoc"
-
A full example of a pyproject.toml
file
[project]
name = "my-cool-project"
version = "0.1.0"
dynamic = ["readme"]
[build-system]
build-backend = "hatchling.build"
requires = ["hatchling", "Pydowndoc"]
[tool.hatch.metadata.hooks.downdoc-readme]
path = "README2.adoc"
uv tool upgrade Pydowndoc
uv sync --upgrade-package Pydowndoc
path/to/venv/python -m pip install --upgrade Pydowndoc
uv remove Pydowndoc
uv tool uninstall Pydowndoc
path/to/venv/python -m pip uninstall Pydowndoc
If there are issues with the Python API for this package, or you are encountering installation problems, please report these to the GitHub issues tracker for this project.
If you have problems with the conversion process of your AsciiDoc files to Markdown, please report these upstream, directly to the downdoc project.
The compiled binary of the distributed downdoc software is shared under the MIT licence as described in the upstream project’s licence file.
All other code in this project is distrubuted under the Apache-2.0 licence.