Skip to content

0xHiteshPatel/sphinxcontrib-addmetahtml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Add META HTML extension for Sphinx

Author: Hitesh Patel <[email protected]>

Overview

Sphinx extension that enables addition of user-defined HTML to docs. Inspired by sphinxcontrib-googleanalytics but a much more generic functionality.

Installation

Manual

git clone https://github.com/0xHiteshPatel/sphinxcontrib-addmetahtml.git

cd sphinxcontrib-addmetahtml

python setup.py install

pip requirements.txt

echo 'git+git://github.com/0xHiteshPatel/sphinxcontrib-addmetahtml@master#egg=sphinxcontrib-addmetahtml' >> requirements.txt

Configuration

  1. Add to extensions list in conf.py:

    extensions += ['sphinxcontrib.addmetahtml']

  2. The extension is enabled by default. Set the content to add to docs generated by the html builder:

    addmetahtml_content = <string>

  3. To disable the extension:

    addmetahtml_enabled = False

Examples

Add Google Analytics ID

addmetahtml_content = """<script async src="https://www.googletagmanager.com/gtag/js?id=UA-0000000-0"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', 'UA-0000000-0');
</script>"""

About

Sphinx extension that enables addition of user-defined HTML to docs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages