| Author: | Hitesh Patel <[email protected]> |
|---|
Sphinx extension that enables addition of user-defined HTML to docs. Inspired by sphinxcontrib-googleanalytics but a much more generic functionality.
git clone https://github.com/0xHiteshPatel/sphinxcontrib-addmetahtml.git
cd sphinxcontrib-addmetahtml
python setup.py install
echo 'git+git://github.com/0xHiteshPatel/sphinxcontrib-addmetahtml@master#egg=sphinxcontrib-addmetahtml' >> requirements.txt
Add to
extensionslist inconf.py:extensions += ['sphinxcontrib.addmetahtml']The extension is enabled by default. Set the content to add to docs generated by the
htmlbuilder:addmetahtml_content = <string>To disable the extension:
addmetahtml_enabled = False
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>"""