Antsibull-docutils is a Python library that provides docutils helpers used primarily by other Antsibull tools for building Ansible documentation. It offers functionalities like finding code blocks within reStructuredText (RST) files. The library is currently at version 1.4.0 and is actively maintained within the Ansible community, showing a regular release cadence with recent updates.
pip install antsibull-docutilsVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use `find_code_blocks` to extract code snippets from a reStructuredText (RST) string. The function returns a list of CodeBlock objects, each containing details about the found block, such as its content, language, and line number.
Ensure `docutils` version 0.18 or newer is installed and used in your environment (`pip install 'docutils>=0.18'`).
Understand its role within the Ansible community's documentation build pipeline. For general Sphinx/docutils use, consider direct `docutils` or `sphinx` APIs before relying heavily on this specialized library, unless integrating with Ansible-specific documentation.
Correct the import path to `from antsibull_docutils.rst_code_finder import find_code_blocks`.
Upgrade your `docutils` installation to version 0.18 or newer (`pip install --upgrade 'docutils>=0.18'`).