I am writing some notebooks for processing Greek syntax trees using XPath / XQuery:
https://github.com/biblicalhumanities/greek-new-testament/blob/master/labnotes/basex-tutorial.ipynb https://github.com/biblicalhumanities/greek-new-testament/blob/master/labnotes/lxml-tutorial.ipynb I can pretty print the XML like this: from pygments import highlightfrom pygments.lexers import XmlLexerfrom pygments.formatters import HtmlFormatterimport IPython def xml_display(xml): formatter = HtmlFormatter() display( IPython.display.HTML('<style type="text/css">{}</style>{}'.format ( formatter.get_style_defs('.highlight'), highlight(xml, XmlLexer(), formatter)))) def xquery_display(query): xml_display(xquery(query)) But I also want to be able to display results using .css as though they were in a browser. This looks like it should be straightforward, but I'm failing to see the hook that I need. This works fine, but without a custom .css stylesheet: def boxwood(xml): formatter = HtmlFormatter() display(HTML(xml)) I want to add the .css stylesheet to this. Where do I do that? Thanks! Jonathan -- You received this message because you are subscribed to the Google Groups "Project Jupyter" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/43b5073b-09a2-449c-b1e4-6c95ab3871ac%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
