Adding hyperlinks to HTML formatter

2 views
Skip to first unread message

Jon Leech

unread,
Apr 13, 2018, 5:31:19 AM4/13/18
to pocoo-libs
I posted this last fall to the bitbucket issues tracker, but haven't seen a response there, so thought I'd try here.

I'd like to enhance HTML output (which will be imbedded in HTML output from asciidoctor) to link from certain function / token names to corresponding anchors elsewhere in the imbedding document. For example, "vxFunction" would link to the #vxFunction anchor, as well as whatever visual style the formatter & class would normally produce. But am a newb at pygments and unclear how to go about this. None of the examples on the website appeared relevant to what I'd like to do.

Is there an existing token type that a filter could modify matching names to, that would result in this happening? Or am I looking at modifying the html formatter class to accomplish this? In the worst case, would it be tractable to run a post-filter over the HTML output from within the pygments pipeline (which is invoked from asciidoctor, and thus not directly accessible to me), and modify it at that stage? Any pointers in the right direction will be welcome.

Thanks,
Jon Leech

Reply all
Reply to author
Forward
0 new messages