Metadata-Version: 2.4
Name: sphinx-section-include
Version: 2026.11.2
Summary: Include selected sections of reStructuredText documents in Sphinx projects.
Author-email: Adam Dangoor <adamdangoor@gmail.com>
License-Expression: MIT
Project-URL: Issues, https://github.com/adamtheturtle/sphinx-section-include/issues
Project-URL: Source, https://github.com/adamtheturtle/sphinx-section-include
Keywords: documentation,rst,sphinx
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Web Environment
Classifier: Framework :: Sphinx :: Extension
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Requires-Python: >=3.12
Description-Content-Type: text/x-rst
License-File: LICENSE
Requires-Dist: docutils>=0.21.2
Requires-Dist: sphinx<10,>=9.1.1
Dynamic: license-file

|Build Status| |PyPI|

sphinx-section-include
======================

Include selected reStructuredText sections in Sphinx documentation.

.. code-block:: console

   $ pip install sphinx-section-include

Add to ``conf.py``:

.. code-block:: python

   """Sphinx configuration."""

   extensions = ["sphinx_section_include"]

Include a section:

.. code-block:: rst

   .. include-section:: manual.rst
      :section: Getting started / Configuration
      :include-heading:
      :exclude-sections: Advanced configuration

Select by exact heading, heading path, or ``#label``.
Omit ``:include-heading:`` to include only the section's contents.
``:exclude-sections:`` accepts one descendant selector per line.
Paths are relative to the including document, or to the Sphinx source directory when prefixed with ``/``.

Extension authors can reuse parsed sources through the `Python API <https://github.com/adamtheturtle/sphinx-section-include/blob/main/API.rst>`_.

See the `examples <https://github.com/adamtheturtle/sphinx-section-include/tree/main/sample/source>`_ and `contributor guide <https://github.com/adamtheturtle/sphinx-section-include/blob/main/CONTRIBUTING.rst>`_.

.. |Build Status| image:: https://github.com/adamtheturtle/sphinx-section-include/actions/workflows/ci.yml/badge.svg?branch=main
   :target: https://github.com/adamtheturtle/sphinx-section-include/actions
.. |PyPI| image:: https://badge.fury.io/py/sphinx-section-include.svg
   :target: https://badge.fury.io/py/sphinx-section-include
