Skip to main content

Sphinx extension for advertising between different Sphinx-Projects and other pages

Project description

License Supported versions GitHub Docs CI Action status GitHub CI Action status PyPI Package latest release black code style

Sphinx-Ads is an extension for the Python based documentation framework Sphinx, which you can use to add advertisements from a central source to your Sphinx documentation website.

Installation

We recommend using the latest version of Python. Sphinx-Ads supports Python 3.7 and newer. Also, we recommend using a virtual environment to manage the dependencies for your project, both in development and production.

Using pip

$ pip install sphinx-ads

From source

$ git clone https://github.com/useblocks/sphinx-ads
$ cd sphinx-ads
$ pip install .

Activation

In the conf.py file under your docs folder, you can set the values for the following options:

extensions = ["sphinx_ads",]

ads_path = "ads.json"   # path to the JSON file containing the ad data.
ads_url = "https://example.org/ads.json"    # url link to the JSON data

Create a layout.html file in the _templates/ folder under your docs/ folder. The HTML file should contain the following data:

{% extends "!layout.html" %}
{% block footer %}
{{ super() }}
{{ advertisement() }}
{% endblock %}

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

sphinx_ads-0.0.2.tar.gz (10.5 kB view hashes)

Uploaded Source

Built Distribution

sphinx_ads-0.0.2-py3-none-any.whl (12.3 kB view hashes)

Uploaded Python 3

Supported by

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