This extension was written by a Sphinx development agent.
sphinx-github-include adds a Sphinx directive for including content directly from GitHub
repositories using the format owner/repo:path.
Include and parse RST or Markdown content:
.. github-include:: sphinx-doc/sphinx:README.rst
:branch: master
:start-line: 21
:end-line: 25Display code with syntax highlighting using :code::
.. github-include:: python/cpython:Lib/this.py
:code: python
:number-lines:Display literal text using :literal::
.. github-include:: github/gitignore:Python.gitignore
:literal:Specify a version with :branch:, :tag:, or :commit: (defaults to main):
.. github-include:: owner/repo:path/to/file.py
:tag: v1.0.0Filter lines with :start-line:, :end-line:, :start-after:, or :end-before::
.. github-include:: owner/repo:example.py
:start-line: 10
:end-line: 50Install via pip:
pip install sphinx-github-includeAdd to your conf.py:
extensions = [
"sphinx_github_include"
]Report issues on the GitHub repository.
sphinx-github-include is covered by the Ubuntu Code of Conduct.
sphinx-github-include is released under the GPL-3.0 license.