Like your previous example, I think - assemble an HTML fragment including a
<style> tag, and then display that.

On 29 November 2017 at 23:30, Jonathan Robie <[email protected]>
wrote:

> 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
> <https://groups.google.com/d/msgid/jupyter/43b5073b-09a2-449c-b1e4-6c95ab3871ac%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAOvn4qi1%2Bsx%3DJkOgMAezvXxCxBEqQOL8ZOwV6Pnf-Gt1OmNP5w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to