|
From: <mi...@us...> - 2020-12-15 23:06:41
|
Revision: 8592
http://sourceforge.net/p/docutils/code/8592
Author: milde
Date: 2020-12-15 23:06:26 +0000 (Tue, 15 Dec 2020)
Log Message:
-----------
New option "detailled" for the `pseudoxml` writer.
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/docs/user/config.txt
trunk/docutils/docutils/nodes.py
trunk/docutils/docutils/writers/pseudoxml.py
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2020-12-15 23:06:16 UTC (rev 8591)
+++ trunk/docutils/HISTORY.txt 2020-12-15 23:06:26 UTC (rev 8592)
@@ -143,6 +143,12 @@
- Fix #126 manpage title with spaces.
- Fix #380 commandline option problem in sphinx.
+* docutils/writers/pseudoxml.py:
+
+ - New option `detailled`__.
+
+ __ docs/user/config.html#detailled
+
* test/DocutilsTestSupport.py
- Run python3 test like python2 against source not the build/-directory
Modified: trunk/docutils/docs/user/config.txt
===================================================================
--- trunk/docutils/docs/user/config.txt 2020-12-15 23:06:16 UTC (rev 8591)
+++ trunk/docutils/docs/user/config.txt 2020-12-15 23:06:26 UTC (rev 8592)
@@ -831,7 +831,7 @@
Enable or disable the promotion of the title of a lone subsection
to a subtitle (docutils.transforms.frontmatter.SectSubTitle).
-Default: disabled (0). Options: ``--section-subtitles,
+Default: disabled (False). Options: ``--section-subtitles,
--no-section-subtitles``.
@@ -869,7 +869,7 @@
Generate XML with a DOCTYPE declaration.
-Default: do (1). Options: ``--no-doctype``.
+Default: do (True). Options: ``--no-doctype``.
indents
~~~~~~~
@@ -894,7 +894,7 @@
Generate XML with an XML declaration.
See also `xml_declaration [html writers]`_.
-Default: do (1). Options: ``--no-xml-declaration``.
+Default: do (True). Options: ``--no-xml-declaration``.
[html writers]
@@ -1234,7 +1234,7 @@
encoding is not UTF-8 or ASCII and the XML declaration is missing,
standard tools may be unable to read the generated XHTML.
-Default: do (1). Options: ``--no-xml-declaration``.
+Default: do (True). Options: ``--no-xml-declaration``.
@@ -1370,7 +1370,7 @@
Auto-hide the presentation controls in slideshow mode, or or keep
them visible at all times.
-Default: auto-hide (1). Options: ``--hidden-controls``,
+Default: auto-hide (True). Options: ``--hidden-controls``,
``--visible-controls``.
current_slide
@@ -1978,9 +1978,14 @@
[pseudoxml writer]
------------------
-This writer does not define specific settings.
+detailled
+~~~~~~~~~
+Pretty-print <#text> nodes.
+Default: False. Options: ``--detailled``.
+
+
[applications]
==============
@@ -2012,7 +2017,7 @@
configuration files or on the command line); on the command line, the
option may also be used more than once.
-Default: none. Options: ``--ignore``.
+Default: None. Options: ``--ignore``.
prune
~~~~~
@@ -2030,7 +2035,7 @@
Recursively scan subdirectories, or ignore subdirectories.
-Default: recurse (1). Options: ``--recurse, --local``.
+Default: recurse (True). Options: ``--recurse, --local``.
silent
~~~~~~
Modified: trunk/docutils/docutils/nodes.py
===================================================================
--- trunk/docutils/docutils/nodes.py 2020-12-15 23:06:16 UTC (rev 8591)
+++ trunk/docutils/docutils/nodes.py 2020-12-15 23:06:26 UTC (rev 8592)
@@ -455,6 +455,14 @@
return self.copy()
def pformat(self, indent=' ', level=0):
+ try:
+ if self.document.settings.detailled:
+ lines = ['%s%s' % (indent * level, '<#text>')
+ ] + [indent*(level+1) + repr(line)
+ for line in self.splitlines(keepends=True)]
+ return '\n'.join(lines) + '\n'
+ except AttributeError:
+ pass
indent = indent * level
lines = [indent+line for line in self.astext().splitlines()]
if not lines:
Modified: trunk/docutils/docutils/writers/pseudoxml.py
===================================================================
--- trunk/docutils/docutils/writers/pseudoxml.py 2020-12-15 23:06:16 UTC (rev 8591)
+++ trunk/docutils/docutils/writers/pseudoxml.py 2020-12-15 23:06:26 UTC (rev 8592)
@@ -9,7 +9,7 @@
__docformat__ = 'reStructuredText'
-from docutils import writers
+from docutils import writers, frontend
class Writer(writers.Writer):
@@ -16,6 +16,14 @@
supported = ('pprint', 'pformat', 'pseudoxml')
"""Formats this writer supports."""
+
+ settings_spec = (
+ '"Docutils pseudo-XML" Writer Options',
+ None,
+ (('Pretty-print <#text> nodes.',
+ ['--detailled'],
+ {'action': 'store_true', 'validator': frontend.validate_boolean}),
+ ))
config_section = 'pseudoxml writer'
config_section_dependencies = ('writers',)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|