|
From: <mi...@us...> - 2021-03-20 23:47:09
|
Revision: 8638
http://sourceforge.net/p/docutils/code/8638
Author: milde
Date: 2021-03-20 23:47:07 +0000 (Sat, 20 Mar 2021)
Log Message:
-----------
Update comments and advertised future changes.
Modified Paths:
--------------
trunk/docutils/RELEASE-NOTES.txt
trunk/docutils/docutils/writers/_html_base.py
trunk/docutils/docutils/writers/html4css1/__init__.py
Modified: trunk/docutils/RELEASE-NOTES.txt
===================================================================
--- trunk/docutils/RELEASE-NOTES.txt 2021-03-20 23:46:52 UTC (rev 8637)
+++ trunk/docutils/RELEASE-NOTES.txt 2021-03-20 23:47:07 UTC (rev 8638)
@@ -26,8 +26,14 @@
and/or ``\DUtitle`` or set to "True".
* `html5` writer:
- Use <aside> instad of <dl> for footnote text and citations
- and <nav> instead of <div> for the Table of Contents.
+ Semantic tags:
+ Use <aside> instad of <dl> for footnote text and citations,
+ <aside> for topics (except abstract), admonitions, and system messages,
+ and <nav> for the Table of Contents.
+
+ Write footnote brackets and field term colons to HTML, so that
+ they are present also without CSS and when copying text.
+ Hide with CSS if required.
Use <summary> and <details> tags for term and definition of a
definition list with class value "details".
Modified: trunk/docutils/docutils/writers/_html_base.py
===================================================================
--- trunk/docutils/docutils/writers/_html_base.py 2021-03-20 23:46:52 UTC (rev 8637)
+++ trunk/docutils/docutils/writers/_html_base.py 2021-03-20 23:47:07 UTC (rev 8638)
@@ -244,7 +244,7 @@
Used by visit_* and depart_* functions in conjunction with the tree
traversal. Make sure that the pops correspond to the pushes."""
- self.topic_classes = [] # TODO: replace with self_in_contents
+ self.topic_classes = []
self.colspecs = []
self.compact_p = True
self.compact_simple = False
@@ -515,7 +515,8 @@
and not self.settings.compact_lists):
return False
# more special cases:
- if (self.topic_classes == ['contents']): # TODO: self.in_contents
+ if (self.topic_classes == ['contents']):
+ # TODO: look for "auto-toc" instead and remove self.topic_classes
return True
# check the list items:
return self.check_simple_list(node)
@@ -973,14 +974,16 @@
imagedata = imagefile.read()
except IOError as err:
err_msg = str(err)
- if not err_msg:
- # TODO (test mimetype for SVG and insert directly)
+ if not err_msg:
+ # TODO: insert SVG as-is?
+ # if mimetype == 'image/svg+xml':
+ # read/parse, apply arguments,
+ # insert as <svg ....> ... </svg> # (about 1/3 less data)
data64 = base64.b64encode(imagedata).decode()
uri = u'data:%s;base64,%s' % (mimetype, data64)
else:
# raise NotImplementedError(os.getcwd() + err_msg)
self.document.reporter.error("Cannot embed image\n "+err_msg)
-
if mimetype == 'application/x-shockwave-flash':
atts['type'] = mimetype
# do NOT use an empty tag: incorrect rendering in browsers
@@ -1373,7 +1376,6 @@
def depart_rubric(self, node):
self.body.append('</p>\n')
- # TODO: use the new HTML 5 element <section>?
def visit_section(self, node):
self.section_level += 1
self.body.append(
@@ -1383,7 +1385,7 @@
self.section_level -= 1
self.body.append('</div>\n')
- # TODO: use the new HTML5 element <aside>? (Also for footnote text)
+ # TODO: use the new HTML5 element <aside>
def visit_sidebar(self, node):
self.body.append(
self.starttag(node, 'div', CLASS='sidebar'))
@@ -1586,17 +1588,13 @@
def depart_title_reference(self, node):
self.body.append('</cite>')
- # TODO: use the new HTML5 element <aside>? (Also for footnote text)
def visit_topic(self, node):
self.body.append(self.starttag(node, 'div', CLASS='topic'))
self.topic_classes = node['classes']
- # TODO: replace with ::
- # self.in_contents = 'contents' in node['classes']
def depart_topic(self, node):
self.body.append('</div>\n')
self.topic_classes = []
- # TODO self.in_contents = False
def visit_transition(self, node):
self.body.append(self.emptytag(node, 'hr', CLASS='docutils'))
Modified: trunk/docutils/docutils/writers/html4css1/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/html4css1/__init__.py 2021-03-20 23:46:52 UTC (rev 8637)
+++ trunk/docutils/docutils/writers/html4css1/__init__.py 2021-03-20 23:47:07 UTC (rev 8638)
@@ -537,13 +537,15 @@
def visit_generated(self, node):
pass
- # Use <object> instead of <img> for some image types:
-
- # SVG not supported by IE up to version 8
- # (html4css1 strives for IE6 compatibility)
+ # Backwards-compatibility implementation:
+ # * Do not use <video>,
+ # * don't embed images,
+ # * use <object> instead of <img> for SVG.
+ # (SVG not supported by IE up to version 8,
+ # html4css1 strives for IE6 compatibility.)
object_image_types = {'.svg': 'image/svg+xml',
'.swf': 'application/x-shockwave-flash'}
-
+ #
def visit_image(self, node):
atts = {}
uri = node['uri']
@@ -621,7 +623,6 @@
def depart_label(self, node):
self.body.append(']%s</td><td>%s' % (self.context.pop(), self.context.pop()))
-
# ersatz for first/last pseudo-classes
def visit_list_item(self, node):
self.body.append(self.starttag(node, 'li', ''))
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|