Skip to main content

This extension was written by a Sphinx development agent.

sphinx-github-include

sphinx-github-include adds a Sphinx directive for including content directly from GitHub repositories using the format owner/repo:path.

Basic usage

Include and parse RST or Markdown content:

.. github-include:: sphinx-doc/sphinx:README.rst
   :branch: master
   :start-line: 21
   :end-line: 25

Display 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.0

Filter lines with :start-line:, :end-line:, :start-after:, or :end-before::

.. github-include:: owner/repo:example.py
   :start-line: 10
   :end-line: 50

Project setup

Install via pip:

pip install sphinx-github-include

Add to your conf.py:

extensions = [
    "sphinx_github_include"
]

Community and support

Report issues on the GitHub repository.

sphinx-github-include is covered by the Ubuntu Code of Conduct.

License and copyright

sphinx-github-include is released under the GPL-3.0 license.

Download files

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

Source Distribution

sphinx_github_include-0.0.1.tar.gz (127.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sphinx_github_include-0.0.1-py3-none-any.whl (18.1 kB view details)

Uploaded Python 3

File details

Details for the file sphinx_github_include-0.0.1.tar.gz.

File metadata

  • Download URL: sphinx_github_include-0.0.1.tar.gz
  • Upload date:
  • Size: 127.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for sphinx_github_include-0.0.1.tar.gz
Algorithm Hash digest
SHA256 e79bcd62dc246628340a34bc2b61c75412ec673b5c4f59e176f426d76aa7c7f8
MD5 2e6b2f5295496358161e41857e672895
BLAKE2b-256 16c21a430b7951687f278b9626837553bf7cda4e0a3d13e2037af86a0a5f93a9

See more details on using hashes here.

Provenance

The following attestation bundles were made for sphinx_github_include-0.0.1.tar.gz:

Publisher: release-publish.yaml on jahn-junior/sphinx-github-include

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sphinx_github_include-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for sphinx_github_include-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 203dd3a24f2419da0648d6129c1bebf390b53eadd366f09ffe0381d1ef7b6811
MD5 88d7fad29bd91fca1c8cfd28d82fc20c
BLAKE2b-256 0e9e9545ff3e35b75681b6a31d03574b6b1f62f3efbd5d050147f61948a64ddc

See more details on using hashes here.

Provenance

The following attestation bundles were made for sphinx_github_include-0.0.1-py3-none-any.whl:

Publisher: release-publish.yaml on jahn-junior/sphinx-github-include

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page