pax_global_header00006660000000000000000000000064143553321150014514gustar00rootroot0000000000000052 comment=284f06da117f6a3535d3d849288b11d8614364b0 googleanalytics-0.4/000077500000000000000000000000001435533211500145435ustar00rootroot00000000000000googleanalytics-0.4/.gitignore000066400000000000000000000000541435533211500165320ustar00rootroot00000000000000*~ *.egg-info/ __pycache__ *.pyc build dist googleanalytics-0.4/MANIFEST.in000066400000000000000000000000611435533211500162760ustar00rootroot00000000000000include README include LICENSE include CHANGES.* googleanalytics-0.4/README.rst000066400000000000000000000023331435533211500162330ustar00rootroot00000000000000.. -*- restructuredtext -*- =========================================== Google Analytics extension for Sphinx =========================================== :author: Domen Kožar About ===== This extensions allows you to track generated html files with Google Analytics web service. Installing from sphinx-contrib checkout --------------------------------------- Checkout googleanalytics sphinx extension:: $ git clone https://github.com/sphinx-contrib/googleanalytics Change into the googleanalytics directory:: $ cd googleanalytics Install the module:: $ python setup.py install Enabling the extension in Sphinx_ --------------------------------- Just add ``sphinxcontrib.googleanalytics`` to the list of extensions in the ``conf.py`` file. For example:: extensions = ['sphinxcontrib.googleanalytics'] Configuration ------------- For now one optional configuration is added to Sphinx_. It can be set in ``conf.py`` file: ``googleanalytics_id`` : UA id for your site, example:: googleanalytics_id = 'UA-123-123-123' ``googleanalytics_enabled`` : True by default, use it to turn off tracking. .. Links: .. _gnuplot: http://www.gnuplot.info/ .. _Sphinx: http://sphinx.pocoo.org/ googleanalytics-0.4/disperse.conf000066400000000000000000000002271435533211500172310ustar00rootroot00000000000000# See https://github.com/jelmer/disperse timeout_days: 5 tag_name: "v$VERSION" update_version { path: "setup.cfg" new_line: "version = $VERSION" } googleanalytics-0.4/pyproject.toml000066400000000000000000000001211435533211500174510ustar00rootroot00000000000000[build-system] requires = ["setuptools"] build-backend = "setuptools.build_meta" googleanalytics-0.4/setup.cfg000066400000000000000000000017071435533211500163710ustar00rootroot00000000000000[metadata] name = sphinxcontrib-googleanalytics version = 0.4 url = https://github.com/sphinx-contrib/googleanalytics download_url = http://pypi.python.org/pypi/sphinxcontrib-googleanalytics project_urls = Repository=https://github.com/sphinx-contrib/googleanalytics license = BSD author = Domen Kozar author_email = domen@dev.si description = Sphinx extension googleanalytics long_description = file:README.rst classifiers = Development Status :: 4 - Beta Environment :: Console Environment :: Web Environment Intended Audience :: Developers License :: OSI Approved :: BSD License Operating System :: OS Independent Programming Language :: Python Topic :: Documentation Topic :: Utilities platforms = any [options] zip_safe = False packages = find: include_package_data = True install_requires = Sphinx>=0.6 namespace_packages = sphinxcontrib [egg_info] tag_build = dev tag_date = true [aliases] release = egg_info -RDb '' googleanalytics-0.4/setup.py000077500000000000000000000000701435533211500162550ustar00rootroot00000000000000#!/usr/bin/python3 from setuptools import setup setup() googleanalytics-0.4/sphinxcontrib/000077500000000000000000000000001435533211500174355ustar00rootroot00000000000000googleanalytics-0.4/sphinxcontrib/__init__.py000066400000000000000000000005561435533211500215540ustar00rootroot00000000000000# -*- coding: utf-8 -*- """ sphinxcontrib ~~~~~~~~~~~~~ This package is a namespace package that contains all extensions distributed in the ``sphinx-contrib`` distribution. :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ __import__('pkg_resources').declare_namespace(__name__) googleanalytics-0.4/sphinxcontrib/googleanalytics.py000066400000000000000000000023651435533211500232010ustar00rootroot00000000000000#!/usr/bin/env python # -*- coding: utf-8 -*- from sphinx.errors import ExtensionError def add_ga_javascript(app, pagename, templatename, context, doctree): if not app.config.googleanalytics_enabled: return metatags = context.get('metatags', '') metatags += """ """ % app.config.googleanalytics_id metatags += """ """ % app.config.googleanalytics_id context['metatags'] = metatags def check_config(app): if not app.config.googleanalytics_id: raise ExtensionError("'googleanalytics_id' config value must be set for ga statistics to function properly.") def setup(app): app.add_config_value('googleanalytics_id', '', 'html') app.add_config_value('googleanalytics_enabled', True, 'html') app.connect('html-page-context', add_ga_javascript) app.connect('builder-inited', check_config) return { 'version': '0.3', 'parallel_read_safe': True, 'parallel_write_safe': True, }