------
I found some OLD threads about this but nothing recent -- SO I'll refresh the question:
Anyone found a way to do syntax highlighting of code that also works in Flare PDF Targets?
I've gotten Prism and Rainbow working in Flare online Targets. But even though Flare's PDF engine "knows" that there's an attempt to format the code -- the code text has a light-gray background -- the syntax highlighting doesn't work.
Any ideas?
Cheers & thanks,
Riley
SFO
Syntax highlighting for PDFs? (2017 version)...
Re: Syntax highlighting for PDFs? (2017 version)...
I think both of those use javascript. For PDFs, you need a solution that doesn't require javascript.
I'd suggest finding a syntax highlighter where you can copy/paste your code, and it'll generate the formatted code ready to copy/paste back into your topic.
I'd suggest finding a syntax highlighter where you can copy/paste your code, and it'll generate the formatted code ready to copy/paste back into your topic.
-
Phlawm53
- Sr. Propeller Head
- Posts: 442
- Joined: Tue Mar 16, 2010 10:58 am
- Location: San Francisco, CA
- Contact:
Re: Syntax highlighting for PDFs? (2017 version)...
What I've found so far are:Dave Lee wrote:I think both of those use javascript. For PDFs, you need a solution that doesn't require javascript.
I'd suggest finding a syntax highlighter where you can copy/paste your code, and it'll generate the formatted code ready to copy/paste back into your topic.
- http://hilite.me/
- The Pygments highlighter http://pygments.org
EDIT:
Found a way to use Pygments to wrap code samples in inline HTML formatting. The resulting highlighting appears in both online and PDF Targets. See:
viewtopic.php?f=6&t=29397
Cheers, thanks, & hope this helps,
Riley
SFO