https://github.com/tdkorn/sphinx-inlinecode
A Sphinx extension to embed source code blocks directly into documentation
https://github.com/tdkorn/sphinx-inlinecode
source-code sphinx sphinx-contrib sphinx-doc sphinx-extension viewcode
Last synced: 10 months ago
JSON representation
A Sphinx extension to embed source code blocks directly into documentation
- Host: GitHub
- URL: https://github.com/tdkorn/sphinx-inlinecode
- Owner: TDKorn
- License: mit
- Created: 2023-10-22T07:11:19.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-18T07:19:42.000Z (over 1 year ago)
- Last Synced: 2025-04-07T17:52:43.260Z (10 months ago)
- Topics: source-code, sphinx, sphinx-contrib, sphinx-doc, sphinx-extension, viewcode
- Language: Python
- Homepage: https://sphinx-inlinecode.readthedocs.io
- Size: 3.19 MB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
.. |.functools.cached_property+cached_property| replace:: ``cached_property``
.. _.functools.cached_property+cached_property: https://docs.python.org/3/library/functools.html#functools.cached_property
.. |.property| replace:: ``property``
.. _.property: https://docs.python.org/3/library/functions.html#property
.. |.sphinx.ext.viewcode| replace:: ``sphinx.ext.viewcode``
.. _.sphinx.ext.viewcode: https://www.sphinx-doc.org/en/master/usage/extensions/viewcode.html#module-sphinx.ext.viewcode
.. meta::
:author: Adam Korn
:title: sphinx-inlinecode - embed source code blocks directly into Sphinx documentation
:description: A Sphinx extension to embed source code blocks directly into Sphinx documentation
sphinx-inlinecode
--------------------
.. image:: https://img.shields.io/pypi/v/sphinx-inlinecode?color=eb5202
:target: https://pypi.org/project/sphinx-inlinecode/
:alt: sphinx-inlinecode PyPI Version
.. image:: https://img.shields.io/badge/GitHub-sphinx--inlinecode-4f1abc
:target: https://github.com/tdkorn/sphinx-inlinecode/
:alt: sphinx-inlinecode GitHub Repository
.. image:: https://static.pepy.tech/personalized-badge/sphinx-inlinecode?period=total&units=none&left_color=grey&right_color=blue&left_text=Downloads
:target: https://pepy.tech/project/sphinx-inlinecode/
.. image:: https://readthedocs.org/projects/sphinx-inlinecode/badge/?version=latest
:target: https://sphinx-inlinecode.readthedocs.io/en/latest/?badge=latest
:alt: sphinx-inlinecode Documentation Status
|
``sphinx-inlinecode`` is a Sphinx extension that embeds source code blocks directly into your documentation as a dropdown.
**Example**
.. image:: https://raw.githubusercontent.com/TDKorn/sphinx-inlinecode/main/docs/source/_static/example.png
:alt: embedded code block added by sphinx-inlinecode
Unlike |.sphinx.ext.viewcode|_, source code blocks will also be added for |.property|_ and |.functools.cached_property+cached_property|_ entries
Installation
~~~~~~~~~~~~
To install ``sphinx-inlinecode`` via pip::
pip install sphinx-inlinecode
Configuration
~~~~~~~~~~~~~~
Add the extension to your ``conf.py``
.. code-block:: python
extensions = [
"sphinx_inlinecode",
]
Documentation
~~~~~~~~~~~~~~~
Full documentation can be found on |RTD|_
.. |RTD| replace:: ReadTheDocs
.. _RTD: https://sphinx-inlinecode.readthedocs.io/en/latest/