sphinx-code-include 2.0.0


pip install sphinx-code-include

  Latest version

Released: Jan 09, 2025


Meta
Author: Colin Kennedy
Requires Python: >=3.9

Classifiers

Development Status
  • 5 - Production/Stable

Intended Audience
  • Developers

License
  • OSI Approved :: BSD License

Operating System
  • Unix
  • POSIX
  • Microsoft :: Windows

Programming Language
  • Python
  • Python :: 3
  • Python :: 3.9
  • Python :: 3.10
  • Python :: 3.11
  • Python :: Implementation :: CPython
  • Python :: Implementation :: PyPy

Topic
  • Utilities

sphinx-code-include is an extension for Sphinx that lets you render source-code of any class or function directly into your Sphinx documentation using only as string.

  • Free software: BSD 2-Clause License

Example

.. code-include :: :func:`os.path.join`

This code-include block renders as: (theme is sphinx_rtd_theme)

https://user-images.githubusercontent.com/10103049/67256848-f7422380-f43d-11e9-857a-434ba7bf579f.jpg

As long as the string you’ve chosen is either

then code-include can find it and render it in your documentation.

Installation

pip install sphinx-code-include

You can also install the in-development version with:

pip install https://github.com/ColinKennedy/sphinx-code-include/archive/master.zip

Documentation

https://sphinx-code-include.readthedocs.io/

Development

To run the all tests run:

tox

Changelog

2.0.1 (2025-01-08)

  • Dropped Python 2.7-3.8 support

  • Added better CI + mypy

1.4.0 (2024-03-16)

  • Added better CI, updated GitHub badges, various quality of life changes

1.3.0 (2024-03-14)

  • Added explicit, separate GitHub workflow actions

1.2.0 (2024-03-13)

  • Added Python 3.10 support

  • Added initial GitHub workflow actions

1.1.2 (2023-04-22)

1.1.1 (2019-10-26)

  • Fixed the requirements of the PyPI package

1.1.0 (2019-10-26)

  • Added :link-to-source: and :link-to-documentation: options

  • Added support for the :obj: tag (which can be used in place of :class:, :func:, or :meth:)

1.0.0 (2019-10-20)

  • First release on PyPI.

Wheel compatibility matrix

Platform Python 2 Python 3
any

Files in release

Extras: None
Dependencies:
beautifulsoup4 (>=4.8)
sphinx (>=1.3)