root/galaxy-central/eggs/docutils-0.4-py2.6.egg/docutils/readers/standalone.py

リビジョン 3, 2.4 KB (コミッタ: kohda, 14 年 前)

Install Unix tools  http://hannonlab.cshl.edu/galaxy_unix_tools/galaxy.html

行番号 
1# Author: David Goodger
2# Contact: goodger@users.sourceforge.net
3# Revision: $Revision: 3892 $
4# Date: $Date: 2005-09-20 22:04:53 +0200 (Tue, 20 Sep 2005) $
5# Copyright: This module has been placed in the public domain.
6
7"""
8Standalone file Reader for the reStructuredText markup syntax.
9"""
10
11__docformat__ = 'reStructuredText'
12
13
14import sys
15from docutils import frontend, readers
16from docutils.transforms import frontmatter, references, misc
17
18
19class Reader(readers.Reader):
20
21    supported = ('standalone',)
22    """Contexts this reader supports."""
23
24    document = None
25    """A single document tree."""
26
27    settings_spec = (
28        'Standalone Reader',
29        None,
30        (('Disable the promotion of a lone top-level section title to '
31          'document title (and subsequent section title to document '
32          'subtitle promotion; enabled by default).',
33          ['--no-doc-title'],
34          {'dest': 'doctitle_xform', 'action': 'store_false', 'default': 1,
35           'validator': frontend.validate_boolean}),
36         ('Disable the bibliographic field list transform (enabled by '
37          'default).',
38          ['--no-doc-info'],
39          {'dest': 'docinfo_xform', 'action': 'store_false', 'default': 1,
40           'validator': frontend.validate_boolean}),
41         ('Activate the promotion of lone subsection titles to '
42          'section subtitles (disabled by default).',
43          ['--section-subtitles'],
44          {'dest': 'sectsubtitle_xform', 'action': 'store_true', 'default': 0,
45           'validator': frontend.validate_boolean}),
46         ('Deactivate the promotion of lone subsection titles.',
47          ['--no-section-subtitles'],
48          {'dest': 'sectsubtitle_xform', 'action': 'store_false',
49           'validator': frontend.validate_boolean}),
50         ))
51
52    config_section = 'standalone reader'
53    config_section_dependencies = ('readers',)
54
55    def get_transforms(self):
56        return readers.Reader.get_transforms(self) + [
57            references.Substitutions,
58            references.PropagateTargets,
59            frontmatter.DocTitle,
60            frontmatter.SectionSubTitle,
61            frontmatter.DocInfo,
62            references.AnonymousHyperlinks,
63            references.IndirectHyperlinks,
64            references.Footnotes,
65            references.ExternalTargets,
66            references.InternalTargets,
67            references.DanglingReferences,
68            misc.Transitions,
69            ]
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。