[Python-modules-commits] [python-latexcodec] 01/07: initial commit

Daniel Stender stender at moszumanska.debian.org
Mon May 9 12:15:59 UTC 2016


This is an automated email from the git hooks/post-receive script.

stender pushed a commit to branch master
in repository python-latexcodec.

commit a6e51a952dcdc90f256437b42681120ed0aa4da5
Author: Daniel Stender <stender at debian.org>
Date:   Mon May 9 13:27:28 2016 +0200

    initial commit
---
 .travis.yml                        |  29 ++
 AUTHORS.rst                        |  26 ++
 CHANGELOG.rst                      |  74 ++++
 INSTALL.rst                        |  85 ++++
 LICENSE.rst                        |  23 +
 MANIFEST.in                        |  14 +
 README.rst                         |  21 +
 VERSION                            |   1 +
 debian/changelog                   |   5 +
 debian/compat                      |   1 +
 debian/control                     |  26 ++
 debian/copyright                   |  31 ++
 debian/python3-latexcodec.doc-base |   9 +
 debian/rules                       |  17 +
 debian/source/format               |   1 +
 debian/source/options              |   1 +
 debian/watch                       |   3 +
 doc/Makefile                       | 153 +++++++
 doc/_build/.gitignore              |   0
 doc/api.rst                        |   8 +
 doc/api/codec.rst                  |   1 +
 doc/api/lexer.rst                  |   1 +
 doc/authors.rst                    |   5 +
 doc/changes.rst                    |   7 +
 doc/conf.py                        |  41 ++
 doc/index.rst                      |  25 ++
 doc/license.rst                    |  11 +
 doc/make.bat                       | 190 +++++++++
 doc/quickstart.rst                 |  13 +
 latexcodec/__init__.py             |   2 +
 latexcodec/codec.py                | 850 +++++++++++++++++++++++++++++++++++++
 latexcodec/lexer.py                | 495 +++++++++++++++++++++
 requirements.txt                   |   1 +
 setup.cfg                          |   8 +
 setup.py                           |  46 ++
 test/test_install_example.py       |  41 ++
 test/test_latex_codec.py           | 437 +++++++++++++++++++
 test/test_latex_lexer.py           | 502 ++++++++++++++++++++++
 38 files changed, 3204 insertions(+)

diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..fecde4e
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,29 @@
+language: python
+sudo: false
+python:
+  - "3.5"
+  - "3.4"
+  - "3.3"
+  - "2.7"
+  - "2.6"
+  - "pypy"
+branches:
+  only:
+    - develop
+install:
+  - "pip install ."
+  - "if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then pip install coveralls check-manifest flake8 Sphinx; fi"
+script:
+  - "if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then check-manifest; fi"
+  - "if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then flake8; fi"
+  - "pushd doc"
+  - "if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then make html; fi"
+  - "popd"
+  - "pushd test"
+  - "if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then coverage run --source=latexcodec `type -p nosetests`; fi"
+  - "if [[ $TRAVIS_PYTHON_VERSION != '2.7' ]]; then nosetests; fi"
+  - "popd"
+after_success:
+  - "pushd test"
+  - "if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then coveralls; fi"
+  - "popd"
diff --git a/AUTHORS.rst b/AUTHORS.rst
new file mode 100644
index 0000000..d97e846
--- /dev/null
+++ b/AUTHORS.rst
@@ -0,0 +1,26 @@
+Main authors:
+
+* David Eppstein
+
+  - wrote the original LaTeX codec as a recipe on ActiveState
+    http://code.activestate.com/recipes/252124-latex-codec/
+
+* Peter Tröger
+
+  - wrote the original latexcodec package, which contained a simple
+    but very effective LaTeX encoder
+
+* Matthias Troffaes (matthias.troffaes at gmail.com)
+
+  - wrote the lexer
+
+  - integrated codec with the lexer for a simpler and more robust
+    design
+
+  - various bugfixes
+
+Contributors:
+
+* Michael Radziej
+
+* Philipp Spitzer
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
new file mode 100644
index 0000000..3285149
--- /dev/null
+++ b/CHANGELOG.rst
@@ -0,0 +1,74 @@
+1.0.3 (in development)
+----------------------
+
+1.0.2 (1 March 2016)
+--------------------
+
+* New ``ulatex`` codec which works as a text transform on unicode
+  strings.
+
+* Fix spacing when translating math (see issue #29, reported by
+  beltiste).
+
+* Performance improvements in latex to unicode translation.
+
+* Support old-style math mode (see pull request #40, contributed by
+  xuhdev).
+
+* Treat tab character as a space character (see discussion in issue
+  #40, raised by xuhdev).
+
+1.0.1 (24 September 2014)
+-------------------------
+
+* br"\\par" is now decoded using two newlines (see issue #26, reported
+  by Jorrit Wronski).
+
+* Fix encoding and decoding of the ogonek (see issue #24, reported by
+  beltiste).
+
+1.0.0 (5 August 2014)
+---------------------
+
+* Add Python 3.4 support.
+
+* Fix "DZ" decoding (see issue #21, reported and fixed by Philipp
+  Spitzer).
+
+0.3.2 (17 April 2014)
+---------------------
+
+* Fix underscore "\\_" encoding (see issue #17, reported and fixed by
+  Michael Radziej).
+
+0.3.1 (5 February 2014)
+-----------------------
+
+* Drop Python 3.2 support.
+
+* Drop 2to3 and instead use six to support both Python 2 and 3 from a
+  single code base.
+
+* Fix control space "\\ " decoding.
+
+* Fix LaTeX encoding of number sign "#" and other special ascii
+  characters (see issues #11 and #13, reported by beltiste).
+
+0.3.0 (19 August 2013)
+----------------------
+
+* Copied lexer and codec from sphinxcontrib-bibtex.
+
+* Initial usage and API documentation.
+
+* Some small bugs fixed.
+
+0.2 (28 September 2012)
+-----------------------
+
+* Adding additional codec with brackets around special characters.
+
+0.1 (26 May 2012)
+-----------------
+
+* Initial release.
diff --git a/INSTALL.rst b/INSTALL.rst
new file mode 100644
index 0000000..d3ceffa
--- /dev/null
+++ b/INSTALL.rst
@@ -0,0 +1,85 @@
+Install the module with ``pip install latexcodec``, or from
+source using ``python setup.py install``.
+
+Minimal Example
+---------------
+
+Simply import the :mod:`latexcodec` module to enable ``"latex"``
+to be used as an encoding:
+
+.. code-block:: python
+
+    import latexcodec
+    text_latex = b"\\'el\\`eve"
+    assert text_latex.decode("latex") == u"élève"
+    text_unicode = u"ångström"
+    assert text_unicode.encode("latex") == b'\\aa ngstr\\"om'
+
+There are also a ``ulatex`` encoding for text transforms.
+The simplest way to use this codec goes through the codecs module
+(as for all text transform codecs on Python):
+
+.. code-block:: python
+
+    import codecs
+    import latexcodec
+    text_latex = u"\\'el\\`eve"
+    assert codecs.decode(text_latex, "ulatex") == u"élève"
+    text_unicode = u"ångström"
+    assert codecs.encode(text_unicode, "ulatex") == u'\\aa ngstr\\"om'
+
+By default, the LaTeX input is assumed to be ascii, as per standard LaTeX.
+However, you can also specify an extra codec
+as ``latex+<encoding>`` or ``ulatex+<encoding>``,
+where ``<encoding>`` describes another encoding.
+In this case characters will be
+translated to and from that encoding whenever possible.
+The following code snippet demonstrates this behaviour:
+
+.. code-block:: python
+
+    import latexcodec
+    text_latex = b"\xfe"
+    assert text_latex.decode("latex+latin1") == u"þ"
+    assert text_latex.decode("latex+latin2") == u"ţ"
+    text_unicode = u"ţ"
+    assert text_unicode.encode("latex+latin1") == b'\\c t'  # ţ is not latin1
+    assert text_unicode.encode("latex+latin2") == b'\xfe'   # but it is latin2
+
+When encoding using the ``ulatex`` codec, you have the option to pass
+through characters that cannot be encoded in the desired encoding, by
+using the ``'keep'`` error. This can be a useful fallback option if
+you want to encode as much as possible, whilst still retaining as much
+as possible of the original code when encoding fails. If instead you
+want to translate to LaTeX but keep as much of the unicode as
+possible, use the ``ulatex+utf8`` codec, which should never fail.
+
+.. code-block::
+
+    import codecs
+    import latexcodec
+    text_unicode = u'⌨'  # \u2328 = keyboard symbol, currently not translated
+    try:
+        # raises a value error as \u2328 cannot be encoded into latex
+        codecs.encode(text_unicode, "ulatex+ascii")
+    except ValueError:
+        pass
+    assert codecs.encode(text_unicode, "ulatex+ascii", "keep") == u'⌨'
+    assert codecs.encode(text_unicode, "ulatex+utf8") == u'⌨'
+
+Limitations
+-----------
+
+* Not all unicode characters are registered. If you find any missing,
+  please report them on the tracker:
+  https://github.com/mcmtroffaes/latexcodec/issues
+
+* Unicode combining characters are currently not handled.
+
+* By design, the codec never removes curly brackets. This is because
+  it is very hard to guess whether brackets are part of a command or
+  not (this would require a full latex parser). Moreover, bibtex uses
+  curly brackets as a guard against case conversion, in which case
+  automatic removal of curly brackets may not be desired at all, even
+  if they are not part of a command. Also see:
+  http://stackoverflow.com/a/19754245/2863746
diff --git a/LICENSE.rst b/LICENSE.rst
new file mode 100644
index 0000000..8e9e89e
--- /dev/null
+++ b/LICENSE.rst
@@ -0,0 +1,23 @@
+| latexcodec is a lexer and codec to work with LaTeX code in Python
+| Copyright (c) 2011-2014 by Matthias C. M. Troffaes
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000..8fe92ed
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1,14 @@
+include VERSION
+include README.rst
+include INSTALL.rst
+include CHANGELOG.rst
+include LICENSE.rst
+include AUTHORS.rst
+include requirements.txt
+include tox.ini
+recursive-include doc *
+recursive-include test *
+global-exclude *.pyc
+global-exclude .gitignore
+prune doc/_build
+exclude .travis.yml
diff --git a/README.rst b/README.rst
new file mode 100644
index 0000000..aa929c1
--- /dev/null
+++ b/README.rst
@@ -0,0 +1,21 @@
+latexcodec
+==========
+
+|travis| |coveralls|
+
+A lexer and codec to work with LaTeX code in Python.
+
+* Download: http://pypi.python.org/pypi/latexcodec/#downloads
+
+* Documentation: http://latexcodec.readthedocs.org/
+
+* Development: http://github.com/mcmtroffaes/latexcodec/
+
+.. |travis| image:: https://travis-ci.org/mcmtroffaes/latexcodec.png?branch=develop
+    :target: https://travis-ci.org/mcmtroffaes/latexcodec
+    :alt: travis-ci
+
+.. |coveralls| image:: https://coveralls.io/repos/mcmtroffaes/latexcodec/badge.png?branch=develop
+    :target: https://coveralls.io/r/mcmtroffaes/latexcodec?branch=develop
+    :alt: coveralls.io
+
diff --git a/VERSION b/VERSION
new file mode 100644
index 0000000..3033bf2
--- /dev/null
+++ b/VERSION
@@ -0,0 +1 @@
+1.0.3a0
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..f8d8c00
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+python-latexcodec (1.0.3-1) UNRELEASED; urgency=medium
+
+  * Initial release (Closes: #801309).
+
+ -- Daniel Stender <stender at debian.org>  Mon, 09 May 2016 12:03:38 +0200
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+9
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..ed48d81
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,26 @@
+Source: python-latexcodec
+Section: python
+Priority: optional
+Maintainer: Debian Python Modules Team <python-modules-team at lists.alioth.debian.org>
+Uploaders: Daniel Stender <stender at debian.org>
+Build-Depends: debhelper (>= 9),
+               dh-python,
+               python3-all,
+               python3-six,
+               python3-setuptools,
+               python3-nose,
+               python-sphinx
+# needs fix: build breaks with python3-sphinx
+Standards-Version: 3.9.8
+Homepage: https://github.com/mcmtroffaes/latexcodec
+Vcs-Git: https://anonscm.debian.org/git/python-modules/packages/python-latexcodec.git
+Vcs-Browser: https://anonscm.debian.org/cgit/python-modules/packages/python-latexcodec.git
+X-Python-Version: >= 3.3
+
+Package: python3-latexcodec
+Architecture: all
+Depends: ${misc:Depends},
+         ${python3:Depends},
+         ${sphinxdoc:Depends}
+Description: LaTeX lexer and codec library for Python
+ Hello, world!
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..c982dbe
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,31 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: latexcodec
+Upstream-Contact: Matthias C. M. Troffaes <matthias.troffaes at gmail.com>
+Source: https://github.com/mcmtroffaes/latexcodec
+
+Files: *
+Copyright: 2011-2016 Matthias C. M. Troffaes <matthias.troffaes at gmail.com>
+                     David Eppstein
+                     Peter Tröger
+License: Expat
+
+Files: debian/*
+Copyright: 2016 Daniel Stender <stender at debian.org>
+License: Expat
+
+License: Expat
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ software and associated documentation files (the "Software"), to deal in the Software
+ without restriction, including without limitation the rights to use, copy, modify, merge,
+ publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ to whom the Software is furnished to do so, subject to the following conditions:
+ .
+ The above copyright notice and this permission notice shall be included in all copies or
+ substantial portions of the Software.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
diff --git a/debian/python3-latexcodec.doc-base b/debian/python3-latexcodec.doc-base
new file mode 100644
index 0000000..e5f7484
--- /dev/null
+++ b/debian/python3-latexcodec.doc-base
@@ -0,0 +1,9 @@
+Document: python3-latexcodec
+Title: latexcodec's documentation
+Author: Matthias C. M. Troffaes <matthias.troffaes at gmail.com>
+Abstract: latexcodec is a LaTeX lexer and codec library for Python
+Section: Programming/Python
+
+Format: HTML
+Index: /usr/share/doc/python3-latexcodec/html/index.html
+Files: /usr/share/doc/python3-latexcodec/html/*.html
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..d49cd0e
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,17 @@
+#!/usr/bin/make -f
+#export DH_VERBOSE=1
+#export DEB_BUILD_OPTIONS=nocheck
+export PYBUILD_NAME=latexcodec
+
+%:
+	dh $@ --with python3,sphinxdoc --buildsystem=pybuild
+
+override_dh_auto_test:
+	PYBUILD_SYSTEM=custom PYBUILD_TEST_ARGS="{interpreter} -m nose -v" dh_auto_test
+
+override_dh_installdocs:
+	dh_installdocs
+	PYTHONPATH=. sphinx-build -N -bhtml doc/ debian/python3-latexcodec/usr/share/doc/python3-latexcodec/html/
+
+override_dh_installchangelogs:
+	dh_installchangelogs CHANGELOG.rst
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debian/source/options b/debian/source/options
new file mode 100644
index 0000000..6e88e49
--- /dev/null
+++ b/debian/source/options
@@ -0,0 +1 @@
+extend-diff-ignore="^[^/]+\.egg-info/"
\ No newline at end of file
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000..d5cfe7a
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,3 @@
+version=3
+opts="filenamemangle=s/(?:.*)?v?(\d[\d\.]+)\.tar\.gz/python-latexcodec-$1.tar.gz/" \
+https://github.com/mcmtroffaes/latexcodec/releases (?:.*/)?v?(\d[\d\.]+)\.tar\.gz
diff --git a/doc/Makefile b/doc/Makefile
new file mode 100644
index 0000000..57c9fc5
--- /dev/null
+++ b/doc/Makefile
@@ -0,0 +1,153 @@
+# Makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS    =
+SPHINXBUILD   = sphinx-build
+PAPER         =
+BUILDDIR      = _build
+
+# Internal variables.
+PAPEROPT_a4     = -D latex_paper_size=a4
+PAPEROPT_letter = -D latex_paper_size=letter
+ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+# the i18n builder cannot share the environment and doctrees with the others
+I18NSPHINXOPTS  = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+
+.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
+
+help:
+	@echo "Please use \`make <target>' where <target> is one of"
+	@echo "  html       to make standalone HTML files"
+	@echo "  dirhtml    to make HTML files named index.html in directories"
+	@echo "  singlehtml to make a single large HTML file"
+	@echo "  pickle     to make pickle files"
+	@echo "  json       to make JSON files"
+	@echo "  htmlhelp   to make HTML files and a HTML help project"
+	@echo "  qthelp     to make HTML files and a qthelp project"
+	@echo "  devhelp    to make HTML files and a Devhelp project"
+	@echo "  epub       to make an epub"
+	@echo "  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+	@echo "  latexpdf   to make LaTeX files and run them through pdflatex"
+	@echo "  text       to make text files"
+	@echo "  man        to make manual pages"
+	@echo "  texinfo    to make Texinfo files"
+	@echo "  info       to make Texinfo files and run them through makeinfo"
+	@echo "  gettext    to make PO message catalogs"
+	@echo "  changes    to make an overview of all changed/added/deprecated items"
+	@echo "  linkcheck  to check all external links for integrity"
+	@echo "  doctest    to run all doctests embedded in the documentation (if enabled)"
+
+clean:
+	-rm -rf $(BUILDDIR)/*
+
+html:
+	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+	@echo
+	@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
+
+dirhtml:
+	$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
+	@echo
+	@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
+
+singlehtml:
+	$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
+	@echo
+	@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
+
+pickle:
+	$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
+	@echo
+	@echo "Build finished; now you can process the pickle files."
+
+json:
+	$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
+	@echo
+	@echo "Build finished; now you can process the JSON files."
+
+htmlhelp:
+	$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
+	@echo
+	@echo "Build finished; now you can run HTML Help Workshop with the" \
+	      ".hhp project file in $(BUILDDIR)/htmlhelp."
+
+qthelp:
+	$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
+	@echo
+	@echo "Build finished; now you can run "qcollectiongenerator" with the" \
+	      ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
+	@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/latexcodec.qhcp"
+	@echo "To view the help file:"
+	@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/latexcodec.qhc"
+
+devhelp:
+	$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
+	@echo
+	@echo "Build finished."
+	@echo "To view the help file:"
+	@echo "# mkdir -p $$HOME/.local/share/devhelp/latexcodec"
+	@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/latexcodec"
+	@echo "# devhelp"
+
+epub:
+	$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
+	@echo
+	@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
+
+latex:
+	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+	@echo
+	@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
+	@echo "Run \`make' in that directory to run these through (pdf)latex" \
+	      "(use \`make latexpdf' here to do that automatically)."
+
+latexpdf:
+	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+	@echo "Running LaTeX files through pdflatex..."
+	$(MAKE) -C $(BUILDDIR)/latex all-pdf
+	@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+text:
+	$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
+	@echo
+	@echo "Build finished. The text files are in $(BUILDDIR)/text."
+
+man:
+	$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
+	@echo
+	@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
+
+texinfo:
+	$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+	@echo
+	@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
+	@echo "Run \`make' in that directory to run these through makeinfo" \
+	      "(use \`make info' here to do that automatically)."
+
+info:
+	$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+	@echo "Running Texinfo files through makeinfo..."
+	make -C $(BUILDDIR)/texinfo info
+	@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
+
+gettext:
+	$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
+	@echo
+	@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
+
+changes:
+	$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
+	@echo
+	@echo "The overview file is in $(BUILDDIR)/changes."
+
+linkcheck:
+	$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
+	@echo
+	@echo "Link check complete; look for any errors in the above output " \
+	      "or in $(BUILDDIR)/linkcheck/output.txt."
+
+doctest:
+	$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
+	@echo "Testing of doctests in the sources finished, look at the " \
+	      "results in $(BUILDDIR)/doctest/output.txt."
diff --git a/doc/_build/.gitignore b/doc/_build/.gitignore
new file mode 100644
index 0000000..e69de29
diff --git a/doc/api.rst b/doc/api.rst
new file mode 100644
index 0000000..c5c989a
--- /dev/null
+++ b/doc/api.rst
@@ -0,0 +1,8 @@
+API
+~~~
+
+.. toctree::
+    :maxdepth: 2
+
+    api/codec
+    api/lexer
diff --git a/doc/api/codec.rst b/doc/api/codec.rst
new file mode 100644
index 0000000..ff39d09
--- /dev/null
+++ b/doc/api/codec.rst
@@ -0,0 +1 @@
+.. automodule:: latexcodec.codec
diff --git a/doc/api/lexer.rst b/doc/api/lexer.rst
new file mode 100644
index 0000000..89f9cbc
--- /dev/null
+++ b/doc/api/lexer.rst
@@ -0,0 +1 @@
+.. automodule:: latexcodec.lexer
diff --git a/doc/authors.rst b/doc/authors.rst
new file mode 100644
index 0000000..45122fc
--- /dev/null
+++ b/doc/authors.rst
@@ -0,0 +1,5 @@
+Authors
+=======
+
+.. include:: ../AUTHORS.rst
+
diff --git a/doc/changes.rst b/doc/changes.rst
new file mode 100644
index 0000000..2eb28cc
--- /dev/null
+++ b/doc/changes.rst
@@ -0,0 +1,7 @@
+:tocdepth: 1
+
+Changes
+=======
+
+.. include:: ../CHANGELOG.rst
+
diff --git a/doc/conf.py b/doc/conf.py
new file mode 100644
index 0000000..0f3942f
--- /dev/null
+++ b/doc/conf.py
@@ -0,0 +1,41 @@
+# -*- coding: utf-8 -*-
+#
+# latexcodec documentation build configuration file, created by
+# sphinx-quickstart on Wed Aug  3 15:45:22 2011.
+
+extensions = [
+    'sphinx.ext.autodoc',
+    'sphinx.ext.doctest',
+    'sphinx.ext.intersphinx',
+    'sphinx.ext.todo',
+    'sphinx.ext.coverage',
+    'sphinx.ext.pngmath',
+    'sphinx.ext.viewcode']
+source_suffix = '.rst'
+master_doc = 'index'
+project = u'latexcodec'
+copyright = u'2011-2014, Matthias C. M. Troffaes'
+with open("../VERSION", "rb") as version_file:
+    release = version_file.read().strip()
+version = '.'.join(release.split('.')[:2])
+exclude_patterns = ['_build']
+pygments_style = 'sphinx'
+html_theme = 'default'
+htmlhelp_basename = 'latexcodecdoc'
+latex_documents = [
+    ('index', 'latexcodec.tex',
+     u'latexcodec Documentation',
+     u'Matthias C. M. Troffaes', 'manual'),
+]
+man_pages = [
+    ('index', 'latexcodec', u'latexcodec Documentation',
+     [u'Matthias C. M. Troffaes'], 1)
+]
+texinfo_documents = [
+    ('index', 'latexcodec', u'latexcodec Documentation',
+     u'Matthias C. M. Troffaes',
+     'latexcodec', 'One line description of project.', 'Miscellaneous'),
+]
+intersphinx_mapping = {
+    'python': ('http://docs.python.org/', None),
+}
diff --git a/doc/index.rst b/doc/index.rst
new file mode 100644
index 0000000..05bd2cf
--- /dev/null
+++ b/doc/index.rst
@@ -0,0 +1,25 @@
+Welcome to latexcodec's documentation!
+======================================
+
+:Release: |release|
+:Date:    |today|
+
+Contents
+--------
+
+.. toctree::
+   :maxdepth: 2
+
+   quickstart
+   api
+   changes
+   authors
+   license
+
+Indices and tables
+==================
+
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
+
diff --git a/doc/license.rst b/doc/license.rst
new file mode 100644
index 0000000..81a43fc
--- /dev/null
+++ b/doc/license.rst
@@ -0,0 +1,11 @@
+License
+=======
+
+.. include:: ../LICENSE.rst
+
+.. rubric:: Remark
+
+Versions 0.1 and 0.2 of the latexcodec package were written by
+Peter Tröger, and were released under the Academic Free License 3.0.
+The current version of the latexcodec package shares no code with those
+earlier versions.
diff --git a/doc/make.bat b/doc/make.bat
new file mode 100644
index 0000000..b280cac
--- /dev/null
+++ b/doc/make.bat
@@ -0,0 +1,190 @@
+ at ECHO OFF
+
+REM Command file for Sphinx documentation
+
+if "%SPHINXBUILD%" == "" (
+	set SPHINXBUILD=sphinx-build
+)
+set BUILDDIR=_build
+set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
+set I18NSPHINXOPTS=%SPHINXOPTS% .
+if NOT "%PAPER%" == "" (
+	set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
+	set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
+)
+
+if "%1" == "" goto help
+
+if "%1" == "help" (
+	:help
+	echo.Please use `make ^<target^>` where ^<target^> is one of
+	echo.  html       to make standalone HTML files
+	echo.  dirhtml    to make HTML files named index.html in directories
+	echo.  singlehtml to make a single large HTML file
+	echo.  pickle     to make pickle files
+	echo.  json       to make JSON files
+	echo.  htmlhelp   to make HTML files and a HTML help project
+	echo.  qthelp     to make HTML files and a qthelp project
+	echo.  devhelp    to make HTML files and a Devhelp project
+	echo.  epub       to make an epub
+	echo.  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter
+	echo.  text       to make text files
+	echo.  man        to make manual pages
+	echo.  texinfo    to make Texinfo files
+	echo.  gettext    to make PO message catalogs
+	echo.  changes    to make an overview over all changed/added/deprecated items
+	echo.  linkcheck  to check all external links for integrity
+	echo.  doctest    to run all doctests embedded in the documentation if enabled
+	goto end
+)
+
+if "%1" == "clean" (
+	for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
+	del /q /s %BUILDDIR%\*
+	goto end
+)
+
+if "%1" == "html" (
+	%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished. The HTML pages are in %BUILDDIR%/html.
+	goto end
+)
+
+if "%1" == "dirhtml" (
+	%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
+	goto end
+)
+
+if "%1" == "singlehtml" (
+	%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
+	goto end
+)
+
+if "%1" == "pickle" (
+	%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished; now you can process the pickle files.
+	goto end
+)
+
+if "%1" == "json" (
+	%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished; now you can process the JSON files.
+	goto end
+)
+
+if "%1" == "htmlhelp" (
+	%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished; now you can run HTML Help Workshop with the ^
+.hhp project file in %BUILDDIR%/htmlhelp.
+	goto end
+)
+
+if "%1" == "qthelp" (
+	%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished; now you can run "qcollectiongenerator" with the ^
+.qhcp project file in %BUILDDIR%/qthelp, like this:
+	echo.^> qcollectiongenerator %BUILDDIR%\qthelp\latexcodec.qhcp
+	echo.To view the help file:
+	echo.^> assistant -collectionFile %BUILDDIR%\qthelp\latexcodec.ghc
+	goto end
+)
+
+if "%1" == "devhelp" (
+	%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished.
+	goto end
+)
+
+if "%1" == "epub" (
+	%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished. The epub file is in %BUILDDIR%/epub.
+	goto end
+)
+
+if "%1" == "latex" (
+	%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
+	goto end
+)
+
+if "%1" == "text" (
+	%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished. The text files are in %BUILDDIR%/text.
+	goto end
+)
+
+if "%1" == "man" (
+	%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished. The manual pages are in %BUILDDIR%/man.
+	goto end
+)
+
+if "%1" == "texinfo" (
+	%SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
+	goto end
+)
+
+if "%1" == "gettext" (
+	%SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
+	goto end
+)
+
+if "%1" == "changes" (
+	%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.The overview file is in %BUILDDIR%/changes.
+	goto end
... 2477 lines suppressed ...

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-latexcodec.git



More information about the Python-modules-commits mailing list