Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

= Sphinx-AsciiDoctrine
:toc: left
:toclevels: 3
:icons: font
:source-highlighter: pygments

image:https://img.shields.io/pypi/v/sphinx-asciidoctrine.svg["PyPI Version", link="https://pypi.org/project/sphinx-asciidoctrine"]
image:https://img.shields.io/pypi/pyversions/sphinx-asciidoctrine.svg["Python Versions"]
image:https://img.shields.io/github/license/webmaven/sphinx-asciidoctrine.svg["License", link="https://github.com/webmaven/sphinx-asciidoctrine/blob/main/LICENSE"]
image:https://img.shields.io/badge/code%20style-ruff-000000.svg["Ruff", link="https://github.com/astral-sh/ruff"]

[.lead]
*Sphinx-AsciiDoctrine* is a modern, highly conforming Sphinx extension providing comprehensive AsciiDoc support. Powered by the Lark-based `asciidoctrine` parser and compliant with the Eclipse AsciiDoc ASG specification.

== Project Links

* *GitHub Repository*: https://github.com/webmaven/sphinx-asciidoctrine
* *PyPI Package*: https://pypi.org/project/sphinx-asciidoctrine/
* *Official Documentation*: https://webmaven.github.io/sphinx-asciidoctrine/

== Features

* *Full-Fidelity Parsing*: Seamlessly compiles `.adoc` and `.asciidoc` files into standard Docutils nodes.
* *Interactive Autodoc Processing*: Dynamically parses and translates AsciiDoc syntax inside Python docstrings for `sphinx.ext.autodoc` pipelines.
* *Static Analysis Friendly*: Exposes a native Docutils parser designed for modern static analysis pipelines like `sphinx-autodoc2`.
* *Optimized for Parallelism*: Fully safe and optimized for Sphinx parallel read and write documentation builds.
* *Robust Fault Tolerance*: Gracefully captures and lists docstring formatting syntax errors inline inside the rendered document without crashing your build.

== Installation

To install from PyPI:

[source,bash]
----
pip install sphinx-asciidoctrine
----

== Usage

To use Sphinx-AsciiDoctrine, add `sphinx_asciidoctrine` to the `extensions` list in your Sphinx project's `conf.py` file:

[source,python]
----
extensions = [
"sphinx_asciidoctrine",
"sphinx.ext.autodoc",
]
----

=== Toggling Docstring Processing

[NOTE]
====
By default, Sphinx-AsciiDoctrine will automatically process all Python docstrings as AsciiDoc and compile them to reStructuredText (reST) during standard autodoc build phases.
====

If your project utilizes AsciiDoc for main documentation files but uses standard reST or Markdown within Python docstrings, you can easily disable automatic docstring translation by setting `asciidoc_process_docstrings` to `False` in your `conf.py`:

[source,python]
----
# Disable automatic AsciiDoc processing for Python docstrings
asciidoc_process_docstrings = False
----

=== Static Analysis with `sphinx-autodoc2`

To document your project using the static analyzer `sphinx-autodoc2` with AsciiDoc docstrings, configure your `conf.py` as follows:

[source,python]
----
extensions = [
"autodoc2",
"sphinx_asciidoctrine",
]

autodoc2_packages = [
"../src/my_package",
]

autodoc2_docstring_parser_regexes = [
(r".*", "sphinx_asciidoctrine.parser"),
]
----

== Interactive Examples

The following interactive code example is verified automatically as a doctest using `asciidoctest`:

[source,python]
----
>>> from sphinx_asciidoctrine import setup
>>> result = setup(None)
>>> isinstance(result, dict)
True
>>> result["parallel_read_safe"]
True
----

== License

This project is licensed under the Apache Software License, Version 2.0. For more details, see the link:LICENSE[LICENSE] file.

Release files for sphinx-asciidoctrine 0.1.0a2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sphinx-asciidoctrine 0.1.0a2
File Size Uploaded
sphinx_asciidoctrine-0.1.0a2.tar.gz 12.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sphinx-asciidoctrine 0.1.0a2
File Interpreter ABI Platform
sphinx_asciidoctrine-0.1.0a2-py3-none-any.whl Python 3 none any Details

Total release size: 22.1 kB

Release files / sphinx_asciidoctrine-0.1.0a2.tar.gz

Download URL sphinx_asciidoctrine-0.1.0a2.tar.gz
Size 12.7 kB
Tags Source
SHA-256 checksum
How to use checksums
3000c206a3ca2fb26d8140182a0f2ca84984dfb3613aa61d0168ad1b3f8ba9fd
BLAKE2b-256 checksum
How to use checksums
b91ff93812f370fe0aa9d6acdba47f45a0c1472d69f2368c01a11f8e81f8e6e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Release files / sphinx_asciidoctrine-0.1.0a2-py3-none-any.whl

Download URL sphinx_asciidoctrine-0.1.0a2-py3-none-any.whl
Size 9.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8b207db6455c61953f237bcc6ecab2bb649554902c191a827d43f4d242a053f8
BLAKE2b-256 checksum
How to use checksums
0b87fe9d1709fa2dba6c9a0eca500c104bc545c46ac93aa2d30af9073a58c40c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Release history Release notifications | RSS feed

This release

0.1.0a2 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page