comparison setup.py @ 382:2682dabbcd04 trunk

* Added documentation for the various stream event kinds. * Move generation of HTML documentation into a custom distutils command, run by `setup.py build_doc` * Added verification of doctest snippets in documentation, which can be run by `setup.py test_doc` * Fixed `repr` of `Markup` instances.
author cmlenz
date Fri, 01 Dec 2006 23:43:59 +0000
parents 7763f7aec949
children cab6b0256019
comparison
equal deleted inserted replaced
381:b9fc7a1f76ca 382:2682dabbcd04
10 # 10 #
11 # This software consists of voluntary contributions made by many 11 # This software consists of voluntary contributions made by many
12 # individuals. For the exact contribution history, see the revision 12 # individuals. For the exact contribution history, see the revision
13 # history and logs, available at http://genshi.edgewall.org/log/. 13 # history and logs, available at http://genshi.edgewall.org/log/.
14 14
15 from distutils.cmd import Command
16 import doctest
17 from glob import glob
18 import os
15 try: 19 try:
16 from setuptools import setup 20 from setuptools import setup
17 except ImportError: 21 except ImportError:
18 from distutils.core import setup 22 from distutils.core import setup
23
24
25 class test_doc(Command):
26 description = 'Tests the code examples in the documentation'
27 user_options = []
28
29 def initialize_options(self):
30 pass
31
32 def finalize_options(self):
33 pass
34
35 def run(self):
36 for filename in glob('doc/*.txt'):
37 print 'testing documentation file %s' % filename
38 doctest.testfile(filename, False, optionflags=doctest.ELLIPSIS)
39
40
41 class build_doc(Command):
42 description = 'Builds the documentation'
43 user_options = []
44
45 def initialize_options(self):
46 pass
47
48 def finalize_options(self):
49 pass
50
51 def run(self):
52 from docutils.core import publish_cmdline
53 conf = os.path.join('doc', 'docutils.conf')
54
55 for source in glob('doc/*.txt'):
56 dest = os.path.splitext(source)[0] + '.html'
57 if not os.path.exists(dest) or \
58 os.path.getmtime(dest) < os.path.getmtime(source):
59 print 'building documentation file %s' % dest
60 publish_cmdline(writer_name='html',
61 argv=['--config=%s' % conf, source, dest])
62
19 63
20 setup( 64 setup(
21 name = 'Genshi', 65 name = 'Genshi',
22 version = '0.4', 66 version = '0.4',
23 description = 'A toolkit for stream-based generation of output for the web', 67 description = 'A toolkit for stream-based generation of output for the web',
54 [python.templating.engines] 98 [python.templating.engines]
55 genshi = genshi.template.plugin:MarkupTemplateEnginePlugin[plugin] 99 genshi = genshi.template.plugin:MarkupTemplateEnginePlugin[plugin]
56 genshi-markup = genshi.template.plugin:MarkupTemplateEnginePlugin[plugin] 100 genshi-markup = genshi.template.plugin:MarkupTemplateEnginePlugin[plugin]
57 genshi-text = genshi.template.plugin:TextTemplateEnginePlugin[plugin] 101 genshi-text = genshi.template.plugin:TextTemplateEnginePlugin[plugin]
58 """, 102 """,
103
104 cmdclass={'build_doc': build_doc, 'test_doc': test_doc}
59 ) 105 )
Copyright (C) 2012-2017 Edgewall Software