Skip to main content

Sphinx awesome sampdirective

GitHub GitHub Workflow Status PyPI PyPI - Python Version Code Style

This Sphinx extension provides a new directive samp which works much like the interpreted text role samp. This extension can be used to markup placeholder variables in code blocks.

Installation

Install the extension:

pip install sphinxawesome-sampdirective

This Sphinx extension should work with Python versions newer than 3.6 and recent Sphinx releases.

Configuration

To enable this extension in Sphinx, add it to the list of extensions in the Sphinx configuration file conf.py:

extensions = ["sphinxawesome.sampdirective"]

Use

Include the directive in your documents:

.. samp::

   $ echo {USERNAME}

USERNAME will become an emphasized node. In many outputs, it will be rendered as USERNAME. For example, in HTML, the above example will be rendered as:

<pre>
    <span class="gp">$</span> echo <em class="var">USERNAME</em>
</pre>

You can then control the style of the emphasized element with the .var class in CSS. If the code block begins with a prompt character (#, $, or ~), they will be marked up as well. The style for the prompt character is provided by the pygments syntax highlighting module.

The Sphinx awesome theme includes styling for the samp directive by default.

Caveat

This extension does not provide full syntax highlighting. It is currently not possible to have code blocks with both markup and syntax highlighting. You have to choose between the following:

  • If you need to render markup, for example links, or bold or italic text, choose the parsed-literal directive.
  • If you just want to highlight a placeholder variable, use the samp directive provided by this extension.
  • If you need full syntax highlighting, use the code-block directive.

Metadata

Release files for sphinxawesome-sampdirective 1.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sphinxawesome-sampdirective 1.0.5
File Size Uploaded Provenance Actions
sphinxawesome-sampdirective-1.0.5.tar.gz 5.4 kB Without provenance Details for sphinxawesome-sampdirective-1.0.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sphinxawesome-sampdirective 1.0.5
File Interpreter ABI Platform Actions
sphinxawesome_sampdirective-1.0.5-py3-none-any.whl Python 3 none any Details for sphinxawesome_sampdirective-1.0.5-py3-none-any.whl

Total release size: 10.8 kB

Release files / sphinxawesome-sampdirective-1.0.5.tar.gz

Download URL sphinxawesome-sampdirective-1.0.5.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
be9d8ded3880d9d82314e23a64d68b0c970bded491df05473e939707d083db31
BLAKE2b-256 checksum
How to use checksums
fcfda9735856ce648b3a8347c071c5a2861bcdf15d6769f722a83db3ff11f2f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.9 CPython/3.8.6 Linux/5.4.0-1026-azure

Release files / sphinxawesome_sampdirective-1.0.5-py3-none-any.whl

Download URL sphinxawesome_sampdirective-1.0.5-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
37c37429d92bae37ba8ce9538ac8e2f2e15949ea63caa7ab6321a9d9f14d2dd5
BLAKE2b-256 checksum
How to use checksums
926446a8f219aadfae3158c3d0c1ea370700f52c316fa17c79cafc83135c00c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.9 CPython/3.8.6 Linux/5.4.0-1026-azure

Security for sphinxawesome-sampdirective 1.0.5

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.

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