[Python-checkins] r66966 - in doctools/trunk: sphinx/latexwriter.py sphinx/textwriter.py tests/root/markup.txt tests/test_build.py
georg.brandl
python-checkins at python.org
Sat Oct 18 19:29:56 CEST 2008
Author: georg.brandl
Date: Sat Oct 18 19:29:56 2008
New Revision: 66966
Log:
Add test for meta directive and add visitor functions for latex and text writers.
Modified:
doctools/trunk/sphinx/latexwriter.py
doctools/trunk/sphinx/textwriter.py
doctools/trunk/tests/root/markup.txt
doctools/trunk/tests/test_build.py
Modified: doctools/trunk/sphinx/latexwriter.py
==============================================================================
--- doctools/trunk/sphinx/latexwriter.py (original)
+++ doctools/trunk/sphinx/latexwriter.py Sat Oct 18 19:29:56 2008
@@ -1127,6 +1127,10 @@
def visit_comment(self, node):
raise nodes.SkipNode
+ def visit_meta(self, node):
+ # only valid for HTML
+ raise nodes.SkipNode
+
def visit_system_message(self, node):
pass
def depart_system_message(self, node):
Modified: doctools/trunk/sphinx/textwriter.py
==============================================================================
--- doctools/trunk/sphinx/textwriter.py (original)
+++ doctools/trunk/sphinx/textwriter.py Sat Oct 18 19:29:56 2008
@@ -598,5 +598,9 @@
def visit_comment(self, node):
raise nodes.SkipNode
+ def visit_meta(self, node):
+ # only valid for HTML
+ raise nodes.SkipNode
+
def unknown_visit(self, node):
raise NotImplementedError('Unknown node: ' + node.__class__.__name__)
Modified: doctools/trunk/tests/root/markup.txt
==============================================================================
--- doctools/trunk/tests/root/markup.txt (original)
+++ doctools/trunk/tests/root/markup.txt Sat Oct 18 19:29:56 2008
@@ -7,6 +7,10 @@
.. contents:: TOC
+.. meta::
+ :author: Me
+ :keywords: docs, sphinx
+
Admonitions
-----------
Modified: doctools/trunk/tests/test_build.py
==============================================================================
--- doctools/trunk/tests/test_build.py (original)
+++ doctools/trunk/tests/test_build.py Sat Oct 18 19:29:56 2008
@@ -54,6 +54,10 @@
".//dt[@id='test_autodoc.function']/em": '**kwds',
".//dd": 'Return spam.',
},
+ 'markup.html': {
+ ".//meta[@name='author'][@content='Me']": '',
+ ".//meta[@name='keywords'][@content='docs, sphinx']": '',
+ },
}
class NslessParser(ET.XMLParser):
More information about the Python-checkins
mailing list