mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Add test for meta directive and add visitor functions for latex and text writers.
This commit is contained in:
@@ -1127,6 +1127,10 @@ class LaTeXTranslator(nodes.NodeVisitor):
|
||||
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):
|
||||
|
||||
@@ -598,5 +598,9 @@ class TextTranslator(nodes.NodeVisitor):
|
||||
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__)
|
||||
|
||||
@@ -7,6 +7,10 @@ Testing various markup
|
||||
|
||||
.. contents:: TOC
|
||||
|
||||
.. meta::
|
||||
:author: Me
|
||||
:keywords: docs, sphinx
|
||||
|
||||
|
||||
Admonitions
|
||||
-----------
|
||||
|
||||
@@ -54,6 +54,10 @@ HTML_XPATH = {
|
||||
".//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):
|
||||
|
||||
Reference in New Issue
Block a user