Visitor functions for xml builder not called for custom directive

1 view
Skip to first unread message

Bradley Miller

Jun 29, 2021, 2:30:44 PMJun 29
to sphinx-dev
Hi again,

I'm working on having my html extension output xml when I use the xml builder.


I modified my add_node call in my setup function as follows and added the two functions

app.add_node(ActivcodeNode, xml=(start_pretext, end_pretext), html=(visit_ac_node, depart_ac_node) )

However two questions:

start_pretext is never called.  I added a pdb.set_trace() as the first line of that function. Nope, not called.  Any ideas?  It seems like xml is the correct builder name to use.

My ActiveCode node constructor gets called TWICE when I'm trying to do an xml build.  Once from exactly where I would expect in my code but a second time from a deep_copy somewhere.  The html builder only calls this constructor once as I would expect.

Any thoughts or help would be appreciated!  I've written a bunch of custom directives for my runestone project but they have all been targeted at html output.  Generating XML is a new direction for me, so maybe I'm just missing something basic when you are going to target multiple builders for an extension.


Reply all
Reply to author
0 new messages