Skip to main content

Extending literalinclude to include remote URLs

Project description

sphinxext-remoteliteralinclude

CI

Sphinx extension that extends the literalinclude directive to allow remote URLS

Installation

Please install the extension via pip using the following command:

python3 -m pip install sphinxext-remoteliteralinclude

then in your conf.py under extensions, it should look like the following:

extensions = ["sphinxext.remoteliteralinclude"]

Configuration

There are two optional configuration for retry logic for failed requests.

remoteliteralinclude_retry_time = 1.0
remoteliteralinclude_max_retry_time = 180.0

The retry_time is the base time in seconds to wait, with an exponential backoff until max_retry_time (in seconds) is reached.

Usage

Simply just use it as you normally would a normal literalinclude

.. rli:: https://example.com/example.java
   :language: java
   :lines: 10-29
   :linenos:
   :lineno-start: 10

Important Notes

This is simply a modification of the normal literalinclude extension. Near all of the code is the exact same. Modifications are made by Eli Barnett, with pip module creation by Dalton Smith.

Using the extension to reference local files will not work. Use the regular literalinclude extension in that case.

Project details


Download files

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

Source Distribution

sphinxext_remoteliteralinclude-0.6.1.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

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

File details

Details for the file sphinxext_remoteliteralinclude-0.6.1.tar.gz.

File metadata

File hashes

Hashes for sphinxext_remoteliteralinclude-0.6.1.tar.gz
Algorithm Hash digest
SHA256 a8b072a6e88a336662810017da3d4eeb154a4ef4ca8b42db69015dbbd36189c7
MD5 928016be246320984aab2fb1f20a5214
BLAKE2b-256 aab87a579e862fdad35933151e028aadebe064099a9a5c750a2a42ad70b9da74

See more details on using hashes here.

File details

Details for the file sphinxext_remoteliteralinclude-0.6.1-py3-none-any.whl.

File metadata

File hashes

Hashes for sphinxext_remoteliteralinclude-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 70271f0404476c08105abff5b30c636864461c1970e47efae0655c5774429a5c
MD5 a857c54c8456923e50bac81c2248766b
BLAKE2b-256 30a6a3d756ec2ae07d7ddb5094b2874366d1dd33a512454139f29c729f215543

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page