Commits

Kay-Uwe (Kiwi) Lorenz  committed e15a402 Draft

initial sphinxcontrib package

  • Participants

Comments (0)

Files changed (9)

+New BSD License
+---------------
+
+Copyright (c) 2012, Kay-Uwe (Kiwi) Lorenz, ModuleWorks GmbH
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright
+  notice, this list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright
+  notice, this list of conditions and the following disclaimer in the
+  documentation and/or other materials provided with the distribution.
+
+* Neither the name of the ModuleWorks GmbH nor the names of its contributors 
+  may be used to endorse or promote products derived from this software 
+  without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL "Kay-Uwe (Kiwi) Lorenz" BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+include README.rst
+include LICENSE.txt
+TARGET_DIR = ../sphinx-contrib/makedomain
+
+sphinxcontrib-release:
+	[ ! -e $(TARGET_DIR) ] && mkdir -p $(TARGET_DIR)
+	cp -r `ls | grep -v Makefile` $(TARGET_DIR)
+	
+GNU Make Domain
+===============
+
+This `Sphinx extension`_ provides a `GNU Make`_ `domain`_.
+
+.. _Sphinx extension: http://sphinx-doc.org
+.. _GNU Make: http://www.gnu.org/software/make/
+.. _domain: http://sphinx-doc.org/domains.html
+
+
+Installation
+------------
+
+::
+
+    pip install sphinxcontrib-makedomain
+
+
+Enable Extension
+----------------
+
+Add ``sphinxcontrib.makedomain`` in ``extensions`` of `conf.py`::
+
+    extensions = [ 'sphinxcontrib.makedomain' ]
+
+
+Usage
+-----
+
+Get ready for make::
+
+    .. highlight:: make
+
+    .. default-domain:: make
+
+Describe a target::
+
+    .. target:: all
+
+       describe here whatever :target:`all` does
+
+Describe a variable::
+
+    .. var:: MY_VAR
+
+       Describe here whatever :var:`MY_VAR` does.
+
+Describe an exported variable::
+
+    .. expvar:: EXPORTED_VAR
+
+       Describe here whatever :expvar:`EXPORTED_VAR` does.
+
+       This would describe::
+
+           export EXPORTED_VAR = some string
+
+
+License
+-------
+
+New BSD License.
+
+
+Author
+------
+
+`Kay-Uwe (Kiwi) Lorenz <kiwi@franka.dyndns.org>`_ (http://quelltexter.org)
+[egg_info]
+tag_build = dev
+tag_date = true
+
+[aliases]
+release = egg_info -RDb ''
+# from aptk.__version__ import release
+import sys, os
+
+from setuptools import setup, find_packages
+
+long_desc = '''
+This package contains a Make Domain for Sphinx.
+
+This adds make:target, make:var and make:expvar directives and roles.
+'''
+
+requires = ['Sphinx>=0.6', 'sphinxcontrib-domaintools>=0.1']
+
+setup(
+    name='sphinxcontrib-makedomain',
+    version='0.1',
+    url='http://bitbucket.org/klorenz/sphinxcontrib-makedomain',
+    download_url='http://pypi.python.org/pypi/sphinxcontrib-makedomain',
+    license='BSD',
+    author='Kay-Uwe (Kiwi) Lorenz',
+    author_email='kiwi@franka.dyndns.org',
+    description='Sphinx Make Domain Extension',
+    long_description=long_desc,
+    zip_safe=False,
+    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',
+    packages=find_packages(),
+    include_package_data=True,
+    install_requires=requires,
+    namespace_packages=['sphinxcontrib'],
+)

File sphinxcontrib/__init__.py

+# -*- 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__)
+

File sphinxcontrib/makedomain.py

+# -*- coding: utf-8 -*-
+"""
+    makedomain
+    ~~~~~~~~~~
+
+    A GNU Make domain.
+
+    This domain provides `make:target`, `make:var` and `make:expvar`
+    directives and roles.
+
+    :copyright: 2012 by Kay-Uwe (Kiwi) Lorenz, ModuleWorks GmbH
+    :license: BSD, see LICENSE for details.
+"""
+
+__version__ = "0.1"
+# for this module's sphinx doc 
+release = __version__
+version = release.rsplit('.', 1)[0]
+
+from domaintools import custom_domain
+import re
+
+def setup(app):
+    app.add_domain(custom_domain('GnuMakeDomain',
+        name  = 'make',
+        label = "GNU Make", 
+
+        elements = dict(
+            target = dict(
+                objname      = "Make Target",
+                indextemplate = "pair: %s; Make Target",
+            ),
+            var   = dict(
+                objname = "Make Variable",
+                indextemplate = "pair: %s; Make Variable"
+            ),
+            expvar = dict(
+                objname = "Make Variable, exported",
+                indextemplate = "pair: %s; Make Variable, exported"
+            )
+        )))
+
+# vim: ts=4 : sw=4 : et
+## configuration for tox <http://codespeak.net/tox/>
+
+## tox automates running certain tasks within virtualenvs.  The following
+## tox configuration outlines a basic setup for running unit tests and
+## building sphinx docs in separate virtual environments.  Give it a try!
+
+[tox]
+envlist=python,doc
+
+# test running
+[testenv:python]
+deps=
+    ## if you use nose for test running
+    # nose
+    ## if you use py.test for test running
+    # pytest
+commands=
+    ## run tests with py.test
+    # py.test []
+    ## run tests with nose
+    # nose
+
+[testenv:doc]
+deps=
+    sphinx
+    # add all Sphinx extensions and other dependencies required to build your docs
+commands=
+    ## test links
+    # sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees doc {envtmpdir}/linkcheck
+    ## test html output
+    # sphinx-build -W -b html -d {envtmpdir}/doctrees doc {envtmpdir}/html
+