summaryrefslogtreecommitdiff
path: root/docutils/docs/api/cmdline-tool.txt
diff options
context:
space:
mode:
authorwiemann <wiemann@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2005-08-17 13:59:12 +0000
committerwiemann <wiemann@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2005-08-17 13:59:12 +0000
commita4bc0d09f3d1f633a5780976d1f913e083c9564a (patch)
tree1777475e88463b08438f0719be97cc087554eadd /docutils/docs/api/cmdline-tool.txt
parent60c69f8cf97125135948a3d35b7698ee80921137 (diff)
parent2818db9a234cc37008c5f2bb0e821f9b1fa92de2 (diff)
downloaddocutils-0.3.9.tar.gz
re-added docutils-0.3.9 tag one level deeper (without web/ and sandboxes/)docutils-0.3.9
git-svn-id: http://svn.code.sf.net/p/docutils/code/tags/docutils-0.3.9@3815 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils/docs/api/cmdline-tool.txt')
-rw-r--r--docutils/docs/api/cmdline-tool.txt68
1 files changed, 0 insertions, 68 deletions
diff --git a/docutils/docs/api/cmdline-tool.txt b/docutils/docs/api/cmdline-tool.txt
deleted file mode 100644
index 3d3d4a635..000000000
--- a/docutils/docs/api/cmdline-tool.txt
+++ /dev/null
@@ -1,68 +0,0 @@
-===============================================
- Inside A Docutils Command-Line Front-End Tool
-===============================================
-
-:Author: David Goodger
-:Contact: goodger@python.org
-:Date: $Date$
-:Revision: $Revision$
-:Copyright: This document has been placed in the public domain.
-
-`The Docutils Publisher`_ class was set up to make building
-command-line tools easy. All that's required is to choose components
-and supply settings for variations. Let's take a look at a typical
-command-line front-end tool, ``tools/rst2html.py``, from top to
-bottom.
-
-On Unixish systems, it's best to make the file executable (``chmod +x
-file``), and supply an interpreter on the first line, the "shebang" or
-"hash-bang" line::
-
- #!/usr/bin/env python
-
-Windows systems can be set up to associate the Python interpreter with
-the ``.py`` extension.
-
-Next are some comments providing metadata::
-
- # Author: David Goodger
- # Contact: goodger@python.org
- # Revision: $Revision: ...
- # Date: $Date: ...
- # Copyright: This module has been placed in the public domain.
-
-The module docstring describes the purpose of the tool::
-
- """
- A minimal front end to the Docutils Publisher, producing HTML.
- """
-
-This next block attempts to invoke locale support for
-internationalization services, specifically text encoding. It's not
-supported on all platforms though, so it's forgiving::
-
- try:
- import locale
- locale.setlocale(locale.LC_ALL, '')
- except:
- pass
-
-The real work will be done by the code that's imported here::
-
- from docutils.core import publish_cmdline, default_description
-
-We construct a description of the tool, for command-line help::
-
- description = ('Generates (X)HTML documents from standalone '
- 'reStructuredText sources. ' + default_description)
-
-Now we call the Publisher convenience function, which takes over.
-Most of it's defaults are used ("standalone" Reader,
-"reStructuredText" Parser, etc.). The HTML Writer is chosen by name,
-and a description for command-line help is passed in::
-
- publish_cmdline(writer_name='html', description=description)
-
-That's it! `The Docutils Publisher`_ takes care of the rest.
-
-.. _The Docutils Publisher: ./publisher.html