|
From: <mi...@us...> - 2019-08-27 12:10:29
|
Revision: 8369
http://sourceforge.net/p/docutils/code/8369
Author: milde
Date: 2019-08-27 12:10:26 +0000 (Tue, 27 Aug 2019)
Log Message:
-----------
Remove auxiliary Python 2/3 compatibility definition module.
No longer required since setting minimal supported version to 2.7.
The remaining issues are now handled directly in the affected modules.
Modified Paths:
--------------
trunk/docutils/test/test_publisher.py
trunk/docutils/test/test_writers/test_odt.py
Removed Paths:
-------------
trunk/docutils/docutils/_compat.py
Deleted: trunk/docutils/docutils/_compat.py
===================================================================
--- trunk/docutils/docutils/_compat.py 2019-08-27 12:10:14 UTC (rev 8368)
+++ trunk/docutils/docutils/_compat.py 2019-08-27 12:10:26 UTC (rev 8369)
@@ -1,24 +0,0 @@
-# $Id$
-# Author: Georg Brandl <ge...@py...>
-# Copyright: This module has been placed in the public domain.
-
-"""
-Python 2/3 compatibility definitions.
-
-This module currently provides the following helper symbols:
-
-* u_prefix (unicode repr prefix: 'u' in 2.x, '' in 3.x)
- (Required in docutils/test/test_publisher.py)
-* BytesIO (a StringIO class that works with bytestrings)
-"""
-
-import sys
-
-if sys.version_info < (3, 0):
- u_prefix = 'u'
- from StringIO import StringIO as BytesIO
-else:
- u_prefix = b''
- # using this hack since 2to3 "fixes" the relative import
- # when using ``from io import BytesIO``
- BytesIO = __import__('io').BytesIO
Modified: trunk/docutils/test/test_publisher.py
===================================================================
--- trunk/docutils/test/test_publisher.py 2019-08-27 12:10:14 UTC (rev 8368)
+++ trunk/docutils/test/test_publisher.py 2019-08-27 12:10:26 UTC (rev 8369)
@@ -9,12 +9,18 @@
"""
import pickle
+import sys
+
import DocutilsTestSupport # must be imported before docutils
import docutils
from docutils import core, nodes, io
-from docutils._compat import u_prefix
+if sys.version_info < (3, 0):
+ u_prefix = 'u'
+else:
+ u_prefix = b''
+
test_document = """\
Test Document
=============
Modified: trunk/docutils/test/test_writers/test_odt.py
===================================================================
--- trunk/docutils/test/test_writers/test_odt.py 2019-08-27 12:10:14 UTC (rev 8368)
+++ trunk/docutils/test/test_writers/test_odt.py 2019-08-27 12:10:26 UTC (rev 8369)
@@ -34,11 +34,11 @@
import os
import zipfile
import xml.etree.ElementTree as etree
+from io import BytesIO
from . import DocutilsTestSupport
import docutils
import docutils.core
-from docutils._compat import BytesIO
#
# Globals
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2019-08-27 12:11:17
|
Revision: 8372
http://sourceforge.net/p/docutils/code/8372
Author: milde
Date: 2019-08-27 12:11:15 +0000 (Tue, 27 Aug 2019)
Log Message:
-----------
py3: Wrap 'foo.keys()', 'zip(foo, bar') in 'list'
In Python 3, 'dict.keys()', 'zip' and 'map' no longer return a list but
rather types 'dict_keys', 'zip' and 'map', respectively. You can't
append to these types nor can you delete from them while in a loop. The
simple solution to both issues is to wrap things in 'list'.
Signed-off-by: Stephen Finucane <st...@th...>
Modified Paths:
--------------
trunk/docutils/docutils/parsers/rst/tableparser.py
trunk/docutils/docutils/statemachine.py
trunk/docutils/docutils/utils/__init__.py
trunk/docutils/docutils/utils/math/math2html.py
trunk/docutils/docutils/writers/odf_odt/__init__.py
trunk/docutils/test/DocutilsTestSupport.py
trunk/docutils/test/test_functional.py
trunk/docutils/test/test_language.py
trunk/docutils/test/test_statemachine.py
Modified: trunk/docutils/docutils/parsers/rst/tableparser.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/tableparser.py 2019-08-27 12:10:52 UTC (rev 8371)
+++ trunk/docutils/docutils/parsers/rst/tableparser.py 2019-08-27 12:11:15 UTC (rev 8372)
@@ -290,7 +290,7 @@
rowindex = {}
for i in range(len(rowseps)):
rowindex[rowseps[i]] = i # row boundary -> row number mapping
- colseps = self.colseps.keys() # list of column boundaries
+ colseps = list(self.colseps.keys()) # list of column boundaries
colseps.sort()
colindex = {}
for i in range(len(colseps)):
Modified: trunk/docutils/docutils/statemachine.py
===================================================================
--- trunk/docutils/docutils/statemachine.py 2019-08-27 12:10:52 UTC (rev 8371)
+++ trunk/docutils/docutils/statemachine.py 2019-08-27 12:11:15 UTC (rev 8372)
@@ -1297,7 +1297,7 @@
self.parent = None
def sort(self, *args):
- tmp = zip(self.data, self.items)
+ tmp = list(zip(self.data, self.items))
tmp.sort(*args)
self.data = [entry[0] for entry in tmp]
self.items = [entry[1] for entry in tmp]
Modified: trunk/docutils/docutils/utils/__init__.py
===================================================================
--- trunk/docutils/docutils/utils/__init__.py 2019-08-27 12:10:52 UTC (rev 8371)
+++ trunk/docutils/docutils/utils/__init__.py 2019-08-27 12:11:15 UTC (rev 8372)
@@ -618,7 +618,7 @@
"""
# TODO: account for asian wide chars here instead of using dummy
# replacements in the tableparser?
- string_indices = range(len(text))
+ string_indices = list(range(len(text)))
for index in find_combining_chars(text):
string_indices[index] = None
return [i for i in string_indices if i is not None]
Modified: trunk/docutils/docutils/utils/math/math2html.py
===================================================================
--- trunk/docutils/docutils/utils/math/math2html.py 2019-08-27 12:10:52 UTC (rev 8371)
+++ trunk/docutils/docutils/utils/math/math2html.py 2019-08-27 12:11:15 UTC (rev 8372)
@@ -2819,7 +2819,7 @@
def innertext(self, pos):
"Parse some text inside the bracket, following textual rules."
- specialchars = FormulaConfig.symbolfunctions.keys()
+ specialchars = list(FormulaConfig.symbolfunctions.keys())
specialchars.append(FormulaConfig.starts['command'])
specialchars.append(FormulaConfig.starts['bracket'])
specialchars.append(Comment.start)
Modified: trunk/docutils/docutils/writers/odf_odt/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/odf_odt/__init__.py 2019-08-27 12:10:52 UTC (rev 8371)
+++ trunk/docutils/docutils/writers/odf_odt/__init__.py 2019-08-27 12:11:15 UTC (rev 8372)
@@ -1117,8 +1117,7 @@
fin = os.popen("paperconf -s 2> /dev/null")
content = fin.read()
content = content.split()
- content = map(float, content)
- content = list(content)
+ content = list(map(float, content))
w, h = content
except (IOError, ValueError):
w, h = 612, 792 # default to Letter
Modified: trunk/docutils/test/DocutilsTestSupport.py
===================================================================
--- trunk/docutils/test/DocutilsTestSupport.py 2019-08-27 12:10:52 UTC (rev 8371)
+++ trunk/docutils/test/DocutilsTestSupport.py 2019-08-27 12:11:15 UTC (rev 8372)
@@ -811,7 +811,7 @@
parts['html_prolog'] = parts['html_prolog'].replace(
self.standard_html_prolog, '')
# remove empty values:
- for key in parts.keys():
+ for key in list(parts.keys()):
if not parts[key]:
del parts[key]
# standard output format:
Modified: trunk/docutils/test/test_functional.py
===================================================================
--- trunk/docutils/test/test_functional.py 2019-08-27 12:10:52 UTC (rev 8371)
+++ trunk/docutils/test/test_functional.py 2019-08-27 12:11:15 UTC (rev 8372)
@@ -154,7 +154,7 @@
del params['test_source']
del params['test_destination']
# Delete private stuff like params['__builtins__']:
- for key in params.keys():
+ for key in list(params.keys()):
if key.startswith('_'):
del params[key]
# Get output (automatically written to the output/ directory
Modified: trunk/docutils/test/test_language.py
===================================================================
--- trunk/docutils/test/test_language.py 2019-08-27 12:10:52 UTC (rev 8371)
+++ trunk/docutils/test/test_language.py 2019-08-27 12:11:15 UTC (rev 8372)
@@ -52,7 +52,7 @@
match = self.language_module_pattern.match(mod)
if match:
languages[match.group(1)] = 1
- self.languages = languages.keys()
+ self.languages = list(languages.keys())
# test language tag normalization:
self.languages += ['en_gb', 'en_US', 'en-CA', 'de-DE', 'de-AT-1901',
'pt-BR', 'pt-foo-BR']
Modified: trunk/docutils/test/test_statemachine.py
===================================================================
--- trunk/docutils/test/test_statemachine.py 2019-08-27 12:10:52 UTC (rev 8371)
+++ trunk/docutils/test/test_statemachine.py 2019-08-27 12:11:15 UTC (rev 8372)
@@ -152,7 +152,7 @@
self.sm.unlink()
def test___init__(self):
- self.assertEqual(self.sm.states.keys(), ['MockState'])
+ self.assertEqual(list(self.sm.states.keys()), ['MockState'])
self.assertEqual(len(self.sm.states['MockState'].transitions), 4)
def test_get_indented(self):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2019-08-27 12:11:33
|
Revision: 8373
http://sourceforge.net/p/docutils/code/8373
Author: milde
Date: 2019-08-27 12:11:30 +0000 (Tue, 27 Aug 2019)
Log Message:
-----------
Simplify code.
Modified Paths:
--------------
trunk/docutils/docutils/parsers/rst/tableparser.py
trunk/docutils/docutils/statemachine.py
trunk/docutils/docutils/writers/odf_odt/__init__.py
trunk/docutils/test/DocutilsTestSupport.py
Modified: trunk/docutils/docutils/parsers/rst/tableparser.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/tableparser.py 2019-08-27 12:11:15 UTC (rev 8372)
+++ trunk/docutils/docutils/parsers/rst/tableparser.py 2019-08-27 12:11:30 UTC (rev 8373)
@@ -290,8 +290,7 @@
rowindex = {}
for i in range(len(rowseps)):
rowindex[rowseps[i]] = i # row boundary -> row number mapping
- colseps = list(self.colseps.keys()) # list of column boundaries
- colseps.sort()
+ colseps = sorted(self.colseps.keys()) # list of column boundaries
colindex = {}
for i in range(len(colseps)):
colindex[colseps[i]] = i # column boundary -> col number map
Modified: trunk/docutils/docutils/statemachine.py
===================================================================
--- trunk/docutils/docutils/statemachine.py 2019-08-27 12:11:15 UTC (rev 8372)
+++ trunk/docutils/docutils/statemachine.py 2019-08-27 12:11:30 UTC (rev 8373)
@@ -1297,8 +1297,7 @@
self.parent = None
def sort(self, *args):
- tmp = list(zip(self.data, self.items))
- tmp.sort(*args)
+ tmp = sorted(zip(self.data, self.items), *args)
self.data = [entry[0] for entry in tmp]
self.items = [entry[1] for entry in tmp]
self.parent = None
Modified: trunk/docutils/docutils/writers/odf_odt/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/odf_odt/__init__.py 2019-08-27 12:11:15 UTC (rev 8372)
+++ trunk/docutils/docutils/writers/odf_odt/__init__.py 2019-08-27 12:11:30 UTC (rev 8373)
@@ -1115,10 +1115,8 @@
def setup_paper(self, root_el):
try:
fin = os.popen("paperconf -s 2> /dev/null")
- content = fin.read()
- content = content.split()
- content = list(map(float, content))
- w, h = content
+ dimensions = fin.read().split()
+ w, h = (float(s) for s in dimensions)
except (IOError, ValueError):
w, h = 612, 792 # default to Letter
finally:
Modified: trunk/docutils/test/DocutilsTestSupport.py
===================================================================
--- trunk/docutils/test/DocutilsTestSupport.py 2019-08-27 12:11:15 UTC (rev 8372)
+++ trunk/docutils/test/DocutilsTestSupport.py 2019-08-27 12:11:30 UTC (rev 8373)
@@ -810,14 +810,10 @@
self.standard_html_meta_value, '...')
parts['html_prolog'] = parts['html_prolog'].replace(
self.standard_html_prolog, '')
- # remove empty values:
- for key in list(parts.keys()):
+ output = []
+ for key in sorted(parts.keys()):
if not parts[key]:
- del parts[key]
- # standard output format:
- keys = sorted(parts.keys())
- output = []
- for key in keys:
+ continue
output.append("%r: '''%s'''"
% (key, parts[key]))
if output[-1].endswith("\n'''"):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2019-08-27 19:49:31
|
Revision: 8376
http://sourceforge.net/p/docutils/code/8376
Author: milde
Date: 2019-08-27 19:49:29 +0000 (Tue, 27 Aug 2019)
Log Message:
-----------
trivial: Misc whitespace fixes
Signed-off-by: Stephen Finucane <st...@th...>
Modified Paths:
--------------
trunk/docutils/docutils/frontend.py
trunk/docutils/docutils/languages/__init__.py
trunk/docutils/docutils/parsers/rst/languages/__init__.py
trunk/docutils/docutils/utils/__init__.py
trunk/docutils/docutils/utils/math/math2html.py
trunk/docutils/docutils/utils/math/tex2mathml_extern.py
trunk/docutils/docutils/utils/roman.py
trunk/docutils/docutils/utils/smartquotes.py
trunk/docutils/docutils/utils/urischemes.py
trunk/docutils/docutils/writers/html5_polyglot/__init__.py
trunk/docutils/docutils/writers/latex2e/__init__.py
trunk/docutils/docutils/writers/manpage.py
trunk/docutils/docutils/writers/xetex/__init__.py
trunk/docutils/test/functional/tests/math_output_mathml.py
trunk/docutils/tools/test/test_buildhtml.py
Modified: trunk/docutils/docutils/frontend.py
===================================================================
--- trunk/docutils/docutils/frontend.py 2019-08-27 15:30:40 UTC (rev 8375)
+++ trunk/docutils/docutils/frontend.py 2019-08-27 19:49:29 UTC (rev 8376)
@@ -247,7 +247,7 @@
raise ValueError('Invalid value "%s". Please specify 4 quotes\n'
' (primary open/close; secondary open/close).'
% item.encode('ascii', 'backslashreplace'))
- lc_quotes.append((lang,quotes))
+ lc_quotes.append((lang, quotes))
return lc_quotes
def make_paths_absolute(pathdict, keys, base_path=None):
Modified: trunk/docutils/docutils/languages/__init__.py
===================================================================
--- trunk/docutils/docutils/languages/__init__.py 2019-08-27 15:30:40 UTC (rev 8375)
+++ trunk/docutils/docutils/languages/__init__.py 2019-08-27 19:49:29 UTC (rev 8376)
@@ -26,7 +26,7 @@
"""
# TODO: use a dummy module returning emtpy strings?, configurable?
for tag in normalize_language_tag(language_code):
- tag = tag.replace('-','_') # '-' not valid in module names
+ tag = tag.replace('-', '_') # '-' not valid in module names
if tag in _languages:
return _languages[tag]
try:
Modified: trunk/docutils/docutils/parsers/rst/languages/__init__.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/__init__.py 2019-08-27 15:30:40 UTC (rev 8375)
+++ trunk/docutils/docutils/parsers/rst/languages/__init__.py 2019-08-27 19:49:29 UTC (rev 8376)
@@ -21,7 +21,7 @@
def get_language(language_code):
for tag in normalize_language_tag(language_code):
- tag = tag.replace('-','_') # '-' not valid in module names
+ tag = tag.replace('-', '_') # '-' not valid in module names
if tag in _languages:
return _languages[tag]
try:
Modified: trunk/docutils/docutils/utils/__init__.py
===================================================================
--- trunk/docutils/docutils/utils/__init__.py 2019-08-27 15:30:40 UTC (rev 8375)
+++ trunk/docutils/docutils/utils/__init__.py 2019-08-27 19:49:29 UTC (rev 8376)
@@ -673,7 +673,7 @@
"""
# normalize:
- tag = tag.lower().replace('-','_')
+ tag = tag.lower().replace('-', '_')
# split (except singletons, which mark the following tag as non-standard):
tag = re.sub(r'_([a-zA-Z0-9])_', r'_\1-', tag)
subtags = [subtag for subtag in tag.split('_')]
Modified: trunk/docutils/docutils/utils/math/math2html.py
===================================================================
--- trunk/docutils/docutils/utils/math/math2html.py 2019-08-27 15:30:40 UTC (rev 8375)
+++ trunk/docutils/docutils/utils/math/math2html.py 2019-08-27 19:49:29 UTC (rev 8376)
@@ -92,75 +92,68 @@
"Configuration class from elyxer.config file"
abbrvnat = {
-
- u'@article':u'$authors. $title. <i>$journal</i>,{ {$volume:}$pages,} $month $year.{ doi: $doi.}{ URL <a href="$url">$url</a>.}{ $note.}',
- u'cite':u'$surname($year)',
- u'default':u'$authors. <i>$title</i>. $publisher, $year.{ URL <a href="$url">$url</a>.}{ $note.}',
+ u'@article': u'$authors. $title. <i>$journal</i>,{ {$volume:}$pages,} $month $year.{ doi: $doi.}{ URL <a href="$url">$url</a>.}{ $note.}',
+ u'cite': u'$surname($year)',
+ u'default': u'$authors. <i>$title</i>. $publisher, $year.{ URL <a href="$url">$url</a>.}{ $note.}',
}
alpha = {
-
- u'@article':u'$authors. $title.{ <i>$journal</i>{, {$volume}{($number)}}{: $pages}{, $year}.}{ <a href="$url">$url</a>.}{ <a href="$filename">$filename</a>.}{ $note.}',
- u'cite':u'$Sur$YY',
- u'default':u'$authors. $title.{ <i>$journal</i>,} $year.{ <a href="$url">$url</a>.}{ <a href="$filename">$filename</a>.}{ $note.}',
+ u'@article': u'$authors. $title.{ <i>$journal</i>{, {$volume}{($number)}}{: $pages}{, $year}.}{ <a href="$url">$url</a>.}{ <a href="$filename">$filename</a>.}{ $note.}',
+ u'cite': u'$Sur$YY',
+ u'default': u'$authors. $title.{ <i>$journal</i>,} $year.{ <a href="$url">$url</a>.}{ <a href="$filename">$filename</a>.}{ $note.}',
}
authordate2 = {
-
- u'@article':u'$authors. $year. $title. <i>$journal</i>, <b>$volume</b>($number), $pages.{ URL <a href="$url">$url</a>.}{ $note.}',
- u'@book':u'$authors. $year. <i>$title</i>. $publisher.{ URL <a href="$url">$url</a>.}{ $note.}',
- u'cite':u'$surname, $year',
- u'default':u'$authors. $year. <i>$title</i>. $publisher.{ URL <a href="$url">$url</a>.}{ $note.}',
+ u'@article': u'$authors. $year. $title. <i>$journal</i>, <b>$volume</b>($number), $pages.{ URL <a href="$url">$url</a>.}{ $note.}',
+ u'@book': u'$authors. $year. <i>$title</i>. $publisher.{ URL <a href="$url">$url</a>.}{ $note.}',
+ u'cite': u'$surname, $year',
+ u'default': u'$authors. $year. <i>$title</i>. $publisher.{ URL <a href="$url">$url</a>.}{ $note.}',
}
default = {
-
- u'@article':u'$authors: “$title”, <i>$journal</i>,{ pp. $pages,} $year.{ URL <a href="$url">$url</a>.}{ $note.}',
- u'@book':u'{$authors: }<i>$title</i>{ ($editor, ed.)}.{{ $publisher,} $year.}{ URL <a href="$url">$url</a>.}{ $note.}',
- u'@booklet':u'$authors: <i>$title</i>.{{ $publisher,} $year.}{ URL <a href="$url">$url</a>.}{ $note.}',
- u'@conference':u'$authors: “$title”, <i>$journal</i>,{ pp. $pages,} $year.{ URL <a href="$url">$url</a>.}{ $note.}',
- u'@inbook':u'$authors: <i>$title</i>.{{ $publisher,} $year.}{ URL <a href="$url">$url</a>.}{ $note.}',
- u'@incollection':u'$authors: <i>$title</i>{ in <i>$booktitle</i>{ ($editor, ed.)}}.{{ $publisher,} $year.}{ URL <a href="$url">$url</a>.}{ $note.}',
- u'@inproceedings':u'$authors: “$title”, <i>$booktitle</i>,{ pp. $pages,} $year.{ URL <a href="$url">$url</a>.}{ $note.}',
- u'@manual':u'$authors: <i>$title</i>.{{ $publisher,} $year.}{ URL <a href="$url">$url</a>.}{ $note.}',
- u'@mastersthesis':u'$authors: <i>$title</i>.{{ $publisher,} $year.}{ URL <a href="$url">$url</a>.}{ $note.}',
- u'@misc':u'$authors: <i>$title</i>.{{ $publisher,}{ $howpublished,} $year.}{ URL <a href="$url">$url</a>.}{ $note.}',
- u'@phdthesis':u'$authors: <i>$title</i>.{{ $publisher,} $year.}{ URL <a href="$url">$url</a>.}{ $note.}',
- u'@proceedings':u'$authors: “$title”, <i>$journal</i>,{ pp. $pages,} $year.{ URL <a href="$url">$url</a>.}{ $note.}',
- u'@techreport':u'$authors: <i>$title</i>, $year.{ URL <a href="$url">$url</a>.}{ $note.}',
- u'@unpublished':u'$authors: “$title”, <i>$journal</i>, $year.{ URL <a href="$url">$url</a>.}{ $note.}',
- u'cite':u'$index',
- u'default':u'$authors: <i>$title</i>.{{ $publisher,} $year.}{ URL <a href="$url">$url</a>.}{ $note.}',
+ u'@article': u'$authors: “$title”, <i>$journal</i>,{ pp. $pages,} $year.{ URL <a href="$url">$url</a>.}{ $note.}',
+ u'@book': u'{$authors: }<i>$title</i>{ ($editor, ed.)}.{{ $publisher,} $year.}{ URL <a href="$url">$url</a>.}{ $note.}',
+ u'@booklet': u'$authors: <i>$title</i>.{{ $publisher,} $year.}{ URL <a href="$url">$url</a>.}{ $note.}',
+ u'@conference': u'$authors: “$title”, <i>$journal</i>,{ pp. $pages,} $year.{ URL <a href="$url">$url</a>.}{ $note.}',
+ u'@inbook': u'$authors: <i>$title</i>.{{ $publisher,} $year.}{ URL <a href="$url">$url</a>.}{ $note.}',
+ u'@incollection': u'$authors: <i>$title</i>{ in <i>$booktitle</i>{ ($editor, ed.)}}.{{ $publisher,} $year.}{ URL <a href="$url">$url</a>.}{ $note.}',
+ u'@inproceedings': u'$authors: “$title”, <i>$booktitle</i>,{ pp. $pages,} $year.{ URL <a href="$url">$url</a>.}{ $note.}',
+ u'@manual': u'$authors: <i>$title</i>.{{ $publisher,} $year.}{ URL <a href="$url">$url</a>.}{ $note.}',
+ u'@mastersthesis': u'$authors: <i>$title</i>.{{ $publisher,} $year.}{ URL <a href="$url">$url</a>.}{ $note.}',
+ u'@misc': u'$authors: <i>$title</i>.{{ $publisher,}{ $howpublished,} $year.}{ URL <a href="$url">$url</a>.}{ $note.}',
+ u'@phdthesis': u'$authors: <i>$title</i>.{{ $publisher,} $year.}{ URL <a href="$url">$url</a>.}{ $note.}',
+ u'@proceedings': u'$authors: “$title”, <i>$journal</i>,{ pp. $pages,} $year.{ URL <a href="$url">$url</a>.}{ $note.}',
+ u'@techreport': u'$authors: <i>$title</i>, $year.{ URL <a href="$url">$url</a>.}{ $note.}',
+ u'@unpublished': u'$authors: “$title”, <i>$journal</i>, $year.{ URL <a href="$url">$url</a>.}{ $note.}',
+ u'cite': u'$index',
+ u'default': u'$authors: <i>$title</i>.{{ $publisher,} $year.}{ URL <a href="$url">$url</a>.}{ $note.}',
}
defaulttags = {
- u'YY':u'??', u'authors':u'', u'surname':u'',
+ u'YY': u'??', u'authors': u'', u'surname': u'',
}
ieeetr = {
-
- u'@article':u'$authors, “$title”, <i>$journal</i>, vol. $volume, no. $number, pp. $pages, $year.{ URL <a href="$url">$url</a>.}{ $note.}',
- u'@book':u'$authors, <i>$title</i>. $publisher, $year.{ URL <a href="$url">$url</a>.}{ $note.}',
- u'cite':u'$index',
- u'default':u'$authors, “$title”. $year.{ URL <a href="$url">$url</a>.}{ $note.}',
+ u'@article': u'$authors, “$title”, <i>$journal</i>, vol. $volume, no. $number, pp. $pages, $year.{ URL <a href="$url">$url</a>.}{ $note.}',
+ u'@book': u'$authors, <i>$title</i>. $publisher, $year.{ URL <a href="$url">$url</a>.}{ $note.}',
+ u'cite': u'$index',
+ u'default': u'$authors, “$title”. $year.{ URL <a href="$url">$url</a>.}{ $note.}',
}
plain = {
-
- u'@article':u'$authors. $title.{ <i>$journal</i>{, {$volume}{($number)}}{:$pages}{, $year}.}{ URL <a href="$url">$url</a>.}{ $note.}',
- u'@book':u'$authors. <i>$title</i>. $publisher,{ $month} $year.{ URL <a href="$url">$url</a>.}{ $note.}',
- u'@incollection':u'$authors. $title.{ In <i>$booktitle</i> {($editor, ed.)}.} $publisher,{ $month} $year.{ URL <a href="$url">$url</a>.}{ $note.}',
- u'@inproceedings':u'$authors. $title. { <i>$booktitle</i>{, {$volume}{($number)}}{:$pages}{, $year}.}{ URL <a href="$url">$url</a>.}{ $note.}',
- u'cite':u'$index',
- u'default':u'{$authors. }$title.{{ $publisher,} $year.}{ URL <a href="$url">$url</a>.}{ $note.}',
+ u'@article': u'$authors. $title.{ <i>$journal</i>{, {$volume}{($number)}}{:$pages}{, $year}.}{ URL <a href="$url">$url</a>.}{ $note.}',
+ u'@book': u'$authors. <i>$title</i>. $publisher,{ $month} $year.{ URL <a href="$url">$url</a>.}{ $note.}',
+ u'@incollection': u'$authors. $title.{ In <i>$booktitle</i> {($editor, ed.)}.} $publisher,{ $month} $year.{ URL <a href="$url">$url</a>.}{ $note.}',
+ u'@inproceedings': u'$authors. $title. { <i>$booktitle</i>{, {$volume}{($number)}}{:$pages}{, $year}.}{ URL <a href="$url">$url</a>.}{ $note.}',
+ u'cite': u'$index',
+ u'default': u'{$authors. }$title.{{ $publisher,} $year.}{ URL <a href="$url">$url</a>.}{ $note.}',
}
vancouver = {
-
- u'@article':u'$authors. $title. <i>$journal</i>, $year{;{<b>$volume</b>}{($number)}{:$pages}}.{ URL: <a href="$url">$url</a>.}{ $note.}',
- u'@book':u'$authors. $title. {$publisher, }$year.{ URL: <a href="$url">$url</a>.}{ $note.}',
- u'cite':u'$index',
- u'default':u'$authors. $title; {$publisher, }$year.{ $howpublished.}{ URL: <a href="$url">$url</a>.}{ $note.}',
+ u'@article': u'$authors. $title. <i>$journal</i>, $year{;{<b>$volume</b>}{($number)}{:$pages}}.{ URL: <a href="$url">$url</a>.}{ $note.}',
+ u'@book': u'$authors. $title. {$publisher, }$year.{ URL: <a href="$url">$url</a>.}{ $note.}',
+ u'cite': u'$index',
+ u'default': u'$authors. $title; {$publisher, }$year.{ $howpublished.}{ URL: <a href="$url">$url</a>.}{ $note.}',
}
class BibTeXConfig(object):
@@ -167,7 +160,7 @@
"Configuration class from elyxer.config file"
replaced = {
- u'--':u'—', u'..':u'.',
+ u'--': u'—', u'..': u'.',
}
class ContainerConfig(object):
@@ -174,127 +167,127 @@
"Configuration class from elyxer.config file"
endings = {
- u'Align':u'\\end_layout', u'BarredText':u'\\bar',
- u'BoldText':u'\\series', u'Cell':u'</cell',
- u'ChangeDeleted':u'\\change_unchanged',
- u'ChangeInserted':u'\\change_unchanged', u'ColorText':u'\\color',
- u'EmphaticText':u'\\emph', u'Hfill':u'\\hfill', u'Inset':u'\\end_inset',
- u'Layout':u'\\end_layout', u'LyXFooter':u'\\end_document',
- u'LyXHeader':u'\\end_header', u'Row':u'</row', u'ShapedText':u'\\shape',
- u'SizeText':u'\\size', u'StrikeOut':u'\\strikeout',
- u'TextFamily':u'\\family', u'VersalitasText':u'\\noun',
+ u'Align': u'\\end_layout', u'BarredText': u'\\bar',
+ u'BoldText': u'\\series', u'Cell': u'</cell',
+ u'ChangeDeleted': u'\\change_unchanged',
+ u'ChangeInserted': u'\\change_unchanged', u'ColorText': u'\\color',
+ u'EmphaticText': u'\\emph', u'Hfill': u'\\hfill', u'Inset': u'\\end_inset',
+ u'Layout': u'\\end_layout', u'LyXFooter': u'\\end_document',
+ u'LyXHeader': u'\\end_header', u'Row': u'</row', u'ShapedText': u'\\shape',
+ u'SizeText': u'\\size', u'StrikeOut': u'\\strikeout',
+ u'TextFamily': u'\\family', u'VersalitasText': u'\\noun',
}
extracttext = {
- u'allowed':[u'StringContainer',u'Constant',u'FormulaConstant',],
- u'cloned':[u'',],
- u'extracted':[u'PlainLayout',u'TaggedText',u'Align',u'Caption',u'TextFamily',u'EmphaticText',u'VersalitasText',u'BarredText',u'SizeText',u'ColorText',u'LangLine',u'Formula',u'Bracket',u'RawText',u'BibTag',u'FormulaNumber',u'AlphaCommand',u'EmptyCommand',u'OneParamFunction',u'SymbolFunction',u'TextFunction',u'FontFunction',u'CombiningFunction',u'DecoratingFunction',u'FormulaSymbol',u'BracketCommand',u'TeXCode',],
+ u'allowed': [u'StringContainer', u'Constant', u'FormulaConstant',],
+ u'cloned': [u'',],
+ u'extracted': [u'PlainLayout', u'TaggedText', u'Align', u'Caption', u'TextFamily', u'EmphaticText', u'VersalitasText', u'BarredText', u'SizeText', u'ColorText', u'LangLine', u'Formula', u'Bracket', u'RawText', u'BibTag', u'FormulaNumber', u'AlphaCommand', u'EmptyCommand', u'OneParamFunction', u'SymbolFunction', u'TextFunction', u'FontFunction', u'CombiningFunction', u'DecoratingFunction', u'FormulaSymbol', u'BracketCommand', u'TeXCode',],
}
startendings = {
- u'\\begin_deeper':u'\\end_deeper', u'\\begin_inset':u'\\end_inset',
- u'\\begin_layout':u'\\end_layout',
+ u'\\begin_deeper': u'\\end_deeper', u'\\begin_inset': u'\\end_inset',
+ u'\\begin_layout': u'\\end_layout',
}
starts = {
- u'':u'StringContainer', u'#LyX':u'BlackBox', u'</lyxtabular':u'BlackBox',
- u'<cell':u'Cell', u'<column':u'Column', u'<row':u'Row',
- u'\\align':u'Align', u'\\bar':u'BarredText',
- u'\\bar default':u'BlackBox', u'\\bar no':u'BlackBox',
- u'\\begin_body':u'BlackBox', u'\\begin_deeper':u'DeeperList',
- u'\\begin_document':u'BlackBox', u'\\begin_header':u'LyXHeader',
- u'\\begin_inset Argument':u'ShortTitle',
- u'\\begin_inset Box':u'BoxInset', u'\\begin_inset Branch':u'Branch',
- u'\\begin_inset Caption':u'Caption',
- u'\\begin_inset CommandInset bibitem':u'BiblioEntry',
- u'\\begin_inset CommandInset bibtex':u'BibTeX',
- u'\\begin_inset CommandInset citation':u'BiblioCitation',
- u'\\begin_inset CommandInset href':u'URL',
- u'\\begin_inset CommandInset include':u'IncludeInset',
- u'\\begin_inset CommandInset index_print':u'PrintIndex',
- u'\\begin_inset CommandInset label':u'Label',
- u'\\begin_inset CommandInset line':u'LineInset',
- u'\\begin_inset CommandInset nomencl_print':u'PrintNomenclature',
- u'\\begin_inset CommandInset nomenclature':u'NomenclatureEntry',
- u'\\begin_inset CommandInset ref':u'Reference',
- u'\\begin_inset CommandInset toc':u'TableOfContents',
- u'\\begin_inset ERT':u'ERT', u'\\begin_inset Flex':u'FlexInset',
- u'\\begin_inset Flex Chunkref':u'NewfangledChunkRef',
- u'\\begin_inset Flex Marginnote':u'SideNote',
- u'\\begin_inset Flex Sidenote':u'SideNote',
- u'\\begin_inset Flex URL':u'FlexURL', u'\\begin_inset Float':u'Float',
- u'\\begin_inset FloatList':u'ListOf', u'\\begin_inset Foot':u'Footnote',
- u'\\begin_inset Formula':u'Formula',
- u'\\begin_inset FormulaMacro':u'FormulaMacro',
- u'\\begin_inset Graphics':u'Image',
- u'\\begin_inset Index':u'IndexReference',
- u'\\begin_inset Info':u'InfoInset',
- u'\\begin_inset LatexCommand bibitem':u'BiblioEntry',
- u'\\begin_inset LatexCommand bibtex':u'BibTeX',
- u'\\begin_inset LatexCommand cite':u'BiblioCitation',
- u'\\begin_inset LatexCommand citealt':u'BiblioCitation',
- u'\\begin_inset LatexCommand citep':u'BiblioCitation',
- u'\\begin_inset LatexCommand citet':u'BiblioCitation',
- u'\\begin_inset LatexCommand htmlurl':u'URL',
- u'\\begin_inset LatexCommand index':u'IndexReference',
- u'\\begin_inset LatexCommand label':u'Label',
- u'\\begin_inset LatexCommand nomenclature':u'NomenclatureEntry',
- u'\\begin_inset LatexCommand prettyref':u'Reference',
- u'\\begin_inset LatexCommand printindex':u'PrintIndex',
- u'\\begin_inset LatexCommand printnomenclature':u'PrintNomenclature',
- u'\\begin_inset LatexCommand ref':u'Reference',
- u'\\begin_inset LatexCommand tableofcontents':u'TableOfContents',
- u'\\begin_inset LatexCommand url':u'URL',
- u'\\begin_inset LatexCommand vref':u'Reference',
- u'\\begin_inset Marginal':u'SideNote',
- u'\\begin_inset Newline':u'NewlineInset',
- u'\\begin_inset Newpage':u'NewPageInset', u'\\begin_inset Note':u'Note',
- u'\\begin_inset OptArg':u'ShortTitle',
- u'\\begin_inset Phantom':u'PhantomText',
- u'\\begin_inset Quotes':u'QuoteContainer',
- u'\\begin_inset Tabular':u'Table', u'\\begin_inset Text':u'InsetText',
- u'\\begin_inset VSpace':u'VerticalSpace', u'\\begin_inset Wrap':u'Wrap',
- u'\\begin_inset listings':u'Listing',
- u'\\begin_inset script':u'ScriptInset', u'\\begin_inset space':u'Space',
- u'\\begin_layout':u'Layout', u'\\begin_layout Abstract':u'Abstract',
- u'\\begin_layout Author':u'Author',
- u'\\begin_layout Bibliography':u'Bibliography',
- u'\\begin_layout Chunk':u'NewfangledChunk',
- u'\\begin_layout Description':u'Description',
- u'\\begin_layout Enumerate':u'ListItem',
- u'\\begin_layout Itemize':u'ListItem', u'\\begin_layout List':u'List',
- u'\\begin_layout LyX-Code':u'LyXCode',
- u'\\begin_layout Plain':u'PlainLayout',
- u'\\begin_layout Standard':u'StandardLayout',
- u'\\begin_layout Title':u'Title', u'\\begin_preamble':u'LyXPreamble',
- u'\\change_deleted':u'ChangeDeleted',
- u'\\change_inserted':u'ChangeInserted',
- u'\\change_unchanged':u'BlackBox', u'\\color':u'ColorText',
- u'\\color inherit':u'BlackBox', u'\\color none':u'BlackBox',
- u'\\emph default':u'BlackBox', u'\\emph off':u'BlackBox',
- u'\\emph on':u'EmphaticText', u'\\emph toggle':u'EmphaticText',
- u'\\end_body':u'LyXFooter', u'\\family':u'TextFamily',
- u'\\family default':u'BlackBox', u'\\family roman':u'BlackBox',
- u'\\hfill':u'Hfill', u'\\labelwidthstring':u'BlackBox',
- u'\\lang':u'LangLine', u'\\length':u'InsetLength',
- u'\\lyxformat':u'LyXFormat', u'\\lyxline':u'LyXLine',
- u'\\newline':u'Newline', u'\\newpage':u'NewPage',
- u'\\noindent':u'BlackBox', u'\\noun default':u'BlackBox',
- u'\\noun off':u'BlackBox', u'\\noun on':u'VersalitasText',
- u'\\paragraph_spacing':u'BlackBox', u'\\series bold':u'BoldText',
- u'\\series default':u'BlackBox', u'\\series medium':u'BlackBox',
- u'\\shape':u'ShapedText', u'\\shape default':u'BlackBox',
- u'\\shape up':u'BlackBox', u'\\size':u'SizeText',
- u'\\size normal':u'BlackBox', u'\\start_of_appendix':u'StartAppendix',
- u'\\strikeout default':u'BlackBox', u'\\strikeout on':u'StrikeOut',
+ u'': u'StringContainer', u'#LyX': u'BlackBox', u'</lyxtabular': u'BlackBox',
+ u'<cell': u'Cell', u'<column': u'Column', u'<row': u'Row',
+ u'\\align': u'Align', u'\\bar': u'BarredText',
+ u'\\bar default': u'BlackBox', u'\\bar no': u'BlackBox',
+ u'\\begin_body': u'BlackBox', u'\\begin_deeper': u'DeeperList',
+ u'\\begin_document': u'BlackBox', u'\\begin_header': u'LyXHeader',
+ u'\\begin_inset Argument': u'ShortTitle',
+ u'\\begin_inset Box': u'BoxInset', u'\\begin_inset Branch': u'Branch',
+ u'\\begin_inset Caption': u'Caption',
+ u'\\begin_inset CommandInset bibitem': u'BiblioEntry',
+ u'\\begin_inset CommandInset bibtex': u'BibTeX',
+ u'\\begin_inset CommandInset citation': u'BiblioCitation',
+ u'\\begin_inset CommandInset href': u'URL',
+ u'\\begin_inset CommandInset include': u'IncludeInset',
+ u'\\begin_inset CommandInset index_print': u'PrintIndex',
+ u'\\begin_inset CommandInset label': u'Label',
+ u'\\begin_inset CommandInset line': u'LineInset',
+ u'\\begin_inset CommandInset nomencl_print': u'PrintNomenclature',
+ u'\\begin_inset CommandInset nomenclature': u'NomenclatureEntry',
+ u'\\begin_inset CommandInset ref': u'Reference',
+ u'\\begin_inset CommandInset toc': u'TableOfContents',
+ u'\\begin_inset ERT': u'ERT', u'\\begin_inset Flex': u'FlexInset',
+ u'\\begin_inset Flex Chunkref': u'NewfangledChunkRef',
+ u'\\begin_inset Flex Marginnote': u'SideNote',
+ u'\\begin_inset Flex Sidenote': u'SideNote',
+ u'\\begin_inset Flex URL': u'FlexURL', u'\\begin_inset Float': u'Float',
+ u'\\begin_inset FloatList': u'ListOf', u'\\begin_inset Foot': u'Footnote',
+ u'\\begin_inset Formula': u'Formula',
+ u'\\begin_inset FormulaMacro': u'FormulaMacro',
+ u'\\begin_inset Graphics': u'Image',
+ u'\\begin_inset Index': u'IndexReference',
+ u'\\begin_inset Info': u'InfoInset',
+ u'\\begin_inset LatexCommand bibitem': u'BiblioEntry',
+ u'\\begin_inset LatexCommand bibtex': u'BibTeX',
+ u'\\begin_inset LatexCommand cite': u'BiblioCitation',
+ u'\\begin_inset LatexCommand citealt': u'BiblioCitation',
+ u'\\begin_inset LatexCommand citep': u'BiblioCitation',
+ u'\\begin_inset LatexCommand citet': u'BiblioCitation',
+ u'\\begin_inset LatexCommand htmlurl': u'URL',
+ u'\\begin_inset LatexCommand index': u'IndexReference',
+ u'\\begin_inset LatexCommand label': u'Label',
+ u'\\begin_inset LatexCommand nomenclature': u'NomenclatureEntry',
+ u'\\begin_inset LatexCommand prettyref': u'Reference',
+ u'\\begin_inset LatexCommand printindex': u'PrintIndex',
+ u'\\begin_inset LatexCommand printnomenclature': u'PrintNomenclature',
+ u'\\begin_inset LatexCommand ref': u'Reference',
+ u'\\begin_inset LatexCommand tableofcontents': u'TableOfContents',
+ u'\\begin_inset LatexCommand url': u'URL',
+ u'\\begin_inset LatexCommand vref': u'Reference',
+ u'\\begin_inset Marginal': u'SideNote',
+ u'\\begin_inset Newline': u'NewlineInset',
+ u'\\begin_inset Newpage': u'NewPageInset', u'\\begin_inset Note': u'Note',
+ u'\\begin_inset OptArg': u'ShortTitle',
+ u'\\begin_inset Phantom': u'PhantomText',
+ u'\\begin_inset Quotes': u'QuoteContainer',
+ u'\\begin_inset Tabular': u'Table', u'\\begin_inset Text': u'InsetText',
+ u'\\begin_inset VSpace': u'VerticalSpace', u'\\begin_inset Wrap': u'Wrap',
+ u'\\begin_inset listings': u'Listing',
+ u'\\begin_inset script': u'ScriptInset', u'\\begin_inset space': u'Space',
+ u'\\begin_layout': u'Layout', u'\\begin_layout Abstract': u'Abstract',
+ u'\\begin_layout Author': u'Author',
+ u'\\begin_layout Bibliography': u'Bibliography',
+ u'\\begin_layout Chunk': u'NewfangledChunk',
+ u'\\begin_layout Description': u'Description',
+ u'\\begin_layout Enumerate': u'ListItem',
+ u'\\begin_layout Itemize': u'ListItem', u'\\begin_layout List': u'List',
+ u'\\begin_layout LyX-Code': u'LyXCode',
+ u'\\begin_layout Plain': u'PlainLayout',
+ u'\\begin_layout Standard': u'StandardLayout',
+ u'\\begin_layout Title': u'Title', u'\\begin_preamble': u'LyXPreamble',
+ u'\\change_deleted': u'ChangeDeleted',
+ u'\\change_inserted': u'ChangeInserted',
+ u'\\change_unchanged': u'BlackBox', u'\\color': u'ColorText',
+ u'\\color inherit': u'BlackBox', u'\\color none': u'BlackBox',
+ u'\\emph default': u'BlackBox', u'\\emph off': u'BlackBox',
+ u'\\emph on': u'EmphaticText', u'\\emph toggle': u'EmphaticText',
+ u'\\end_body': u'LyXFooter', u'\\family': u'TextFamily',
+ u'\\family default': u'BlackBox', u'\\family roman': u'BlackBox',
+ u'\\hfill': u'Hfill', u'\\labelwidthstring': u'BlackBox',
+ u'\\lang': u'LangLine', u'\\length': u'InsetLength',
+ u'\\lyxformat': u'LyXFormat', u'\\lyxline': u'LyXLine',
+ u'\\newline': u'Newline', u'\\newpage': u'NewPage',
+ u'\\noindent': u'BlackBox', u'\\noun default': u'BlackBox',
+ u'\\noun off': u'BlackBox', u'\\noun on': u'VersalitasText',
+ u'\\paragraph_spacing': u'BlackBox', u'\\series bold': u'BoldText',
+ u'\\series default': u'BlackBox', u'\\series medium': u'BlackBox',
+ u'\\shape': u'ShapedText', u'\\shape default': u'BlackBox',
+ u'\\shape up': u'BlackBox', u'\\size': u'SizeText',
+ u'\\size normal': u'BlackBox', u'\\start_of_appendix': u'StartAppendix',
+ u'\\strikeout default': u'BlackBox', u'\\strikeout on': u'StrikeOut',
}
string = {
- u'startcommand':u'\\',
+ u'startcommand': u'\\',
}
table = {
- u'headers':[u'<lyxtabular',u'<features',],
+ u'headers': [u'<lyxtabular', u'<features',],
}
class EscapeConfig(object):
@@ -301,32 +294,32 @@
"Configuration class from elyxer.config file"
chars = {
- u'\n':u'', u' -- ':u' — ', u' --- ':u' — ', u'\'':u'’', u'`':u'‘',
+ u'\n': u'', u' -- ': u' — ', u' --- ': u' — ', u'\'': u'’', u'`': u'‘',
}
commands = {
- u'\\InsetSpace \\space{}':u' ', u'\\InsetSpace \\thinspace{}':u' ',
- u'\\InsetSpace ~':u' ', u'\\SpecialChar \\-':u'',
- u'\\SpecialChar \\@.':u'.', u'\\SpecialChar \\ldots{}':u'…',
- u'\\SpecialChar \\menuseparator':u' ▷ ',
- u'\\SpecialChar \\nobreakdash-':u'-', u'\\SpecialChar \\slash{}':u'/',
- u'\\SpecialChar \\textcompwordmark{}':u'', u'\\backslash':u'\\',
+ u'\\InsetSpace \\space{}': u' ', u'\\InsetSpace \\thinspace{}': u' ',
+ u'\\InsetSpace ~': u' ', u'\\SpecialChar \\-': u'',
+ u'\\SpecialChar \\@.': u'.', u'\\SpecialChar \\ldots{}': u'…',
+ u'\\SpecialChar \\menuseparator': u' ▷ ',
+ u'\\SpecialChar \\nobreakdash-': u'-', u'\\SpecialChar \\slash{}': u'/',
+ u'\\SpecialChar \\textcompwordmark{}': u'', u'\\backslash': u'\\',
}
entities = {
- u'&':u'&', u'<':u'<', u'>':u'>',
+ u'&': u'&', u'<': u'<', u'>': u'>',
}
html = {
- u'/>':u'>',
+ u'/>': u'>',
}
iso885915 = {
- u' ':u' ', u' ':u' ', u' ':u' ',
+ u' ': u' ', u' ': u' ', u' ': u' ',
}
nonunicode = {
- u' ':u' ',
+ u' ': u' ',
}
class FormulaConfig(object):
@@ -333,469 +326,467 @@
"Configuration class from elyxer.config file"
alphacommands = {
- u'\\AA':u'Å', u'\\AE':u'Æ',
- u'\\AmS':u'<span class="versalitas">AmS</span>', u'\\Angstroem':u'Å',
- u'\\DH':u'Ð', u'\\Koppa':u'Ϟ', u'\\L':u'Ł', u'\\Micro':u'µ', u'\\O':u'Ø',
- u'\\OE':u'Œ', u'\\Sampi':u'Ϡ', u'\\Stigma':u'Ϛ', u'\\TH':u'Þ',
- u'\\aa':u'å', u'\\ae':u'æ', u'\\alpha':u'α', u'\\beta':u'β',
- u'\\delta':u'δ', u'\\dh':u'ð', u'\\digamma':u'ϝ', u'\\epsilon':u'ϵ',
- u'\\eta':u'η', u'\\eth':u'ð', u'\\gamma':u'γ', u'\\i':u'ı',
- u'\\imath':u'ı', u'\\iota':u'ι', u'\\j':u'ȷ', u'\\jmath':u'ȷ',
- u'\\kappa':u'κ', u'\\koppa':u'ϟ', u'\\l':u'ł', u'\\lambda':u'λ',
- u'\\mu':u'μ', u'\\nu':u'ν', u'\\o':u'ø', u'\\oe':u'œ', u'\\omega':u'ω',
- u'\\phi':u'φ', u'\\pi':u'π', u'\\psi':u'ψ', u'\\rho':u'ρ',
- u'\\sampi':u'ϡ', u'\\sigma':u'σ', u'\\ss':u'ß', u'\\stigma':u'ϛ',
- u'\\tau':u'τ', u'\\tcohm':u'Ω', u'\\textcrh':u'ħ', u'\\th':u'þ',
- u'\\theta':u'θ', u'\\upsilon':u'υ', u'\\varDelta':u'∆',
- u'\\varGamma':u'Γ', u'\\varLambda':u'Λ', u'\\varOmega':u'Ω',
- u'\\varPhi':u'Φ', u'\\varPi':u'Π', u'\\varPsi':u'Ψ', u'\\varSigma':u'Σ',
- u'\\varTheta':u'Θ', u'\\varUpsilon':u'Υ', u'\\varXi':u'Ξ',
- u'\\varbeta':u'ϐ', u'\\varepsilon':u'ε', u'\\varkappa':u'ϰ',
- u'\\varphi':u'φ', u'\\varpi':u'ϖ', u'\\varrho':u'ϱ', u'\\varsigma':u'ς',
- u'\\vartheta':u'ϑ', u'\\xi':u'ξ', u'\\z...
[truncated message content] |
|
From: <mi...@us...> - 2019-08-28 09:50:39
|
Revision: 8378
http://sourceforge.net/p/docutils/code/8378
Author: milde
Date: 2019-08-28 09:50:37 +0000 (Wed, 28 Aug 2019)
Log Message:
-----------
setup.cfg: Mark wheels as universal
We now have a source tree that's compatible with both Python 2 and
Python 3. Time to indicate this. Huzzah!
A now obsolete 'wheeling' document is removed. None of the caveats it
describes are valid now. The release document is updated.
Signed-off-by: Stephen Finucane <st...@th...>
Modified Paths:
--------------
trunk/docutils/docs/dev/release.txt
trunk/docutils/setup.cfg
Removed Paths:
-------------
trunk/docutils/docs/dev/wheeling.txt
Modified: trunk/docutils/docs/dev/release.txt
===================================================================
--- trunk/docutils/docs/dev/release.txt 2019-08-27 19:49:45 UTC (rev 8377)
+++ trunk/docutils/docs/dev/release.txt 2019-08-28 09:50:37 UTC (rev 8378)
@@ -201,11 +201,9 @@
* **build wheels**::
- python3 setup.py sdist bdist_wheel
- python2 setup.py bdist_wheel
+ python setup.py bdist_wheel
- This builds wheels_ (`pure Python wheels`_ for Python 2 and 3
- respectively) by downloading the new release from pypi.
+ This builds wheels_ by downloading the new release from pypi.
Upload the wheels to PyPI::
Deleted: trunk/docutils/docs/dev/wheeling.txt
===================================================================
--- trunk/docutils/docs/dev/wheeling.txt 2019-08-27 19:49:45 UTC (rev 8377)
+++ trunk/docutils/docs/dev/wheeling.txt 2019-08-28 09:50:37 UTC (rev 8378)
@@ -1,204 +0,0 @@
-===========================
- Docutils_ Building Wheels
-===========================
-
-:Authors: engelbert gruber; open to all Docutils developers
-:Contact: doc...@li...
-:Date: $Date$
-:Revision: $Revision$
-:Copyright: This document has been placed in the public domain.
-
-.. _Docutils: http://docutils.sourceforge.net/
-
-.. contents::
-
-Abstract
---------
-
-This document documents trials to build python wheels from Docutils. Once it
-is finished it might be driven into distribution or release documentation.
-
-Requests
---------
-
-There is `feature request 43`_ : Make setup.py build wheels.
-
- Just add this to setup.cfg:
-
- [bdist_wheel]
- universal = 1
-
-
- .. warning:: Docutils is not fit for Universal Wheels. It supports both
- Python 2 and 3, but with different code (we use “2to3”). This makes it
- a candidate for `Pure Python wheels`_.
-
- As "universal" is false by default, no change to setup.cfg is required.
- The wheel builder detects that the package is pure Python and generates
- wheels for Py2 and Py3 depending under which python version it runs.
-
-and bugs275_ : Upload wheels to pypi
-
- Currently docutils does not publish any wheels on pypi. Wheels make docutils
- faster to install (no need to run setup.py, which for a large number of
- packages can take some time), and is no more difficult than uploading an
- sdist (see https://packaging.python.org/en/latest/distributing.html#wheels
- for instructions).
-
-Logbook
--------
-
-1. Add ``[bdist_wheel] universal = 0`` to setup.cfg.
-2. Run ``python setup.py bdist_wheel``::
-
- error: invalid command 'bdist_wheel'
-
-3. setuptools is too old. Install the new one by wheel or source or pip or
- easy...
-
-4. try wheel ... first get wheel tar.gz and unpack.
-
-5. try ::
-
- python2.7 wheel-0.24.0/wheel install setuptools-15.0-py2.py3-none-any.whl
-
- no error. But still ``error: invalid command 'bdist_wheel'``::
-
- $ python2.7 setup.py --version
- 0.12
-
- Did wheel install ? If no, why no error, if yes in which place ?
-
-
-Logbook: with setuptools branch
--------------------------------
-
-`gitpull/setuptools`_ sandbox branch introduces `setuptools`_ in ``setup.py``.
-
-As of 2015-04-16: **Not working yet**, ``import docutils`` will raise an
-``ImportError``. Need to get packages detected correctly.
-
-Install::
-
- $ svn checkout svn://svn.code.sf.net/p/docutils/code/trunk/sandbox/gitpull/setuptools docutils-setuptools
- $ cd setuptools
- # create a virtualenv (however you like)
- $ pip install -e .
-
-This includes support for generate ``python setup.py bdist_wheel``::
-
- $ python setup.py bdist_wheel
- running bdist_wheel
- running build
- running build_scripts
- installing to build/bdist.linux-x86_64/wheel
- running install
- running install_egg_info
- running egg_info
- writing docutils.egg-info/PKG-INFO
- writing top-level names to docutils.egg-info/top_level.txt
- writing dependency_links to docutils.egg-info/dependency_links.txt
- reading manifest file 'docutils.egg-info/SOURCES.txt'
- reading manifest template 'MANIFEST.in'
- warning: no files found matching 'MANIFEST'
- warning: no files found matching '*' under directory 'extras'
- warning: no previously-included files matching '.cvsignore' found under directory '*'
- warning: no previously-included files matching '*~' found under directory '*'
- warning: no previously-included files matching '.DS_Store' found under directory '*'
- writing manifest file 'docutils.egg-info/SOURCES.txt'
- Copying docutils.egg-info to build/bdist.linux-x86_64/wheel/docutils-0.13.data/purelib/docutils-0.13-py2.7.egg-info
- running install_scripts
- creating build/bdist.linux-x86_64/wheel/docutils-0.13.data/scripts
- copying build/scripts-2.7/rst2pseudoxml.py -> build/bdist.linux-x86_64/wheel/docutils-0.13.data/scripts
- copying build/scripts-2.7/rst2man.py -> build/bdist.linux-x86_64/wheel/docutils-0.13.data/scripts
- copying build/scripts-2.7/rst2odt.py -> build/bdist.linux-x86_64/wheel/docutils-0.13.data/scripts
- copying build/scripts-2.7/rst2latex.py -> build/bdist.linux-x86_64/wheel/docutils-0.13.data/scripts
- copying build/scripts-2.7/rstpep2html.py -> build/bdist.linux-x86_64/wheel/docutils-0.13.data/scripts
- copying build/scripts-2.7/rst2s5.py -> build/bdist.linux-x86_64/wheel/docutils-0.13.data/scripts
- copying build/scripts-2.7/rst2odt_prepstyles.py -> build/bdist.linux-x86_64/wheel/docutils-0.13.data/scripts
- copying build/scripts-2.7/rst2html.py -> build/bdist.linux-x86_64/wheel/docutils-0.13.data/scripts
- copying build/scripts-2.7/rst2html5.py -> build/bdist.linux-x86_64/wheel/docutils-0.13.data/scripts
- copying build/scripts-2.7/rst2xml.py -> build/bdist.linux-x86_64/wheel/docutils-0.13.data/scripts
- copying build/scripts-2.7/rst2xetex.py -> build/bdist.linux-x86_64/wheel/docutils-0.13.data/scripts
- changing mode of build/bdist.linux-x86_64/wheel/docutils-0.13.data/scripts/rst2pseudoxml.py to 755
- changing mode of build/bdist.linux-x86_64/wheel/docutils-0.13.data/scripts/rst2man.py to 755
- changing mode of build/bdist.linux-x86_64/wheel/docutils-0.13.data/scripts/rst2odt.py to 755
- changing mode of build/bdist.linux-x86_64/wheel/docutils-0.13.data/scripts/rst2latex.py to 755
- changing mode of build/bdist.linux-x86_64/wheel/docutils-0.13.data/scripts/rstpep2html.py to 755
- changing mode of build/bdist.linux-x86_64/wheel/docutils-0.13.data/scripts/rst2s5.py to 755
- changing mode of build/bdist.linux-x86_64/wheel/docutils-0.13.data/scripts/rst2odt_prepstyles.py to 755
- changing mode of build/bdist.linux-x86_64/wheel/docutils-0.13.data/scripts/rst2html.py to 755
- changing mode of build/bdist.linux-x86_64/wheel/docutils-0.13.data/scripts/rst2html5.py to 755
- changing mode of build/bdist.linux-x86_64/wheel/docutils-0.13.data/scripts/rst2xml.py to 755
- changing mode of build/bdist.linux-x86_64/wheel/docutils-0.13.data/scripts/rst2xetex.py to 755
- creating build/bdist.linux-x86_64/wheel/docutils-0.13.dist-info/WHEEL
-
-Installation::
-
- # create a fresh virtualenv
- $ pip install -U dist/docutils-0.13-cp27-none-linux_x86_64.whl
- Processing ./dist/docutils-0.13-cp27-none-linux_x86_64.whl
- Installing collected packages: docutils
- Found existing installation: docutils 0.13
- Uninstalling docutils-0.13:
- Successfully uninstalled docutils-0.13
- Successfully installed docutils-0.13
-
-
-Logbook with "pip"
-------------------
-
-Docutils' "setup.py" imports from the stdlib's "distutils" module
-instead of the 3rd party "setuptools". "distutils" cannot build wheels. [#]_
-
-OTOH, pip_ internally uses "setuptools" instead of "distutils". This way, it
-can generate wheels without changes to "setup.py".
-
-1. Install "pip" and "wheels"
-
- Under Debian Gnu/Linux: ``aptitude install python-pip python3-pip``
-
-2. In the repository root directory, run ::
-
- #> pip wheel ./docutils/
- Unpacking ./docutils
- Running setup.py (path:/tmp/pip-Ym9hKL-build/setup.py) egg_info for package from file:///[...]docutils-svn/docutils
-
- warning: no previously-included files matching '.DS_Store' found under directory '*'
- Building wheels for collected packages: docutils
- Running setup.py bdist_wheel for docutils
- Destination directory: /home/milde/Code/Python/docutils-svn/wheelhouse
- Successfully built docutils
- Cleaning up...
-
-3. There is a "pure Python" wheel under
- ``wheelhouse/docutils-0.13-py2-none-any.whl``
-
-4. Repeat with::
-
- #> pip3 wheel ./docutils/
-
- to get ``wheelhouse/docutils-0.13-py3-none-any.whl``
-
-You can also generate wheels for Docutils 0.12 with ``pip wheel docutils``
-and ``pip3 wheel docutils``. The 0.12 archive is downloaded from PIP and
-re-packed as wheel. With "pip3" this includes the 2to3 conversion.
-
-Summary:
- With the "pip" utility, it is possible to generate wheels for Python 2
- and 3 for both, the released and the repository version of Docutils
- without changes to the code base.
-
- The generated wheel can be installed. Installing the Py3k version happens
- "instantaneously".
-
-.. [#] Docutils uses the batteries included with Python and avoids external
- dependencies.
-
-.. _bugs275: https://sourceforge.net/p/docutils/bugs/275/
-.. _pure python wheels:
- https://packaging.python.org/en/latest/distributing.html#pure-python-wheels
-.. _feature request 43: https://sourceforge.net/p/docutils/feature-requests/43/
-.. _gitpull/setuptools: https://sourceforge.net/p/docutils/code/HEAD/tree/trunk/sandbox/gitpull/setuptools/
-.. _setuptools: https://pythonhosted.org/setuptools/
-.. _pip: http://pip.readthedocs.org/en/latest/
Modified: trunk/docutils/setup.cfg
===================================================================
--- trunk/docutils/setup.cfg 2019-08-27 19:49:45 UTC (rev 8377)
+++ trunk/docutils/setup.cfg 2019-08-28 09:50:37 UTC (rev 8378)
@@ -9,6 +9,5 @@
docs/
licenses/
-# [build]
-# executable = /usr/bin/env python
-# Uncomment to keep unchanged in the "shebang line" of front-end scripts
+[bdist_wheel]
+universal = 1
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2019-09-01 19:39:38
|
Revision: 8383
http://sourceforge.net/p/docutils/code/8383
Author: milde
Date: 2019-09-01 19:39:36 +0000 (Sun, 01 Sep 2019)
Log Message:
-----------
Update setup.py
Python 3.4 no longer supported,
more languages supported (and Lithuanian accepted by PyPi).
Modified Paths:
--------------
trunk/docutils/README.txt
trunk/docutils/setup.py
Modified: trunk/docutils/README.txt
===================================================================
--- trunk/docutils/README.txt 2019-09-01 19:39:23 UTC (rev 8382)
+++ trunk/docutils/README.txt 2019-09-01 19:39:36 UTC (rev 8383)
@@ -16,7 +16,7 @@
This is for those who want to get up & running quickly.
-1. Docutils requires Python (version 2.7 or later), available from
+1. Docutils requires Python, available from
http://www.python.org/
@@ -104,10 +104,10 @@
To run the code, Python_ must be installed.
Docutils is compatible with Python versions 2.7, and
-versions 3.5 to 3.7 (cf. `Python 3 compatibility`_).
+3.5 to 3.7 (cf. `Python 3 compatibility`_).
-Docutils uses the following packages for enhanced functionality, if they are
-installed:
+Docutils uses the following packages for enhanced functionality,
+if they are installed:
* The `Python Imaging Library`_, or PIL, is used for some image
manipulation operations.
@@ -125,7 +125,7 @@
Up to version 0.15, the Docutils codebase was translated "on-demand" using
the 2to3 tool. Starting with Docutils 0.16, the code base supports both
-Python 2.7 and 3.4+ natively.
+Python 2.7 and 3.5+ natively.
Project Files & Directories
Modified: trunk/docutils/setup.py
===================================================================
--- trunk/docutils/setup.py 2019-09-01 19:39:23 UTC (rev 8382)
+++ trunk/docutils/setup.py 2019-09-01 19:39:36 UTC (rev 8383)
@@ -10,6 +10,10 @@
try:
import setuptools
+except ImportError:
+ print('Warning: Could not load package `setuptools`.')
+ print('Actions requiring `setuptools` instead of `distutils` will fail')
+try:
from distutils.core import setup, Command
from distutils.command.build import build
from distutils.command.build_py import build_py
@@ -82,7 +86,7 @@
'maintainer_email': 'doc...@li...',
'license': 'public domain, Python, 2-Clause BSD, GPL 3 (see COPYING.txt)',
'platforms': 'OS-independent',
- 'python_requires': '>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
+ 'python_requires': '>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*', !=3.4.*',
'cmdclass': {
'build_data': build_data,
'install_data': smart_install_data,
@@ -147,8 +151,6 @@
'tools/rst2odt.py',
'tools/rst2odt_prepstyles.py',
],
- # BUG pypi did not like following languages
- # 'Natural Language :: Lithuanian',
'classifiers': [
'Development Status :: 4 - Beta',
'Environment :: Console',
@@ -176,6 +178,7 @@
'Natural Language :: Chinese (Simplified)',
'Natural Language :: Chinese (Traditional)',
'Natural Language :: Czech',
+ 'Natural Language :: Danish',
'Natural Language :: Dutch',
'Natural Language :: Esperanto',
'Natural Language :: Finnish',
@@ -182,8 +185,13 @@
'Natural Language :: French',
'Natural Language :: Galician',
'Natural Language :: German',
+ 'Natural Language :: Hebrew',
'Natural Language :: Italian',
'Natural Language :: Japanese',
+ 'Natural Language :: Korean',
+ 'Natural Language :: Latvian',
+ 'Natural Language :: Lithuanian',
+ 'Natural Language :: Persian',
'Natural Language :: Polish',
'Natural Language :: Portuguese (Brazilian)',
'Natural Language :: Russian',
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2019-09-06 13:16:36
|
Revision: 8387
http://sourceforge.net/p/docutils/code/8387
Author: milde
Date: 2019-09-06 13:16:34 +0000 (Fri, 06 Sep 2019)
Log Message:
-----------
Do not rely on `nodes.Node.traverse()` returning a "list" instance.
While the current implementation actually returns a list of nodes,
the docstring specifies only: "Return an iterable ...".
Modified Paths:
--------------
trunk/docutils/docutils/transforms/references.py
trunk/docutils/docutils/transforms/universal.py
trunk/docutils/docutils/writers/latex2e/__init__.py
trunk/docutils/test/test_transforms/test_strip_comments.py
Modified: trunk/docutils/docutils/transforms/references.py
===================================================================
--- trunk/docutils/docutils/transforms/references.py 2019-09-06 13:16:17 UTC (rev 8386)
+++ trunk/docutils/docutils/transforms/references.py 2019-09-06 13:16:34 UTC (rev 8387)
@@ -663,7 +663,7 @@
def apply(self):
defs = self.document.substitution_defs
normed = self.document.substitution_names
- subreflist = self.document.traverse(nodes.substitution_reference)
+ subreflist = list(self.document.traverse(nodes.substitution_reference))
nested = {}
for ref in subreflist:
refname = ref['refname']
Modified: trunk/docutils/docutils/transforms/universal.py
===================================================================
--- trunk/docutils/docutils/transforms/universal.py 2019-09-06 13:16:17 UTC (rev 8386)
+++ trunk/docutils/docutils/transforms/universal.py 2019-09-06 13:16:34 UTC (rev 8387)
@@ -144,7 +144,7 @@
default_priority = 870
def apply(self):
- for node in self.document.traverse(nodes.system_message):
+ for node in list(self.document.traverse(nodes.system_message)):
if node['level'] < self.document.reporter.report_level:
node.parent.remove(node)
@@ -176,7 +176,7 @@
def apply(self):
if self.document.settings.strip_comments:
- for node in self.document.traverse(nodes.comment):
+ for node in list(self.document.traverse(nodes.comment)):
node.parent.remove(node)
@@ -191,27 +191,31 @@
default_priority = 420
def apply(self):
- if not (self.document.settings.strip_elements_with_classes
- or self.document.settings.strip_classes):
+ if self.document.settings.strip_elements_with_classes:
+ self.strip_elements = set(
+ self.document.settings.strip_elements_with_classes)
+ # Iterate over a list as removing the current node
+ # corrupts the iterator returned by `traverse`:
+ for node in list(self.document.traverse(self.check_classes)):
+ node.parent.remove(node)
+
+ if not self.document.settings.strip_classes:
return
- # prepare dicts for lookup (not sets, for Python 2.2 compatibility):
- self.strip_elements = dict(
- [(key, None)
- for key in (self.document.settings.strip_elements_with_classes
- or [])])
- self.strip_classes = dict(
- [(key, None) for key in (self.document.settings.strip_classes
- or [])])
- for node in self.document.traverse(self.check_classes):
- node.parent.remove(node)
+ strip_classes = self.document.settings.strip_classes
+ for node in self.document.traverse(nodes.Element):
+ for class_value in strip_classes:
+ try:
+ node['classes'].remove(class_value)
+ except ValueError:
+ pass
def check_classes(self, node):
- if isinstance(node, nodes.Element):
- for class_value in node['classes'][:]:
- if class_value in self.strip_classes:
- node['classes'].remove(class_value)
- if class_value in self.strip_elements:
- return 1
+ if not isinstance(node, nodes.Element):
+ return False
+ for class_value in node['classes'][:]:
+ if class_value in self.strip_elements:
+ return True
+ return False
class SmartQuotes(Transform):
Modified: trunk/docutils/docutils/writers/latex2e/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/latex2e/__init__.py 2019-09-06 13:16:17 UTC (rev 8386)
+++ trunk/docutils/docutils/writers/latex2e/__init__.py 2019-09-06 13:16:34 UTC (rev 8387)
@@ -1815,13 +1815,11 @@
if self._use_latex_citations:
followup_citation = False
# check for a following citation separated by a space or newline
- next_siblings = node.traverse(descend=False, siblings=True,
- include_self=False)
- if len(next_siblings) > 1:
- next = next_siblings[0]
- if (isinstance(next, nodes.Text) and
- next.astext() in (' ', '\n')):
- if next_siblings[1].__class__ == node.__class__:
+ sibling = node.next_node(descend=False, siblings=True)
+ if (isinstance(sibling, nodes.Text)
+ and sibling.astext() in (' ', '\n')):
+ sibling2 = sibling.next_node(descend=False, siblings=True)
+ if isinstance(sibling2, nodes.citation_reference):
followup_citation = True
if followup_citation:
self.out.append(',')
Modified: trunk/docutils/test/test_transforms/test_strip_comments.py
===================================================================
--- trunk/docutils/test/test_transforms/test_strip_comments.py 2019-09-06 13:16:17 UTC (rev 8386)
+++ trunk/docutils/test/test_transforms/test_strip_comments.py 2019-09-06 13:16:34 UTC (rev 8387)
@@ -31,6 +31,8 @@
=====
Paragraph.
+
+.. second comment
""",
"""\
<document source="test data">
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2019-09-11 20:02:53
|
Revision: 8390
http://sourceforge.net/p/docutils/code/8390
Author: milde
Date: 2019-09-11 20:02:51 +0000 (Wed, 11 Sep 2019)
Log Message:
-----------
Fix informal titles
Fix Topic subtitle.
Use class value "sidebar" instead of "title" for the title in a side bar.
Do not center a rubric.
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/docutils/writers/latex2e/__init__.py
trunk/docutils/test/functional/expected/standalone_rst_latex.tex
trunk/docutils/test/functional/expected/standalone_rst_xetex.tex
trunk/docutils/test/test_writers/test_latex2e.py
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2019-09-11 11:39:13 UTC (rev 8389)
+++ trunk/docutils/HISTORY.txt 2019-09-11 20:02:51 UTC (rev 8390)
@@ -21,6 +21,8 @@
* General
- Dropped support for Python 2.6, 3.3 and 3.4 (work in progress).
+ - Docutils now supports Python 2.7 and Python 3.5+ natively
+ (without conversion by ``2to3``).
- Keep `backslash escapes`__ in the document tree. Backslash characters in
text are be represented by NULL characters in the ``text`` attribute of
Doctree nodes and removed in the writing stage by the node's
@@ -42,6 +44,10 @@
- Patch [ 158 ]: Speed up patterns by saving compiled versions (eric89gxl)
+* docutils/writers/latex2e/__init__.py:
+
+ - Fix topic subtitle, do not center a rubric.
+
* docutils/writers/odf_odt/__init__.py:
- Fix: ElementTree.getchildren deprecated warning
Modified: trunk/docutils/docutils/writers/latex2e/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/latex2e/__init__.py 2019-09-11 11:39:13 UTC (rev 8389)
+++ trunk/docutils/docutils/writers/latex2e/__init__.py 2019-09-11 20:02:51 UTC (rev 8390)
@@ -641,8 +641,7 @@
PreambleCmds.rubric = r"""
% rubric (informal heading)
-\providecommand*{\DUrubric}[1]{%
- \subsubsection*{\centering\textit{\textmd{#1}}}}"""
+\providecommand*{\DUrubric}[1]{\subsubsection*{\emph{#1}}}"""
PreambleCmds.sidebar = r"""
% sidebar (text outside the main text flow)
@@ -2004,7 +2003,7 @@
if self.title:
title += self.title_labels
if self.subtitle:
- title += [r'\\ % subtitle',
+ title += [r'\\',
r'\DUdocumentsubtitle{%s}' % ''.join(self.subtitle)
] + self.subtitle_labels
self.titledata.append(r'\title{%s}' % '%\n '.join(title))
@@ -2891,7 +2890,7 @@
self.d_class.section(self.section_level + 1))
else:
self.fallbacks['subtitle'] = PreambleCmds.subtitle
- self.out.append('\n\\DUsubtitle[%s]{' % node.parent.tagname)
+ self.out.append('\n\\DUsubtitle{')
def depart_subtitle(self, node):
if isinstance(node.parent, nodes.document):
@@ -3046,7 +3045,7 @@
self.fallbacks['title'] = PreambleCmds.title
classes = ','.join(node.parent['classes'])
if not classes:
- classes = node.tagname
+ classes = node.parent.tagname
self.out.append('\n\\DUtitle[%s]{' % classes)
self.context.append('}\n')
# Table caption
Modified: trunk/docutils/test/functional/expected/standalone_rst_latex.tex
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_latex.tex 2019-09-11 11:39:13 UTC (rev 8389)
+++ trunk/docutils/test/functional/expected/standalone_rst_latex.tex 2019-09-11 20:02:51 UTC (rev 8390)
@@ -152,8 +152,7 @@
}{}
% rubric (informal heading)
-\providecommand*{\DUrubric}[1]{%
- \subsubsection*{\centering\textit{\textmd{#1}}}}
+\providecommand*{\DUrubric}[1]{\subsubsection*{\emph{#1}}}
% sidebar (text outside the main text flow)
\providecommand{\DUsidebar}[1]{%
@@ -205,7 +204,7 @@
\title{reStructuredText Test Document%
\label{restructuredtext-test-document}%
\label{doctitle}%
- \\ % subtitle%
+ \\%
\DUdocumentsubtitle{Examples of Syntax Constructs}%
\label{examples-of-syntax-constructs}%
\label{subtitle}}
@@ -1203,9 +1202,9 @@
\emph{Sidebars} are like miniature, parallel documents.
\DUsidebar{
-\DUtitle[title]{Sidebar Title}
+\DUtitle[sidebar]{Sidebar Title}
-\DUsubtitle[sidebar]{Optional Subtitle}
+\DUsubtitle{Optional Subtitle}
This is a sidebar. It is for text outside the flow of the main
text.
Modified: trunk/docutils/test/functional/expected/standalone_rst_xetex.tex
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_xetex.tex 2019-09-11 11:39:13 UTC (rev 8389)
+++ trunk/docutils/test/functional/expected/standalone_rst_xetex.tex 2019-09-11 20:02:51 UTC (rev 8390)
@@ -154,8 +154,7 @@
% rubric (informal heading)
-\providecommand*{\DUrubric}[1]{%
- \subsubsection*{\centering\textit{\textmd{#1}}}}
+\providecommand*{\DUrubric}[1]{\subsubsection*{\emph{#1}}}
% sidebar (text outside the main text flow)
\providecommand{\DUsidebar}[1]{%
@@ -204,7 +203,7 @@
\title{reStructuredText Test Document%
\label{restructuredtext-test-document}%
\label{doctitle}%
- \\ % subtitle%
+ \\%
\DUdocumentsubtitle{Examples of Syntax Constructs}%
\label{examples-of-syntax-constructs}%
\label{subtitle}}
@@ -1205,9 +1204,9 @@
\emph{Sidebars} are like miniature, parallel documents.
\DUsidebar{
-\DUtitle[title]{Sidebar Title}
+\DUtitle[sidebar]{Sidebar Title}
-\DUsubtitle[sidebar]{Optional Subtitle}
+\DUsubtitle{Optional Subtitle}
This is a sidebar. It is for text outside the flow of the main
text.
Modified: trunk/docutils/test/test_writers/test_latex2e.py
===================================================================
--- trunk/docutils/test/test_writers/test_latex2e.py 2019-09-11 11:39:13 UTC (rev 8389)
+++ trunk/docutils/test/test_writers/test_latex2e.py 2019-09-11 20:02:51 UTC (rev 8390)
@@ -929,7 +929,7 @@
}
""", titledata=r"""\title{This is the \emph{Title}%
\label{this-is-the-title}%
- \\ % subtitle%
+ \\%
\DUdocumentsubtitle{This is the \emph{Subtitle}}%
\label{this-is-the-subtitle}}
\author{}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2019-09-14 12:32:46
|
Revision: 8391
http://sourceforge.net/p/docutils/code/8391
Author: milde
Date: 2019-09-14 12:32:44 +0000 (Sat, 14 Sep 2019)
Log Message:
-----------
Fix [ 339 ] don't use "alltt" in admonitions and footnotes.
Includes some other minor cleanups for the LaTeX writer.
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/docs/user/latex.txt
trunk/docutils/docutils/writers/latex2e/__init__.py
trunk/docutils/test/functional/expected/latex_literal_block.tex
trunk/docutils/test/functional/expected/latex_literal_block_fancyvrb.tex
trunk/docutils/test/functional/expected/latex_literal_block_listings.tex
trunk/docutils/test/functional/expected/latex_literal_block_verbatim.tex
trunk/docutils/test/functional/expected/latex_literal_block_verbatimtab.tex
trunk/docutils/test/functional/expected/standalone_rst_latex.tex
trunk/docutils/test/functional/expected/standalone_rst_xetex.tex
trunk/docutils/test/functional/input/latex_literal_block.txt
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2019-09-11 20:02:51 UTC (rev 8390)
+++ trunk/docutils/HISTORY.txt 2019-09-14 12:32:44 UTC (rev 8391)
@@ -46,7 +46,10 @@
* docutils/writers/latex2e/__init__.py:
- - Fix topic subtitle, do not center a rubric.
+ - Fix topic subtitle.
+ - Make "rubric" bold-italic and left aligned.
+ - Fix [ 339 ] don't use "alltt" or literal-block-environment
+ in admonitions and footnotes.
* docutils/writers/odf_odt/__init__.py:
@@ -61,7 +64,7 @@
- Fix: 377 ResourceWarning: unclosed file python3.8
Close alltests.out with atexit.
-* test/functional/tests/*
+* test/functional/tests/*
- Fix: 377 ResourceWarning: unclosed file python3.8
Read defaults file with context.
@@ -73,7 +76,7 @@
* test/test_writers/test_odt.py:
- Fix [ 359 ]: Test suite failes on Python 3.8. odt xml sorting.
- Use ElementTree instead of minidom.
+ Use ElementTree instead of minidom.
Release 0.15.1 (2019-07-24)
===========================
Modified: trunk/docutils/docs/user/latex.txt
===================================================================
--- trunk/docutils/docs/user/latex.txt 2019-09-11 20:02:51 UTC (rev 8390)
+++ trunk/docutils/docs/user/latex.txt 2019-09-14 12:32:44 UTC (rev 8391)
@@ -185,7 +185,7 @@
*Block level elements*
are wrapped in "class environments":
``\begin{DUclass}`` calls the optional styling command
- ``\DUCLASSe«classargument»{}``, ``\end{DUclass}`` tries
+ ``\DUCLASS«classargument»{}``, ``\end{DUclass}`` tries
``\endDUCLASS«classargument»``.
Customization is done by defining matching macros or environments.
@@ -196,7 +196,7 @@
*Inline elements*
The LaTeX function ``\textsc`` sets the argument in small caps::
- \newcommand{\DUrolesmallcaps}[1]{\textsc{#1}}
+ \newcommand{\DUrolecustom}[1]{\textsc{#1}}
*Block-level elements*
The LaTeX directive (macro without argument) ``\scshape`` switches to
@@ -215,8 +215,7 @@
{\end{enumerate}}%
}
-Notes
-`````
+.. rubric:: Notes
* Class arguments may contain numbers and hyphens, which need special
treatment in LaTeX command names (see `class directive`_). The commands
Modified: trunk/docutils/docutils/writers/latex2e/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/latex2e/__init__.py 2019-09-11 20:02:51 UTC (rev 8390)
+++ trunk/docutils/docutils/writers/latex2e/__init__.py 2019-09-14 12:32:44 UTC (rev 8391)
@@ -212,9 +212,11 @@
['--use-bibtex'],
{'default': ''}),
# TODO: implement "latex footnotes" alternative
- ('Footnotes with numbers/symbols by Docutils. (currently ignored)',
+ ('Footnotes with numbers/symbols by Docutils. (default) '
+ '(The alternative, --latex-footnotes, is not implemented yet.)',
['--docutils-footnotes'],
- {'default': True, 'action': 'store_true',
+ {'default': True,
+ 'action': 'store_true',
'validator': frontend.validate_boolean}),
),)
@@ -652,7 +654,7 @@
}"""
PreambleCmds.subtitle = r"""
-% subtitle (for topic/sidebar)
+% subtitle (for sidebar)
\providecommand*{\DUsubtitle}[1]{\par\emph{#1}\smallskip}"""
PreambleCmds.documentsubtitle = r"""
@@ -1695,7 +1697,7 @@
if cls != 'admonition']
self.out.append('\n\\DUadmonition[%s]{' % ','.join(node['classes']))
- def depart_admonition(self, node=None):
+ def depart_admonition(self, node):
self.out.append('}\n')
def visit_author(self, node):
@@ -1773,7 +1775,6 @@
self.out.append( '}' )
def visit_citation(self, node):
- # TODO maybe use cite bibitems
if self._use_latex_citations:
self.push_output_collector([])
else:
@@ -1784,6 +1785,7 @@
def depart_citation(self, node):
if self._use_latex_citations:
+ # TODO: normalize label
label = self.out[0]
text = ''.join(self.out[1:])
self._bibitems.append([label, text])
@@ -1813,7 +1815,7 @@
followup_citation = False
# check for a following citation separated by a space or newline
sibling = node.next_node(descend=False, siblings=True)
- if (isinstance(sibling, nodes.Text)
+ if (isinstance(sibling, nodes.Text)
and sibling.astext() in (' ', '\n')):
sibling2 = sibling.next_node(descend=False, siblings=True)
if isinstance(sibling2, nodes.citation_reference):
@@ -2188,12 +2190,11 @@
self._enumeration_counters.pop()
def visit_field(self, node):
- # real output is done in siblings: _argument, _body, _name
+ # output is done in field_argument, field_body, field_name
pass
def depart_field(self, node):
pass
- ##self.out.append('%[depart_field]\n')
def visit_field_body(self, node):
pass
@@ -2497,7 +2498,7 @@
#
# In both cases, we want to use a typewriter/monospaced typeface.
# For "real" literal-blocks, we can use \verbatim, while for all
- # the others we must use \mbox or \alltt.
+ # the others we must use \ttfamily and \raggedright.
#
# We can distinguish between the two kinds by the number of
# siblings that compose this node: if it is composed by a
@@ -2520,27 +2521,31 @@
'Verbatim': r'\usepackage{fancyvrb}',
'verbatimtab': r'\usepackage{moreverb}'}
- environment = self.literal_block_env
+ literal_env = self.literal_block_env
+
+ # Check, if it is possible to use a literal-block environment
+ _plaintext = self.is_plaintext(node)
_in_table = self.active_table.is_open()
# TODO: fails if normal text precedes the literal block.
# Check parent node instead?
_autowidth_table = _in_table and self.active_table.colwidths_auto
- _plaintext = self.is_plaintext(node)
- _listings = (environment == 'lstlisting') and _plaintext
+ _use_env = _plaintext and not isinstance(node.parent,
+ (nodes.footnote, nodes.admonition))
+ _use_listings = (literal_env == 'lstlisting') and _use_env
# Labels and classes:
if node.get('ids'):
self.out += ['\n'] + self.ids_to_labels(node)
self.duclass_open(node)
+ # Highlight code?
if (not _plaintext and 'code' in node['classes']
and self.settings.syntax_highlight != 'none'):
self.requirements['color'] = PreambleCmds.color
self.fallbacks['code'] = PreambleCmds.highlight_rules
-
- # Wrapper?
- if _in_table and _plaintext and not _autowidth_table:
- # minipage prevents extra vertical space with alltt
- # and verbatim-like environments
+ # Wrap?
+ if _in_table and _use_env and not _autowidth_table:
+ # Wrap in minipage to prevent extra vertical space
+ # with alltt and verbatim-like environments:
self.fallbacks['ttem'] = '\n'.join(['',
r'% character width in monospaced font',
r'\newlength{\ttemwidth}',
@@ -2548,8 +2553,8 @@
self.out.append('\\begin{minipage}{%d\\ttemwidth}\n' %
(max(len(line) for line in node.astext().split('\n'))))
self.context.append('\n\\end{minipage}\n')
- elif not _in_table and not _listings:
- # wrap in quote to set off vertically and indent
+ elif not _in_table and not _use_listings:
+ # Wrap in quote to set off vertically and indent
self.out.append('\\begin{quote}\n')
self.context.append('\n\\end{quote}\n')
else:
@@ -2556,18 +2561,20 @@
self.context.append('\n')
# Use verbatim-like environment, if defined and possible
- if environment and _plaintext and (not _autowidth_table or _listings):
+ # (in an auto-width table, only listings works):
+ if literal_env and _use_env and (not _autowidth_table
+ or _use_listings):
try:
- self.requirements['literal_block'] = packages[environment]
+ self.requirements['literal_block'] = packages[literal_env]
except KeyError:
pass
self.verbatim = True
- if _in_table and _listings:
+ if _in_table and _use_listings:
self.out.append('\\lstset{xleftmargin=0pt}\n')
self.out.append('\\begin{%s}%s\n' %
- (environment, self.literal_block_options))
- self.context.append('\n\\end{%s}' % environment)
- elif _plaintext and not _autowidth_table:
+ (literal_env, self.literal_block_options))
+ self.context.append('\n\\end{%s}' % literal_env)
+ elif _use_env and not _autowidth_table:
self.alltt = True
self.requirements['alltt'] = r'\usepackage{alltt}'
self.out.append('\\begin{alltt}\n')
@@ -2922,7 +2929,7 @@
def depart_system_message(self, node):
self.out.append(self.context.pop())
- self.depart_admonition()
+ self.depart_admonition(node)
def visit_table(self, node):
self.requirements['table'] = PreambleCmds.table
@@ -2974,8 +2981,7 @@
return
self.out.append('%\n')
# do we need an anchor (\phantomsection)?
- set_anchor = not(isinstance(node.parent, nodes.caption) or
- isinstance(node.parent, nodes.title))
+ set_anchor = not isinstance(node.parent, (nodes.caption, nodes.title))
# TODO: where else can/must we omit the \phantomsection?
self.out += self.ids_to_labels(node, set_anchor)
Modified: trunk/docutils/test/functional/expected/latex_literal_block.tex
===================================================================
--- trunk/docutils/test/functional/expected/latex_literal_block.tex 2019-09-11 20:02:51 UTC (rev 8390)
+++ trunk/docutils/test/functional/expected/latex_literal_block.tex 2019-09-14 12:32:44 UTC (rev 8391)
@@ -30,6 +30,18 @@
\csname \DocutilsClassFunctionName \endcsname}%
{\csname end\DocutilsClassFunctionName \endcsname}%
\fi
+
+% admonition (specially marked topic)
+\providecommand{\DUadmonition}[2][class-arg]{%
+ % try \DUadmonition#1{#2}:
+ \ifcsname DUadmonition#1\endcsname%
+ \csname DUadmonition#1\endcsname{#2}%
+ \else
+ \begin{center}
+ \fbox{\parbox{0.9\linewidth}{#2}}
+ \end{center}
+ \fi
+}
% numeric or symbol footnotes with hyperlinks
\providecommand*{\DUfootnotemark}[3]{%
\raisebox{1em}{\hypertarget{#1}{}}%
@@ -64,6 +76,16 @@
\usepackage{fixltx2e} % since 2015 loaded by default
\fi
+% title for topics, admonitions, unsupported section levels, and sidebar
+\providecommand*{\DUtitle}[2][class-arg]{%
+ % call \DUtitle#1{#2} if it exists:
+ \ifcsname DUtitle#1\endcsname%
+ \csname DUtitle#1\endcsname{#2}%
+ \else
+ \smallskip\noindent\textbf{#2}\smallskip%
+ \fi
+}
+
% titlereference role
\providecommand*{\DUroletitlereference}[1]{\textsl{#1}}
@@ -82,9 +104,11 @@
\begin{document}
In LaTeX, literal blocks can be customized with the \textquotedbl{}literal-block-env\textquotedbl{}
-setting. This test file exists to check the latex writer output compiles and
-looks as expected. Start with a plain literal block:
+setting. This test file exists to check if the LaTeX writer output compiles
+and looks as expected.
+Start with a plain literal block:
+
\begin{quote}
\begin{alltt}
$\textbackslash{}sin^2(x)$ and $\textbackslash{}cos^2(x)$ equals one:
@@ -142,6 +166,17 @@
\hline
\end{longtable*}
+\DUadmonition[note]{
+\DUtitle[note]{Note}
+
+A literal block in an admonition:
+
+\begin{quote}
+\ttfamily\raggedright
+\textbackslash{}sin\textasciicircum{}2~x
+\end{quote}
+}
+
Parsed literal block with inline markup and leading whitespace:
\begin{quote}
@@ -168,6 +203,13 @@
%
\DUfootnotetext{id3}{id1}{*}{%
This footnote is referenced in a \DUroletitlereference{parsed literal} block.
+
+It contains a literal block:
+
+\begin{quote}
+\ttfamily\raggedright
+\textbackslash{}sin\textasciicircum{}2~x
+\end{quote}
}
\begin{figure}[b]\raisebox{1em}{\hypertarget{cit2002}{}}[CIT2002]
Sample Citation, 2017.
Modified: trunk/docutils/test/functional/expected/latex_literal_block_fancyvrb.tex
===================================================================
--- trunk/docutils/test/functional/expected/latex_literal_block_fancyvrb.tex 2019-09-11 20:02:51 UTC (rev 8390)
+++ trunk/docutils/test/functional/expected/latex_literal_block_fancyvrb.tex 2019-09-14 12:32:44 UTC (rev 8391)
@@ -30,6 +30,18 @@
\csname \DocutilsClassFunctionName \endcsname}%
{\csname end\DocutilsClassFunctionName \endcsname}%
\fi
+
+% admonition (specially marked topic)
+\providecommand{\DUadmonition}[2][class-arg]{%
+ % try \DUadmonition#1{#2}:
+ \ifcsname DUadmonition#1\endcsname%
+ \csname DUadmonition#1\endcsname{#2}%
+ \else
+ \begin{center}
+ \fbox{\parbox{0.9\linewidth}{#2}}
+ \end{center}
+ \fi
+}
% numeric or symbol footnotes with hyperlinks
\providecommand*{\DUfootnotemark}[3]{%
\raisebox{1em}{\hypertarget{#1}{}}%
@@ -64,6 +76,16 @@
\usepackage{fixltx2e} % since 2015 loaded by default
\fi
+% title for topics, admonitions, unsupported section levels, and sidebar
+\providecommand*{\DUtitle}[2][class-arg]{%
+ % call \DUtitle#1{#2} if it exists:
+ \ifcsname DUtitle#1\endcsname%
+ \csname DUtitle#1\endcsname{#2}%
+ \else
+ \smallskip\noindent\textbf{#2}\smallskip%
+ \fi
+}
+
% titlereference role
\providecommand*{\DUroletitlereference}[1]{\textsl{#1}}
@@ -82,9 +104,11 @@
\begin{document}
In LaTeX, literal blocks can be customized with the \textquotedbl{}literal-block-env\textquotedbl{}
-setting. This test file exists to check the latex writer output compiles and
-looks as expected. Start with a plain literal block:
+setting. This test file exists to check if the LaTeX writer output compiles
+and looks as expected.
+Start with a plain literal block:
+
\begin{quote}
\begin{Verbatim}
$\sin^2(x)$ and $\cos^2(x)$ equals one:
@@ -142,6 +166,17 @@
\hline
\end{longtable*}
+\DUadmonition[note]{
+\DUtitle[note]{Note}
+
+A literal block in an admonition:
+
+\begin{quote}
+\ttfamily\raggedright
+\textbackslash{}sin\textasciicircum{}2~x
+\end{quote}
+}
+
Parsed literal block with inline markup and leading whitespace:
\begin{quote}
@@ -168,6 +203,13 @@
%
\DUfootnotetext{id3}{id1}{*}{%
This footnote is referenced in a \DUroletitlereference{parsed literal} block.
+
+It contains a literal block:
+
+\begin{quote}
+\ttfamily\raggedright
+\textbackslash{}sin\textasciicircum{}2~x
+\end{quote}
}
\begin{figure}[b]\raisebox{1em}{\hypertarget{cit2002}{}}[CIT2002]
Sample Citation, 2017.
Modified: trunk/docutils/test/functional/expected/latex_literal_block_listings.tex
===================================================================
--- trunk/docutils/test/functional/expected/latex_literal_block_listings.tex 2019-09-11 20:02:51 UTC (rev 8390)
+++ trunk/docutils/test/functional/expected/latex_literal_block_listings.tex 2019-09-14 12:32:44 UTC (rev 8391)
@@ -36,6 +36,18 @@
\csname \DocutilsClassFunctionName \endcsname}%
{\csname end\DocutilsClassFunctionName \endcsname}%
\fi
+
+% admonition (specially marked topic)
+\providecommand{\DUadmonition}[2][class-arg]{%
+ % try \DUadmonition#1{#2}:
+ \ifcsname DUadmonition#1\endcsname%
+ \csname DUadmonition#1\endcsname{#2}%
+ \else
+ \begin{center}
+ \fbox{\parbox{0.9\linewidth}{#2}}
+ \end{center}
+ \fi
+}
% numeric or symbol footnotes with hyperlinks
\providecommand*{\DUfootnotemark}[3]{%
\raisebox{1em}{\hypertarget{#1}{}}%
@@ -70,6 +82,16 @@
\usepackage{fixltx2e} % since 2015 loaded by default
\fi
+% title for topics, admonitions, unsupported section levels, and sidebar
+\providecommand*{\DUtitle}[2][class-arg]{%
+ % call \DUtitle#1{#2} if it exists:
+ \ifcsname DUtitle#1\endcsname%
+ \csname DUtitle#1\endcsname{#2}%
+ \else
+ \smallskip\noindent\textbf{#2}\smallskip%
+ \fi
+}
+
% titlereference role
\providecommand*{\DUroletitlereference}[1]{\textsl{#1}}
@@ -88,9 +110,11 @@
\begin{document}
In LaTeX, literal blocks can be customized with the \textquotedbl{}literal-block-env\textquotedbl{}
-setting. This test file exists to check the latex writer output compiles and
-looks as expected. Start with a plain literal block:
+setting. This test file exists to check if the LaTeX writer output compiles
+and looks as expected.
+Start with a plain literal block:
+
\begin{lstlisting}
$\sin^2(x)$ and $\cos^2(x)$ equals one:
@@ -147,6 +171,17 @@
\hline
\end{longtable*}
+\DUadmonition[note]{
+\DUtitle[note]{Note}
+
+A literal block in an admonition:
+
+\begin{quote}
+\ttfamily\raggedright
+\textbackslash{}sin\textasciicircum{}2~x
+\end{quote}
+}
+
Parsed literal block with inline markup and leading whitespace:
\begin{quote}
@@ -173,6 +208,13 @@
%
\DUfootnotetext{id3}{id1}{*}{%
This footnote is referenced in a \DUroletitlereference{parsed literal} block.
+
+It contains a literal block:
+
+\begin{quote}
+\ttfamily\raggedright
+\textbackslash{}sin\textasciicircum{}2~x
+\end{quote}
}
\begin{figure}[b]\raisebox{1em}{\hypertarget{cit2002}{}}[CIT2002]
Sample Citation, 2017.
Modified: trunk/docutils/test/functional/expected/latex_literal_block_verbatim.tex
===================================================================
--- trunk/docutils/test/functional/expected/latex_literal_block_verbatim.tex 2019-09-11 20:02:51 UTC (rev 8390)
+++ trunk/docutils/test/functional/expected/latex_literal_block_verbatim.tex 2019-09-14 12:32:44 UTC (rev 8391)
@@ -29,6 +29,18 @@
\csname \DocutilsClassFunctionName \endcsname}%
{\csname end\DocutilsClassFunctionName \endcsname}%
\fi
+
+% admonition (specially marked topic)
+\providecommand{\DUadmonition}[2][class-arg]{%
+ % try \DUadmonition#1{#2}:
+ \ifcsname DUadmonition#1\endcsname%
+ \csname DUadmonition#1\endcsname{#2}%
+ \else
+ \begin{center}
+ \fbox{\parbox{0.9\linewidth}{#2}}
+ \end{center}
+ \fi
+}
% numeric or symbol footnotes with hyperlinks
\providecommand*{\DUfootnotemark}[3]{%
\raisebox{1em}{\hypertarget{#1}{}}%
@@ -63,6 +75,16 @@
\usepackage{fixltx2e} % since 2015 loaded by default
\fi
+% title for topics, admonitions, unsupported section levels, and sidebar
+\providecommand*{\DUtitle}[2][class-arg]{%
+ % call \DUtitle#1{#2} if it exists:
+ \ifcsname DUtitle#1\endcsname%
+ \csname DUtitle#1\endcsname{#2}%
+ \else
+ \smallskip\noindent\textbf{#2}\smallskip%
+ \fi
+}
+
% titlereference role
\providecommand*{\DUroletitlereference}[1]{\textsl{#1}}
@@ -81,9 +103,11 @@
\begin{document}
In LaTeX, literal blocks can be customized with the \textquotedbl{}literal-block-env\textquotedbl{}
-setting. This test file exists to check the latex writer output compiles and
-looks as expected. Start with a plain literal block:
+setting. This test file exists to check if the LaTeX writer output compiles
+and looks as expected.
+Start with a plain literal block:
+
\begin{quote}
\begin{verbatim}
$\sin^2(x)$ and $\cos^2(x)$ equals one:
@@ -141,6 +165,17 @@
\hline
\end{longtable*}
+\DUadmonition[note]{
+\DUtitle[note]{Note}
+
+A literal block in an admonition:
+
+\begin{quote}
+\ttfamily\raggedright
+\textbackslash{}sin\textasciicircum{}2~x
+\end{quote}
+}
+
Parsed literal block with inline markup and leading whitespace:
\begin{quote}
@@ -167,6 +202,13 @@
%
\DUfootnotetext{id3}{id1}{*}{%
This footnote is referenced in a \DUroletitlereference{parsed literal} block.
+
+It contains a literal block:
+
+\begin{quote}
+\ttfamily\raggedright
+\textbackslash{}sin\textasciicircum{}2~x
+\end{quote}
}
\begin{figure}[b]\raisebox{1em}{\hypertarget{cit2002}{}}[CIT2002]
Sample Citation, 2017.
Modified: trunk/docutils/test/functional/expected/latex_literal_block_verbatimtab.tex
===================================================================
--- trunk/docutils/test/functional/expected/latex_literal_block_verbatimtab.tex 2019-09-11 20:02:51 UTC (rev 8390)
+++ trunk/docutils/test/functional/expected/latex_literal_block_verbatimtab.tex 2019-09-14 12:32:44 UTC (rev 8391)
@@ -30,6 +30,18 @@
\csname \DocutilsClassFunctionName \endcsname}%
{\csname end\DocutilsClassFunctionName \endcsname}%
\fi
+
+% admonition (specially marked topic)
+\providecommand{\DUadmonition}[2][class-arg]{%
+ % try \DUadmonition#1{#2}:
+ \ifcsname DUadmonition#1\endcsname%
+ \csname DUadmonition#1\endcsname{#2}%
+ \else
+ \begin{center}
+ \fbox{\parbox{0.9\linewidth}{#2}}
+ \end{center}
+ \fi
+}
% numeric or symbol footnotes with hyperlinks
\providecommand*{\DUfootnotemark}[3]{%
\raisebox{1em}{\hypertarget{#1}{}}%
@@ -64,6 +76,16 @@
\usepackage{fixltx2e} % since 2015 loaded by default
\fi
+% title for topics, admonitions, unsupported section levels, and sidebar
+\providecommand*{\DUtitle}[2][class-arg]{%
+ % call \DUtitle#1{#2} if it exists:
+ \ifcsname DUtitle#1\endcsname%
+ \csname DUtitle#1\endcsname{#2}%
+ \else
+ \smallskip\noindent\textbf{#2}\smallskip%
+ \fi
+}
+
% titlereference role
\providecommand*{\DUroletitlereference}[1]{\textsl{#1}}
@@ -82,9 +104,11 @@
\begin{document}
In LaTeX, literal blocks can be customized with the \textquotedbl{}literal-block-env\textquotedbl{}
-setting. This test file exists to check the latex writer output compiles and
-looks as expected. Start with a plain literal block:
+setting. This test file exists to check if the LaTeX writer output compiles
+and looks as expected.
+Start with a plain literal block:
+
\begin{quote}
\begin{verbatimtab}
$\sin^2(x)$ and $\cos^2(x)$ equals one:
@@ -142,6 +166,17 @@
\hline
\end{longtable*}
+\DUadmonition[note]{
+\DUtitle[note]{Note}
+
+A literal block in an admonition:
+
+\begin{quote}
+\ttfamily\raggedright
+\textbackslash{}sin\textasciicircum{}2~x
+\end{quote}
+}
+
Parsed literal block with inline markup and leading whitespace:
\begin{quote}
@@ -168,6 +203,13 @@
%
\DUfootnotetext{id3}{id1}{*}{%
This footnote is referenced in a \DUroletitlereference{parsed literal} block.
+
+It contains a literal block:
+
+\begin{quote}
+\ttfamily\raggedright
+\textbackslash{}sin\textasciicircum{}2~x
+\end{quote}
}
\begin{figure}[b]\raisebox{1em}{\hypertarget{cit2002}{}}[CIT2002]
Sample Citation, 2017.
Modified: trunk/docutils/test/functional/expected/standalone_rst_latex.tex
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_latex.tex 2019-09-11 20:02:51 UTC (rev 8390)
+++ trunk/docutils/test/functional/expected/standalone_rst_latex.tex 2019-09-14 12:32:44 UTC (rev 8391)
@@ -161,7 +161,7 @@
\end{center}
}
-% subtitle (for topic/sidebar)
+% subtitle (for sidebar)
\providecommand*{\DUsubtitle}[1]{\par\emph{#1}\smallskip}
% text mode subscript
Modified: trunk/docutils/test/functional/expected/standalone_rst_xetex.tex
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_xetex.tex 2019-09-11 20:02:51 UTC (rev 8390)
+++ trunk/docutils/test/functional/expected/standalone_rst_xetex.tex 2019-09-14 12:32:44 UTC (rev 8391)
@@ -163,7 +163,7 @@
\end{center}
}
-% subtitle (for topic/sidebar)
+% subtitle (for sidebar)
\providecommand*{\DUsubtitle}[1]{\par\emph{#1}\smallskip}
% text mode subscript
Modified: trunk/docutils/test/functional/input/latex_literal_block.txt
===================================================================
--- trunk/docutils/test/functional/input/latex_literal_block.txt 2019-09-11 20:02:51 UTC (rev 8390)
+++ trunk/docutils/test/functional/input/latex_literal_block.txt 2019-09-14 12:32:44 UTC (rev 8391)
@@ -1,7 +1,9 @@
In LaTeX, literal blocks can be customized with the "literal-block-env"
-setting. This test file exists to check the latex writer output compiles and
-looks as expected. Start with a plain literal block::
+setting. This test file exists to check if the LaTeX writer output compiles
+and looks as expected.
+Start with a plain literal block::
+
$\sin^2(x)$ and $\cos^2(x)$ equals one:
\[
@@ -38,6 +40,10 @@
\sin^2 x
==== =========== ====
+.. note:: A literal block in an admonition::
+
+ \sin^2 x
+
.. role:: custom
.. role:: custom-role
@@ -63,7 +69,14 @@
:custom:`custom` :custom-role:`roles`, and explicit roles for
:title:`Docutils`' :emphasis:`standard` :strong:`inline` :literal:`markup`.
-.. [*] This footnote is referenced in a `parsed literal` block.
+.. [*] This footnote is referenced in a `parsed literal` block.
+
+ It contains a literal block::
+
+ \sin^2 x
+
.. [CIT2002] Sample Citation, 2017.
+
.. _external: http://www.python.org/
+
.. |EXAMPLE| image:: ../../../docs/user/rst/images/biohazard.png
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2019-09-17 08:41:23
|
Revision: 8392
http://sourceforge.net/p/docutils/code/8392
Author: milde
Date: 2019-09-17 08:41:21 +0000 (Tue, 17 Sep 2019)
Log Message:
-----------
LaTeX writer: Deprecation warning for ``\docutilsrole``-prefix.
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/RELEASE-NOTES.txt
trunk/docutils/docs/user/latex.txt
trunk/docutils/docutils/writers/latex2e/__init__.py
trunk/docutils/test/functional/expected/latex_literal_block.tex
trunk/docutils/test/functional/expected/latex_literal_block_fancyvrb.tex
trunk/docutils/test/functional/expected/latex_literal_block_listings.tex
trunk/docutils/test/functional/expected/latex_literal_block_verbatim.tex
trunk/docutils/test/functional/expected/latex_literal_block_verbatimtab.tex
trunk/docutils/test/functional/expected/standalone_rst_latex.tex
trunk/docutils/test/functional/expected/standalone_rst_xetex.tex
trunk/docutils/test/test_writers/test_latex2e.py
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2019-09-14 12:32:44 UTC (rev 8391)
+++ trunk/docutils/HISTORY.txt 2019-09-17 08:41:21 UTC (rev 8392)
@@ -50,6 +50,7 @@
- Make "rubric" bold-italic and left aligned.
- Fix [ 339 ] don't use "alltt" or literal-block-environment
in admonitions and footnotes.
+ - Deprecation warning for ``\docutilsrole``-prefixed styling commands.
* docutils/writers/odf_odt/__init__.py:
Modified: trunk/docutils/RELEASE-NOTES.txt
===================================================================
--- trunk/docutils/RELEASE-NOTES.txt 2019-09-14 12:32:44 UTC (rev 8391)
+++ trunk/docutils/RELEASE-NOTES.txt 2019-09-17 08:41:21 UTC (rev 8392)
@@ -22,12 +22,13 @@
Future changes
==============
-* The "latex" writer will handle admonitions like other block-level elements
- and wrap them in a "DUclass" environment. The current implementation fails
- with some content, see docs/user/latex.txt and
- https://sourceforge.net/p/docutils/bugs/339/
+* The "latex" writer will wrap admonitions in a "DUclass" environment.
If your custom stylesheets modify "\DUadmonition" to style admonitions,
- you will need to adapt them after upgrading to versions > 0.15.
+ you will need to adapt them after upgrading to versions > 0.16.
+ Styling commands using ``\docutilsrole`` prefix will be ignored
+ in versions > 0.16 (see `Generating LaTeX with Docutils`__).
+
+ __ docs/user/latex.html#classes
* Remove the `handle_io_errors` option from io.FileInput/Output.
Used by Sphinx up to version 1.3.1, fixed in 1.3.2 (Nov 29, 2015).
@@ -72,7 +73,13 @@
__ http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#escaping-mechanism
+* LaTeX writer:
+ - Informal titles of type "rubric" default to bold-italic and left aligned.
+ - Deprecate ``\docutilsrole`` prefix for styling commands:
+ use ``\DUrole`` instead.
+
+
Release 0.15
============
Modified: trunk/docutils/docs/user/latex.txt
===================================================================
--- trunk/docutils/docs/user/latex.txt 2019-09-14 12:32:44 UTC (rev 8391)
+++ trunk/docutils/docs/user/latex.txt 2019-09-17 08:41:21 UTC (rev 8392)
@@ -468,17 +468,22 @@
../ref/rst/directives.html#specific-admonitions
Example 2:
- Use ``.. note::`` for a margin note::
+ Print admonitions in the margin::
+ \newcommand{\DUadmonition}[2][class-arg]{\marginpar{#2}}
+
+ Make sure there is enough space to fit the note.
+ See also the marginnote_ package.
+
+Example 3:
+ Use the ``.. note::`` admonition for a margin note::
+
\newcommand{\DUadmonitionnote}[1]{\marginpar{#1}}
Make sure there is enough space to fit the note.
- See also the marginnote_ and pdfcomment_ packages.
.. _marginnote:
http://mirror.ctan.org/help/Catalogue/entries/marginnote.html
-.. _pdfcomment:
- http://mirror.ctan.org/help/Catalogue/entries/pdfcomment.html
.. _custom role:
Modified: trunk/docutils/docutils/writers/latex2e/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/latex2e/__init__.py 2019-09-14 12:32:44 UTC (rev 8391)
+++ trunk/docutils/docutils/writers/latex2e/__init__.py 2019-09-17 08:41:21 UTC (rev 8392)
@@ -578,6 +578,8 @@
\else
% backwards compatibility: try \docutilsrole#1{#2}
\ifcsname docutilsrole#1\endcsname%
+ \PackageWarningNoLine{docutils}{Command prefix "docutilsrole" is
+ deprecated, \MessageBreak use `\protect\DUrole #1`}
\csname docutilsrole#1\endcsname{#2}%
\else%
#2%
Modified: trunk/docutils/test/functional/expected/latex_literal_block.tex
===================================================================
--- trunk/docutils/test/functional/expected/latex_literal_block.tex 2019-09-14 12:32:44 UTC (rev 8391)
+++ trunk/docutils/test/functional/expected/latex_literal_block.tex 2019-09-17 08:41:21 UTC (rev 8392)
@@ -64,6 +64,8 @@
\else
% backwards compatibility: try \docutilsrole#1{#2}
\ifcsname docutilsrole#1\endcsname%
+ \PackageWarningNoLine{docutils}{Command prefix "docutilsrole" is
+ deprecated, \MessageBreak use `\protect\DUrole #1`}
\csname docutilsrole#1\endcsname{#2}%
\else%
#2%
Modified: trunk/docutils/test/functional/expected/latex_literal_block_fancyvrb.tex
===================================================================
--- trunk/docutils/test/functional/expected/latex_literal_block_fancyvrb.tex 2019-09-14 12:32:44 UTC (rev 8391)
+++ trunk/docutils/test/functional/expected/latex_literal_block_fancyvrb.tex 2019-09-17 08:41:21 UTC (rev 8392)
@@ -64,6 +64,8 @@
\else
% backwards compatibility: try \docutilsrole#1{#2}
\ifcsname docutilsrole#1\endcsname%
+ \PackageWarningNoLine{docutils}{Command prefix "docutilsrole" is
+ deprecated, \MessageBreak use `\protect\DUrole #1`}
\csname docutilsrole#1\endcsname{#2}%
\else%
#2%
Modified: trunk/docutils/test/functional/expected/latex_literal_block_listings.tex
===================================================================
--- trunk/docutils/test/functional/expected/latex_literal_block_listings.tex 2019-09-14 12:32:44 UTC (rev 8391)
+++ trunk/docutils/test/functional/expected/latex_literal_block_listings.tex 2019-09-17 08:41:21 UTC (rev 8392)
@@ -70,6 +70,8 @@
\else
% backwards compatibility: try \docutilsrole#1{#2}
\ifcsname docutilsrole#1\endcsname%
+ \PackageWarningNoLine{docutils}{Command prefix "docutilsrole" is
+ deprecated, \MessageBreak use `\protect\DUrole #1`}
\csname docutilsrole#1\endcsname{#2}%
\else%
#2%
Modified: trunk/docutils/test/functional/expected/latex_literal_block_verbatim.tex
===================================================================
--- trunk/docutils/test/functional/expected/latex_literal_block_verbatim.tex 2019-09-14 12:32:44 UTC (rev 8391)
+++ trunk/docutils/test/functional/expected/latex_literal_block_verbatim.tex 2019-09-17 08:41:21 UTC (rev 8392)
@@ -63,6 +63,8 @@
\else
% backwards compatibility: try \docutilsrole#1{#2}
\ifcsname docutilsrole#1\endcsname%
+ \PackageWarningNoLine{docutils}{Command prefix "docutilsrole" is
+ deprecated, \MessageBreak use `\protect\DUrole #1`}
\csname docutilsrole#1\endcsname{#2}%
\else%
#2%
Modified: trunk/docutils/test/functional/expected/latex_literal_block_verbatimtab.tex
===================================================================
--- trunk/docutils/test/functional/expected/latex_literal_block_verbatimtab.tex 2019-09-14 12:32:44 UTC (rev 8391)
+++ trunk/docutils/test/functional/expected/latex_literal_block_verbatimtab.tex 2019-09-17 08:41:21 UTC (rev 8392)
@@ -64,6 +64,8 @@
\else
% backwards compatibility: try \docutilsrole#1{#2}
\ifcsname docutilsrole#1\endcsname%
+ \PackageWarningNoLine{docutils}{Command prefix "docutilsrole" is
+ deprecated, \MessageBreak use `\protect\DUrole #1`}
\csname docutilsrole#1\endcsname{#2}%
\else%
#2%
Modified: trunk/docutils/test/functional/expected/standalone_rst_latex.tex
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_latex.tex 2019-09-14 12:32:44 UTC (rev 8391)
+++ trunk/docutils/test/functional/expected/standalone_rst_latex.tex 2019-09-17 08:41:21 UTC (rev 8392)
@@ -109,6 +109,8 @@
\else
% backwards compatibility: try \docutilsrole#1{#2}
\ifcsname docutilsrole#1\endcsname%
+ \PackageWarningNoLine{docutils}{Command prefix "docutilsrole" is
+ deprecated, \MessageBreak use `\protect\DUrole #1`}
\csname docutilsrole#1\endcsname{#2}%
\else%
#2%
Modified: trunk/docutils/test/functional/expected/standalone_rst_xetex.tex
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_xetex.tex 2019-09-14 12:32:44 UTC (rev 8391)
+++ trunk/docutils/test/functional/expected/standalone_rst_xetex.tex 2019-09-17 08:41:21 UTC (rev 8392)
@@ -108,6 +108,8 @@
\else
% backwards compatibility: try \docutilsrole#1{#2}
\ifcsname docutilsrole#1\endcsname%
+ \PackageWarningNoLine{docutils}{Command prefix "docutilsrole" is
+ deprecated, \MessageBreak use `\protect\DUrole #1`}
\csname docutilsrole#1\endcsname{#2}%
\else%
#2%
Modified: trunk/docutils/test/test_writers/test_latex2e.py
===================================================================
--- trunk/docutils/test/test_writers/test_latex2e.py 2019-09-14 12:32:44 UTC (rev 8391)
+++ trunk/docutils/test/test_writers/test_latex2e.py 2019-09-17 08:41:21 UTC (rev 8392)
@@ -84,6 +84,8 @@
\else
% backwards compatibility: try \docutilsrole#1{#2}
\ifcsname docutilsrole#1\endcsname%
+ \PackageWarningNoLine{docutils}{Command prefix "docutilsrole" is
+ deprecated, \MessageBreak use `\protect\DUrole #1`}
\csname docutilsrole#1\endcsname{#2}%
\else%
#2%
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2019-09-18 10:13:02
|
Revision: 8393
http://sourceforge.net/p/docutils/code/8393
Author: milde
Date: 2019-09-18 10:13:00 +0000 (Wed, 18 Sep 2019)
Log Message:
-----------
Future warning for Node.traverse().
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/RELEASE-NOTES.txt
trunk/docutils/docutils/nodes.py
trunk/docutils/docutils/transforms/universal.py
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2019-09-17 08:41:21 UTC (rev 8392)
+++ trunk/docutils/HISTORY.txt 2019-09-18 10:13:00 UTC (rev 8393)
@@ -20,7 +20,7 @@
* General
- - Dropped support for Python 2.6, 3.3 and 3.4 (work in progress).
+ - Dropped support for Python 2.6, 3.3 and 3.4
- Docutils now supports Python 2.7 and Python 3.5+ natively
(without conversion by ``2to3``).
- Keep `backslash escapes`__ in the document tree. Backslash characters in
@@ -30,19 +30,25 @@
__ http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#escaping-mechanism
-* docutils/utils/__init__.py
+* docutils/nodes.py
- - unescape() definition moved to `nodes` to avoid circular import
- dependency. Fixes [ 366 ].
+ - Speed up Node.next_node().
+ - Warn about Node.traverse() returning an iterator instead of a list
+ in future.
+* docutils/statemachine.py
+
+ - Patch [ 158 ]: Speed up patterns by saving compiled versions (eric89gxl)
+
* docutils/transforms/universal.py
- Fix [ 332 ]: Standard backslash escape for smartquotes.
- Fix [ 342 ]: No escape in roles descending from `inline literal`.
-* docutils/statemachine.py
+* docutils/utils/__init__.py
- - Patch [ 158 ]: Speed up patterns by saving compiled versions (eric89gxl)
+ - unescape() definition moved to `nodes` to avoid circular import
+ dependency. Fixes [ 366 ].
* docutils/writers/latex2e/__init__.py:
@@ -79,6 +85,7 @@
- Fix [ 359 ]: Test suite failes on Python 3.8. odt xml sorting.
Use ElementTree instead of minidom.
+
Release 0.15.1 (2019-07-24)
===========================
Modified: trunk/docutils/RELEASE-NOTES.txt
===================================================================
--- trunk/docutils/RELEASE-NOTES.txt 2019-09-17 08:41:21 UTC (rev 8392)
+++ trunk/docutils/RELEASE-NOTES.txt 2019-09-18 10:13:00 UTC (rev 8393)
@@ -23,16 +23,18 @@
==============
* The "latex" writer will wrap admonitions in a "DUclass" environment.
- If your custom stylesheets modify "\DUadmonition" to style admonitions,
- you will need to adapt them after upgrading to versions > 0.16.
+ Stylesheets modifying "\DUadmonition" will need to adapt.
+
Styling commands using ``\docutilsrole`` prefix will be ignored
in versions > 0.16 (see `Generating LaTeX with Docutils`__).
-
+
__ docs/user/latex.html#classes
* Remove the `handle_io_errors` option from io.FileInput/Output.
Used by Sphinx up to version 1.3.1, fixed in 1.3.2 (Nov 29, 2015).
+* Node.traverse() will return an iterator instead of a list.
+
* Remove `utils.unique_combinations` (obsoleted by `itertools.combinations`).
* The default HTML writer "html" with frontend ``rst2html.py`` may change
Modified: trunk/docutils/docutils/nodes.py
===================================================================
--- trunk/docutils/docutils/nodes.py 2019-09-17 08:41:21 UTC (rev 8392)
+++ trunk/docutils/docutils/nodes.py 2019-09-18 10:13:00 UTC (rev 8393)
@@ -33,6 +33,28 @@
unicode = str # noqa
basestring = str # noqa
+
+class _traversal_list():
+ # auxiliary class to report a FutureWarning
+
+ def __init__(self, iterable):
+ self.nodes = list(iterable)
+
+ def __getattr__(self, name):
+ msg = ("The iterable returned by Node.traverse()\n "
+ "will become an iterator instead of a list in "
+ "Docutils > 0.16.")
+ warnings.warn(msg, FutureWarning, stacklevel=2)
+ return getattr(self.nodes, name)
+
+ def __iter__(self):
+ return iter(self.nodes)
+
+ def __len__(self):
+ # used in Python 2.7 when typecasting to `list` or `tuple`
+ return len(self.nodes)
+
+
# ==============================
# Functional Node Base Classes
# ==============================
@@ -254,7 +276,7 @@
# value, the implementation returned a list up to v. 0.15. Some 3rd
# party code still relies on this (e.g. Sphinx as of 2019-09-07).
# Therefore, let's return a list until this is sorted out:
- return list(self._traverse(condition, include_self,
+ return _traversal_list(self._traverse(condition, include_self,
descend, siblings, ascend))
def _traverse(self, condition=None, include_self=True, descend=True,
Modified: trunk/docutils/docutils/transforms/universal.py
===================================================================
--- trunk/docutils/docutils/transforms/universal.py 2019-09-17 08:41:21 UTC (rev 8392)
+++ trunk/docutils/docutils/transforms/universal.py 2019-09-18 10:13:00 UTC (rev 8393)
@@ -144,7 +144,7 @@
default_priority = 870
def apply(self):
- for node in list(self.document.traverse(nodes.system_message)):
+ for node in tuple(self.document.traverse(nodes.system_message)):
if node['level'] < self.document.reporter.report_level:
node.parent.remove(node)
@@ -176,7 +176,7 @@
def apply(self):
if self.document.settings.strip_comments:
- for node in list(self.document.traverse(nodes.comment)):
+ for node in tuple(self.document.traverse(nodes.comment)):
node.parent.remove(node)
@@ -194,9 +194,9 @@
if self.document.settings.strip_elements_with_classes:
self.strip_elements = set(
self.document.settings.strip_elements_with_classes)
- # Iterate over a list as removing the current node
+ # Iterate over a tuple as removing the current node
# corrupts the iterator returned by `traverse`:
- for node in list(self.document.traverse(self.check_classes)):
+ for node in tuple(self.document.traverse(self.check_classes)):
node.parent.remove(node)
if not self.document.settings.strip_classes:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2019-09-18 10:13:19
|
Revision: 8394
http://sourceforge.net/p/docutils/code/8394
Author: milde
Date: 2019-09-18 10:13:17 +0000 (Wed, 18 Sep 2019)
Log Message:
-----------
Remove the `handle_io_errors` option from io.FileInput/Output.
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/RELEASE-NOTES.txt
trunk/docutils/docutils/io.py
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2019-09-18 10:13:00 UTC (rev 8393)
+++ trunk/docutils/HISTORY.txt 2019-09-18 10:13:17 UTC (rev 8394)
@@ -30,6 +30,10 @@
__ http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#escaping-mechanism
+* docutils/io.py
+
+ - Remove the `handle_io_errors` option from io.FileInput/Output.
+
* docutils/nodes.py
- Speed up Node.next_node().
Modified: trunk/docutils/RELEASE-NOTES.txt
===================================================================
--- trunk/docutils/RELEASE-NOTES.txt 2019-09-18 10:13:00 UTC (rev 8393)
+++ trunk/docutils/RELEASE-NOTES.txt 2019-09-18 10:13:17 UTC (rev 8394)
@@ -30,9 +30,6 @@
__ docs/user/latex.html#classes
-* Remove the `handle_io_errors` option from io.FileInput/Output.
- Used by Sphinx up to version 1.3.1, fixed in 1.3.2 (Nov 29, 2015).
-
* Node.traverse() will return an iterator instead of a list.
* Remove `utils.unique_combinations` (obsoleted by `itertools.combinations`).
@@ -49,11 +46,7 @@
.. _rst2html.py: docs/user/tools.html#rst2html-py
-* Allow escaping of author-separators in `bibliographic fields`__.
- __ docs/ref/rst/restructuredtext.html#bibliographic-fields
-
-
Release 0.16
============
@@ -71,10 +64,13 @@
* reStructuredText:
- - Keep `backslash escapes`__ in the document tree.
+ - Keep `backslash escapes`__ in the document tree. This allows, e.g.,
+ escaping of author-separators in `bibliographic fields`__.
__ http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#escaping-mechanism
+ __ docs/ref/rst/restructuredtext.html#bibliographic-fields
+
* LaTeX writer:
- Informal titles of type "rubric" default to bold-italic and left aligned.
@@ -81,7 +77,11 @@
- Deprecate ``\docutilsrole`` prefix for styling commands:
use ``\DUrole`` instead.
+* docutils/io.py
+ - Remove the `handle_io_errors` option from io.FileInput/Output.
+
+
Release 0.15
============
Modified: trunk/docutils/docutils/io.py
===================================================================
--- trunk/docutils/docutils/io.py 2019-09-18 10:13:00 UTC (rev 8393)
+++ trunk/docutils/docutils/io.py 2019-09-18 10:13:17 UTC (rev 8394)
@@ -208,7 +208,7 @@
def __init__(self, source=None, source_path=None,
encoding=None, error_handler='strict',
autoclose=True,
- mode='r' if sys.version_info >= (3, 0) else 'rU', **kwargs):
+ mode='r' if sys.version_info >= (3, 0) else 'rU'):
"""
:Parameters:
- `source`: either a file-like object (which is read directly), or
@@ -220,21 +220,11 @@
`sys.stdin` is the source).
- `mode`: how the file is to be opened (see standard function
`open`). The default 'rU' provides universal newline support
- for text files on Python < 3.4.
+ for text files with Python 2.x.
"""
Input.__init__(self, source, source_path, encoding, error_handler)
self.autoclose = autoclose
self._stderr = ErrorOutput()
- # deprecation warning
- for key in kwargs:
- if key == 'handle_io_errors':
- sys.stderr.write('deprecation warning: '
- 'io.FileInput() argument `handle_io_errors` '
- 'is ignored since Docutils 0.10 (2012-12-16) '
- 'and will soon be removed.')
- else:
- raise TypeError('__init__() got an unexpected keyword '
- "argument '%s'" % key)
if source is None:
if source_path:
@@ -244,7 +234,6 @@
'errors': self.error_handler}
else:
kwargs = {}
-
try:
self.source = open(source_path, mode, **kwargs)
except IOError as error:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2019-09-19 13:59:11
|
Revision: 8396
http://sourceforge.net/p/docutils/code/8396
Author: milde
Date: 2019-09-19 13:59:09 +0000 (Thu, 19 Sep 2019)
Log Message:
-----------
HTML fixes and updates.
Remove dead code.
Remove unused class value "first" for topic-title.
Fix/update CSS stylesheets for html5 writer.
Modified Paths:
--------------
trunk/docutils/docutils/writers/_html_base.py
trunk/docutils/docutils/writers/html5_polyglot/__init__.py
trunk/docutils/docutils/writers/html5_polyglot/minimal.css
trunk/docutils/docutils/writers/html5_polyglot/plain.css
trunk/docutils/test/functional/expected/pep_html.html
trunk/docutils/test/functional/expected/standalone_rst_html4css1.html
trunk/docutils/test/functional/expected/standalone_rst_html5.html
trunk/docutils/test/functional/expected/standalone_rst_s5_html_1.html
trunk/docutils/test/functional/expected/standalone_rst_s5_html_2.html
trunk/docutils/test/functional/input/standalone_rst_html5.txt
Modified: trunk/docutils/docutils/writers/_html_base.py
===================================================================
--- trunk/docutils/docutils/writers/_html_base.py 2019-09-18 10:13:40 UTC (rev 8395)
+++ trunk/docutils/docutils/writers/_html_base.py 2019-09-19 13:59:09 UTC (rev 8396)
@@ -1514,11 +1514,10 @@
def visit_title(self, node):
"""Only 6 section levels are supported by HTML."""
- check_id = 0 # TODO: is this a bool (False) or a counter?
close_tag = '</p>\n'
if isinstance(node.parent, nodes.topic):
self.body.append(
- self.starttag(node, 'p', '', CLASS='topic-title first'))
+ self.starttag(node, 'p', '', CLASS='topic-title'))
elif isinstance(node.parent, nodes.sidebar):
self.body.append(
self.starttag(node, 'p', '', CLASS='sidebar-title'))
Modified: trunk/docutils/docutils/writers/html5_polyglot/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/html5_polyglot/__init__.py 2019-09-18 10:13:40 UTC (rev 8395)
+++ trunk/docutils/docutils/writers/html5_polyglot/__init__.py 2019-09-19 13:59:09 UTC (rev 8396)
@@ -217,7 +217,3 @@
# TODO: use the new HTML5 element <section>?
# def visit_section(self, node):
# def depart_section(self, node):
-
- # TODO: use the new HTML5 element <aside>?
- # def visit_topic(self, node):
- # def depart_topic(self, node):
Modified: trunk/docutils/docutils/writers/html5_polyglot/minimal.css
===================================================================
--- trunk/docutils/docutils/writers/html5_polyglot/minimal.css 2019-09-18 10:13:40 UTC (rev 8395)
+++ trunk/docutils/docutils/writers/html5_polyglot/minimal.css 2019-09-19 13:59:09 UTC (rev 8396)
@@ -32,10 +32,10 @@
h1.title, p.subtitle {
text-align: center;
}
-p.admonition-title,
p.topic-title,
p.sidebar-title,
p.rubric,
+p.admonition-title,
p.system-message-title {
font-weight: bold;
}
@@ -93,7 +93,7 @@
}
/* Table of Contents */
-div.topic.contents { margin: 0; }
+div.topic.contents { margin: 0.5em 0; }
div.topic.contents ul {
list-style-type: none;
padding-left: 1.5em;
@@ -152,7 +152,7 @@
dd.authors > p { margin: 0; }
/* Option Lists */
-dl.option-list { margin-left: 40px; }
+dl.option-list { margin-left: 1.5em; }
dl.option-list > dt { font-weight: normal; }
span.option { white-space: nowrap; }
@@ -189,11 +189,7 @@
}
.figure.align-center,
img.align-center,
-object.align-center {
- margin-left: auto;
- margin-right: auto;
- display: block;
-}
+object.align-center,
table.align-center {
margin-left: auto;
margin-right: auto;
@@ -204,6 +200,11 @@
table.align-right {
margin-left: auto;
}
+.figure.align-center, .figure.align-right,
+img.align-center, img.align-right,
+object.align-center, object.align-right {
+ display: block;
+}
/* reset inner alignment in figures and tables */
/* div.align-left, div.align-center, div.align-right, */
table.align-left, table.align-center, table.align-right
@@ -212,15 +213,19 @@
/* Admonitions and System Messages */
div.admonition,
div.system-message,
-div.sidebar{
- margin: 40px;
+div.sidebar,
+aside.sidebar {
+ margin: 1em 1.5em;
border: medium outset;
+ padding-top: 0.5em;
+ padding-bottom: 0.5em;
padding-right: 1em;
padding-left: 1em;
}
/* Sidebar */
-div.sidebar {
+div.sidebar,
+aside.sidebar {
width: 30%;
max-width: 26em;
float: right;
@@ -235,13 +240,8 @@
pre.math,
pre.code {
margin-left: 1.5em;
- margin-right: 1.5em
+ margin-right: 1.5em;
}
-pre.literal-block,
-pre.doctest-block,
-pre.math,
-pre.code {
- font-family: monospace;
pre.code .ln { color: gray; } /* line numbers */
/* Tables */
@@ -265,3 +265,14 @@
padding: 0;
padding-right: 0.5em /* separate table cells */
}
+
+/* Document Header and Footer */
+/* div.header, */
+/* header { border-bottom: 1px solid black; } */
+/* div.footer, */
+/* footer { border-top: 1px solid black; } */
+
+/* new HTML5 block elements: set display for older browsers */
+header, section, footer, aside, nav, main, article, figure {
+ display: block;
+}
Modified: trunk/docutils/docutils/writers/html5_polyglot/plain.css
===================================================================
--- trunk/docutils/docutils/writers/html5_polyglot/plain.css 2019-09-18 10:13:40 UTC (rev 8395)
+++ trunk/docutils/docutils/writers/html5_polyglot/plain.css 2019-09-19 13:59:09 UTC (rev 8396)
@@ -48,32 +48,33 @@
clear: both;
}
-/* Paragraphs */
-/* ========== */
+/* Paragraphs */
+/* ========== */
/* vertical space (parskip) */
p, ol, ul, dl,
div.line-block,
-table{
+div.topic,
+table {
margin-top: 0.5em;
margin-bottom: 0.5em;
}
+p:first-child { margin-top: 0; }
+/* (:last-child is new in CSS 3) */
+p:last-child { margin-bottom: 0; }
+
h1, h2, h3, h4, h5, h6,
dl > dd {
margin-bottom: 0.5em;
}
-/* Lists */
-/* ========== */
+/* Lists */
+/* ===== */
-/* Definition Lists */
+/* Definition Lists */
-dl > dd > p:first-child { margin-top: 0; }
-/* :last-child is not part of CSS 2.1 (introduced in CSS 3) */
-dl > dd > p:last-child { margin-bottom: 0; }
-
/* lists nested in definition lists */
-/* :only-child is not part of CSS 2.1 (introduced in CSS 3) */
+/* (:only-child is new in CSS 3) */
dd > ul:only-child, dd > ol:only-child { padding-left: 1em; }
/* Description Lists */
@@ -122,13 +123,20 @@
font-weight: normal;
}
-/* Text Blocks */
-/* ============ */
+/* Text Blocks */
+/* =========== */
-/* Literal Blocks */
+/* Literal Blocks */
-/* Block Quotes */
+pre.literal-block,
+pre.doctest-block,
+pre.math,
+pre.code {
+ font-family: monospace;
+}
+/* Block Quotes */
+
blockquote > table,
div.topic > table {
margin-top: 0;
@@ -140,8 +148,8 @@
margin-left: 20%;
}
-/* Tables */
-/* ====== */
+/* Tables */
+/* ====== */
/* th { vertical-align: bottom; } */
@@ -168,11 +176,11 @@
font-weight: bold;
}
-/* Explicit Markup Blocks */
-/* ====================== */
+/* Explicit Markup Blocks */
+/* ====================== */
-/* Footnotes and Citations */
-/* ----------------------- */
+/* Footnotes and Citations */
+/* ----------------------- */
/* line on the left */
dl.footnote {
@@ -181,11 +189,11 @@
border-left-width: thin;
}
-/* Directives */
-/* ---------- */
+/* Directives */
+/* ---------- */
-/* Body Elements */
-/* ~~~~~~~~~~~~~ */
+/* Body Elements */
+/* ~~~~~~~~~~~~~ */
/* Images and Figures */
@@ -211,13 +219,13 @@
/* Sidebar */
-/* Move into the margin. In a layout with fixed margins, */
-/* it can be moved into the margin completely. */
+/* Move right. In a layout with fixed margins, */
+/* it can be moved into the margin. */
div.sidebar {
width: 30%;
max-width: 26em;
margin-left: 1em;
- margin-right: -5.5%;
+ margin-right: -2%;
background-color: #ffffee ;
}
@@ -238,44 +246,49 @@
/* Math */
/* styled separately (see math.css for math-output=HTML) */
-/* Epigraph */
-/* Highlights */
-/* Pull-Quote */
-/* Compound Paragraph */
-/* Container */
+/* Epigraph */
+/* Highlights */
+/* Pull-Quote */
+/* Compound Paragraph */
+/* Container */
/* can be styled in a custom stylesheet */
/* Document Header and Footer */
+footer, header,
div.footer, div.header {
+ font-size: smaller;
clear: both;
- font-size: smaller;
+ padding: 0.5em 2%;
+ background-color: #ebebee;
+ border: none;
}
-/* Inline Markup */
-/* ============= */
+/* Inline Markup */
+/* ============= */
-/* Emphasis */
-/* em */
-/* Strong Emphasis */
-/* strong */
-/* Interpreted Text */
-/* span.interpreted */
-/* Title Reference */
-/* cite */
-/* Inline Literals */
+/* Emphasis */
+/* em */
+/* Strong Emphasis */
+/* strong */
+/* Interpreted Text */
+/* span.interpreted */
+/* Title Reference */
+/* cite */
+
+/* Inline Literals */
/* possible values: normal, nowrap, pre, pre-wrap, pre-line */
-/* span.docutils.literal { white-space: pre-wrap; } */
+/* span.docutils.literal { white-space: pre-wrap; } */
-/* Hyperlink References */
+/* Hyperlink References */
a { text-decoration: none; }
-/* External Targets */
-/* span.target.external */
-/* Internal Targets */
-/* span.target.internal */
-/* Footnote References */
-/* a.footnote-reference */
-/* Citation References */
-/* a.citation-reference */
+/* External Targets */
+/* span.target.external */
+/* Internal Targets */
+/* span.target.internal */
+/* Footnote References */
+/* a.footnote-reference */
+/* Citation References */
+/* a.citation-reference */
Modified: trunk/docutils/test/functional/expected/pep_html.html
===================================================================
--- trunk/docutils/test/functional/expected/pep_html.html 2019-09-18 10:13:40 UTC (rev 8395)
+++ trunk/docutils/test/functional/expected/pep_html.html 2019-09-19 13:59:09 UTC (rev 8396)
@@ -55,7 +55,7 @@
</table>
<hr />
<div class="contents topic" id="contents">
-<p class="topic-title first">Contents</p>
+<p class="topic-title">Contents</p>
<ul class="simple">
<li><a class="reference internal" href="#abstract" id="id5">Abstract</a></li>
<li><a class="reference internal" href="#copyright" id="id6">Copyright</a></li>
Modified: trunk/docutils/test/functional/expected/standalone_rst_html4css1.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_html4css1.html 2019-09-18 10:13:40 UTC (rev 8395)
+++ trunk/docutils/test/functional/expected/standalone_rst_html4css1.html 2019-09-19 13:59:09 UTC (rev 8396)
@@ -70,11 +70,11 @@
</tbody>
</table>
<div class="dedication topic">
-<p class="topic-title first">Dedication</p>
+<p class="topic-title">Dedication</p>
<p>For Docutils users & co-developers.</p>
</div>
<div class="abstract topic">
-<p class="topic-title first">Abstract</p>
+<p class="topic-title">Abstract</p>
<p>This is a test document, containing at least one example of each
reStructuredText construct.</p>
</div>
@@ -84,7 +84,7 @@
They are transformed from section titles after parsing. -->
<!-- bibliographic fields (which also require a transform): -->
<div class="contents topic" id="table-of-contents">
-<p class="topic-title first">Table of Contents</p>
+<p class="topic-title">Table of Contents</p>
<ul class="auto-toc simple">
<li><a class="reference internal" href="#structural-elements" id="id34">1 Structural Elements</a><ul class="auto-toc">
<li><a class="reference internal" href="#section-title" id="id35">1.1 Section Title</a></li>
@@ -819,7 +819,7 @@
<p>A <em>topic</em> is like a block quote with a title, or a self-contained section
with no subsections.</p>
<div class="topic">
-<p class="topic-title first">Topic Title</p>
+<p class="topic-title">Topic Title</p>
<p>This is a topic.</p>
</div>
<p>A <em>rubric</em> is like an informal heading that doesn't correspond to the
Modified: trunk/docutils/test/functional/expected/standalone_rst_html5.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_html5.html 2019-09-18 10:13:40 UTC (rev 8395)
+++ trunk/docutils/test/functional/expected/standalone_rst_html5.html 2019-09-19 13:59:09 UTC (rev 8396)
@@ -70,11 +70,11 @@
</dd>
</dl>
<div class="dedication topic">
-<p class="topic-title first">Dedication</p>
+<p class="topic-title">Dedication</p>
<p>For Docutils users & co-developers.</p>
</div>
<div class="abstract topic">
-<p class="topic-title first">Abstract</p>
+<p class="topic-title">Abstract</p>
<p>This is a test document, containing at least one example of each
reStructuredText construct.</p>
</div>
@@ -84,7 +84,7 @@
They are transformed from section titles after parsing. -->
<!-- bibliographic fields (which also require a transform): -->
<div class="contents topic" id="table-of-contents">
-<p class="topic-title first">Table of Contents</p>
+<p class="topic-title">Table of Contents</p>
<ul class="auto-toc simple">
<li><p><a class="reference internal" href="#structural-elements" id="id38"><span class="sectnum">1</span> Structural Elements</a></p>
<ul class="auto-toc">
@@ -806,7 +806,7 @@
<p>A <em>topic</em> is like a block quote with a title, or a self-contained section
with no subsections.</p>
<div class="topic">
-<p class="topic-title first">Topic Title</p>
+<p class="topic-title">Topic Title</p>
<p>This is a topic.</p>
</div>
<p>A <em>rubric</em> is like an informal heading that doesn't correspond to the
@@ -1387,7 +1387,8 @@
</div>
<div class="section" id="field-list-variants">
<h3><a class="toc-backref" href="#id84"><span class="sectnum">3.2.2</span> Field list variants</a></h3>
-<p>For field lists, the "compact/open", "narrow" and "run-in" styles are defined.</p>
+<p>For field lists, the "compact/open", "narrow" and "run-in" styles are defined
+in the style sheet <span class="docutils literal">plain.css</span>.</p>
<dl class="simple">
<dt><em>compact</em></dt>
<dd><dl class="compact field-list simple">
@@ -1567,7 +1568,7 @@
<div class="footer">
<hr class="footer" />
<p>Document footer</p>
-<p><a class="reference external" href="http://www.w3.org/TR/html5/"><img alt="Conforms to HTML 5" src="http://www.w3.org/html/logo/badge/html5-badge-h-css3-semantics.png" style="width: 88px; height: 31px;" /></a> <a class="reference external" href="http://validator.w3.org/check?uri=referer"><img alt="Check validity!" src="https://validator-suite.w3.org/icons/vs-blue-256.png" style="width: 88px; height: 31px;" /></a> <a class="reference external" href="http://jigsaw.w3.org/css-validator/check/referer"><img alt="Valid CSS 2.1!" src="http://jigsaw.w3.org/css-validator/images/vcss" style="width: 88px; height: 31px;" /></a></p>
+<p><a class="reference external" href="http://www.w3.org/TR/html5/"><img alt="Conforms to HTML 5" src="http://www.w3.org/html/logo/badge/html5-badge-h-css3-semantics.png" style="width: 88px; height: 31px;" /></a> <a class="reference external" href="http://validator.w3.org/check?uri=referer"><img alt="Check validity!" src="https://www.w3.org/Icons/ValidatorSuite/vs-blue-190.png" style="width: 88px; height: 31px;" /></a> <a class="reference external" href="http://jigsaw.w3.org/css-validator/check/referer"><img alt="Valid CSS 2.1!" src="http://jigsaw.w3.org/css-validator/images/vcss" style="width: 88px; height: 31px;" /></a></p>
</div>
</body>
Modified: trunk/docutils/test/functional/expected/standalone_rst_s5_html_1.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_s5_html_1.html 2019-09-18 10:13:40 UTC (rev 8395)
+++ trunk/docutils/test/functional/expected/standalone_rst_s5_html_1.html 2019-09-19 13:59:09 UTC (rev 8396)
@@ -69,7 +69,7 @@
<!-- Incremental Display
=================== -->
<div class="contents handout topic" id="contents">
-<p class="topic-title first">Contents</p>
+<p class="topic-title">Contents</p>
<ul class="simple">
<li><a class="reference internal" href="#introduction" id="id1">Introduction</a></li>
<li><a class="reference internal" href="#features-1" id="id2">Features (1)</a></li>
Modified: trunk/docutils/test/functional/expected/standalone_rst_s5_html_2.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_s5_html_2.html 2019-09-18 10:13:40 UTC (rev 8395)
+++ trunk/docutils/test/functional/expected/standalone_rst_s5_html_2.html 2019-09-19 13:59:09 UTC (rev 8396)
@@ -65,7 +65,7 @@
<!-- Incremental Display
=================== -->
<div class="contents handout topic" id="contents">
-<p class="topic-title first">Contents</p>
+<p class="topic-title">Contents</p>
<ul class="simple">
<li><a class="reference internal" href="#introduction" id="id1">Introduction</a></li>
<li><a class="reference internal" href="#features-1" id="id2">Features (1)</a></li>
Modified: trunk/docutils/test/functional/input/standalone_rst_html5.txt
===================================================================
--- trunk/docutils/test/functional/input/standalone_rst_html5.txt 2019-09-18 10:13:40 UTC (rev 8395)
+++ trunk/docutils/test/functional/input/standalone_rst_html5.txt 2019-09-19 13:59:09 UTC (rev 8396)
@@ -87,7 +87,8 @@
Field list variants
```````````````````
-For field lists, the "compact/open", "narrow" and "run-in" styles are defined.
+For field lists, the "compact/open", "narrow" and "run-in" styles are defined
+in the style sheet ``plain.css``.
*compact*
.. class:: compact
@@ -194,7 +195,7 @@
:alt: Conforms to HTML 5
:target: http://www.w3.org/TR/html5/
-.. |validator| image:: https://validator-suite.w3.org/icons/vs-blue-256.png
+.. |validator| image:: https://www.w3.org/Icons/ValidatorSuite/vs-blue-190.png
:height: 31
:width: 88
:alt: Check validity!
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2019-09-20 11:09:35
|
Revision: 8397
http://sourceforge.net/p/docutils/code/8397
Author: milde
Date: 2019-09-20 11:09:34 +0000 (Fri, 20 Sep 2019)
Log Message:
-----------
Prepare for HTML5 semantic tags.
Modified Paths:
--------------
trunk/docutils/RELEASE-NOTES.txt
trunk/docutils/docutils/writers/_html_base.py
trunk/docutils/docutils/writers/html5_polyglot/minimal.css
trunk/docutils/docutils/writers/html5_polyglot/plain.css
Modified: trunk/docutils/RELEASE-NOTES.txt
===================================================================
--- trunk/docutils/RELEASE-NOTES.txt 2019-09-19 13:59:09 UTC (rev 8396)
+++ trunk/docutils/RELEASE-NOTES.txt 2019-09-20 11:09:34 UTC (rev 8397)
@@ -22,6 +22,10 @@
Future changes
==============
+* The "html5" will use the new semantic tags <main>, <section>, <header>,
+ <footer>, <aside>, <figure>, and <figcaption>.
+ See ``minimal.css`` and ``plain.css`` for styling rule examples.
+
* The "latex" writer will wrap admonitions in a "DUclass" environment.
Stylesheets modifying "\DUadmonition" will need to adapt.
@@ -70,7 +74,6 @@
__ http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#escaping-mechanism
__ docs/ref/rst/restructuredtext.html#bibliographic-fields
-
* LaTeX writer:
- Informal titles of type "rubric" default to bold-italic and left aligned.
Modified: trunk/docutils/docutils/writers/_html_base.py
===================================================================
--- trunk/docutils/docutils/writers/_html_base.py 2019-09-19 13:59:09 UTC (rev 8396)
+++ trunk/docutils/docutils/writers/_html_base.py 2019-09-20 11:09:34 UTC (rev 8397)
@@ -974,7 +974,6 @@
self.body.append(self.emptytag(node, 'img', suffix, **atts))
def depart_image(self, node):
- # self.body.append(self.context.pop())
pass
def visit_inline(self, node):
Modified: trunk/docutils/docutils/writers/html5_polyglot/minimal.css
===================================================================
--- trunk/docutils/docutils/writers/html5_polyglot/minimal.css 2019-09-19 13:59:09 UTC (rev 8396)
+++ trunk/docutils/docutils/writers/html5_polyglot/minimal.css 2019-09-20 11:09:34 UTC (rev 8397)
@@ -182,6 +182,7 @@
/* Figures, Images, and Tables */
.figure.align-left,
+figure.align-left,
img.align-left,
object.align-left,
table.align-left {
@@ -188,6 +189,7 @@
margin-right: auto;
}
.figure.align-center,
+figure.align-center,
img.align-center,
object.align-center,
table.align-center {
@@ -195,6 +197,7 @@
margin-right: auto;
}
.figure.align-right,
+figure.align-right,
img.align-right,
object.align-right,
table.align-right {
@@ -201,14 +204,17 @@
margin-left: auto;
}
.figure.align-center, .figure.align-right,
+figure.align-center, figure.align-right,
img.align-center, img.align-right,
object.align-center, object.align-right {
display: block;
}
/* reset inner alignment in figures and tables */
-/* div.align-left, div.align-center, div.align-right, */
-table.align-left, table.align-center, table.align-right
-{ text-align: inherit }
+.figure.align-left, .figure.align-right,
+figure.align-left, figure.align-right,
+table.align-left, table.align-center, table.align-right {
+ text-align: inherit;
+}
/* Admonitions and System Messages */
div.admonition,
Modified: trunk/docutils/docutils/writers/html5_polyglot/plain.css
===================================================================
--- trunk/docutils/docutils/writers/html5_polyglot/plain.css 2019-09-19 13:59:09 UTC (rev 8396)
+++ trunk/docutils/docutils/writers/html5_polyglot/plain.css 2019-09-20 11:09:34 UTC (rev 8397)
@@ -25,7 +25,8 @@
margin: 0;
background-color: #dbdbdb;
}
-div.document {
+div.document,
+main {
line-height:1.3;
counter-reset: table;
/* counter-reset: figure; */
@@ -199,20 +200,22 @@
/* let content flow to the side of aligned images and figures */
.figure.align-left,
+figure.align-left,
img.align-left,
object.align-left {
display: block;
clear: left;
float: left;
- margin-right: 1em
+ margin-right: 1em;
}
.figure.align-right,
+figure.align-right,
img.align-right,
object.align-right {
display: block;
clear: right;
float: right;
- margin-left: 1em
+ margin-left: 1em;
}
/* Stop floating sidebars, images and figures at section level 1,2,3 */
h1, h2, h3 { clear: both; }
@@ -221,12 +224,13 @@
/* Move right. In a layout with fixed margins, */
/* it can be moved into the margin. */
-div.sidebar {
+div.sidebar,
+aside.sidebar {
width: 30%;
max-width: 26em;
margin-left: 1em;
margin-right: -2%;
- background-color: #ffffee ;
+ background-color: #ffffee;
}
/* Code */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2019-09-30 11:36:58
|
Revision: 8399
http://sourceforge.net/p/docutils/code/8399
Author: milde
Date: 2019-09-30 11:36:56 +0000 (Mon, 30 Sep 2019)
Log Message:
-----------
html5 writer: Add list of text-level tags to the functional test.
Preparation for support of more text-level tags.
Also some minor formatting/documentation fixes.
Modified Paths:
--------------
trunk/docutils/docutils/writers/_html_base.py
trunk/docutils/docutils/writers/html5_polyglot/__init__.py
trunk/docutils/test/functional/expected/standalone_rst_html5.html
trunk/docutils/test/functional/input/standalone_rst_html5.txt
Added Paths:
-----------
trunk/docutils/test/functional/input/html5-text-level-tags.txt
Modified: trunk/docutils/docutils/writers/_html_base.py
===================================================================
--- trunk/docutils/docutils/writers/_html_base.py 2019-09-30 11:36:39 UTC (rev 8398)
+++ trunk/docutils/docutils/writers/_html_base.py 2019-09-30 11:36:56 UTC (rev 8399)
@@ -335,7 +335,7 @@
classes = []
languages = []
# unify class arguments and move language specification
- for cls in node.get('classes', []) + atts.pop('class', '').split() :
+ for cls in node.get('classes', []) + atts.pop('class', '').split():
if cls.startswith('language-'):
languages.append(cls[9:])
elif cls.strip() and cls not in classes:
Modified: trunk/docutils/docutils/writers/html5_polyglot/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/html5_polyglot/__init__.py 2019-09-30 11:36:39 UTC (rev 8398)
+++ trunk/docutils/docutils/writers/html5_polyglot/__init__.py 2019-09-30 11:36:56 UTC (rev 8399)
@@ -155,7 +155,7 @@
and examples.
"""
- # <acronym> tag not supported in HTML5. Use the <abbr> tag instead.
+ # <acronym> tag obsolete in HTML5. Use the <abbr> tag instead.
def visit_acronym(self, node):
# @@@ implementation incomplete ("title" attribute)
self.body.append(self.starttag(node, 'abbr', ''))
Modified: trunk/docutils/test/functional/expected/standalone_rst_html5.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_html5.html 2019-09-30 11:36:39 UTC (rev 8398)
+++ trunk/docutils/test/functional/expected/standalone_rst_html5.html 2019-09-30 11:36:56 UTC (rev 8399)
@@ -86,82 +86,83 @@
<div class="contents topic" id="table-of-contents">
<p class="topic-title">Table of Contents</p>
<ul class="auto-toc simple">
-<li><p><a class="reference internal" href="#structural-elements" id="id38"><span class="sectnum">1</span> Structural Elements</a></p>
+<li><p><a class="reference internal" href="#structural-elements" id="id50"><span class="sectnum">1</span> Structural Elements</a></p>
<ul class="auto-toc">
-<li><p><a class="reference internal" href="#section-title" id="id39"><span class="sectnum">1.1</span> Section Title</a></p></li>
-<li><p><a class="reference internal" href="#empty-section" id="id40"><span class="sectnum">1.2</span> Empty Section</a></p></li>
-<li><p><a class="reference internal" href="#transitions" id="id41"><span class="sectnum">1.3</span> Transitions</a></p></li>
+<li><p><a class="reference internal" href="#section-title" id="id51"><span class="sectnum">1.1</span> Section Title</a></p></li>
+<li><p><a class="reference internal" href="#empty-section" id="id52"><span class="sectnum">1.2</span> Empty Section</a></p></li>
+<li><p><a class="reference internal" href="#transitions" id="id53"><span class="sectnum">1.3</span> Transitions</a></p></li>
</ul>
</li>
-<li><p><a class="reference internal" href="#body-elements" id="id42"><span class="sectnum">2</span> Body Elements</a></p>
+<li><p><a class="reference internal" href="#body-elements" id="id54"><span class="sectnum">2</span> Body Elements</a></p>
<ul class="auto-toc">
-<li><p><a class="reference internal" href="#paragraphs" id="id43"><span class="sectnum">2.1</span> Paragraphs</a></p>
+<li><p><a class="reference internal" href="#paragraphs" id="id55"><span class="sectnum">2.1</span> Paragraphs</a></p>
<ul class="auto-toc">
-<li><p><a class="reference internal" href="#inline-markup" id="id44"><span class="sectnum">2.1.1</span> Inline Markup</a></p></li>
+<li><p><a class="reference internal" href="#inline-markup" id="id56"><span class="sectnum">2.1.1</span> Inline Markup</a></p></li>
</ul>
</li>
-<li><p><a class="reference internal" href="#bullet-lists" id="id45"><span class="sectnum">2.2</span> Bullet Lists</a></p></li>
-<li><p><a class="reference internal" href="#enumerated-lists" id="id46"><span class="sectnum">2.3</span> Enumerated Lists</a></p></li>
-<li><p><a class="reference internal" href="#definition-lists" id="id47"><span class="sectnum">2.4</span> Definition Lists</a></p></li>
-<li><p><a class="reference internal" href="#field-lists" id="id48"><span class="sectnum">2.5</span> Field Lists</a></p></li>
-<li><p><a class="reference internal" href="#option-lists" id="id49"><span class="sectnum">2.6</span> Option Lists</a></p></li>
-<li><p><a class="reference internal" href="#literal-blocks" id="id50"><span class="sectnum">2.7</span> Literal Blocks</a></p></li>
-<li><p><a class="reference internal" href="#line-blocks" id="id51"><span class="sectnum">2.8</span> Line Blocks</a></p></li>
-<li><p><a class="reference internal" href="#block-quotes" id="id52"><span class="sectnum">2.9</span> Block Quotes</a></p></li>
-<li><p><a class="reference internal" href="#doctest-blocks" id="id53"><span class="sectnum">2.10</span> Doctest Blocks</a></p></li>
-<li><p><a class="reference internal" href="#footnotes" id="id54"><span class="sectnum">2.11</span> Footnotes</a></p></li>
-<li><p><a class="reference internal" href="#citations" id="id55"><span class="sectnum">2.12</span> Citations</a></p></li>
-<li><p><a class="reference internal" href="#targets" id="id56"><span class="sectnum">2.13</span> Targets</a></p>
+<li><p><a class="reference internal" href="#bullet-lists" id="id57"><span class="sectnum">2.2</span> Bullet Lists</a></p></li>
+<li><p><a class="reference internal" href="#enumerated-lists" id="id58"><span class="sectnum">2.3</span> Enumerated Lists</a></p></li>
+<li><p><a class="reference internal" href="#definition-lists" id="id59"><span class="sectnum">2.4</span> Definition Lists</a></p></li>
+<li><p><a class="reference internal" href="#field-lists" id="id60"><span class="sectnum">2.5</span> Field Lists</a></p></li>
+<li><p><a class="reference internal" href="#option-lists" id="id61"><span class="sectnum">2.6</span> Option Lists</a></p></li>
+<li><p><a class="reference internal" href="#literal-blocks" id="id62"><span class="sectnum">2.7</span> Literal Blocks</a></p></li>
+<li><p><a class="reference internal" href="#line-blocks" id="id63"><span class="sectnum">2.8</span> Line Blocks</a></p></li>
+<li><p><a class="reference internal" href="#block-quotes" id="id64"><span class="sectnum">2.9</span> Block Quotes</a></p></li>
+<li><p><a class="reference internal" href="#doctest-blocks" id="id65"><span class="sectnum">2.10</span> Doctest Blocks</a></p></li>
+<li><p><a class="reference internal" href="#footnotes" id="id66"><span class="sectnum">2.11</span> Footnotes</a></p></li>
+<li><p><a class="reference internal" href="#citations" id="id67"><span class="sectnum">2.12</span> Citations</a></p></li>
+<li><p><a class="reference internal" href="#targets" id="id68"><span class="sectnum">2.13</span> Targets</a></p>
<ul class="auto-toc">
-<li><p><a class="reference internal" href="#duplicate-target-names" id="id57"><span class="sectnum">2.13.1</span> Duplicate Target Names</a></p></li>
-<li><p><a class="reference internal" href="#id21" id="id58"><span class="sectnum">2.13.2</span> Duplicate Target Names</a></p></li>
+<li><p><a class="reference internal" href="#duplicate-target-names" id="id69"><span class="sectnum">2.13.1</span> Duplicate Target Names</a></p></li>
+<li><p><a class="reference internal" href="#id21" id="id70"><span class="sectnum">2.13.2</span> Duplicate Target Names</a></p></li>
</ul>
</li>
-<li><p><a class="reference internal" href="#directives" id="id59"><span class="sectnum">2.14</span> Directives</a></p>
+<li><p><a class="reference internal" href="#directives" id="id71"><span class="sectnum">2.14</span> Directives</a></p>
<ul class="auto-toc">
-<li><p><a class="reference internal" href="#document-parts" id="id60"><span class="sectnum">2.14.1</span> Document Parts</a></p></li>
-<li><p><a class="reference internal" href="#images-and-figures" id="id61"><span class="sectnum">2.14.2</span> Images and Figures</a></p></li>
-<li><p><a class="reference internal" href="#admonitions" id="id62"><span class="sectnum">2.14.3</span> Admonitions</a></p></li>
-<li><p><a class="reference internal" href="#topics-sidebars-and-rubrics" id="id63"><span class="sectnum">2.14.4</span> Topics, Sidebars, and Rubrics</a></p></li>
-<li><p><a class="reference internal" href="#target-footnotes" id="id64"><span class="sectnum">2.14.5</span> Target Footnotes</a></p></li>
-<li><p><a class="reference internal" href="#replacement-text" id="id65"><span class="sectnum">2.14.6</span> Replacement Text</a></p></li>
-<li><p><a class="reference internal" href="#compound-paragraph" id="id66"><span class="sectnum">2.14.7</span> Compound Paragraph</a></p></li>
-<li><p><a class="reference internal" href="#parsed-literal-blocks" id="id67"><span class="sectnum">2.14.8</span> Parsed Literal Blocks</a></p></li>
-<li><p><a class="reference internal" href="#code" id="id68"><span class="sectnum">2.14.9</span> Code</a></p></li>
+<li><p><a class="reference internal" href="#document-parts" id="id72"><span class="sectnum">2.14.1</span> Document Parts</a></p></li>
+<li><p><a class="reference internal" href="#images-and-figures" id="id73"><span class="sectnum">2.14.2</span> Images and Figures</a></p></li>
+<li><p><a class="reference internal" href="#admonitions" id="id74"><span class="sectnum">2.14.3</span> Admonitions</a></p></li>
+<li><p><a class="reference internal" href="#topics-sidebars-and-rubrics" id="id75"><span class="sectnum">2.14.4</span> Topics, Sidebars, and Rubrics</a></p></li>
+<li><p><a class="reference internal" href="#target-footnotes" id="id76"><span class="sectnum">2.14.5</span> Target Footnotes</a></p></li>
+<li><p><a class="reference internal" href="#replacement-text" id="id77"><span class="sectnum">2.14.6</span> Replacement Text</a></p></li>
+<li><p><a class="reference internal" href="#compound-paragraph" id="id78"><span class="sectnum">2.14.7</span> Compound Paragraph</a></p></li>
+<li><p><a class="reference internal" href="#parsed-literal-blocks" id="id79"><span class="sectnum">2.14.8</span> Parsed Literal Blocks</a></p></li>
+<li><p><a class="reference internal" href="#code" id="id80"><span class="sectnum">2.14.9</span> Code</a></p></li>
</ul>
</li>
-<li><p><a class="reference internal" href="#substitution-definitions" id="id69"><span class="sectnum">2.15</span> Substitution Definitions</a></p></li>
-<li><p><a class="reference internal" href="#comments" id="id70"><span class="sectnum">2.16</span> Comments</a></p></li>
-<li><p><a class="reference internal" href="#raw-text" id="id71"><span class="sectnum">2.17</span> Raw text</a></p></li>
-<li><p><a class="reference internal" href="#container" id="id72"><span class="sectnum">2.18</span> Container</a></p></li>
-<li><p><a class="reference internal" href="#colspanning-tables" id="id73"><span class="sectnum">2.19</span> Colspanning tables</a></p></li>
-<li><p><a class="reference internal" href="#rowspanning-tables" id="id74"><span class="sectnum">2.20</span> Rowspanning tables</a></p></li>
-<li><p><a class="reference internal" href="#complex-tables" id="id75"><span class="sectnum">2.21</span> Complex tables</a></p></li>
-<li><p><a class="reference internal" href="#list-tables" id="id76"><span class="sectnum">2.22</span> List Tables</a></p></li>
-<li><p><a class="reference internal" href="#custom-roles" id="id77"><span class="sectnum">2.23</span> Custom Roles</a></p></li>
-<li><p><a class="reference internal" href="#svg-images" id="id78"><span class="sectnum">2.24</span> SVG Images</a></p></li>
-<li><p><a class="reference internal" href="#swf-images" id="id79"><span class="sectnum">2.25</span> SWF Images</a></p></li>
+<li><p><a class="reference internal" href="#substitution-definitions" id="id81"><span class="sectnum">2.15</span> Substitution Definitions</a></p></li>
+<li><p><a class="reference internal" href="#comments" id="id82"><span class="sectnum">2.16</span> Comments</a></p></li>
+<li><p><a class="reference internal" href="#raw-text" id="id83"><span class="sectnum">2.17</span> Raw text</a></p></li>
+<li><p><a class="reference internal" href="#container" id="id84"><span class="sectnum">2.18</span> Container</a></p></li>
+<li><p><a class="reference internal" href="#colspanning-tables" id="id85"><span class="sectnum">2.19</span> Colspanning tables</a></p></li>
+<li><p><a class="reference internal" href="#rowspanning-tables" id="id86"><span class="sectnum">2.20</span> Rowspanning tables</a></p></li>
+<li><p><a class="reference internal" href="#complex-tables" id="id87"><span class="sectnum">2.21</span> Complex tables</a></p></li>
+<li><p><a class="reference internal" href="#list-tables" id="id88"><span class="sectnum">2.22</span> List Tables</a></p></li>
+<li><p><a class="reference internal" href="#custom-roles" id="id89"><span class="sectnum">2.23</span> Custom Roles</a></p></li>
+<li><p><a class="reference internal" href="#svg-images" id="id90"><span class="sectnum">2.24</span> SVG Images</a></p></li>
+<li><p><a class="reference internal" href="#swf-images" id="id91"><span class="sectnum">2.25</span> SWF Images</a></p></li>
</ul>
</li>
-<li><p><a class="reference internal" href="#changes-to-the-html4css1-writer" id="id80"><span class="sectnum">3</span> Changes to the html4css1 writer</a></p>
+<li><p><a class="reference internal" href="#text-level-semantics" id="id92"><span class="sectnum">3</span> Text-level semantics</a></p></li>
+<li><p><a class="reference internal" href="#changes-to-the-html4css1-writer" id="id93"><span class="sectnum">4</span> Changes to the html4css1 writer</a></p>
<ul class="auto-toc">
-<li><p><a class="reference internal" href="#field-list-handling" id="id81"><span class="sectnum">3.1</span> Field list handling</a></p></li>
-<li><p><a class="reference internal" href="#styling-with-class-arguments" id="id82"><span class="sectnum">3.2</span> Styling with class arguments</a></p>
+<li><p><a class="reference internal" href="#field-list-handling" id="id94"><span class="sectnum">4.1</span> Field list handling</a></p></li>
+<li><p><a class="reference internal" href="#styling-with-class-arguments" id="id95"><span class="sectnum">4.2</span> Styling with class arguments</a></p>
<ul class="auto-toc">
-<li><p><a class="reference internal" href="#description-lists" id="id83"><span class="sectnum">3.2.1</span> Description lists</a></p></li>
-<li><p><a class="reference internal" href="#field-list-variants" id="id84"><span class="sectnum">3.2.2</span> Field list variants</a></p></li>
-<li><p><a class="reference internal" href="#table-variants" id="id85"><span class="sectnum">3.2.3</span> Table variants</a></p></li>
+<li><p><a class="reference internal" href="#description-lists" id="id96"><span class="sectnum">4.2.1</span> Description lists</a></p></li>
+<li><p><a class="reference internal" href="#field-list-variants" id="id97"><span class="sectnum">4.2.2</span> Field list variants</a></p></li>
+<li><p><a class="reference internal" href="#table-variants" id="id98"><span class="sectnum">4.2.3</span> Table variants</a></p></li>
</ul>
</li>
</ul>
</li>
-<li><p><a class="reference internal" href="#error-handling" id="id86"><span class="sectnum">4</span> Error Handling</a></p></li>
+<li><p><a class="reference internal" href="#error-handling" id="id99"><span class="sectnum">5</span> Error Handling</a></p></li>
</ul>
</div>
<div class="section" id="structural-elements">
-<h1><a class="toc-backref" href="#id38"><span class="sectnum">1</span> Structural Elements</a></h1>
+<h1><a class="toc-backref" href="#id50"><span class="sectnum">1</span> Structural Elements</a></h1>
<div class="section" id="section-title">
-<h2 class="with-subtitle"><a class="toc-backref" href="#id39"><span class="sectnum">1.1</span> Section Title</a></h2>
+<h2 class="with-subtitle"><a class="toc-backref" href="#id51"><span class="sectnum">1.1</span> Section Title</a></h2>
<p class="section-subtitle" id="section-subtitle">Section Subtitle</p>
<p>Lone subsections are converted to a section subtitle by a transform
activated with the <span class="docutils literal"><span class="pre">--section-subtitles</span></span> command line option or the
@@ -168,10 +169,10 @@
<span class="docutils literal"><span class="pre">sectsubtitle-xform</span></span> configuration value.</p>
</div>
<div class="section" id="empty-section">
-<h2><a class="toc-backref" href="#id40"><span class="sectnum">1.2</span> Empty Section</a></h2>
+<h2><a class="toc-backref" href="#id52"><span class="sectnum">1.2</span> Empty Section</a></h2>
</div>
<div class="section" id="transitions">
-<h2><a class="toc-backref" href="#id41"><span class="sectnum">1.3</span> Transitions</a></h2>
+<h2><a class="toc-backref" href="#id53"><span class="sectnum">1.3</span> Transitions</a></h2>
<p>Here's a transition:</p>
<hr class="docutils" />
<p>It divides the section. Transitions may also occur between sections:</p>
@@ -179,24 +180,24 @@
</div>
<hr class="docutils" />
<div class="section" id="body-elements">
-<h1><a class="toc-backref" href="#id42"><span class="sectnum">2</span> Body Elements</a></h1>
+<h1><a class="toc-backref" href="#id54"><span class="sectnum">2</span> Body Elements</a></h1>
<div class="section" id="paragraphs">
-<h2><a class="toc-backref" href="#id43"><span class="sectnum">2.1</span> Paragraphs</a></h2>
+<h2><a class="toc-backref" href="#id55"><span class="sectnum">2.1</span> Paragraphs</a></h2>
<p>A paragraph.</p>
<div class="section" id="inline-markup">
-<h3><a class="toc-backref" href="#id44"><span class="sectnum">2.1.1</span> Inline Markup</a></h3>
+<h3><a class="toc-backref" href="#id56"><span class="sectnum">2.1.1</span> Inline Markup</a></h3>
<p>Paragraphs contain text and may contain inline markup: <em>emphasis</em>,
<strong>strong emphasis</strong>, <span class="docutils literal">inline literals</span>, standalone hyperlinks
-(<a class="reference external" href="http://www.python.org">http://www.python.org</a>), external hyperlinks (<a class="reference external" href="http://www.python.org/">Python</a> <a class="footnote-reference brackets" href="#id25" id="id26">5</a>), internal
+(<a class="reference external" href="http://www.python.org">http://www.python.org</a>), external hyperlinks (<a class="reference external" href="http://www.python.org/">Python</a> <a class="footnote-reference brackets" href="#id33" id="id34">7</a>), internal
cross-references (<a class="reference internal" href="#example">example</a>), external hyperlinks with embedded URIs
(<a class="reference external" href="http://www.python.org">Python web site</a>), <a class="reference external" href="http://www.python.org/">anonymous hyperlink
-references</a> <a class="footnote-reference brackets" href="#id25" id="id35">5</a> (<a class="reference external" href="http://docutils.sourceforge.net/">a second reference</a> <a class="footnote-reference brackets" href="#id36" id="id37">9</a>), footnote references (manually
+references</a> <a class="footnote-reference brackets" href="#id33" id="id45">7</a> (<a class="reference external" href="http://docutils.sourceforge.net/">a second reference</a> <a class="footnote-reference brackets" href="#id46" id="id47">12</a>), footnote references (manually
numbered <a class="footnote-reference brackets" href="#id8" id="id1">1</a>, anonymous auto-numbered <a class="footnote-reference brackets" href="#id12" id="id2">3</a>, labeled auto-numbered
<a class="footnote-reference brackets" href="#label" id="id3">2</a>, or symbolic <a class="footnote-reference brackets" href="#id13" id="id4">*</a>), citation references (<a class="citation-reference" href="#cit2002" id="id5">[CIT2002]</a>),
substitution references (<img alt="EXAMPLE" src="../../../docs/user/rst/images/biohazard.png" /> &
a <em>trimmed heart</em> <span class="docutils literal">(U+2665):</span>♥), and <span class="target" id="inline-hyperlink-targets">inline hyperlink targets</span>
(see <a class="reference internal" href="#targets">Targets</a> below for a reference back to here). Character-level
-inline markup is also possible (although exceedingly ugly!) in <em>re</em><span class="docutils literal">Structured</span><em>Text</em>. Problems are indicated by <a href="#id23"><span class="problematic" id="id24">|problematic|</span></a> text
+inline markup is also possible (although exceedingly ugly!) in <em>re</em><span class="docutils literal">Structured</span><em>Text</em>. Problems are indicated by <a href="#id31"><span class="problematic" id="id32">|problematic|</span></a> text
(generated by processing errors; this one is intentional). Here is a
reference to the <a class="reference internal" href="#doctitle">doctitle</a> and the <a class="reference internal" href="#subtitle">subtitle</a>.</p>
<p>The default role for interpreted text is <cite>Title Reference</cite>. Here are
@@ -213,7 +214,7 @@
</div>
</div>
<div class="section" id="bullet-lists">
-<h2><a class="toc-backref" href="#id45"><span class="sectnum">2.2</span> Bullet Lists</a></h2>
+<h2><a class="toc-backref" href="#id57"><span class="sectnum">2.2</span> Bullet Lists</a></h2>
<ul>
<li><p>A bullet list</p>
<ul class="simple">
@@ -240,7 +241,7 @@
</ul>
</div>
<div class="section" id="enumerated-lists">
-<h2><a class="toc-backref" href="#id46"><span class="sectnum">2.3</span> Enumerated Lists</a></h2>
+<h2><a class="toc-backref" href="#id58"><span class="sectnum">2.3</span> Enumerated Lists</a></h2>
<ol class="arabic">
<li><p>Arabic numerals.</p>
<ol class="loweralpha simple">
@@ -276,7 +277,7 @@
</ol>
</div>
<div class="section" id="definition-lists">
-<h2><a class="toc-backref" href="#id47"><span class="sectnum">2.4</span> Definition Lists</a></h2>
+<h2><a class="toc-backref" href="#id59"><span class="sectnum">2.4</span> Definition Lists</a></h2>
<dl>
<dt>Term</dt>
<dd><p>Definition</p>
@@ -294,7 +295,7 @@
</dl>
</div>
<div class="section" id="field-lists">
-<h2><a class="toc-backref" href="#id48"><span class="sectnum">2.5</span> Field Lists</a></h2>
+<h2><a class="toc-backref" href="#id60"><span class="sectnum">2.5</span> Field Lists</a></h2>
<dl class="field-list">
<dt>what</dt>
<dd><p>Field lists map field names to field bodies, like database
@@ -314,7 +315,7 @@
</dl>
</div>
<div class="section" id="option-lists">
-<h2><a class="toc-backref" href="#id49"><span class="sectnum">2.6</span> Option Lists</a></h2>
+<h2><a class="toc-backref" href="#id61"><span class="sectnum">2.6</span> Option Lists</a></h2>
<p>For listing command-line options:</p>
<dl class="option-list">
<dt><kbd><span class="option">-a</span></kbd></dt>
@@ -353,7 +354,7 @@
description.</p>
</div>
<div class="section" id="literal-blocks">
-<h2><a class="toc-backref" href="#id50"><span class="sectnum">2.7</span> Literal Blocks</a></h2>
+<h2><a class="toc-backref" href="#id62"><span class="sectnum">2.7</span> Literal Blocks</a></h2>
<p>Literal blocks are indicated with a double-colon ("::") at the end of
the preceding paragraph (over there <span class="docutils literal"><span class="pre">--></span></span>). They can be indented:</p>
<pre class="literal-block">if literal_block:
@@ -366,7 +367,7 @@
> Why didn't I think of that?</pre>
</div>
<div class="section" id="line-blocks">
-<h2><a class="toc-backref" href="#id51"><span class="sectnum">2.8</span> Line Blocks</a></h2>
+<h2><a class="toc-backref" href="#id63"><span class="sectnum">2.8</span> Line Blocks</a></h2>
<p>This section tests line blocks. Line blocks are body elements which
consist of lines and other line blocks. Nested line blocks cause
indentation.</p>
@@ -440,7 +441,7 @@
</div>
</div>
<div class="section" id="block-quotes">
-<h2><a class="toc-backref" href="#id52"><span class="sectnum">2.9</span> Block Quotes</a></h2>
+<h2><a class="toc-backref" href="#id64"><span class="sectnum">2.9</span> Block Quotes</a></h2>
<p>Block quotes consist of indented body elements:</p>
<blockquote>
<p>My theory by A. Elk. Brackets Miss, brackets. This theory goes
@@ -459,7 +460,7 @@
</blockquote>
</div>
<div class="section" id="doctest-blocks">
-<h2><a class="toc-backref" href="#id53"><span class="sectnum">2.10</span> Doctest Blocks</a></h2>
+<h2><a class="toc-backref" href="#id65"><span class="sectnum">2.10</span> Doctest Blocks</a></h2>
<pre class="code python doctest">>>> print 'Python-specific usage examples; begun with ">>>"'
Python-specific usage examples; begun with ">>>"
>>> print '(cut and pasted from interactive Python sessions)'
@@ -467,7 +468,7 @@
</pre>
</div>
<div class="section" id="footnotes">
-<h2><a class="toc-backref" href="#id54"><span class="sectnum">2.11</span> Footnotes</a></h2>
+<h2><a class="toc-backref" href="#id66"><span class="sectnum">2.11</span> Footnotes</a></h2>
<dl class="footnote brackets">
<dt class="label" id="id8"><span class="brackets">1</span><span class="fn-backref">(<a href="#id1">1</a>,<a href="#id9">2</a>,<a href="#id22">3</a>)</span></dt>
<dd><p>A footnote contains body elements, consistently indented by at
@@ -495,12 +496,12 @@
</dd>
<dt class="label" id="id16"><span class="brackets">4</span></dt>
<dd><p>Here's an unreferenced footnote, with a reference to a
-nonexistent footnote: <a href="#id96"><span class="problematic" id="id17">[5]_</span></a>.</p>
+nonexistent footnote: <a href="#id109"><span class="problematic" id="id17">[5]_</span></a>.</p>
</dd>
</dl>
</div>
<div class="section" id="citations">
-<h2><a class="toc-backref" href="#id55"><span class="sectnum">2.12</span> Citations</a></h2>
+<h2><a class="toc-backref" href="#id67"><span class="sectnum">2.12</span> Citations</a></h2>
<dl class="citation">
<dt class="label" id="cit2002"><span class="brackets">CIT2002</span><span class="fn-backref">(<a href="#id5">1</a>,<a href="#id18">2</a>)</span></dt>
<dd><p>Citations are text-labeled footnotes. They may be
@@ -507,11 +508,11 @@
rendered separately and differently from footnotes.</p>
</dd>
</dl>
-<p>Here's a reference to the above, <a class="citation-reference" href="#cit2002" id="id18">[CIT2002]</a>, and a <a href="#id97"><span class="problematic" id="id19">[nonexistent]_</span></a>
+<p>Here's a reference to the above, <a class="citation-reference" href="#cit2002" id="id18">[CIT2002]</a>, and a <a href="#id110"><span class="problematic" id="id19">[nonexistent]_</span></a>
citation.</p>
</div>
<div class="section" id="targets">
-<span id="another-target"></span><h2><a class="toc-backref" href="#id56"><span class="sectnum">2.13</span> Targets</a></h2>
+<span id="another-target"></span><h2><a class="toc-backref" href="#id68"><span class="sectnum">2.13</span> Targets</a></h2>
<p id="example">This paragraph is pointed to by the explicit "example" target. A
reference can be found under <a class="reference internal" href="#inline-markup">Inline Markup</a>, above. <a class="reference internal" href="#inline-hyperlink-targets">Inline
hyperlink targets</a> are also possible.</p>
@@ -518,37 +519,37 @@
<p>Section headers are implicit targets, referred to by name. See
<a class="reference internal" href="#targets">Targets</a>, which is a subsection of <a class="reference internal" href="#body-elements">Body Elements</a>.</p>
<p>Explicit external targets are interpolated into references such as
-"<a class="reference external" href="http://www.python.org/">Python</a> <a class="footnote-reference brackets" href="#id25" id="id27">5</a>".</p>
+"<a class="reference external" href="http://www.python.org/">Python</a> <a class="footnote-reference brackets" href="#id33" id="id35">7</a>".</p>
<p>Targets may be indirect and anonymous. Thus <a class="reference internal" href="#targets">this phrase</a> may also
refer to the <a class="reference internal" href="#targets">Targets</a> section.</p>
-<p>Here's a <a href="#id98"><span class="problematic" id="id99">`hyperlink reference without a target`_</span></a>, which generates an
+<p>Here's a <a href="#id111"><span class="problematic" id="id112">`hyperlink reference without a target`_</span></a>, which generates an
error.</p>
<div class="section" id="duplicate-target-names">
-<h3><a class="toc-backref" href="#id57"><span class="sectnum">2.13.1</span> Duplicate Target Names</a></h3>
+<h3><a class="toc-backref" href="#id69"><span class="sectnum">2.13.1</span> Duplicate Target Names</a></h3>
<p>Duplicate names in section headers or other implicit targets will
generate "info" (level-1) system messages. Duplicate names in
explicit targets will generate "warning" (level-2) system messages.</p>
</div>
<div class="section" id="id21">
-<h3><a class="toc-backref" href="#id58"><span class="sectnum">2.13.2</span> Duplicate Target Names</a></h3>
+<h3><a class="toc-backref" href="#id70"><span class="sectnum">2.13.2</span> Duplicate Target Names</a></h3>
<p>Since there are two "Duplicate Target Names" section headers, we
cannot uniquely refer to either of them by name. If we try to (like
-this: <a href="#id100"><span class="problematic" id="id101">`Duplicate Target Names`_</span></a>), an error is generated.</p>
+this: <a href="#id113"><span class="problematic" id="id114">`Duplicate Target Names`_</span></a>), an error is generated.</p>
</div>
</div>
<div class="section" id="directives">
-<h2><a class="toc-backref" href="#id59"><span class="sectnum">2.14</span> Directives</a></h2>
+<h2><a class="toc-backref" href="#id71"><span class="sectnum">2.14</span> Directives</a></h2>
<div class="contents local topic" id="contents">
<ul class...
[truncated message content] |
|
From: <mi...@us...> - 2019-10-10 13:19:57
|
Revision: 8402
http://sourceforge.net/p/docutils/code/8402
Author: milde
Date: 2019-10-10 13:19:55 +0000 (Thu, 10 Oct 2019)
Log Message:
-----------
html5 writer: prepare support of <ins> and <del> tags.
Modified Paths:
--------------
trunk/docutils/RELEASE-NOTES.txt
trunk/docutils/docs/ref/rst/directives.txt
trunk/docutils/test/functional/expected/standalone_rst_html5.html
trunk/docutils/test/functional/input/html5-text-level-tags.txt
trunk/docutils/test/functional/input/standalone_rst_html5.txt
Modified: trunk/docutils/RELEASE-NOTES.txt
===================================================================
--- trunk/docutils/RELEASE-NOTES.txt 2019-09-30 21:01:03 UTC (rev 8401)
+++ trunk/docutils/RELEASE-NOTES.txt 2019-10-10 13:19:55 UTC (rev 8402)
@@ -28,9 +28,13 @@
See ``minimal.css`` and ``plain.css`` for styling rule examples.
Use HTML text-level tags <small>, <s>, <q>, <dfn>, <var>, <samp>, <kbd>,
- <i>, <b>, <u>, <mark>, and <bdi> if matching class value is found in
- `inline` and `literal` elements.
+ <i>, <b>, <u>, <mark>, and <bdi> if a matching class value
+ is found in `inline` and `literal` elements.
+ Use HTML tags <ins> and <del> if a matching class value
+ is found in `inline`, `literal`, or `container` elements.
+
+
* LaTeX writer:
Wrap admonitions in a "DUclass" environment. Stylesheets modifying
"\DUadmonition" will need to adapt.
Modified: trunk/docutils/docs/ref/rst/directives.txt
===================================================================
--- trunk/docutils/docs/ref/rst/directives.txt 2019-09-30 21:01:03 UTC (rev 8401)
+++ trunk/docutils/docs/ref/rst/directives.txt 2019-10-10 13:19:55 UTC (rev 8402)
@@ -1730,6 +1730,8 @@
may be followed by any number of letters, digits ([0-9]),
hyphens ("-"), underscores ("_"), colons (":"), and periods
(".").
+
+ -- http://www.w3.org/TR/html401/types.html#type-name
- The `CSS1 spec`_ defines identifiers based on the "name" token
("flex" tokenizer notation below; "latin1" and "escape" 8-bit
Modified: trunk/docutils/test/functional/expected/standalone_rst_html5.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_html5.html 2019-09-30 21:01:03 UTC (rev 8401)
+++ trunk/docutils/test/functional/expected/standalone_rst_html5.html 2019-10-10 13:19:55 UTC (rev 8402)
@@ -86,83 +86,88 @@
<div class="contents topic" id="table-of-contents">
<p class="topic-title">Table of Contents</p>
<ul class="auto-toc simple">
-<li><p><a class="reference internal" href="#structural-elements" id="id50"><span class="sectnum">1</span> Structural Elements</a></p>
+<li><p><a class="reference internal" href="#structural-elements" id="id55"><span class="sectnum">1</span> Structural Elements</a></p>
<ul class="auto-toc">
-<li><p><a class="reference internal" href="#section-title" id="id51"><span class="sectnum">1.1</span> Section Title</a></p></li>
-<li><p><a class="reference internal" href="#empty-section" id="id52"><span class="sectnum">1.2</span> Empty Section</a></p></li>
-<li><p><a class="reference internal" href="#transitions" id="id53"><span class="sectnum">1.3</span> Transitions</a></p></li>
+<li><p><a class="reference internal" href="#section-title" id="id56"><span class="sectnum">1.1</span> Section Title</a></p></li>
+<li><p><a class="reference internal" href="#empty-section" id="id57"><span class="sectnum">1.2</span> Empty Section</a></p></li>
+<li><p><a class="reference internal" href="#transitions" id="id58"><span class="sectnum">1.3</span> Transitions</a></p></li>
</ul>
</li>
-<li><p><a class="reference internal" href="#body-elements" id="id54"><span class="sectnum">2</span> Body Elements</a></p>
+<li><p><a class="reference internal" href="#body-elements" id="id59"><span class="sectnum">2</span> Body Elements</a></p>
<ul class="auto-toc">
-<li><p><a class="reference internal" href="#paragraphs" id="id55"><span class="sectnum">2.1</span> Paragraphs</a></p>
+<li><p><a class="reference internal" href="#paragraphs" id="id60"><span class="sectnum">2.1</span> Paragraphs</a></p>
<ul class="auto-toc">
-<li><p><a class="reference internal" href="#inline-markup" id="id56"><span class="sectnum">2.1.1</span> Inline Markup</a></p></li>
+<li><p><a class="reference internal" href="#inline-markup" id="id61"><span class="sectnum">2.1.1</span> Inline Markup</a></p></li>
</ul>
</li>
-<li><p><a class="reference internal" href="#bullet-lists" id="id57"><span class="sectnum">2.2</span> Bullet Lists</a></p></li>
-<li><p><a class="reference internal" href="#enumerated-lists" id="id58"><span class="sectnum">2.3</span> Enumerated Lists</a></p></li>
-<li><p><a class="reference internal" href="#definition-lists" id="id59"><span class="sectnum">2.4</span> Definition Lists</a></p></li>
-<li><p><a class="reference internal" href="#field-lists" id="id60"><span class="sectnum">2.5</span> Field Lists</a></p></li>
-<li><p><a class="reference internal" href="#option-lists" id="id61"><span class="sectnum">2.6</span> Option Lists</a></p></li>
-<li><p><a class="reference internal" href="#literal-blocks" id="id62"><span class="sectnum">2.7</span> Literal Blocks</a></p></li>
-<li><p><a class="reference internal" href="#line-blocks" id="id63"><span class="sectnum">2.8</span> Line Blocks</a></p></li>
-<li><p><a class="reference internal" href="#block-quotes" id="id64"><span class="sectnum">2.9</span> Block Quotes</a></p></li>
-<li><p><a class="reference internal" href="#doctest-blocks" id="id65"><span class="sectnum">2.10</span> Doctest Blocks</a></p></li>
-<li><p><a class="reference internal" href="#footnotes" id="id66"><span class="sectnum">2.11</span> Footnotes</a></p></li>
-<li><p><a class="reference internal" href="#citations" id="id67"><span class="sectnum">2.12</span> Citations</a></p></li>
-<li><p><a class="reference internal" href="#targets" id="id68"><span class="sectnum">2.13</span> Targets</a></p>
+<li><p><a class="reference internal" href="#bullet-lists" id="id62"><span class="sectnum">2.2</span> Bullet Lists</a></p></li>
+<li><p><a class="reference internal" href="#enumerated-lists" id="id63"><span class="sectnum">2.3</span> Enumerated Lists</a></p></li>
+<li><p><a class="reference internal" href="#definition-lists" id="id64"><span class="sectnum">2.4</span> Definition Lists</a></p></li>
+<li><p><a class="reference internal" href="#field-lists" id="id65"><span class="sectnum">2.5</span> Field Lists</a></p></li>
+<li><p><a class="reference internal" href="#option-lists" id="id66"><span class="sectnum">2.6</span> Option Lists</a></p></li>
+<li><p><a class="reference internal" href="#literal-blocks" id="id67"><span class="sectnum">2.7</span> Literal Blocks</a></p></li>
+<li><p><a class="reference internal" href="#line-blocks" id="id68"><span class="sectnum">2.8</span> Line Blocks</a></p></li>
+<li><p><a class="reference internal" href="#block-quotes" id="id69"><span class="sectnum">2.9</span> Block Quotes</a></p></li>
+<li><p><a class="reference internal" href="#doctest-blocks" id="id70"><span class="sectnum">2.10</span> Doctest Blocks</a></p></li>
+<li><p><a class="reference internal" href="#footnotes" id="id71"><span class="sectnum">2.11</span> Footnotes</a></p></li>
+<li><p><a class="reference internal" href="#citations" id="id72"><span class="sectnum">2.12</span> Citations</a></p></li>
+<li><p><a class="reference internal" href="#targets" id="id73"><span class="sectnum">2.13</span> Targets</a></p>
<ul class="auto-toc">
-<li><p><a class="reference internal" href="#duplicate-target-names" id="id69"><span class="sectnum">2.13.1</span> Duplicate Target Names</a></p></li>
-<li><p><a class="reference internal" href="#id21" id="id70"><span class="sectnum">2.13.2</span> Duplicate Target Names</a></p></li>
+<li><p><a class="reference internal" href="#duplicate-target-names" id="id74"><span class="sectnum">2.13.1</span> Duplicate Target Names</a></p></li>
+<li><p><a class="reference internal" href="#id21" id="id75"><span class="sectnum">2.13.2</span> Duplicate Target Names</a></p></li>
</ul>
</li>
-<li><p><a class="reference internal" href="#directives" id="id71"><span class="sectnum">2.14</span> Directives</a></p>
+<li><p><a class="reference internal" href="#directives" id="id76"><span class="sectnum">2.14</span> Directives</a></p>
<ul class="auto-toc">
-<li><p><a class="reference internal" href="#document-parts" id="id72"><span class="sectnum">2.14.1</span> Document Parts</a></p></li>
-<li><p><a class="reference internal" href="#images-and-figures" id="id73"><span class="sectnum">2.14.2</span> Images and Figures</a></p></li>
-<li><p><a class="reference internal" href="#admonitions" id="id74"><span class="sectnum">2.14.3</span> Admonitions</a></p></li>
-<li><p><a class="reference internal" href="#topics-sidebars-and-rubrics" id="id75"><span class="sectnum">2.14.4</span> Topics, Sidebars, and Rubrics</a></p></li>
-<li><p><a class="reference internal" href="#target-footnotes" id="id76"><span class="sectnum">2.14.5</span> Target Footnotes</a></p></li>
-<li><p><a class="reference internal" href="#replacement-text" id="id77"><span class="sectnum">2.14.6</span> Replacement Text</a></p></li>
-<li><p><a class="reference internal" href="#compound-paragraph" id="id78"><span class="sectnum">2.14.7</span> Compound Paragraph</a></p></li>
-<li><p><a class="reference internal" href="#parsed-literal-blocks" id="id79"><span class="sectnum">2.14.8</span> Parsed Literal Blocks</a></p></li>
-<li><p><a class="reference internal" href="#code" id="id80"><span class="sectnum">2.14.9</span> Code</a></p></li>
+<li><p><a class="reference internal" href="#document-parts" id="id77"><span class="sectnum">2.14.1</span> Document Parts</a></p></li>
+<li><p><a class="reference internal" href="#images-and-figures" id="id78"><span class="sectnum">2.14.2</span> Images and Figures</a></p></li>
+<li><p><a class="reference internal" href="#admonitions" id="id79"><span class="sectnum">2.14.3</span> Admonitions</a></p></li>
+<li><p><a class="reference internal" href="#topics-sidebars-and-rubrics" id="id80"><span class="sectnum">2.14.4</span> Topics, Sidebars, and Rubrics</a></p></li>
+<li><p><a class="reference internal" href="#target-footnotes" id="id81"><span class="sectnum">2.14.5</span> Target Footnotes</a></p></li>
+<li><p><a class="reference internal" href="#replacement-text" id="id82"><span class="sectnum">2.14.6</span> Replacement Text</a></p></li>
+<li><p><a class="reference internal" href="#compound-paragraph" id="id83"><span class="sectnum">2.14.7</span> Compound Paragraph</a></p></li>
+<li><p><a class="reference internal" href="#parsed-literal-blocks" id="id84"><span class="sectnum">2.14.8</span> Parsed Literal Blocks</a></p></li>
+<li><p><a class="reference internal" href="#code" id="id85"><span class="sectnum">2.14.9</span> Code</a></p></li>
</ul>
</li>
-<li><p><a class="reference internal" href="#substitution-definitions" id="id81"><span class="sectnum">2.15</span> Substitution Definitions</a></p></li>
-<li><p><a class="reference internal" href="#comments" id="id82"><span class="sectnum">2.16</span> Comments</a></p></li>
-<li><p><a class="reference internal" href="#raw-text" id="id83"><span class="sectnum">2.17</span> Raw text</a></p></li>
-<li><p><a class="reference internal" href="#container" id="id84"><span class="sectnum">2.18</span> Container</a></p></li>
-<li><p><a class="reference internal" href="#colspanning-tables" id="id85"><span class="sectnum">2.19</span> Colspanning tables</a></p></li>
-<li><p><a class="reference internal" href="#rowspanning-tables" id="id86"><span class="sectnum">2.20</span> Rowspanning tables</a></p></li>
-<li><p><a class="reference internal" href="#complex-tables" id="id87"><span class="sectnum">2.21</span> Complex tables</a></p></li>
-<li><p><a class="reference internal" href="#list-tables" id="id88"><span class="sectnum">2.22</span> List Tables</a></p></li>
-<li><p><a class="reference internal" href="#custom-roles" id="id89"><span class="sectnum">2.23</span> Custom Roles</a></p></li>
-<li><p><a class="reference internal" href="#svg-images" id="id90"><span class="sectnum">2.24</span> SVG Images</a></p></li>
-<li><p><a class="reference internal" href="#swf-images" id="id91"><span class="sectnum">2.25</span> SWF Images</a></p></li>
+<li><p><a class="reference internal" href="#substitution-definitions" id="id86"><span class="sectnum">2.15</span> Substitution Definitions</a></p></li>
+<li><p><a class="reference internal" href="#comments" id="id87"><span class="sectnum">2.16</span> Comments</a></p></li>
+<li><p><a class="reference internal" href="#raw-text" id="id88"><span class="sectnum">2.17</span> Raw text</a></p></li>
+<li><p><a class="reference internal" href="#container" id="id89"><span class="sectnum">2.18</span> Container</a></p></li>
+<li><p><a class="reference internal" href="#colspanning-tables" id="id90"><span class="sectnum">2.19</span> Colspanning tables</a></p></li>
+<li><p><a class="reference internal" href="#rowspanning-tables" id="id91"><span class="sectnum">2.20</span> Rowspanning tables</a></p></li>
+<li><p><a class="reference internal" href="#complex-tables" id="id92"><span class="sectnum">2.21</span> Complex tables</a></p></li>
+<li><p><a class="reference internal" href="#list-tables" id="id93"><span class="sectnum">2.22</span> List Tables</a></p></li>
+<li><p><a class="reference internal" href="#custom-roles" id="id94"><span class="sectnum">2.23</span> Custom Roles</a></p></li>
</ul>
</li>
-<li><p><a class="reference internal" href="#text-level-semantics" id="id92"><span class="sectnum">3</span> Text-level semantics</a></p></li>
-<li><p><a class="reference internal" href="#changes-to-the-html4css1-writer" id="id93"><span class="sectnum">4</span> Changes to the html4css1 writer</a></p>
+<li><p><a class="reference internal" href="#html-specific" id="id95"><span class="sectnum">3</span> HTML specific</a></p>
<ul class="auto-toc">
-<li><p><a class="reference internal" href="#field-list-handling" id="id94"><span class="sectnum">4.1</span> Field list handling</a></p></li>
-<li><p><a class="reference internal" href="#styling-with-class-arguments" id="id95"><span class="sectnum">4.2</span> Styling with class arguments</a></p>
+<li><p><a class="reference internal" href="#svg-images" id="id96"><span class="sectnum">3.1</span> SVG Images</a></p></li>
+<li><p><a class="reference internal" href="#swf-images" id="id97"><span class="sectnum">3.2</span> SWF Images</a></p></li>
+<li><p><a class="reference internal" href="#text-level-semantics" id="id98"><span class="sectnum">3.3</span> Text-level semantics</a></p></li>
+<li><p><a class="reference internal" href="#indicating-edits" id="id99"><span class="sectnum">3.4</span> Indicating Edits</a></p></li>
+</ul>
+</li>
+<li><p><a class="reference internal" href="#changes-to-the-html4css1-writer" id="id100"><span class="sectnum">4</span> Changes to the html4css1 writer</a></p>
<ul class="auto-toc">
-<li><p><a class="reference internal" href="#description-lists" id="id96"><span class="sectnum">4.2.1</span> Description lists</a></p></li>
-<li><p><a class="reference internal" href="#field-list-variants" id="id97"><span class="sectnum">4.2.2</span> Field list variants</a></p></li>
-<li><p><a class="reference internal" href="#table-variants" id="id98"><span class="sectnum">4.2.3</span> Table variants</a></p></li>
+<li><p><a class="reference internal" href="#field-list-handling" id="id101"><span class="sectnum">4.1</span> Field list handling</a></p></li>
+<li><p><a class="reference internal" href="#styling-with-class-arguments" id="id102"><span class="sectnum">4.2</span> Styling with class arguments</a></p>
+<ul class="auto-toc">
+<li><p><a class="reference internal" href="#description-lists" id="id103"><span class="sectnum">4.2.1</span> Description lists</a></p></li>
+<li><p><a class="reference internal" href="#field-list-variants" id="id104"><span class="sectnum">4.2.2</span> Field list variants</a></p></li>
+<li><p><a class="reference internal" href="#table-variants" id="id105"><span class="sectnum">4.2.3</span> Table variants</a></p></li>
</ul>
</li>
</ul>
</li>
-<li><p><a class="reference internal" href="#error-handling" id="id99"><span class="sectnum">5</span> Error Handling</a></p></li>
+<li><p><a class="reference internal" href="#error-handling" id="id106"><span class="sectnum">5</span> Error Handling</a></p></li>
</ul>
</div>
<div class="section" id="structural-elements">
-<h1><a class="toc-backref" href="#id50"><span class="sectnum">1</span> Structural Elements</a></h1>
+<h1><a class="toc-backref" href="#id55"><span class="sectnum">1</span> Structural Elements</a></h1>
<div class="section" id="section-title">
-<h2 class="with-subtitle"><a class="toc-backref" href="#id51"><span class="sectnum">1.1</span> Section Title</a></h2>
+<h2 class="with-subtitle"><a class="toc-backref" href="#id56"><span class="sectnum">1.1</span> Section Title</a></h2>
<p class="section-subtitle" id="section-subtitle">Section Subtitle</p>
<p>Lone subsections are converted to a section subtitle by a transform
activated with the <span class="docutils literal"><span class="pre">--section-subtitles</span></span> command line option or the
@@ -169,10 +174,10 @@
<span class="docutils literal"><span class="pre">sectsubtitle-xform</span></span> configuration value.</p>
</div>
<div class="section" id="empty-section">
-<h2><a class="toc-backref" href="#id52"><span class="sectnum">1.2</span> Empty Section</a></h2>
+<h2><a class="toc-backref" href="#id57"><span class="sectnum">1.2</span> Empty Section</a></h2>
</div>
<div class="section" id="transitions">
-<h2><a class="toc-backref" href="#id53"><span class="sectnum">1.3</span> Transitions</a></h2>
+<h2><a class="toc-backref" href="#id58"><span class="sectnum">1.3</span> Transitions</a></h2>
<p>Here's a transition:</p>
<hr class="docutils" />
<p>It divides the section. Transitions may also occur between sections:</p>
@@ -180,24 +185,24 @@
</div>
<hr class="docutils" />
<div class="section" id="body-elements">
-<h1><a class="toc-backref" href="#id54"><span class="sectnum">2</span> Body Elements</a></h1>
+<h1><a class="toc-backref" href="#id59"><span class="sectnum">2</span> Body Elements</a></h1>
<div class="section" id="paragraphs">
-<h2><a class="toc-backref" href="#id55"><span class="sectnum">2.1</span> Paragraphs</a></h2>
+<h2><a class="toc-backref" href="#id60"><span class="sectnum">2.1</span> Paragraphs</a></h2>
<p>A paragraph.</p>
<div class="section" id="inline-markup">
-<h3><a class="toc-backref" href="#id56"><span class="sectnum">2.1.1</span> Inline Markup</a></h3>
+<h3><a class="toc-backref" href="#id61"><span class="sectnum">2.1.1</span> Inline Markup</a></h3>
<p>Paragraphs contain text and may contain inline markup: <em>emphasis</em>,
<strong>strong emphasis</strong>, <span class="docutils literal">inline literals</span>, standalone hyperlinks
-(<a class="reference external" href="http://www.python.org">http://www.python.org</a>), external hyperlinks (<a class="reference external" href="http://www.python.org/">Python</a> <a class="footnote-reference brackets" href="#id33" id="id34">7</a>), internal
+(<a class="reference external" href="http://www.python.org">http://www.python.org</a>), external hyperlinks (<a class="reference external" href="http://www.python.org/">Python</a> <a class="footnote-reference brackets" href="#id36" id="id37">7</a>), internal
cross-references (<a class="reference internal" href="#example">example</a>), external hyperlinks with embedded URIs
(<a class="reference external" href="http://www.python.org">Python web site</a>), <a class="reference external" href="http://www.python.org/">anonymous hyperlink
-references</a> <a class="footnote-reference brackets" href="#id33" id="id45">7</a> (<a class="reference external" href="http://docutils.sourceforge.net/">a second reference</a> <a class="footnote-reference brackets" href="#id46" id="id47">12</a>), footnote references (manually
+references</a> <a class="footnote-reference brackets" href="#id36" id="id48">7</a> (<a class="reference external" href="http://docutils.sourceforge.net/">a second reference</a> <a class="footnote-reference brackets" href="#id49" id="id50">12</a>), footnote references (manually
numbered <a class="footnote-reference brackets" href="#id8" id="id1">1</a>, anonymous auto-numbered <a class="footnote-reference brackets" href="#id12" id="id2">3</a>, labeled auto-numbered
<a class="footnote-reference brackets" href="#label" id="id3">2</a>, or symbolic <a class="footnote-reference brackets" href="#id13" id="id4">*</a>), citation references (<a class="citation-reference" href="#cit2002" id="id5">[CIT2002]</a>),
substitution references (<img alt="EXAMPLE" src="../../../docs/user/rst/images/biohazard.png" /> &
a <em>trimmed heart</em> <span class="docutils literal">(U+2665):</span>♥), and <span class="target" id="inline-hyperlink-targets">inline hyperlink targets</span>
(see <a class="reference internal" href="#targets">Targets</a> below for a reference back to here). Character-level
-inline markup is also possible (although exceedingly ugly!) in <em>re</em><span class="docutils literal">Structured</span><em>Text</em>. Problems are indicated by <a href="#id31"><span class="problematic" id="id32">|problematic|</span></a> text
+inline markup is also possible (although exceedingly ugly!) in <em>re</em><span class="docutils literal">Structured</span><em>Text</em>. Problems are indicated by <a href="#id34"><span class="problematic" id="id35">|problematic|</span></a> text
(generated by processing errors; this one is intentional). Here is a
reference to the <a class="reference internal" href="#doctitle">doctitle</a> and the <a class="reference internal" href="#subtitle">subtitle</a>.</p>
<p>The default role for interpreted text is <cite>Title Reference</cite>. Here are
@@ -214,7 +219,7 @@
</div>
</div>
<div class="section" id="bullet-lists">
-<h2><a class="toc-backref" href="#id57"><span class="sectnum">2.2</span> Bullet Lists</a></h2>
+<h2><a class="toc-backref" href="#id62"><span class="sectnum">2.2</span> Bullet Lists</a></h2>
<ul>
<li><p>A bullet list</p>
<ul class="simple">
@@ -241,7 +246,7 @@
</ul>
</div>
<div class="section" id="enumerated-lists">
-<h2><a class="toc-backref" href="#id58"><span class="sectnum">2.3</span> Enumerated Lists</a></h2>
+<h2><a class="toc-backref" href="#id63"><span class="sectnum">2.3</span> Enumerated Lists</a></h2>
<ol class="arabic">
<li><p>Arabic numerals.</p>
<ol class="loweralpha simple">
@@ -277,7 +282,7 @@
</ol>
</div>
<div class="section" id="definition-lists">
-<h2><a class="toc-backref" href="#id59"><span class="sectnum">2.4</span> Definition Lists</a></h2>
+<h2><a class="toc-backref" href="#id64"><span class="sectnum">2.4</span> Definition Lists</a></h2>
<dl>
<dt>Term</dt>
<dd><p>Definition</p>
@@ -295,7 +300,7 @@
</dl>
</div>
<div class="section" id="field-lists">
-<h2><a class="toc-backref" href="#id60"><span class="sectnum">2.5</span> Field Lists</a></h2>
+<h2><a class="toc-backref" href="#id65"><span class="sectnum">2.5</span> Field Lists</a></h2>
<dl class="field-list">
<dt>what</dt>
<dd><p>Field lists map field names to field bodies, like database
@@ -315,7 +320,7 @@
</dl>
</div>
<div class="section" id="option-lists">
-<h2><a class="toc-backref" href="#id61"><span class="sectnum">2.6</span> Option Lists</a></h2>
+<h2><a class="toc-backref" href="#id66"><span class="sectnum">2.6</span> Option Lists</a></h2>
<p>For listing command-line options:</p>
<dl class="option-list">
<dt><kbd><span class="option">-a</span></kbd></dt>
@@ -354,7 +359,7 @@
description.</p>
</div>
<div class="section" id="literal-blocks">
-<h2><a class="toc-backref" href="#id62"><span class="sectnum">2.7</span> Literal Blocks</a></h2>
+<h2><a class="toc-backref" href="#id67"><span class="sectnum">2.7</span> Literal Blocks</a></h2>
<p>Literal blocks are indicated with a double-colon ("::") at the end of
the preceding paragraph (over there <span class="docutils literal"><span class="pre">--></span></span>). They can be indented:</p>
<pre class="literal-block">if literal_block:
@@ -367,7 +372,7 @@
> Why didn't I think of that?</pre>
</div>
<div class="section" id="line-blocks">
-<h2><a class="toc-backref" href="#id63"><span class="sectnum">2.8</span> Line Blocks</a></h2>
+<h2><a class="toc-backref" href="#id68"><span class="sectnum">2.8</span> Line Blocks</a></h2>
<p>This section tests line blocks. Line blocks are body elements which
consist of lines and other line blocks. Nested line blocks cause
indentation.</p>
@@ -441,7 +446,7 @@
</div>
</div>
<div class="section" id="block-quotes">
-<h2><a class="toc-backref" href="#id64"><span class="sectnum">2.9</span> Block Quotes</a></h2>
+<h2><a class="toc-backref" href="#id69"><span class="sectnum">2.9</span> Block Quotes</a></h2>
<p>Block quotes consist of indented body elements:</p>
<blockquote>
<p>My theory by A. Elk. Brackets Miss, brackets. This theory goes
@@ -460,7 +465,7 @@
</blockquote>
</div>
<div class="section" id="doctest-blocks">
-<h2><a class="toc-backref" href="#id65"><span class="sectnum">2.10</span> Doctest Blocks</a></h2>
+<h2><a class="toc-backref" href="#id70"><span class="sectnum">2.10</span> Doctest Blocks</a></h2>
<pre class="code python doctest">>>> print 'Python-specific usage examples; begun with ">>>"'
Python-specific usage examples; begun with ">>>"
>>> print '(cut and pasted from interactive Python sessions)'
@@ -468,7 +473,7 @@
</pre>
</div>
<div class="section" id="footnotes">
-<h2><a class="toc-backref" href="#id66"><span class="sectnum">2.11</span> Footnotes</a></h2>
+<h2><a class="toc-backref" href="#id71"><span class="sectnum">2.11</span> Footnotes</a></h2>
<dl class="footnote brackets">
<dt class="label" id="id8"><span class="brackets">1</span><span class="fn-backref">(<a href="#id1">1</a>,<a href="#id9">2</a>,<a href="#id22">3</a>)</span></dt>
<dd><p>A footnote contains body elements, consistently indented by at
@@ -496,12 +501,12 @@
</dd>
<dt class="label" id="id16"><span class="brackets">4</span></dt>
<dd><p>Here's an unreferenced footnote, with a reference to a
-nonexistent footnote: <a href="#id109"><span class="problematic" id="id17">[5]_</span></a>.</p>
+nonexistent footnote: <a href="#id116"><span class="problematic" id="id17">[5]_</span></a>.</p>
</dd>
</dl>
</div>
<div class="section" id="citations">
-<h2><a class="toc-backref" href="#id67"><span class="sectnum">2.12</span> Citations</a></h2>
+<h2><a class="toc-backref" href="#id72"><span class="sectnum">2.12</span> Citations</a></h2>
<dl class="citation">
<dt class="label" id="cit2002"><span class="brackets">CIT2002</span><span class="fn-backref">(<a href="#id5">1</a>,<a href="#id18">2</a>)</span></dt>
<dd><p>Citations are text-labeled footnotes. They may be
@@ -508,11 +513,11 @@
rendered separately and differently from footnotes.</p>
</dd>
</dl>
-<p>Here's a reference to the above, <a class="citation-reference" href="#cit2002" id="id18">[CIT2002]</a>, and a <a href="#id110"><span class="problematic" id="id19">[nonexistent]_</span></a>
+<p>Here's a reference to the above, <a class="citation-reference" href="#cit2002" id="id18">[CIT2002]</a>, and a <a href="#id117"><span class="problematic" id="id19">[nonexistent]_</span></a>
citation.</p>
</div>
<div class="section" id="targets">
-<span id="another-target"></span><h2><a class="toc-backref" href="#id68"><span class="sectnum">2.13</span> Targets</a></h2>
+<span id="another-target"></span><h2><a class="toc-backref" href="#id73"><span class="sectnum">2.13</span> Targets</a></h2>
<p id="example">This paragraph is pointed to by the explicit "example" target. A
reference can be found under <a class="reference internal" href="#inline-markup">Inline Markup</a>, above. <a class="reference internal" href="#inline-hyperlink-targets">Inline
hyperlink targets</a> are also possible.</p>
@@ -519,37 +524,37 @@
<p>Section headers are implicit targets, referred to by name. See
<a class="reference internal" href="#targets">Targets</a>, which is a subsection of <a class="reference internal" href="#body-elements">Body Elements</a>.</p>
<p>Explicit external targets are interpolated into references such as
-"<a class="reference external" href="http://www.python.org/">Python</a> <a class="footnote-reference brackets" href="#id33" id="id35">7</a>".</p>
+"<a class="reference external" href="http://www.python.org/">Python</a> <a class="footnote-reference brackets" href="#id36" id="id38">7</a>".</p>
<p>Targets may be indirect and anonymous. Thus <a class="reference internal" href="#targets">this phrase</a> may also
refer to the <a class="reference internal" href="#targets">Targets</a> section.</p>
-<p>Here's a <a href="#id111"><span class="problematic" id="id112">`hyperlink reference without a target`_</span></a>, which generates an
+<p>Here's a <a href="#id118"><span class="problematic" id="id119">`hyperlink reference without a target`_</span></a>, which generates an
error.</p>
<div class="section" id="duplicate-target-names">
-<h3><a class="toc-backref" href="#id69"><span class="sectnum">2.13.1</span> Duplicate Target Names</a></h3>
+<h3><a class="toc-backref" href="#id74"><span class="sectnum">2.13.1</span> Duplicate Target Names</a></h3>
<p>Duplicate names in section headers or other implicit targets will
generate "info" (level-1) system messages. Duplicate names in
explicit targets will generate "warning" (level-2) system messages.</p>
</div>
<div class="section" id="id21">
-<h3><a class="toc-backref" href="#id70"><span class="sectnum">2.13.2</span> Duplicate Target Names</a></h3>
+<h3><a class="toc-backref" href="#id75"><span class="sectnum">2.13.2</span> Duplicate Target Names</a></h3>
<p>Since there are two "Duplicate Target Names" section headers, we
cannot uniquely refer to either of them by name. If we try to (like
-this: <a href="#id113"><span class="problematic" id="id114">`Duplicate Target Names...
[truncated message content] |
|
From: <mi...@us...> - 2019-10-12 20:38:12
|
Revision: 8404
http://sourceforge.net/p/docutils/code/8404
Author: milde
Date: 2019-10-12 20:38:10 +0000 (Sat, 12 Oct 2019)
Log Message:
-----------
Document descriptive auto-IDs and future changes to ID generation.
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/RELEASE-NOTES.txt
trunk/docutils/docs/user/config.txt
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2019-10-11 10:09:53 UTC (rev 8403)
+++ trunk/docutils/HISTORY.txt 2019-10-12 20:38:10 UTC (rev 8404)
@@ -37,9 +37,13 @@
* docutils/nodes.py
- Speed up Node.next_node().
+ - If `auto_id_prefix`_ ends with a "%", this is replaced with the tag
+ name.
- Warn about Node.traverse() returning an iterator instead of a list
in future.
+ .. _auto_id_prefix: docs/user/config.html#auto-id-prefix
+
* docutils/statemachine.py
- Patch [ 158 ]: Speed up patterns by saving compiled versions (eric89gxl)
Modified: trunk/docutils/RELEASE-NOTES.txt
===================================================================
--- trunk/docutils/RELEASE-NOTES.txt 2019-10-11 10:09:53 UTC (rev 8403)
+++ trunk/docutils/RELEASE-NOTES.txt 2019-10-12 20:38:10 UTC (rev 8404)
@@ -48,7 +48,20 @@
* Remove ``utils.unique_combinations``
(obsoleted by ``itertools.combinations``).
+
+* The id_prefix_ setting will be prepended to the `reference name`_ *before*
+ conversion to an ID. (Currently it is prepended as-is, without checking
+ for conformance to Docutils' `ID naming rules`_.) This may change
+ generated IDs.
+
+ Example: with ``--id-prefix="DU"``, a section with title "34.
+ May" currently gets the ID ``DU-may`` and after the change the ID
+ ``du-34-may``.
+* The default value for auto_id_prefix_ will change to "%". This means
+ auto-generated IDs will use the tag name as prefix. Set auto_id_prefix_ to
+ "id" if you want unchanged IDs or to "%" if you want descriptive IDs.
+
* The default HTML writer "html" with frontend ``rst2html.py`` may change
from "html4css1" to "html5".
@@ -59,9 +72,12 @@
generated HTML code, e.g. because you use a custom style sheet or
post-processing that may break otherwise.
+.. _id_prefix: docs/user/config.html#id-prefix
+.. _auto_id_prefix: docs/user/config.html#auto-id-prefix
.. _rst2html.py: docs/user/tools.html#rst2html-py
+.. _reference name: docs/ref/rst/restructuredtext.html#reference-names
+.. _ID naming rules: docs/ref/rst/directives.html#rationale
-
Release 0.16
============
Modified: trunk/docutils/docs/user/config.txt
===================================================================
--- trunk/docutils/docs/user/config.txt 2019-10-11 10:09:53 UTC (rev 8403)
+++ trunk/docutils/docs/user/config.txt 2019-10-12 20:38:10 UTC (rev 8404)
@@ -199,10 +199,13 @@
Prefix prepended to all auto-generated IDs generated within the
document, after id_prefix_.
+A trailing "%" is replaced with the tag name (new in Docutils 0.16).
-Default: "id".
+Default: "id". (Will be `changed to "%" in future`__.)
Options: ``--auto-id-prefix`` (hidden, intended mainly for programmatic use).
+__ ../../RELEASE-NOTES.html#future-changes
+
datestamp
---------
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2019-10-29 22:48:18
|
Revision: 8405
http://sourceforge.net/p/docutils/code/8405
Author: milde
Date: 2019-10-29 22:48:16 +0000 (Tue, 29 Oct 2019)
Log Message:
-----------
Less invasive change-plan for `identifier key` generation.
Do not use `identifier normalization` on the "id_prefix".
This allows users to keep generating identifiers with a prefix
containing capital letters or characters allowed in some output
formats but not in Docutils `identifier keys`.
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/RELEASE-NOTES.txt
trunk/docutils/docs/user/config.txt
trunk/docutils/docs/user/smartquotes.txt
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2019-10-12 20:38:10 UTC (rev 8404)
+++ trunk/docutils/HISTORY.txt 2019-10-29 22:48:16 UTC (rev 8405)
@@ -37,8 +37,7 @@
* docutils/nodes.py
- Speed up Node.next_node().
- - If `auto_id_prefix`_ ends with a "%", this is replaced with the tag
- name.
+ - If `auto_id_prefix`_ ends with "%", this is replaced with the tag name.
- Warn about Node.traverse() returning an iterator instead of a list
in future.
Modified: trunk/docutils/RELEASE-NOTES.txt
===================================================================
--- trunk/docutils/RELEASE-NOTES.txt 2019-10-12 20:38:10 UTC (rev 8404)
+++ trunk/docutils/RELEASE-NOTES.txt 2019-10-29 22:48:16 UTC (rev 8405)
@@ -49,18 +49,17 @@
* Remove ``utils.unique_combinations``
(obsoleted by ``itertools.combinations``).
-* The id_prefix_ setting will be prepended to the `reference name`_ *before*
- conversion to an ID. (Currently it is prepended as-is, without checking
- for conformance to Docutils' `ID naming rules`_.) This may change
- generated IDs.
+* If the id_prefix_ setting is non-empty, leading number and hyphen characters
+ will not be stripped from a `reference name`_ during `identifier
+ normalization`_. This may change generated `identifier keys`.
- Example: with ``--id-prefix="DU"``, a section with title "34.
- May" currently gets the ID ``DU-may`` and after the change the ID
- ``du-34-may``.
+ Example: with ``--id-prefix="DU-"``, a section with title "34. May"
+ currently gets the identifier key ``DU-may`` and after the change the
+ identifier key ``DU-34-may``.
* The default value for auto_id_prefix_ will change to "%". This means
auto-generated IDs will use the tag name as prefix. Set auto_id_prefix_ to
- "id" if you want unchanged IDs or to "%" if you want descriptive IDs.
+ "id" if you want unchanged auto-IDs or to "%" if you want descriptive IDs.
* The default HTML writer "html" with frontend ``rst2html.py`` may change
from "html4css1" to "html5".
@@ -76,7 +75,7 @@
.. _auto_id_prefix: docs/user/config.html#auto-id-prefix
.. _rst2html.py: docs/user/tools.html#rst2html-py
.. _reference name: docs/ref/rst/restructuredtext.html#reference-names
-.. _ID naming rules: docs/ref/rst/directives.html#rationale
+.. _identifier normalization: directives.html#identifier-normalization
Release 0.16
============
Modified: trunk/docutils/docs/user/config.txt
===================================================================
--- trunk/docutils/docs/user/config.txt 2019-10-12 20:38:10 UTC (rev 8404)
+++ trunk/docutils/docs/user/config.txt 2019-10-29 22:48:16 UTC (rev 8405)
@@ -197,13 +197,18 @@
auto_id_prefix
--------------
-Prefix prepended to all auto-generated IDs generated within the
-document, after id_prefix_.
+Prefix prepended to all auto-generated `identifier keys` generated within
+the document, after id_prefix_. Ensure the value conforms to the
+restrictions on identifiers in the output format, as it is not subjected to
+the `identifier normalization`_.
+
A trailing "%" is replaced with the tag name (new in Docutils 0.16).
-Default: "id". (Will be `changed to "%" in future`__.)
+Default: "id" (`will change to "%" in future`__).
Options: ``--auto-id-prefix`` (hidden, intended mainly for programmatic use).
+.. _identifier normalization:
+ ../ref/rst/directives.html#identifier-normalization
__ ../../RELEASE-NOTES.html#future-changes
datestamp
@@ -338,8 +343,10 @@
id_prefix
---------
-Prefix prepended to all IDs generated within the document. See also
-auto_id_prefix_.
+Prefix prepended to all identifier keys generated within the document.
+Ensure the value conforms to the restrictions on identifiers in the output
+format, as it is not subjected to the `identifier normalization`_.
+See also auto_id_prefix_.
Default: "" (empty).
Options: ``--id-prefix`` (hidden, intended mainly for programmatic use).
@@ -703,7 +710,7 @@
New in Docutils 0.10.
.. _SmartQuotes: smartquotes.html
-__ smartquotes.html#localisation
+__ smartquotes.html#localization
.. _quote characters:
http://en.wikipedia.org/wiki/Non-English_usage_of_quotation_marks
Modified: trunk/docutils/docs/user/smartquotes.txt
===================================================================
--- trunk/docutils/docs/user/smartquotes.txt 2019-10-12 20:38:10 UTC (rev 8404)
+++ trunk/docutils/docs/user/smartquotes.txt 2019-10-29 22:48:16 UTC (rev 8405)
@@ -75,7 +75,7 @@
.. _backslash escape: ../ref/rst/restructuredtext.html#escaping-mechanism
-Localisation
+Localization
============
Quotation marks have a `variety of forms`__ in different languages and
@@ -469,7 +469,7 @@
`Jeremy Hedley`_ and `Charles Wiltgen`_ deserve mention for exemplary beta
testing of the original SmartyPants.
-Internationalisation and adaption to Docutils by Günter Milde.
+Internationalization and adaption to Docutils by Günter Milde.
.. _SmartyPants: http://daringfireball.net/projects/smartypants/
.. _Pyblosxom: http://pyblosxom.bluesock.org/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2019-10-30 15:35:30
|
Revision: 8409
http://sourceforge.net/p/docutils/code/8409
Author: milde
Date: 2019-10-30 15:35:28 +0000 (Wed, 30 Oct 2019)
Log Message:
-----------
Fix and add test for more use cases for nodes.set_id().
Modified Paths:
--------------
trunk/docutils/docutils/nodes.py
trunk/docutils/test/test_nodes.py
Modified: trunk/docutils/docutils/nodes.py
===================================================================
--- trunk/docutils/docutils/nodes.py 2019-10-30 12:10:25 UTC (rev 8408)
+++ trunk/docutils/docutils/nodes.py 2019-10-30 15:35:28 UTC (rev 8409)
@@ -1365,15 +1365,17 @@
if not node['ids']:
id_prefix = self.settings.id_prefix
auto_id_prefix = self.settings.auto_id_prefix
+ base_id = ''
id = ''
for name in node['names']:
- id = id_prefix + make_id(name)
+ base_id = make_id(name)
+ id = id_prefix + base_id
# TODO: allow names starting with numbers if `id_prefix`
# is non-empty: id = make_id(id_prefix + name)
- if id and id not in self.ids:
+ if base_id and id not in self.ids:
break
else:
- if id and auto_id_prefix.endswith('%'):
+ if base_id and auto_id_prefix.endswith('%'):
# disambiguate name-derived ID
# TODO: remove second condition after announcing change
prefix = id + '-'
Modified: trunk/docutils/test/test_nodes.py
===================================================================
--- trunk/docutils/test/test_nodes.py 2019-10-30 12:10:25 UTC (rev 8408)
+++ trunk/docutils/test/test_nodes.py 2019-10-30 15:35:28 UTC (rev 8409)
@@ -661,6 +661,68 @@
self.compare_trees(self.document, newtree)
+class SetIdTests(unittest.TestCase):
+
+ def setUp(self):
+ self.document = utils.new_document('test')
+ self.elements = [nodes.Element(names=['test']),
+ nodes.section(), # Name empty
+ nodes.section(names=['Test']), # duplicate id
+ nodes.footnote(names=['2019-10-30']), # id empty
+ ]
+
+ def test_set_id_default(self):
+ # Default prefixes.
+ for element in self.elements:
+ self.document.set_id(element)
+ ids = [element['ids'] for element in self.elements]
+ self.assertEqual(ids, [['test'], ['id1'], ['id2'], ['id3']])
+
+ def test_set_id_custom(self):
+ # Custom prefixes.
+
+ # Change settings.
+ self.document.settings.id_prefix = 'P-'
+ self.document.settings.auto_id_prefix = 'auto'
+
+ for element in self.elements:
+ self.document.set_id(element)
+ ids = [element['ids'] for element in self.elements]
+ self.assertEqual(ids, [['P-test'],
+ ['P-auto1'],
+ ['P-auto2'],
+ ['P-auto3']])
+
+ def test_set_id_descriptive_auto_id(self):
+ # Use name or tag-name for auto-id.
+
+ # Change setting.
+ self.document.settings.auto_id_prefix = '%'
+
+ for element in self.elements:
+ self.document.set_id(element)
+ ids = [element['ids'] for element in self.elements]
+ self.assertEqual(ids, [['test'],
+ ['section-1'],
+ ['test-1'],
+ ['footnote-1']])
+
+ def test_set_id_custom_descriptive_auto_id(self):
+ # Custom prefixes and name or tag-name for auto-id.
+
+ # Change settings.
+ self.document.settings.id_prefix = 'P:'
+ self.document.settings.auto_id_prefix = 'a-%'
+
+ for element in self.elements:
+ self.document.set_id(element)
+ ids = [element['ids'] for element in self.elements]
+ self.assertEqual(ids, [['P:test'],
+ ['P:a-section-1'],
+ ['P:test-1'],
+ ['P:a-footnote-1']])
+
+
class MiscFunctionTests(unittest.TestCase):
names = [('a', 'a'), ('A', 'a'), ('A a A', 'a a a'),
@@ -672,33 +734,6 @@
normed = nodes.fully_normalize_name(input)
self.assertEqual(normed, output)
- def test_set_id_default(self):
- # Default prefixes.
- document = utils.new_document('test')
- # From name.
- element = nodes.Element(names=['test'])
- document.set_id(element)
- self.assertEqual(element['ids'], ['test'])
- # Auto-generated.
- element = nodes.Element()
- document.set_id(element)
- self.assertEqual(element['ids'], ['id1'])
- def test_set_id_custom(self):
- # Custom prefixes.
- document = utils.new_document('test')
- # Change settings.
- document.settings.id_prefix = 'prefix'
- document.settings.auto_id_prefix = 'auto'
- # From name.
- element = nodes.Element(names=['test'])
- document.set_id(element)
- self.assertEqual(element['ids'], ['prefixtest'])
- # Auto-generated.
- element = nodes.Element()
- document.set_id(element)
- self.assertEqual(element['ids'], ['prefixauto1'])
-
-
if __name__ == '__main__':
unittest.main()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2019-11-04 21:14:47
|
Revision: 8410
http://sourceforge.net/p/docutils/code/8410
Author: milde
Date: 2019-11-04 21:14:43 +0000 (Mon, 04 Nov 2019)
Log Message:
-----------
buildhtml.py: New option "--html-writer".
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/RELEASE-NOTES.txt
trunk/docutils/docutils/writers/html5_polyglot/__init__.py
trunk/docutils/docutils.conf
trunk/docutils/tools/buildhtml.py
trunk/docutils/tools/rst2html5.py
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2019-10-30 15:35:28 UTC (rev 8409)
+++ trunk/docutils/HISTORY.txt 2019-11-04 21:14:43 UTC (rev 8410)
@@ -92,7 +92,14 @@
- Fix [ 359 ]: Test suite failes on Python 3.8. odt xml sorting.
Use ElementTree instead of minidom.
+* tools/buildhtml.py
+ - New option "--html-writer" allows to select "html__" (default),
+ "html4" or "html5".
+
+ __ html: docs/user/html.html#html
+
+
Release 0.15.1 (2019-07-24)
===========================
Modified: trunk/docutils/RELEASE-NOTES.txt
===================================================================
--- trunk/docutils/RELEASE-NOTES.txt 2019-10-30 15:35:28 UTC (rev 8409)
+++ trunk/docutils/RELEASE-NOTES.txt 2019-11-04 21:14:43 UTC (rev 8410)
@@ -48,11 +48,11 @@
* Remove ``utils.unique_combinations``
(obsoleted by ``itertools.combinations``).
-
+
* If the id_prefix_ setting is non-empty, leading number and hyphen characters
will not be stripped from a `reference name`_ during `identifier
normalization`_. This may change generated `identifier keys`.
-
+
Example: with ``--id-prefix="DU-"``, a section with title "34. May"
currently gets the identifier key ``DU-may`` and after the change the
identifier key ``DU-34-may``.
@@ -106,13 +106,20 @@
- Deprecate ``\docutilsrole`` prefix for styling commands:
use ``\DUrole`` instead.
+* tools/buildhtml.py
+
+ - New option "--html-writer" allows to select "html__" (default),
+ "html4" or "html5".
+
+ __ html: docs/user/html.html#html
+
* docutils/io.py
- Remove the `handle_io_errors` option from io.FileInput/Output.
-Release 0.15
-============
+Release 0.15 (2019-07-20)
+=========================
.. Note::
Modified: trunk/docutils/docutils/writers/html5_polyglot/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/html5_polyglot/__init__.py 2019-10-30 15:35:28 UTC (rev 8409)
+++ trunk/docutils/docutils/writers/html5_polyglot/__init__.py 2019-11-04 21:14:43 UTC (rev 8410)
@@ -20,7 +20,7 @@
"""
Plain HyperText Markup Language document tree Writer.
-The output conforms to the `HTML5` specification.
+The output conforms to the `HTML 5` specification.
The cascading style sheet "minimal.css" is required for proper viewing,
the style sheet "plain.css" improves reading experience.
Modified: trunk/docutils/docutils.conf
===================================================================
--- trunk/docutils/docutils.conf 2019-10-30 15:35:28 UTC (rev 8409)
+++ trunk/docutils/docutils.conf 2019-11-04 21:14:43 UTC (rev 8410)
@@ -10,6 +10,11 @@
embed-stylesheet: no
field-name-limit: 20
+[html5 writer]
+stylesheet-dirs: docutils/writers/html5_polyglot/
+stylesheet-path: minimal.css, plain.css
+embed-stylesheet: no
+
# Prevent tools/buildhtml.py from processing certain text files.
[buildhtml application]
ignore: GPL2.txt
Modified: trunk/docutils/tools/buildhtml.py
===================================================================
--- trunk/docutils/tools/buildhtml.py 2019-10-30 15:35:28 UTC (rev 8409)
+++ trunk/docutils/tools/buildhtml.py 2019-11-04 21:14:43 UTC (rev 8410)
@@ -32,7 +32,7 @@
from docutils.utils.error_reporting import ErrorOutput, ErrorString
from docutils.parsers import rst
from docutils.readers import standalone, pep
-from docutils.writers import html4css1, pep_html
+from docutils.writers import html4css1, html5_polyglot, pep_html
usage = '%prog [options] [<directory> ...]'
@@ -75,6 +75,12 @@
{'metavar': '<patterns>', 'action': 'append',
'default': [],
'validator': frontend.validate_colon_separated_string_list}),
+ ('HTML version, one of "html", "html4", "html5". '
+ 'Default: "html" (use Docutils\' default HTML writer).',
+ ['--html-writer'],
+ {'metavar': '<html_writer>',
+ 'choices': ['html', 'html4', 'html5'],
+ 'default': 'html'}),
('Work silently (no progress messages). Independent of "--quiet".',
['--silent'],
{'action': 'store_true', 'validator': frontend.validate_boolean}),
@@ -121,10 +127,14 @@
self.publishers = {
'': Struct(components=(pep.Reader, rst.Parser, pep_html.Writer,
SettingsSpec)),
- '.txt': Struct(components=(rst.Parser, standalone.Reader,
+ 'html4': Struct(components=(rst.Parser, standalone.Reader,
html4css1.Writer, SettingsSpec),
reader_name='standalone',
- writer_name='html'),
+ writer_name='html4'),
+ 'html5': Struct(components=(rst.Parser, standalone.Reader,
+ html5_polyglot.Writer, SettingsSpec),
+ reader_name='standalone',
+ writer_name='html5'),
'PEPs': Struct(components=(rst.Parser, pep.Reader,
pep_html.Writer, SettingsSpec),
reader_name='pep',
@@ -134,6 +144,8 @@
all components used by individual publishers."""
self.setup_publishers()
+ # default html writer (may change to html5 some time):
+ self.publishers['html'] = self.publishers['html4']
def setup_publishers(self):
"""
@@ -223,7 +235,7 @@
if name.startswith('pep-'):
publisher = 'PEPs'
else:
- publisher = '.txt'
+ publisher = self.initial_settings.html_writer
settings = self.get_settings(publisher, directory)
errout = ErrorOutput(encoding=settings.error_encoding)
pub_struct = self.publishers[publisher]
Modified: trunk/docutils/tools/rst2html5.py
===================================================================
--- trunk/docutils/tools/rst2html5.py 2019-10-30 15:35:28 UTC (rev 8409)
+++ trunk/docutils/tools/rst2html5.py 2019-11-04 21:14:43 UTC (rev 8410)
@@ -14,7 +14,7 @@
# Date: $Date$
"""
-A minimal front end to the Docutils Publisher, producing HTML 5 documents.
+A minimal front end to the Docutils Publisher, producing HTML 5 documents.
The output also conforms to XHTML 1.0 transitional
(except for the doctype declaration).
@@ -28,7 +28,7 @@
from docutils.core import publish_cmdline, default_description
-description = (u'Generates HTML 5 documents from standalone '
+description = (u'Generates HTML 5 documents from standalone '
u'reStructuredText sources '
+ default_description)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2019-11-05 13:32:15
|
Revision: 8411
http://sourceforge.net/p/docutils/code/8411
Author: milde
Date: 2019-11-05 13:32:13 +0000 (Tue, 05 Nov 2019)
Log Message:
-----------
New configuration section "[latex writers]".
Add "latex writers" to the `config_section_dependencies`
in the "latex2e" and "xetex" writers.
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/docs/user/config.txt
trunk/docutils/docs/user/latex.txt
trunk/docutils/docutils/writers/latex2e/__init__.py
trunk/docutils/docutils/writers/odf_odt/__init__.py
trunk/docutils/docutils/writers/xetex/__init__.py
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2019-11-04 21:14:43 UTC (rev 8410)
+++ trunk/docutils/HISTORY.txt 2019-11-05 13:32:13 UTC (rev 8411)
@@ -64,15 +64,19 @@
- Fix [ 339 ] don't use "alltt" or literal-block-environment
in admonitions and footnotes.
- Deprecation warning for ``\docutilsrole``-prefixed styling commands.
+ - Add "latex writers" to the `config_section_dependencies`.
+* docutils/writers/manpage.py
+
+ - Apply fix for [ 289 ], line starting with ``.`` in a text.
+
* docutils/writers/odf_odt/__init__.py:
- Fix: ElementTree.getchildren deprecated warning
-* docutils/writers/manpage.py
+* docutils/writers/xetex/__init__.py:
+ - Add "latex writers" to the `config_section_dependencies`.
- - Apply fix for [ 289 ], line starting with ``.`` in a text.
-
* test/alltests.py
- Fix: 377 ResourceWarning: unclosed file python3.8
Modified: trunk/docutils/docs/user/config.txt
===================================================================
--- trunk/docutils/docs/user/config.txt 2019-11-04 21:14:43 UTC (rev 8410)
+++ trunk/docutils/docs/user/config.txt 2019-11-05 13:32:13 UTC (rev 8411)
@@ -343,9 +343,9 @@
id_prefix
---------
-Prefix prepended to all identifier keys generated within the document.
+Prefix prepended to all identifier keys generated within the document.
Ensure the value conforms to the restrictions on identifiers in the output
-format, as it is not subjected to the `identifier normalization`_.
+format, as it is not subjected to the `identifier normalization`_.
See also auto_id_prefix_.
Default: "" (empty).
@@ -780,7 +780,7 @@
Options: ``--trim-footnote-reference-space, --leave-footnote-reference-space``.
-__ `footnote_references [latex2e writer]`_
+__ `footnote_references [latex writers]`_
[readers]
@@ -890,7 +890,7 @@
Format for `block quote`_ attributions: one of "dash" (em-dash
prefix), "parentheses"/"parens", or "none". Also defined for the
-`LaTeX Writer <attribution [latex2e writer]_>`__.
+`LaTeX Writers <attribution [latex writers]_>`__.
Default: "dash". Options: ``--attribution``.
@@ -946,7 +946,7 @@
Embed the stylesheet in the output HTML file. The stylesheet file
must specified by the stylesheet_path__ setting and must be
accessible during processing.
-Also defined for the `LaTeX Writer <embed_stylesheet [latex2e writer]_>`__.
+Also defined for the `LaTeX Writers <embed_stylesheet [latex writers]_>`__.
Default: enabled. Options: ``--embed-stylesheet,
--link-stylesheet``.
@@ -968,7 +968,7 @@
~~~~~~~~~~~~~~~~~~~
Format for `footnote references`_, one of "superscript" or "brackets".
-Also defined for the `LaTeX Writer <footnote_references [latex2e writer]_>`__.
+Also defined for the `LaTeX Writers <footnote_references [latex writers]_>`__.
Overrides [#override]_ trim_footnote_reference_space_, if
applicable. [#footnote_space]_
@@ -1110,7 +1110,7 @@
~~~~~~~~~~
A comma-separated list of CSS stylesheet URLs, used verbatim.
-Also defined for the `LaTeX Writer <stylesheet [latex2e writer]_>`__.
+Also defined for the `LaTeX Writer <stylesheet [latex writers]_>`__.
Overrides also stylesheet-path__. [#override]_
@@ -1156,7 +1156,7 @@
Options: ``--stylesheet-path``.
__ `embed_stylesheet [html4css1 writer]`_
-__ `stylesheet_path [latex2e writer]`_
+__ `stylesheet_path [latex writers]`_
__ `stylesheet_dirs [html4css1 writer]`_
.. _table_style [html4css1 writer]:
@@ -1186,7 +1186,7 @@
Default: "". Option: ``--table-style``.
-__ `table_style [latex2e writer]`_
+__ `table_style [latex writers]`_
.. _table directive: ../ref/rst/directives.html#table
.. _template [html4css1 writer]:
@@ -1201,7 +1201,7 @@
directory (installed automatically; for the exact machine-specific
path, use the ``--help`` option). Options: ``--template``.
-__ `template [latex2e writer]`_
+__ `template [latex writers]`_
.. _xml_declaration [html4css1 writer]:
@@ -1358,9 +1358,11 @@
New in Docutils 0.13.
-[latex2e writer]
+[latex writers]
----------------
+Common settings for the `[latex2e writer]`_ and `[xetex writer]`_.
+
use_latex_toc
~~~~~~~~~~~~~
@@ -1442,21 +1444,9 @@
Default: "a4paper". Option: ``--documentoptions``.
-font_encoding
-~~~~~~~~~~~~~
-Specify LaTeX font encoding. Multiple options can be given, separated by
-commas. The last value becomes the document default.
-Possible values are "", "T1", "OT1", "LGR,T1" or any other combination of
-`LaTeX font encodings`_.
+.. _embed_stylesheet [latex writers]:
-Default: "T1". Option: ``--font-encoding``.
-
-.. _LaTeX font encodings:
- http://mirror.ctan.org/macros/latex/doc/encguide.pdf
-
-.. _embed_stylesheet [latex2e writer]:
-
embed_stylesheet
~~~~~~~~~~~~~~~~
@@ -1470,7 +1460,7 @@
__ `embed_stylesheet [html4css1 writer]`_
-.. _stylesheet [latex2e writer]:
+.. _stylesheet [latex writers]:
stylesheet
~~~~~~~~~~
@@ -1488,14 +1478,14 @@
Default: no stylesheet (""). Option: ``--stylesheet``.
-__ `stylesheet_path [latex2e writer]`_
-__ `embed_stylesheet [latex2e writer]`_
+__ `stylesheet_path [latex writers]`_
+__ `embed_stylesheet [latex writers]`_
__ `stylesheet [html4css1 writer]`_
.. _TeX input path:
http://www.tex.ac.uk/cgi-bin/texfaq2html?label=what-TDS
-.. _stylesheet_dirs [latex2e writer]:
+.. _stylesheet_dirs [latex writers]:
stylesheet_dirs
~~~~~~~~~~~~~~~
@@ -1508,7 +1498,7 @@
stylesheet_path__ setting with the meaning of a file location.
__
-__ `stylesheet_path [latex2e writer]`_
+__ `stylesheet_path [latex writers]`_
Default: the working directory of the process at launch and the directory
with default stylesheet files (writer and installation specific).
@@ -1515,7 +1505,7 @@
Use the ``--help`` option to get the exact value.
Option: ``--stylesheet-directories``.
-.. _stylesheet_path [latex2e writer]:
+.. _stylesheet_path [latex writers]:
stylesheet_path
~~~~~~~~~~~~~~~
@@ -1535,10 +1525,10 @@
Default: no stylesheet (""). Option: ``--stylesheet-path``.
-__ `stylesheet_dirs [latex2e writer]`_
-__ `embed_stylesheet [latex2e writer]`_
+__ `stylesheet_dirs [latex writers]`_
+__ `embed_stylesheet [latex writers]`_
__
-__ `stylesheet [latex2e writer]`_
+__ `stylesheet [latex writers]`_
latex_preamble
@@ -1548,16 +1538,10 @@
Can be used to load packages with options or (re-) define LaTeX
macros without writing a custom style file (new in Docutils 0.7).
-Default: Load the "PDF standard fonts" (Times, Helvetica,
-Courier)::
-
- \usepackage{mathptmx} % Times
- \usepackage[scaled=.90]{helvet}
- \usepackage{courier}
-
+Default: writer dependent (see `[latex2e writer]`_, `[xetex writer]`_).
Option: ``--latex-preamble``.
-.. _footnote_references [latex2e writer]:
+.. _footnote_references [latex writers]:
footnote_references
~~~~~~~~~~~~~~~~~~~
@@ -1572,7 +1556,7 @@
__ `footnote_references [html4css1 writer]`_
-.. _attribution [latex2e writer]:
+.. _attribution [latex writers]:
attribution
~~~~~~~~~~~
@@ -1631,7 +1615,7 @@
Default: "-". Option: ``--section-enumerator-separator``.
-.. _table_style [latex2e writer]:
+.. _table_style [latex writers]:
table_style
~~~~~~~~~~~
@@ -1668,36 +1652,81 @@
__ `table_style [html4css1 writer]`_
-.. _template [latex2e writer]:
+.. _template [latex writers]:
template
~~~~~~~~
-Path to template file, which must be encoded in UTF-8. [#pwd]_
+Path [#pwd]_ to template file, which must be encoded in UTF-8.
Also defined for the `HTML Writer`__.
-Default: "default.tex" in the docutils/writers/latex2e/
-directory (installed automatically; for the exact machine-specific
-path, use the ``--help`` option). Options: ``--template``.
+Default: writer dependent (see `[latex2e writer]`_, `[xetex writer]`_).
+Options: ``--template``.
__ `template [html4css1 writer]`_
+[latex2e writer]
+~~~~~~~~~~~~~~~~
+
+The `LaTeX2e writer`_ generates a LaTeX source for compilation with 8-bit
+LaTeX (pdfTeX_). It shares all settings defined in the `[latex writers]`_
+`configuration section`_.
+
+.. _LaTeX2e writer: latex.html#latex2e-writer
+.. _pdfTeX: https://www.tug.org/applications/pdftex/
+.. _configuration section: `Configuration File Sections & Entries`_
+
+
+Writer Specific Defaults
+""""""""""""""""""""""""
+
+latex_preamble_
+ Load the "PDF standard fonts" (Times, Helvetica, Courier)::
+
+ \usepackage{mathptmx} % Times
+ \usepackage[scaled=.90]{helvet}
+ \usepackage{courier}
+
+template__
+ "default.tex" in the ``docutils/writers/latex2e/`` directory
+ (installed automatically).
+
+ __ `template [latex writers]`_
+
+
+font_encoding
+"""""""""""""
+
+Specify `LaTeX font encoding`_. Multiple options can be given, separated by
+commas. The last value becomes the document default.
+Possible values are "", "T1", "OT1", "LGR,T1" or any other combination of
+`LaTeX font encodings`_.
+
+Default: "T1". Option: ``--font-encoding``.
+
+.. _LaTeX font encoding: latex.html#font-encoding
+.. _LaTeX font encodings:
+ http://mirror.ctan.org/macros/latex/doc/encguide.pdf
+
+
[xetex writer]
~~~~~~~~~~~~~~
-The xetex writer derives from the latex2e writer, and shares
-all settings defined in the `[latex2e writer]`_ section. The
-"[latex2e writer]" section of configuration files is processed
-before the "[xetex writer]" section.
+The `XeTeX writer`_ generates a LaTeX source for compilation with `XeTeX or
+LuaTeX`_. It derives from the latex2e writer, and shares all settings
+defined in the `[latex writers]`_ and `[latex2e writer]`_ `configuration
+sections`_.
-The following settings differ from those of the latex2e writer:
+.. _XeTeX writer: latex.html#xetex-writer
+.. _XeTeX or LuaTeX: https://texfaq.org/FAQ-xetex-luatex
+.. _configuration sections: `Configuration File Sections & Entries`_
-font_encoding_
- Disabled (Use Unicode-encoded fonts).
+Writer Specific Defaults
+""""""""""""""""""""""""
-latex_preamble_
- Default: Font setup for `Linux Libertine`_,::
+latex_preamble_:
+ Font setup for `Linux Libertine`_,::
% Linux Libertine (free, wide coverage, not only for Linux)
\setmainfont{Linux Libertine O}
@@ -1707,13 +1736,19 @@
The optional argument ``HyphenChar=None`` to the monospace font
prevents word hyphenation in literal text.
-template__
- Default: "xelatex.tex"
-
.. _Linux Libertine: http://www.linuxlibertine.org/
-__ `template [latex2e writer]`_
+template__:
+ "xelatex.tex" in the ``docutils/writers/latex2e/`` directory
+ (installed automatically).
+
+ .. TODO: show full path with --help (like in the HTML writers) and
+ add the following line:
+ for the exact machine-specific path, use the ``--help`` option).
+ __ `template [latex writers]`_
+
+
[odf_odt writer]
----------------
Modified: trunk/docutils/docs/user/latex.txt
===================================================================
--- trunk/docutils/docs/user/latex.txt 2019-11-04 21:14:43 UTC (rev 8410)
+++ trunk/docutils/docs/user/latex.txt 2019-11-05 13:32:13 UTC (rev 8411)
@@ -123,11 +123,13 @@
_`pdflatex`
Generates a PDF document directly from the LaTeX file.
+ Export your document with the _`LaTeX2e writer` (writer
+ name "``latex``", frontend tool rst2latex.py_).
_`xelatex` or _`lualatex`
The `XeTeX`_ and LuaTeX_ engines work with input files in UTF-8 encoding
- and system fonts. Export your document with the `xetex` writer
- (``rst2xetex``), if you want to go this route.
+ and system fonts. Export your document with the _`XeTeX writer` (writer
+ name "``xetex``", frontend tool rst2xetex.py_).
You may need to call latex two or three times to get internal references
correct.
@@ -135,8 +137,9 @@
.. _documentoptions: config.html#documentoptions
.. _xetex: http://tug.org/xetex/
.. _luatex: http://luatex.org/
+.. _rst2latex.py: tools.html#rst2latex-py
+.. _rst2xetex.py: tools.html#rst2xetex-py
-
_`rubber`
The Rubber__ wrapper for LaTeX and friends can be used to automatically
run all programs the required number of times and delete "spurious" files.
Modified: trunk/docutils/docutils/writers/latex2e/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/latex2e/__init__.py 2019-11-04 21:14:43 UTC (rev 8410)
+++ trunk/docutils/docutils/writers/latex2e/__init__.py 2019-11-05 13:32:13 UTC (rev 8411)
@@ -223,7 +223,7 @@
settings_defaults = {'sectnum_depth': 0 # updated by SectNum transform
}
config_section = 'latex2e writer'
- config_section_dependencies = ('writers',)
+ config_section_dependencies = ('writers', 'latex writers')
head_parts = ('head_prefix', 'requirements', 'latex_preamble',
'stylesheet', 'fallbacks', 'pdfsetup', 'titledata')
Modified: trunk/docutils/docutils/writers/odf_odt/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/odf_odt/__init__.py 2019-11-04 21:14:43 UTC (rev 8410)
+++ trunk/docutils/docutils/writers/odf_odt/__init__.py 2019-11-05 13:32:13 UTC (rev 8411)
@@ -554,9 +554,7 @@
)
config_section = 'odf_odt writer'
- config_section_dependencies = (
- 'writers',
- )
+ config_section_dependencies = ('writers',)
def __init__(self):
writers.Writer.__init__(self)
Modified: trunk/docutils/docutils/writers/xetex/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/xetex/__init__.py 2019-11-04 21:14:43 UTC (rev 8410)
+++ trunk/docutils/docutils/writers/xetex/__init__.py 2019-11-05 13:32:13 UTC (rev 8411)
@@ -47,7 +47,8 @@
])
config_section = 'xetex writer'
- config_section_dependencies = ('writers', 'latex2e writer')
+ config_section_dependencies = ('writers', 'latex writers',
+ 'latex2e writer') # TODO: remove dependency on `latex2e writer`.
settings_spec = frontend.filter_settings_spec(
latex2e.Writer.settings_spec,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2019-11-06 18:15:24
|
Revision: 8412
http://sourceforge.net/p/docutils/code/8412
Author: milde
Date: 2019-11-06 18:15:21 +0000 (Wed, 06 Nov 2019)
Log Message:
-----------
Update and document configuration section dependencies.
Modified Paths:
--------------
trunk/docutils/docs/user/config.txt
trunk/docutils/docutils/writers/_html_base.py
trunk/docutils/docutils/writers/pep_html/__init__.py
trunk/docutils/docutils/writers/s5_html/__init__.py
trunk/docutils/docutils.conf
trunk/docutils/tools/docutils.conf
Modified: trunk/docutils/docs/user/config.txt
===================================================================
--- trunk/docutils/docs/user/config.txt 2019-11-05 13:32:13 UTC (rev 8411)
+++ trunk/docutils/docs/user/config.txt 2019-11-06 18:15:21 UTC (rev 8412)
@@ -159,13 +159,14 @@
Reader used ("[... reader]"). For example, `[pep reader]`_ depends
on `[standalone reader]`_.
-4. `[writers]`_, writer dependencies, and the section specific to the
- Writer used ("[... writer]"). For example, `[pep_html writer]`_
- depends on `[html4css1 writer]`_.
+4. `[writers]`_, writer family ("[... writers]"; if applicable),
+ writer dependencies, and the section specific to the writer used
+ ("[... writer]"). For example, `[pep_html writer]`_ depends
+ on `[html4css1 writer]`_.
5. `[applications]`_, application dependencies, and the section
- specific to the Application (front-end tool) in use
- ("[... application]").
+ specific to the Application (front-end tool) in use
+ ("[... application]").
Since any setting may be specified in any section, this ordering
allows component- or application-specific overrides of earlier
@@ -873,17 +874,17 @@
~~~~~~~~~~~~~~~
Generate XML with an XML declaration. Also defined for the
-`HTML Writer`__.
+`HTML Writers`__.
Default: do (1). Options: ``--no-xml-declaration``.
-__ `xml_declaration [html4css1 writer]`_
+__ `xml_declaration [html writers]`_
-[html4css1 writer]
-------------------
+[html writers]
+--------------
-.. _attribution [html4css1 writer]:
+.. _attribution [html writers]:
attribution
~~~~~~~~~~~
@@ -890,10 +891,12 @@
Format for `block quote`_ attributions: one of "dash" (em-dash
prefix), "parentheses"/"parens", or "none". Also defined for the
-`LaTeX Writers <attribution [latex writers]_>`__.
+`LaTeX Writers`__.
Default: "dash". Options: ``--attribution``.
+__ attribution [latex writers]_
+
cloak_email_addresses
~~~~~~~~~~~~~~~~~~~~~
@@ -938,8 +941,9 @@
Default: enabled (True).
Options: ``--compact-field-lists, --no-compact-field-lists``.
-.. _embed_stylesheet [html4css1 writer]:
+.. _embed_stylesheet [html writers]:
+
embed_stylesheet
~~~~~~~~~~~~~~~~
@@ -951,19 +955,11 @@
Default: enabled. Options: ``--embed-stylesheet,
--link-stylesheet``.
-__ `stylesheet_path [html4css1 writer]`_
+__ `stylesheet_path [html writers]`_
-field_name_limit
-~~~~~~~~~~~~~~~~
-The maximum width (in characters) for one-column `field names`_. Longer
-field names will span an entire row of the table used to render the field
-list. 0 indicates "no limit". See also option_limit_.
+.. _footnote_references [html writers]:
-Default: 14 (i.e. 14 characters). Option: ``--field-name-limit``.
-
-.. _footnote_references [html4css1 writer]:
-
footnote_references
~~~~~~~~~~~~~~~~~~~
@@ -983,6 +979,7 @@
Default: 1 (for "<h1>"). Option: ``--initial-header-level``.
+
math_output
~~~~~~~~~~~
@@ -992,9 +989,9 @@
:HTML:
Format math in standard HTML enhanced by CSS rules.
Requires the ``math.css`` stylesheet (in the system
- `stylesheet directory <stylesheet_dirs [html4css1 writer]_>`_)
+ `stylesheet directory <stylesheet_dirs [html writers]_>`_)
- A `stylesheet_path <stylesheet_path [html4css1 writer]_>`_
+ A `stylesheet_path <stylesheet_path [html writers]_>`_
can be appended after whitespace, the specified
stylesheet(s) will only be referenced or embedded, if required
(i.e. if there is mathematical content in the document).
@@ -1081,7 +1078,7 @@
The failsave fallback.
-Default: "HTML math.css" (The `[html5 writer]`_ defaults to "MathML").
+Default: writer dependent (see `[html4css1 writer]`_, `[html5 writer]`_).
Option: ``--math-output``.
New in Docutils 0.8.
@@ -1094,18 +1091,9 @@
.. _LaTeXML: http://dlmf.nist.gov/LaTeXML/
.. _TtM: http://hutchinson.belmont.ma.us/tth/mml/
-option_limit
-~~~~~~~~~~~~
-The maximum width (in characters) for options in `option lists`_.
-Longer options will span an entire row of the table used to render
-the option list. 0 indicates "no limit". See also
-field_name_limit_.
+.. _stylesheet [html writers]:
-Default: 14 (i.e. 14 characters). Option: ``--option-limit``.
-
-.. _stylesheet [html4css1 writer]:
-
stylesheet
~~~~~~~~~~
@@ -1116,10 +1104,11 @@
Default: None. Options: ``--stylesheet``.
-__ `stylesheet_path [html4css1 writer]`_
+__ `stylesheet_path [html writers]`_
-.. _stylesheet_dirs [html4css1 writer]:
+.. _stylesheet_dirs [html writers]:
+
stylesheet_dirs
~~~~~~~~~~~~~~~
@@ -1131,7 +1120,7 @@
stylesheet_path__ setting with the meaning of a file location.
__
-__ `stylesheet_path [html4css1 writer]`_
+__ `stylesheet_path [html writers]`_
Default: the working directory of the process at launch and the directory
with default stylesheet files (writer and installation specific).
@@ -1138,7 +1127,7 @@
Use the ``--help`` option to get the exact value.
Option: ``--stylesheet-directories``.
-.. _stylesheet_path [html4css1 writer]:
+.. _stylesheet_path [html writers]:
stylesheet_path
~~~~~~~~~~~~~~~
@@ -1152,15 +1141,17 @@
Pass an empty string (to either "stylesheet" or "stylesheet_path") to
deactivate stylesheet inclusion.
-Default: "html4css1.css".
+Default: writer dependent (see `[html4css1 writer]`_, `[html5 writer]`_,
+[pep_html writer]_).
Options: ``--stylesheet-path``.
-__ `embed_stylesheet [html4css1 writer]`_
+__ `embed_stylesheet [html writers]`_
__ `stylesheet_path [latex writers]`_
-__ `stylesheet_dirs [html4css1 writer]`_
+__ `stylesheet_dirs [html writers]`_
-.. _table_style [html4css1 writer]:
+.. _table_style [html writers]:
+
table_style
~~~~~~~~~~~
@@ -1189,8 +1180,9 @@
__ `table_style [latex writers]`_
.. _table directive: ../ref/rst/directives.html#table
-.. _template [html4css1 writer]:
+.. _template [html writers]:
+
template
~~~~~~~~
@@ -1203,8 +1195,9 @@
__ `template [latex writers]`_
-.. _xml_declaration [html4css1 writer]:
+.. _xml_declaration [html writers]:
+
xml_declaration
~~~~~~~~~~~~~~~
@@ -1220,22 +1213,83 @@
__ `xml_declaration [docutils_xml writer]`_
+[html4css1 writer]
+~~~~~~~~~~~~~~~~~~
+
+The `HTML4/CSS1 Writer`_ generates output that conforms to the
+`XHTML 1 Transitional`_ specification.
+It shares all settings defined in the `[html writers]`_
+`configuration section`_.
+
+
+Writer specific defaults:
+
+math_output_
+ "MathML"
+
+`stylesheet_path <stylesheet_path [html writers]_>`_:
+ "html4css1.css"
+
+.. _HTML4/CSS1 Writer: html.html#html4css1
+.. _XHTML 1 Transitional: http://www.w3.org/TR/xhtml1/
+
+
+field_name_limit
+""""""""""""""""
+
+The maximum width (in characters) for one-column `field names`_. Longer
+field names will span an entire row of the table used to render the field
+list. 0 indicates "no limit". See also option_limit_.
+
+Default: 14 (i.e. 14 characters). Option: ``--field-name-limit``.
+
+
+option_limit
+""""""""""""
+
+The maximum width (in characters) for options in `option lists`_.
+Longer options will span an entire row of the table used to render
+the option list. 0 indicates "no limit". See also
+field_name_limit_.
+
+Default: 14 (i.e. 14 characters). Option: ``--option-limit``.
+
+
+[html5 writer]
+~~~~~~~~~~~~~~
+
+The `HTML5 Writer`_ generates valid XML that is compatible with `HTML5`_.
+It shares all settings defined in the `[html writers]`_
+`configuration section`_.
+
+Writer specific defaults:
+
+`math_output`_
+ "MathML"
+
+`stylesheet_path <stylesheet_path [html writers]_>`_:
+ "minimal.css,plain.css"
+
+New in Docutils 0.13.
+
+.. _HTML5 Writer: html.html#html5-polyglot
+.. _HTML5: http://www.w3.org/TR/html5/
+
+
[pep_html writer]
~~~~~~~~~~~~~~~~~
-The PEP/HTML Writer derives from the standard HTML Writer, and shares
-all settings defined in the `[html4css1 writer]`_ section. The
-"[html4css1 writer]" section of configuration files is processed
-before the "[pep_html writer]" section.
+The PEP/HTML Writer derives from the HTML4/CSS1 Writer, and shares
+all settings defined in the `[html writers]`_ and `[html4css1 writer]`_
+`configuration sections`_.
-The PEP/HTML Writer's default for the following settings differ from
-those of the standard HTML Writer:
+Writer specific defaults:
-`stylesheet_path <stylesheet_path [html4css1 writer]_>`_:
- Default: "pep.css"
+`stylesheet_path <stylesheet_path [html writers]_>`__:
+ "pep.css"
-`template <template [html4css1 writer]_>`_:
- Default: ``docutils/writers/pep_html/template.txt`` in the installation
+`template <template [html writers]_>`__:
+ ``docutils/writers/pep_html/template.txt`` in the installation
directory. For the exact machine-specific path, use the ``--help``
option.
@@ -1263,23 +1317,23 @@
[s5_html writer]
~~~~~~~~~~~~~~~~
-The S5/HTML Writer derives from the standard HTML Writer, and shares
-all settings defined in the `[html4css1 writer]`_ section. The
-"[html4css1 writer]" section of configuration files is processed
-before the "[s5_html writer]" section.
+The S5/HTML Writer derives from the HTML4/CSS1 Writer, and shares
+all settings defined in the `[html writers]`_ and `[html4css1 writer]`_
+`configuration sections`_.
-The S5/HTML Writer's default for the following settings differ
-from those of the standard HTML Writer:
+Writer specific defaults:
compact_lists_:
- Default: disable compact lists.
+ disable compact lists.
-template_:
- Default: ``docutils/writers/s5_html/template.txt`` in the installation
+template__:
+ ``docutils/writers/s5_html/template.txt`` in the installation
directory. For the exact machine-specific path, use the ``--help``
option.
+__ `template [html writers]`_
+
hidden_controls
"""""""""""""""
@@ -1320,6 +1374,7 @@
theme_url
"""""""""
+
The URL of an S5 theme directory. The destination file (output
HTML) will link to this theme; nothing will be copied. Also overrides
the "theme_" setting. [#override]_
@@ -1333,36 +1388,16 @@
Default: "slidewhow". Option: ``--view-mode``.
+.. ------------------------------------------------------------
-[html5 writer]
---------------
-
-The `html5` writer uses the settings described in the `[html4css1
-writer]`_ section with the following exceptions:
-
-Removed options:
- `field_name_limit`_, `option_limit`_.
-
-Different default for:
-
-`math_output`_
- Default: "MathML"
-
-`stylesheet_path <stylesheet_path [html4css1 writer]_>`_:
- Default: "minimal.css,plain.css"
-
-`stylesheet_dirs <stylesheet_dirs [html4css1 writer]_>`_:
- Default: Installation-dependent. Use the --help option to get the exact
- value.
-
-New in Docutils 0.13.
-
-
[latex writers]
----------------
-Common settings for the `[latex2e writer]`_ and `[xetex writer]`_.
+Common settings for the `LaTeX writers`_
+`[latex2e writer]`_ and `[xetex writer]`_.
+.. _LaTeX writers: latex.html
+
use_latex_toc
~~~~~~~~~~~~~
@@ -1454,11 +1489,11 @@
stylesheets must be accessible during processing. Currently, this
fails if the file is not available via the given path (i.e. the
file is *not* searched in the `TeX input path`_).
-Also defined for the `HTML Writer`__ (with default *on*).
+Also defined for the `HTML Writers`__ (with default *on*).
Default: off. Options: ``--embed-stylesheet, --link-stylesheet``.
-__ `embed_stylesheet [html4css1 writer]`_
+__ `embed_stylesheet [html writers]`_
.. _stylesheet [latex writers]:
@@ -1466,7 +1501,7 @@
~~~~~~~~~~
A comma-separated list_ of style files.
-Also defined for the `HTML Writer`__.
+Also defined for the `HTML Writers`__.
Overrides also stylesheet_path__. [#override]_
@@ -1480,7 +1515,7 @@
__ `stylesheet_path [latex writers]`_
__ `embed_stylesheet [latex writers]`_
-__ `stylesheet [html4css1 writer]`_
+__ `stylesheet [html writers]`_
.. _TeX input path:
http://www.tex.ac.uk/cgi-bin/texfaq2html?label=what-TDS
@@ -1519,7 +1554,7 @@
The stylesheet__ option is preferred for files in the `TeX input path`_.
Also defined for the
-`HTML Writer <stylesheet_path [html4css1 writer]_>`__.
+`HTML Writers <stylesheet_path [html writers]_>`__.
Also overrides stylesheet__. [#override]_
@@ -1547,7 +1582,7 @@
~~~~~~~~~~~~~~~~~~~
Format for `footnote references`_: one of "superscript" or
-"brackets". Also defined for the `HTML Writer`__.
+"brackets". Also defined for the `HTML Writers`__.
Overrides [#override]_ trim_footnote_reference_space_, if
applicable [#footnote_space]_.
@@ -1554,7 +1589,7 @@
Default: "superscript". Option: ``--footnote-references``.
-__ `footnote_references [html4css1 writer]`_
+__ `footnote_references [html writers]`_
.. _attribution [latex writers]:
@@ -1561,7 +1596,7 @@
attribution
~~~~~~~~~~~
-See `attribution [html4css1 writer]`_.
+See `attribution [html writers]`_.
compound_enumerators
~~~~~~~~~~~~~~~~~~~~
@@ -1621,7 +1656,7 @@
~~~~~~~~~~~
Specify the default style for tables_
-Also defined for the `HTML Writer`__.
+Also defined for the `HTML Writers`__.
Supported values:
@@ -1649,7 +1684,7 @@
Default: "standard". Option: ``--table-style``.
-__ `table_style [html4css1 writer]`_
+__ `table_style [html writers]`_
.. _template [latex writers]:
@@ -1658,12 +1693,12 @@
~~~~~~~~
Path [#pwd]_ to template file, which must be encoded in UTF-8.
-Also defined for the `HTML Writer`__.
+Also defined for the `HTML Writers`__.
Default: writer dependent (see `[latex2e writer]`_, `[xetex writer]`_).
Options: ``--template``.
-__ `template [html4css1 writer]`_
+__ `template [html writers]`_
[latex2e writer]
@@ -1741,7 +1776,7 @@
template__:
"xelatex.tex" in the ``docutils/writers/latex2e/`` directory
(installed automatically).
-
+
.. TODO: show full path with --help (like in the HTML writers) and
add the following line:
for the exact machine-specific path, use the ``--help`` option).
Modified: trunk/docutils/docutils/writers/_html_base.py
===================================================================
--- trunk/docutils/docutils/writers/_html_base.py 2019-11-05 13:32:13 UTC (rev 8411)
+++ trunk/docutils/docutils/writers/_html_base.py 2019-11-06 18:15:21 UTC (rev 8412)
@@ -61,7 +61,7 @@
settings_defaults = {'output_encoding_error_handler': 'xmlcharrefreplace'}
# config_section = ... # set in subclass!
- config_section_dependencies = ['writers', 'html writers']
+ config_section_dependencies = ('writers', 'html writers')
visitor_attributes = (
'head_prefix', 'head', 'stylesheet', 'body_prefix',
Modified: trunk/docutils/docutils/writers/pep_html/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/pep_html/__init__.py 2019-11-05 13:32:13 UTC (rev 8411)
+++ trunk/docutils/docutils/writers/pep_html/__init__.py 2019-11-06 18:15:21 UTC (rev 8412)
@@ -55,7 +55,8 @@
relative_path_settings = ('template',)
config_section = 'pep_html writer'
- config_section_dependencies = ('writers', 'html4css1 writer')
+ config_section_dependencies = ('writers', 'html writers',
+ 'html4css1 writer')
def __init__(self):
html4css1.Writer.__init__(self)
Modified: trunk/docutils/docutils/writers/s5_html/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/s5_html/__init__.py 2019-11-05 13:32:13 UTC (rev 8411)
+++ trunk/docutils/docutils/writers/s5_html/__init__.py 2019-11-06 18:15:21 UTC (rev 8412)
@@ -83,7 +83,8 @@
settings_default_overrides = {'toc_backlinks': 0}
config_section = 's5_html writer'
- config_section_dependencies = ('writers', 'html4css1 writer')
+ config_section_dependencies = ('writers', 'html writers',
+ 'html4css1 writer')
def __init__(self):
html4css1.Writer.__init__(self)
Modified: trunk/docutils/docutils.conf
===================================================================
--- trunk/docutils/docutils.conf 2019-11-05 13:32:13 UTC (rev 8411)
+++ trunk/docutils/docutils.conf 2019-11-06 18:15:21 UTC (rev 8412)
@@ -5,15 +5,16 @@
generator: on
# These entries affect HTML output:
+[html writers]
+embed-stylesheet: no
+
[html4css1 writer]
stylesheet-path: docutils/writers/html4css1/html4css1.css
-embed-stylesheet: no
field-name-limit: 20
[html5 writer]
stylesheet-dirs: docutils/writers/html5_polyglot/
stylesheet-path: minimal.css, plain.css
-embed-stylesheet: no
# Prevent tools/buildhtml.py from processing certain text files.
[buildhtml application]
Modified: trunk/docutils/tools/docutils.conf
===================================================================
--- trunk/docutils/tools/docutils.conf 2019-11-05 13:32:13 UTC (rev 8411)
+++ trunk/docutils/tools/docutils.conf 2019-11-06 18:15:21 UTC (rev 8412)
@@ -5,8 +5,15 @@
generator: on
# These entries affect HTML output:
+[html writers]
+embed-stylesheet: no
+
[html4css1 writer]
# Required for docutils-update, the website build system:
stylesheet-path: ../docutils/writers/html4css1/html4css1.css
-embed-stylesheet: no
field-name-limit: 20
+
+[html5 writer]
+stylesheet-dirs: ../docutils/writers/html5_polyglot/
+stylesheet-path: minimal.css, plain.css
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2019-11-13 13:45:46
|
Revision: 8413
http://sourceforge.net/p/docutils/code/8413
Author: milde
Date: 2019-11-13 13:45:43 +0000 (Wed, 13 Nov 2019)
Log Message:
-----------
Ignore classes for `rubric` elements
Class wrapper interferes with LaTeX formatting of text following
the "rubric" heading.
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/docs/ref/rst/directives.txt
trunk/docutils/docs/user/latex.txt
trunk/docutils/docutils/writers/latex2e/__init__.py
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2019-11-06 18:15:21 UTC (rev 8412)
+++ trunk/docutils/HISTORY.txt 2019-11-13 13:45:43 UTC (rev 8413)
@@ -65,6 +65,8 @@
in admonitions and footnotes.
- Deprecation warning for ``\docutilsrole``-prefixed styling commands.
- Add "latex writers" to the `config_section_dependencies`.
+ - Ignore classes for `rubric` elements
+ (class wrapper interferes with LaTeX formatting).
* docutils/writers/manpage.py
Modified: trunk/docutils/docs/ref/rst/directives.txt
===================================================================
--- trunk/docutils/docs/ref/rst/directives.txt 2019-11-06 18:15:21 UTC (rev 8412)
+++ trunk/docutils/docs/ref/rst/directives.txt 2019-11-13 13:45:43 UTC (rev 8413)
@@ -715,7 +715,7 @@
=========
:Directive Type: "container"
-:Doctree Element: container_
+:Doctree Element: `container <container element_>`__
:Directive Arguments: One or more, optional (class names).
:Directive Options: `:name:`_
:Directive Content: Interpreted as body elements.
@@ -1978,7 +1978,7 @@
.. _block_quote: ../doctree.html#block-quote
.. _caption: ../doctree.html#caption
.. _compound: ../doctree.html#compound
-.. _container: ../doctree.html#container
+.. _container element: ../doctree.html#container
.. _decoration: ../doctree.html#decoration
.. _figure: ../doctree.html#figure
.. _footnote: ../doctree.html#footnote
Modified: trunk/docutils/docs/user/latex.txt
===================================================================
--- trunk/docutils/docs/user/latex.txt 2019-11-06 18:15:21 UTC (rev 8412)
+++ trunk/docutils/docs/user/latex.txt 2019-11-13 13:45:43 UTC (rev 8413)
@@ -34,8 +34,8 @@
.. _LaTeX packages:
-LaTeX classes and packages
---------------------------
+LaTeX document classes and packages
+-----------------------------------
Unlike HTML with CSS, LaTeX uses one common language for markup and style
definitions. Separation of content and style is realized by collecting style
@@ -178,10 +178,12 @@
Docutils elements.
In HTML, the common use is to provide selection criteria for style rules in
CSS stylesheets. As there is no comparable framework for LaTeX, Docutils
-mimics some of this behaviour via `Docutils specific LaTeX macros`_.
+emulates some of this behaviour via `Docutils specific LaTeX macros`_.
+Due to LaTeX limitations, class arguments are ignored for
+some elements (e.g. a rubric_).
*Inline elements*
- are handled via the ``\DUrole{}`` macro, that calls the optional styling
+ are handled via the ``\DUrole{}`` macro that calls the optional styling
command ``\DUrole«classargument»`` with one argument (the role content).
See `custom interpreted text roles`_.
@@ -1548,17 +1550,22 @@
``\DUrubric``
Default:
- subsubsection style, italic, centred
+ subsubsection style (unnumbered), italic
-Example:
- set flushleft and red::
+Example1:
+ Set centred and red::
\newcommand*{\DUrubric}[1]{%
- \subsubsection*{{\color{red}#1}\hfill}}
+ \subsubsection*{\centerline{\color{red}#1}}}
+.. note::
+ Class attribute values are ignored because the "classes_ wrapper"
+ interferes with LaTeX's formatting (spacing/indendation) of text following
+ a section heading. Consider using a `topic element`_ or a container_.
+
__ ../ref/rst/directives.html#rubric
+.. _container: ../ref/rst/directives.html#container
-
section numbering
-----------------
@@ -1640,7 +1647,7 @@
setting or set for individual tables via a `class directive`_ or the class
option of the `table directive`_.
-.. _table-style: config.html#table-style-latex2e-writer
+.. _table-style: config.html#table-style-latex-writers
.. _table directive: ../ref/rst/directives.html#table
topic element
Modified: trunk/docutils/docutils/writers/latex2e/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/latex2e/__init__.py 2019-11-06 18:15:21 UTC (rev 8412)
+++ trunk/docutils/docutils/writers/latex2e/__init__.py 2019-11-13 13:45:43 UTC (rev 8413)
@@ -2823,12 +2823,12 @@
def visit_rubric(self, node):
self.fallbacks['rubric'] = PreambleCmds.rubric
- self.duclass_open(node)
- self.out.append('\\DUrubric{')
+ # class wrapper would interfere with ``\section*"`` type commands
+ # (spacing/indent of first paragraph)
+ self.out.append('\n\\DUrubric{')
def depart_rubric(self, node):
self.out.append('}\n')
- self.duclass_close(node)
def visit_section(self, node):
self.section_level += 1
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2019-11-15 10:36:18
|
Revision: 8414
http://sourceforge.net/p/docutils/code/8414
Author: milde
Date: 2019-11-15 10:36:15 +0000 (Fri, 15 Nov 2019)
Log Message:
-----------
tests/functional: Set "auto_id_prefix" to "%" (expands to tag-names).
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/test/functional/expected/cyrillic.tex
trunk/docutils/test/functional/expected/footnotes_html5.html
trunk/docutils/test/functional/expected/latex_literal_block.tex
trunk/docutils/test/functional/expected/latex_literal_block_fancyvrb.tex
trunk/docutils/test/functional/expected/latex_literal_block_listings.tex
trunk/docutils/test/functional/expected/latex_literal_block_verbatim.tex
trunk/docutils/test/functional/expected/latex_literal_block_verbatimtab.tex
trunk/docutils/test/functional/expected/pep_html.html
trunk/docutils/test/functional/expected/standalone_rst_docutils_xml.xml
trunk/docutils/test/functional/expected/standalone_rst_html4css1.html
trunk/docutils/test/functional/expected/standalone_rst_html5.html
trunk/docutils/test/functional/expected/standalone_rst_latex.tex
trunk/docutils/test/functional/expected/standalone_rst_pseudoxml.txt
trunk/docutils/test/functional/expected/standalone_rst_s5_html_1.html
trunk/docutils/test/functional/expected/standalone_rst_s5_html_2.html
trunk/docutils/test/functional/expected/standalone_rst_xetex.tex
trunk/docutils/test/functional/expected/xetex-cyrillic.tex
trunk/docutils/test/functional/tests/_default.py
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2019-11-13 13:45:43 UTC (rev 8413)
+++ trunk/docutils/HISTORY.txt 2019-11-15 10:36:15 UTC (rev 8414)
@@ -84,11 +84,15 @@
- Fix: 377 ResourceWarning: unclosed file python3.8
Close alltests.out with atexit.
-* test/functional/tests/*
+* test/functional/*
- Fix: 377 ResourceWarning: unclosed file python3.8
Read defaults file with context.
+ - Set "auto_id_prefix" to "%" (expands to tag-names).
+ Results in descriptive links in HTML and more localized changes when
+ editions to the input add or remove auto-ids.
+
* test/test_io.py:
- Apply patch #157: avoid test failure because of a ``ResourceWarning``.
Modified: trunk/docutils/test/functional/expected/cyrillic.tex
===================================================================
--- trunk/docutils/test/functional/expected/cyrillic.tex 2019-11-13 13:45:43 UTC (rev 8413)
+++ trunk/docutils/test/functional/expected/cyrillic.tex 2019-11-15 10:36:15 UTC (rev 8414)
@@ -33,7 +33,7 @@
\section{Заголовок%
- \label{id1}%
+ \label{section-1}%
}
первый пример: «Здравствуй, мир!»
Modified: trunk/docutils/test/functional/expected/footnotes_html5.html
===================================================================
--- trunk/docutils/test/functional/expected/footnotes_html5.html 2019-11-13 13:45:43 UTC (rev 8413)
+++ trunk/docutils/test/functional/expected/footnotes_html5.html 2019-11-15 10:36:15 UTC (rev 8414)
@@ -11,52 +11,52 @@
<div class="document" id="test-footnote-and-citation-rendering">
<h1 class="title">Test footnote and citation rendering</h1>
-<p>Paragraphs may contain footnote references (manually numbered<a class="footnote-reference superscript" href="#id7" id="id1">1</a>, anonymous auto-numbered<a class="footnote-reference superscript" href="#id11" id="id2">3</a>, labeled auto-numbered<a class="footnote-reference superscript" href="#label" id="id3">2</a>, or
-symbolic<a class="footnote-reference superscript" href="#id12" id="id4">*</a>) or citation references (<a class="citation-reference" href="#cit2002" id="id5">[CIT2002]</a>, <a class="citation-reference" href="#du2015" id="id6">[DU2015]</a>).</p>
+<p>Paragraphs may contain footnote references (manually numbered<a class="footnote-reference superscript" href="#footnote-1" id="footnote-reference-1">1</a>, anonymous auto-numbered<a class="footnote-reference superscript" href="#footnote-2" id="footnote-reference-2">3</a>, labeled auto-numbered<a class="footnote-reference superscript" href="#label" id="footnote-reference-3">2</a>, or
+symbolic<a class="footnote-reference superscript" href="#footnote-3" id="footnote-reference-4">*</a>) or citation references (<a class="citation-reference" href="#cit2002" id="citation-reference-1">[CIT2002]</a>, <a class="citation-reference" href="#du2015" id="citation-reference-2">[DU2015]</a>).</p>
<dl class="footnote superscript">
-<dt class="label" id="id7"><span class="superscript">1</span><span class="fn-backref">(<a href="#id1">1</a>,<a href="#id8">2</a>)</span></dt>
+<dt class="label" id="footnote-1"><span class="superscript">1</span><span class="fn-backref">(<a href="#footnote-reference-1">1</a>,<a href="#footnote-reference-5">2</a>)</span></dt>
<dd><p>A footnote contains body elements, consistently indented by at
least 3 spaces.</p>
<p>This is the footnote's second paragraph.</p>
</dd>
-<dt class="label" id="label"><span class="superscript">2</span><span class="fn-backref">(<a href="#id3">1</a>,<a href="#id9">2</a>)</span></dt>
-<dd><p>Footnotes may be numbered, either manually (as in<a class="footnote-reference superscript" href="#id7" id="id8">1</a>) or
+<dt class="label" id="label"><span class="superscript">2</span><span class="fn-backref">(<a href="#footnote-reference-3">1</a>,<a href="#footnote-reference-6">2</a>)</span></dt>
+<dd><p>Footnotes may be numbered, either manually (as in<a class="footnote-reference superscript" href="#footnote-1" id="footnote-reference-5">1</a>) or
automatically using a "#"-prefixed label. This footnote has a
label so it can be referred to from multiple places, both as a
-footnote reference (<a class="footnote-reference superscript" href="#label" id="id9">2</a>) and as a <a class="reference internal" href="#label">hyperlink reference</a>.</p>
+footnote reference (<a class="footnote-reference superscript" href="#label" id="footnote-reference-6">2</a>) and as a <a class="reference internal" href="#label">hyperlink reference</a>.</p>
</dd>
-<dt class="label" id="id11"><span class="superscript"><a class="fn-backref" href="#id2">3</a></span></dt>
+<dt class="label" id="footnote-2"><span class="superscript"><a class="fn-backref" href="#footnote-reference-2">3</a></span></dt>
<dd><p>This footnote is numbered automatically and anonymously using a
label of "#" only.</p>
<p>This is the second paragraph.</p>
<p>And this is the third paragraph.</p>
</dd>
-<dt class="label" id="id12"><span class="superscript"><a class="fn-backref" href="#id4">*</a></span></dt>
+<dt class="label" id="footnote-3"><span class="superscript"><a class="fn-backref" href="#footnote-reference-4">*</a></span></dt>
<dd><p>Footnotes may also use symbols, specified with a "*" label.
-Here's a reference to the next footnote:<a class="footnote-reference superscript" href="#id14" id="id13">†</a>.</p>
+Here's a reference to the next footnote:<a class="footnote-reference superscript" href="#footnote-4" id="footnote-reference-7">†</a>.</p>
</dd>
-<dt class="label" id="id14"><span class="superscript"><a class="fn-backref" href="#id13">†</a></span></dt>
+<dt class="label" id="footnote-4"><span class="superscript"><a class="fn-backref" href="#footnote-reference-7">†</a></span></dt>
<dd><p>This footnote shows the next symbol in the sequence.</p>
</dd>
-<dt class="label" id="id15"><span class="superscript">4</span></dt>
+<dt class="label" id="footnote-5"><span class="superscript">4</span></dt>
<dd><p>Here's an unreferenced footnote, with a reference to a
-nonexistent footnote:<a class="footnote-reference superscript" href="#id18" id="id16">5</a>.</p>
+nonexistent footnote:<a class="footnote-reference superscript" href="#footnote-6" id="footnote-reference-8">5</a>.</p>
</dd>
</dl>
<div class="section" id="citations">
<h1>Citations</h1>
<dl class="citation">
-<dt class="label" id="cit2002"><span class="brackets">CIT2002</span><span class="fn-backref">(<a href="#id5">1</a>,<a href="#id17">2</a>)</span></dt>
+<dt class="label" id="cit2002"><span class="brackets">CIT2002</span><span class="fn-backref">(<a href="#citation-reference-1">1</a>,<a href="#citation-reference-3">2</a>)</span></dt>
<dd><p>Citations are text-labeled footnotes. They may be
rendered separately and differently from footnotes.</p>
</dd>
-<dt class="label" id="du2015"><span class="brackets"><a class="fn-backref" href="#id6">DU2015</a></span></dt>
+<dt class="label" id="du2015"><span class="brackets"><a class="fn-backref" href="#citation-reference-2">DU2015</a></span></dt>
<dd><p><cite>Example document</cite>, Hometown: 2015.</p>
</dd>
</dl>
-<p>Here's a reference to the above, <a class="citation-reference" href="#cit2002" id="id17">[CIT2002]</a>.</p>
+<p>Here's a reference to the above, <a class="citation-reference" href="#cit2002" id="citation-reference-3">[CIT2002]</a>.</p>
<dl class="footnote superscript">
-<dt class="label" id="id18"><span class="superscript"><a class="fn-backref" href="#id16">5</a></span></dt>
+<dt class="label" id="footnote-6"><span class="superscript"><a class="fn-backref" href="#footnote-reference-8">5</a></span></dt>
<dd><p>this footnote is missing in the standard example document.</p>
</dd>
</dl>
Modified: trunk/docutils/test/functional/expected/latex_literal_block.tex
===================================================================
--- trunk/docutils/test/functional/expected/latex_literal_block.tex 2019-11-13 13:45:43 UTC (rev 8413)
+++ trunk/docutils/test/functional/expected/latex_literal_block.tex 2019-11-15 10:36:15 UTC (rev 8414)
@@ -189,7 +189,7 @@
%
\phantomsection\label{internal}internal~hyperlink~targets,\\
images~via~substitution~references~(\includegraphics{../../../docs/user/rst/images/biohazard.png}),\\
-footnote~references\DUfootnotemark{id1}{id3}{*},\\
+footnote~references\DUfootnotemark{footnote-reference-1}{footnote-1}{*},\\
citation~references~(\hyperlink{cit2002}{[CIT2002]}),~and~more.\\
~\\
~~~Here~are~some~explicit~interpreted~text~roles:\\
@@ -203,7 +203,7 @@
\DUroletitlereference{Docutils}'~\emph{standard}~\textbf{inline}~\texttt{markup}.
\end{quote}
%
-\DUfootnotetext{id3}{id1}{*}{%
+\DUfootnotetext{footnote-1}{footnote-reference-1}{*}{%
This footnote is referenced in a \DUroletitlereference{parsed literal} block.
It contains a literal block:
Modified: trunk/docutils/test/functional/expected/latex_literal_block_fancyvrb.tex
===================================================================
--- trunk/docutils/test/functional/expected/latex_literal_block_fancyvrb.tex 2019-11-13 13:45:43 UTC (rev 8413)
+++ trunk/docutils/test/functional/expected/latex_literal_block_fancyvrb.tex 2019-11-15 10:36:15 UTC (rev 8414)
@@ -189,7 +189,7 @@
%
\phantomsection\label{internal}internal~hyperlink~targets,\\
images~via~substitution~references~(\includegraphics{../../../docs/user/rst/images/biohazard.png}),\\
-footnote~references\DUfootnotemark{id1}{id3}{*},\\
+footnote~references\DUfootnotemark{footnote-reference-1}{footnote-1}{*},\\
citation~references~(\hyperlink{cit2002}{[CIT2002]}),~and~more.\\
~\\
~~~Here~are~some~explicit~interpreted~text~roles:\\
@@ -203,7 +203,7 @@
\DUroletitlereference{Docutils}'~\emph{standard}~\textbf{inline}~\texttt{markup}.
\end{quote}
%
-\DUfootnotetext{id3}{id1}{*}{%
+\DUfootnotetext{footnote-1}{footnote-reference-1}{*}{%
This footnote is referenced in a \DUroletitlereference{parsed literal} block.
It contains a literal block:
Modified: trunk/docutils/test/functional/expected/latex_literal_block_listings.tex
===================================================================
--- trunk/docutils/test/functional/expected/latex_literal_block_listings.tex 2019-11-13 13:45:43 UTC (rev 8413)
+++ trunk/docutils/test/functional/expected/latex_literal_block_listings.tex 2019-11-15 10:36:15 UTC (rev 8414)
@@ -194,7 +194,7 @@
%
\phantomsection\label{internal}internal~hyperlink~targets,\\
images~via~substitution~references~(\includegraphics{../../../docs/user/rst/images/biohazard.png}),\\
-footnote~references\DUfootnotemark{id1}{id3}{*},\\
+footnote~references\DUfootnotemark{footnote-reference-1}{footnote-1}{*},\\
citation~references~(\hyperlink{cit2002}{[CIT2002]}),~and~more.\\
~\\
~~~Here~are~some~explicit~interpreted~text~roles:\\
@@ -208,7 +208,7 @@
\DUroletitlereference{Docutils}'~\emph{standard}~\textbf{inline}~\texttt{markup}.
\end{quote}
%
-\DUfootnotetext{id3}{id1}{*}{%
+\DUfootnotetext{footnote-1}{footnote-reference-1}{*}{%
This footnote is referenced in a \DUroletitlereference{parsed literal} block.
It contains a literal block:
Modified: trunk/docutils/test/functional/expected/latex_literal_block_verbatim.tex
===================================================================
--- trunk/docutils/test/functional/expected/latex_literal_block_verbatim.tex 2019-11-13 13:45:43 UTC (rev 8413)
+++ trunk/docutils/test/functional/expected/latex_literal_block_verbatim.tex 2019-11-15 10:36:15 UTC (rev 8414)
@@ -188,7 +188,7 @@
%
\phantomsection\label{internal}internal~hyperlink~targets,\\
images~via~substitution~references~(\includegraphics{../../../docs/user/rst/images/biohazard.png}),\\
-footnote~references\DUfootnotemark{id1}{id3}{*},\\
+footnote~references\DUfootnotemark{footnote-reference-1}{footnote-1}{*},\\
citation~references~(\hyperlink{cit2002}{[CIT2002]}),~and~more.\\
~\\
~~~Here~are~some~explicit~interpreted~text~roles:\\
@@ -202,7 +202,7 @@
\DUroletitlereference{Docutils}'~\emph{standard}~\textbf{inline}~\texttt{markup}.
\end{quote}
%
-\DUfootnotetext{id3}{id1}{*}{%
+\DUfootnotetext{footnote-1}{footnote-reference-1}{*}{%
This footnote is referenced in a \DUroletitlereference{parsed literal} block.
It contains a literal block:
Modified: trunk/docutils/test/functional/expected/latex_literal_block_verbatimtab.tex
===================================================================
--- trunk/docutils/test/functional/expected/latex_literal_block_verbatimtab.tex 2019-11-13 13:45:43 UTC (rev 8413)
+++ trunk/docutils/test/functional/expected/latex_literal_block_verbatimtab.tex 2019-11-15 10:36:15 UTC (rev 8414)
@@ -189,7 +189,7 @@
%
\phantomsection\label{internal}internal~hyperlink~targets,\\
images~via~substitution~references~(\includegraphics{../../../docs/user/rst/images/biohazard.png}),\\
-footnote~references\DUfootnotemark{id1}{id3}{*},\\
+footnote~references\DUfootnotemark{footnote-reference-1}{footnote-1}{*},\\
citation~references~(\hyperlink{cit2002}{[CIT2002]}),~and~more.\\
~\\
~~~Here~are~some~explicit~interpreted~text~roles:\\
@@ -203,7 +203,7 @@
\DUroletitlereference{Docutils}'~\emph{standard}~\textbf{inline}~\texttt{markup}.
\end{quote}
%
-\DUfootnotetext{id3}{id1}{*}{%
+\DUfootnotetext{footnote-1}{footnote-reference-1}{*}{%
This footnote is referenced in a \DUroletitlereference{parsed literal} block.
It contains a literal block:
Modified: trunk/docutils/test/functional/expected/pep_html.html
===================================================================
--- trunk/docutils/test/functional/expected/pep_html.html 2019-11-13 13:45:43 UTC (rev 8413)
+++ trunk/docutils/test/functional/expected/pep_html.html 2019-11-15 10:36:15 UTC (rev 8414)
@@ -57,32 +57,32 @@
<div class="contents topic" id="contents">
<p class="topic-title">Contents</p>
<ul class="simple">
-<li><a class="reference internal" href="#abstract" id="id5">Abstract</a></li>
-<li><a class="reference internal" href="#copyright" id="id6">Copyright</a></li>
-<li><a class="reference internal" href="#references-and-footnotes" id="id7">References and Footnotes</a></li>
+<li><a class="reference internal" href="#abstract" id="toc-entry-1">Abstract</a></li>
+<li><a class="reference internal" href="#copyright" id="toc-entry-2">Copyright</a></li>
+<li><a class="reference internal" href="#references-and-footnotes" id="toc-entry-3">References and Footnotes</a></li>
</ul>
</div>
<div class="section" id="abstract">
-<h1><a class="toc-backref" href="#id5">Abstract</a></h1>
-<p>This is just a test <a class="footnote-reference" href="#id2" id="id1">[1]</a>. See the <a class="reference external" href="http://www.python.org/peps/">PEP repository</a> <a class="footnote-reference" href="#id3" id="id4">[2]</a> for the real
+<h1><a class="toc-backref" href="#toc-entry-1">Abstract</a></h1>
+<p>This is just a test <a class="footnote-reference" href="#footnote-1" id="footnote-reference-1">[1]</a>. See the <a class="reference external" href="http://www.python.org/peps/">PEP repository</a> <a class="footnote-reference" href="#footnote-2" id="footnote-reference-2">[2]</a> for the real
thing.</p>
</div>
<div class="section" id="copyright">
-<h1><a class="toc-backref" href="#id6">Copyright</a></h1>
+<h1><a class="toc-backref" href="#toc-entry-2">Copyright</a></h1>
<p>This document has been placed in the public domain.</p>
</div>
<div class="section" id="references-and-footnotes">
-<h1><a class="toc-backref" href="#id7">References and Footnotes</a></h1>
-<table class="docutils footnote" frame="void" id="id2" rules="none">
+<h1><a class="toc-backref" href="#toc-entry-3">References and Footnotes</a></h1>
+<table class="docutils footnote" frame="void" id="footnote-1" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
-<tr><td class="label"><a class="fn-backref" href="#id1">[1]</a></td><td>PEP editors: <a class="reference external" href="mailto:peps%40python.org">peps<span>@</span>python<span>.</span>org</a></td></tr>
+<tr><td class="label"><a class="fn-backref" href="#footnote-reference-1">[1]</a></td><td>PEP editors: <a class="reference external" href="mailto:peps%40python.org">peps<span>@</span>python<span>.</span>org</a></td></tr>
</tbody>
</table>
-<table class="docutils footnote" frame="void" id="id3" rules="none">
+<table class="docutils footnote" frame="void" id="footnote-2" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
-<tr><td class="label"><a class="fn-backref" href="#id4">[2]</a></td><td><a class="reference external" href="http://www.python.org/peps/">http://www.python.org/peps/</a></td></tr>
+<tr><td class="label"><a class="fn-backref" href="#footnote-reference-2">[2]</a></td><td><a class="reference external" href="http://www.python.org/peps/">http://www.python.org/peps/</a></td></tr>
</tbody>
</table>
</div>
Modified: trunk/docutils/test/functional/expected/standalone_rst_docutils_xml.xml
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_docutils_xml.xml 2019-11-13 13:45:43 UTC (rev 8413)
+++ trunk/docutils/test/functional/expected/standalone_rst_docutils_xml.xml 2019-11-15 10:36:15 UTC (rev 8414)
@@ -70,141 +70,141 @@
<title>Table of Contents</title>
<bullet_list classes="auto-toc">
<list_item>
- <paragraph><reference ids="id34" refid="structural-elements"><generated classes="sectnum">1 </generated>Structural Elements</reference></paragraph>
+ <paragraph><reference ids="toc-entry-1" refid="structural-elements"><generated classes="sectnum">1 </generated>Structural Elements</reference></paragraph>
<bullet_list classes="auto-toc">
<list_item>
- <paragraph><reference ids="id35" refid="section-title"><generated classes="sectnum">1.1 </generated>Section Title</reference></paragraph>
+ <paragraph><reference ids="toc-entry-2" refid="section-title"><generated classes="sectnum">1.1 </generated>Section Title</reference></paragraph>
</list_item>
<list_item>
- <paragraph><reference ids="id36" refid="empty-section"><generated classes="sectnum">1.2 </generated>Empty Section</reference></paragraph>
+ <paragraph><reference ids="toc-entry-3" refid="empty-section"><generated classes="sectnum">1.2 </generated>Empty Section</reference></paragraph>
</list_item>
<list_item>
- <paragraph><reference ids="id37" refid="transitions"><generated classes="sectnum">1.3 </generated>Transitions</reference></paragraph>
+ <paragraph><reference ids="toc-entry-4" refid="transitions"><generated classes="sectnum">1.3 </generated>Transitions</reference></paragraph>
</list_item>
</bullet_list>
</list_item>
<list_item>
- <paragraph><reference ids="id38" refid="body-elements"><generated classes="sectnum">2 </generated>Body Elements</reference></paragraph>
+ <paragraph><reference ids="toc-entry-5" refid="body-elements"><generated classes="sectnum">2 </generated>Body Elements</reference></paragraph>
<bullet_list classes="auto-toc">
<list_item>
- <paragraph><reference ids="id39" refid="paragraphs"><generated classes="sectnum">2.1 </generated>Paragraphs</reference></paragraph>
+ <paragraph><reference ids="toc-entry-6" refid="paragraphs"><generated classes="sectnum">2.1 </generated>Paragraphs</reference></paragraph>
<bullet_list classes="auto-toc">
<list_item>
- <paragraph><reference ids="id40" refid="inline-markup"><generated classes="sectnum">2.1.1 </generated>Inline Markup</reference></paragraph>
+ <paragraph><reference ids="toc-entry-7" refid="inline-markup"><generated classes="sectnum">2.1.1 </generated>Inline Markup</reference></paragraph>
</list_item>
</bullet_list>
</list_item>
<list_item>
- <paragraph><reference ids="id41" refid="bullet-lists"><generated classes="sectnum">2.2 </generated>Bullet Lists</reference></paragraph>
+ <paragraph><reference ids="toc-entry-8" refid="bullet-lists"><generated classes="sectnum">2.2 </generated>Bullet Lists</reference></paragraph>
</list_item>
<list_item>
- <paragraph><reference ids="id42" refid="enumerated-lists"><generated classes="sectnum">2.3 </generated>Enumerated Lists</reference></paragraph>
+ <paragraph><reference ids="toc-entry-9" refid="enumerated-lists"><generated classes="sectnum">2.3 </generated>Enumerated Lists</reference></paragraph>
</list_item>
<list_item>
- <paragraph><reference ids="id43" refid="definition-lists"><generated classes="sectnum">2.4 </generated>Definition Lists</reference></paragraph>
+ <paragraph><reference ids="toc-entry-10" refid="definition-lists"><generated classes="sectnum">2.4 </generated>Definition Lists</reference></paragraph>
</list_item>
<list_item>
- <paragraph><reference ids="id44" refid="field-lists"><generated classes="sectnum">2.5 </generated>Field Lists</reference></paragraph>
+ <paragraph><reference ids="toc-entry-11" refid="field-lists"><generated classes="sectnum">2.5 </generated>Field Lists</reference></paragraph>
</list_item>
<list_item>
- <paragraph><reference ids="id45" refid="option-lists"><generated classes="sectnum">2.6 </generated>Option Lists</reference></paragraph>
+ <paragraph><reference ids="toc-entry-12" refid="option-lists"><generated classes="sectnum">2.6 </generated>Option Lists</reference></paragraph>
</list_item>
<list_item>
- <paragraph><reference ids="id46" refid="literal-blocks"><generated classes="sectnum">2.7 </generated>Literal Blocks</reference></paragraph>
+ <paragraph><reference ids="toc-entry-13" refid="literal-blocks"><generated classes="sectnum">2.7 </generated>Literal Blocks</reference></paragraph>
</list_item>
<list_item>
- <paragraph><reference ids="id47" refid="line-blocks"><generated classes="sectnum">2.8 </generated>Line Blocks</reference></paragraph>
+ <paragraph><reference ids="toc-entry-14" refid="line-blocks"><generated classes="sectnum">2.8 </generated>Line Blocks</reference></paragraph>
</list_item>
<list_item>
- <paragraph><reference ids="id48" refid="block-quotes"><generated classes="sectnum">2.9 </generated>Block Quotes</reference></paragraph>
+ <paragraph><reference ids="toc-entry-15" refid="block-quotes"><generated classes="sectnum">2.9 </generated>Block Quotes</reference></paragraph>
</list_item>
<list_item>
- <paragraph><reference ids="id49" refid="doctest-blocks"><generated classes="sectnum">2.10 </generated>Doctest Blocks</reference></paragraph>
+ <paragraph><reference ids="toc-entry-16" refid="doctest-blocks"><generated classes="sectnum">2.10 </generated>Doctest Blocks</reference></paragraph>
</list_item>
<list_item>
- <paragraph><reference ids="id50" refid="footnotes"><generated classes="sectnum">2.11 </generated>Footnotes</reference></paragraph>
+ <paragraph><reference ids="toc-entry-17" refid="footnotes"><generated classes="sectnum">2.11 </generated>Footnotes</reference></paragraph>
</list_item>
<list_item>
- <paragraph><reference ids="id51" refid="citations"><generated classes="sectnum">2.12 </generated>Citations</reference></paragraph>
+ <paragraph><reference ids="toc-entry-18" refid="citations"><generated classes="sectnum">2.12 </generated>Citations</reference></paragraph>
</list_item>
<list_item>
- <paragraph><reference ids="id52" refid="targets"><generated classes="sectnum">2.13 </generated>Targets</reference></paragraph>
+ <paragraph><reference ids="toc-entry-19" refid="targets"><generated classes="sectnum">2.13 </generated>Targets</reference></paragraph>
<bullet_list classes="auto-toc">
<list_item>
- <paragraph><reference ids="id53" refid="duplicate-target-names"><generated classes="sectnum">2.13.1 </generated>Duplicate Target Names</reference></paragraph>
+ <paragraph><reference ids="toc-entry-20" refid="duplicate-target-names"><generated classes="sectnum">2.13.1 </generated>Duplicate Target Names</reference></paragraph>
</list_item>
<list_item>
- <paragraph><reference ids="id54" refid="id21"><generated classes="sectnum">2.13.2 </generated>Duplicate Target Names</reference></paragraph>
+ <paragraph><reference ids="toc-entry-21" refid="duplicate-target-names-1"><generated classes="sectnum">2.13.2 </generated>Duplicate Target Names</reference></paragraph>
</list_item>
</bullet_list>
</list_item>
<list_item>
- <paragraph><reference ids="id55" refid="directives"><generated classes="sectnum">2.14 </generated>Directives</reference></paragraph>
+ <paragraph><reference ids="toc-entry-22" refid="directives"><generated classes="sectnum">2.14 </generated>Directives</reference></paragraph>
<bullet_list classes="auto-toc">
<list_item>
- <paragraph><reference ids="id56" refid="document-parts"><generated classes="sectnum">2.14.1 </generated>Document Parts</reference></paragraph>
+ <paragraph><reference ids="toc-entry-23" refid="document-parts"><generated classes="sectnum">2.14.1 </generated>Document Parts</reference></paragraph>
</list_item>
<list_item>
- <paragraph><reference ids="id57" refid="images-and-figures"><generated classes="sectnum">2.14.2 </generated>Images and Figures</reference></paragraph>
+ <paragraph><reference ids="toc-entry-24" refid="images-and-figures"><generated classes="sectnum">2.14.2 </generated>Images and Figures</reference></paragraph>
</list_item>
<list_item>
- <paragraph><reference ids="id58" refid="admonitions"><generated classes="sectnum">2.14.3 </generated>Admonitions</reference></paragraph>
+ <paragraph><reference ids="toc-entry-25" refid="admonitions"><generated classes="sectnum">2.14.3 </generated>Admonitions</reference></paragraph>
</list_item>
<list_item>
- <paragraph><reference ids="id59" refid="topics-sidebars-and-rubrics"><generated classes="sectnum">2.14.4 </generated>Topics, Sidebars, and Rubrics</reference></paragraph>
+ <paragraph><reference ids="toc-entry-26" refid="topics-sidebars-and-rubrics"><generated classes="sectnum">2.14.4 </generated>Topics, Sidebars, and Rubrics</reference></paragraph>
</list_item>
<list_item>
- <paragraph><reference ids="id60" refid="target-footnotes"><generated classes="sectnum">2.14.5 </generated>Target Footnotes</reference></paragra...
[truncated message content] |
|
From: <gr...@us...> - 2019-11-24 12:50:46
|
Revision: 8420
http://sourceforge.net/p/docutils/code/8420
Author: grubert
Date: 2019-11-24 12:50:44 +0000 (Sun, 24 Nov 2019)
Log Message:
-----------
FIX for BUG #287 comma after option is bold
Modified Paths:
--------------
trunk/docutils/docutils/writers/manpage.py
trunk/docutils/test/test_writers/test_manpage.py
Modified: trunk/docutils/docutils/writers/manpage.py
===================================================================
--- trunk/docutils/docutils/writers/manpage.py 2019-11-23 12:12:43 UTC (rev 8419)
+++ trunk/docutils/docutils/writers/manpage.py 2019-11-24 12:50:44 UTC (rev 8420)
@@ -210,6 +210,7 @@
#
# Fonts are put on a stack, the top one is used.
# ``.ft P`` or ``\\fP`` pop from stack.
+ # But ``.BI`` seams to fill stack with BIBIBIBIB...
# ``B`` bold, ``I`` italic, ``R`` roman should be available.
# Hopefully ``C`` courier too.
self.defs = {
@@ -912,7 +913,10 @@
def visit_option(self, node):
# each form of the option will be presented separately
if self.context[-1] > 0:
- self.body.append('\\fP,\\fB ')
+ if self.context[-3] == '.BI':
+ self.body.append('\\fR,\\fB ')
+ else:
+ self.body.append('\\fP,\\fB ')
if self.context[-3] == '.BI':
self.body.append('\\')
self.body.append(' ')
Modified: trunk/docutils/test/test_writers/test_manpage.py
===================================================================
--- trunk/docutils/test/test_writers/test_manpage.py 2019-11-23 12:12:43 UTC (rev 8419)
+++ trunk/docutils/test/test_writers/test_manpage.py 2019-11-24 12:50:44 UTC (rev 8420)
@@ -362,7 +362,39 @@
.'''],
]
+totest['cmdlineoptions'] = [
+ ["""optional arguments:
+ -h, --help show this help
+ --output FILE, -o FILE output filename
+ -i DEVICE, --input DEVICE input device
+""",
+ r""".\" Man page generated from reStructuredText.
+.
+.TH "" "" ""
+.SH NAME
+ \-
+"""+indend_macros+
+r""".INDENT 0.0
+.TP
+.B optional arguments:
+.INDENT 7.0
+.TP
+.B \-h\fP,\fB \-\-help
+show this help
+.TP
+.BI \-\-output \ FILE\fR,\fB \ \-o \ FILE
+output filename
+.TP
+.BI \-i \ DEVICE\fR,\fB \ \-\-input \ DEVICE
+input device
+.UNINDENT
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.
+"""],
+ ]
+
if __name__ == '__main__':
import unittest
unittest.main(defaultTest='suite')
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|