Skip to content

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

License

Notifications You must be signed in to change notification settings

ColinKennedy/sphinx-code-include

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

docs Documentation Status
tests
Dependencies Auto-Checks are enabled
Coverage Status
Codacy Code Quality Status
package

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