mirror of https://github.com/scrapy/scrapy.git
skip Xpath nodes in latex build to avoid build errors
This commit is contained in:
parent
bfcc2395e3
commit
7f5068373a
|
|
@ -1,5 +1,6 @@
|
|||
from docutils import nodes
|
||||
from sphinx.util.compat import Directive
|
||||
from sphinx.search import SkipNode
|
||||
|
||||
|
||||
class xpath_demo_node(nodes.Element):
|
||||
|
|
@ -29,11 +30,17 @@ def setup(app):
|
|||
html=(
|
||||
visit_xpath_demo_node,
|
||||
depart_xpath_demo_node,
|
||||
)
|
||||
),
|
||||
# latex build are failing, so let's skip the xpath nodes
|
||||
latex=(skip_node, None),
|
||||
)
|
||||
app.add_directive('xpathdemo', XPathDemoDirective)
|
||||
|
||||
|
||||
def skip_node(self, node):
|
||||
raise SkipNode
|
||||
|
||||
|
||||
def visit_xpath_demo_node(self, node):
|
||||
try:
|
||||
with open(node.form_template) as fp:
|
||||
|
|
|
|||
Loading…
Reference in New Issue