diff options
author | S. Solomon Darnell | 2025-03-28 21:52:21 -0500 |
---|---|---|
committer | S. Solomon Darnell | 2025-03-28 21:52:21 -0500 |
commit | 4a52a71956a8d46fcb7294ac71734504bb09bcc2 (patch) | |
tree | ee3dc5af3b6313e921cd920906356f5d4febc4ed /.venv/lib/python3.12/site-packages/docutils/readers/standalone.py | |
parent | cc961e04ba734dd72309fb548a2f97d67d578813 (diff) | |
download | gn-ai-master.tar.gz |
Diffstat (limited to '.venv/lib/python3.12/site-packages/docutils/readers/standalone.py')
-rw-r--r-- | .venv/lib/python3.12/site-packages/docutils/readers/standalone.py | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/.venv/lib/python3.12/site-packages/docutils/readers/standalone.py b/.venv/lib/python3.12/site-packages/docutils/readers/standalone.py new file mode 100644 index 00000000..a6dfd6d7 --- /dev/null +++ b/.venv/lib/python3.12/site-packages/docutils/readers/standalone.py @@ -0,0 +1,65 @@ +# $Id: standalone.py 9539 2024-02-17 10:36:51Z milde $ +# Author: David Goodger <goodger@python.org> +# Copyright: This module has been placed in the public domain. + +""" +Standalone file Reader for the reStructuredText markup syntax. +""" + +__docformat__ = 'reStructuredText' + + +from docutils import frontend, readers +from docutils.transforms import frontmatter, references, misc + + +class Reader(readers.Reader): + + supported = ('standalone',) + """Contexts this reader supports.""" + + document = None + """A single document tree.""" + + settings_spec = ( + 'Standalone Reader Options', + None, + (('Disable the promotion of a lone top-level section title to ' + 'document title (and subsequent section title to document ' + 'subtitle promotion; enabled by default).', + ['--no-doc-title'], + {'dest': 'doctitle_xform', 'action': 'store_false', + 'default': True, 'validator': frontend.validate_boolean}), + ('Disable the bibliographic field list transform (enabled by ' + 'default).', + ['--no-doc-info'], + {'dest': 'docinfo_xform', 'action': 'store_false', + 'default': True, 'validator': frontend.validate_boolean}), + ('Activate the promotion of lone subsection titles to ' + 'section subtitles (disabled by default).', + ['--section-subtitles'], + {'dest': 'sectsubtitle_xform', 'action': 'store_true', + 'default': False, 'validator': frontend.validate_boolean}), + ('Deactivate the promotion of lone subsection titles.', + ['--no-section-subtitles'], + {'dest': 'sectsubtitle_xform', 'action': 'store_false'}), + )) + + config_section = 'standalone reader' + config_section_dependencies = ('readers',) + + def get_transforms(self): + return super().get_transforms() + [ + references.Substitutions, + references.PropagateTargets, + frontmatter.DocTitle, + frontmatter.SectionSubTitle, + frontmatter.DocInfo, + references.AnonymousHyperlinks, + references.IndirectHyperlinks, + references.Footnotes, + references.ExternalTargets, + references.InternalTargets, + references.DanglingReferences, + misc.Transitions, + ] |