Skip to main content

Include source code from any Sphinx project using only its import path

Project description

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

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sphinx-code-include-1.4.0.tar.gz (234.5 kB view details)

Uploaded Source

Built Distribution

sphinx_code_include-1.4.0-py2.py3-none-any.whl (14.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file sphinx-code-include-1.4.0.tar.gz.

File metadata

  • Download URL: sphinx-code-include-1.4.0.tar.gz
  • Upload date:
  • Size: 234.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for sphinx-code-include-1.4.0.tar.gz
Algorithm Hash digest
SHA256 6fb7197a7f992b870f2d4a97ce02cb6f2f62ffcaf5512cbf6e044ae6e826306b
MD5 50cc7a50706d7d15d245fc0e57090430
BLAKE2b-256 958e06d6fb0735691e5366c514196771c9653ff6aba4c108f2ccb1a1bfa698e1

See more details on using hashes here.

File details

Details for the file sphinx_code_include-1.4.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for sphinx_code_include-1.4.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 adf150e97f38895c11c14f52d4cd378bab1b08de9b62880ab160c7e86b8ab0c7
MD5 5147a3d40e0f9d435c7c53851b3e3cdb
BLAKE2b-256 95af4fe757168ac5ca1a1869365b2f33faa56a545036b8df20ed87180e1ec884

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page