This release is a pre-release and may not be stable for production use.
GetTheCode plugin for Sphinx
This plugin provides an enhanced literalinclude directive for Sphinx Documentation Generator.
Written by Fabrice Salvaire.
Installation
See sphinx-contrib for more details.
To install the plugin, you have to run these commands:
python setup.py build
python setup.py install
The PySpice source code is hosted at https://github.com/FabriceSalvaire/sphinx-getthecode
To clone the Git repository, run this command in a terminal:
git clone git@github.com:FabriceSalvaire/sphinx-getthecode
Usage
To load the plugin, you have to add it in your conf.py file.
extensions = [
...
'sphinxcontrib.getthecode',
]
Directives
This plugin adds a new directive getthecode which is equivalent to the literalinclude directive, but adds in front of the code block an header with the file name and an icon to download the file.
.. getthecode:: example.py :language: python
will result in:
<div class="getthecode"> <div class="getthecode-header"> <span class="getthecode-filename">example.py</span> <a href="../../../_downloads/example.py"><span>example.py</span></a> </div> <div class="highlight-python"> <div class="highlight"><pre> ... </pre></div> </div> </div>
To work properly, you must add some definitions in your CSS style, for example:
div.getthecode { border-radius: 3px; } div.getthecode-header { padding: 5px; margin-bottom: 0px; border-bottom: 1px solid rgb(216, 216, 216); background-repeat: repeat-x; background-color: rgb(234, 234, 234); background-image: linear-gradient(rgb(250, 250, 250), rgb(234, 234, 234)); } div.getthecode-header span { } div.getthecode-header a { margin-left: .5em; display: inline-block; background-image: url("file-text-small.png"); background-repeat: no-repeat; width: 16px; height: 16px; /* text-indent :-9999px; */ /* hide text */ } div.getthecode-header a span { display: none; } div.getthecode pre { margin-top: 0px; padding: 3px; }
Metadata
Release files for sphinxcontrib-getthecode 0.1dev-20140921
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sphinxcontrib-getthecode-0.1dev-20140921.tar.gz | 7.8 kB | Without provenance | Details for sphinxcontrib-getthecode-0.1dev-20140921.tar.gz |
Release files / sphinxcontrib-getthecode-0.1dev-20140921.tar.gz
| Download URL | sphinxcontrib-getthecode-0.1dev-20140921.tar.gz |
|---|---|
| Size | 7.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ef2495098b13aa699ea2273998a3e328e2650355781f3df29a1bc44c8429d46b
|
|
BLAKE2b-256 checksum How to use checksums |
f052a44c322431dc351860990ea3a82be009b38e0b283fd156578a777f303ded
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for sphinxcontrib-getthecode 0.1dev-20140921
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.