Include syntax highlighting?

Asked by Dennis Benzinger

Can you include syntax highlighting in Silva?
I want to include code samples in various programming languages into my site
and want them to be highlighted automatically (for example by Pygments http://pygments.org/).

Question information

Language:
English Edit question
Status:
Solved
For:
Silva Edit question
Assignee:
No assignee Edit question
Solved by:
Eric Casteleijn
Solved:
Last query:
Last reply:
Revision history for this message
Best Eric Casteleijn (thisfred) said :
#1

there is currently nothing to do this in silva, but it probably shouldn't be very hard to create a 'code source' to do it. Code sources are dynamic elements you can put into Silva Documents.

Revision history for this message
Eric Casteleijn (thisfred) said :
#2

Note that the name code source may be confusing here it has nothing to do with displaying code, per se, it's just something that can actually use code to generate dynamic pieces of a page.

Revision history for this message
Dennis Benzinger (dennis-benzinger) said :
#3

Thanks thisfred, that solved my question.

Revision history for this message
Tuomas Tonteri (tuomas-tonteri) said :
#4

Doesn't this mean having to input and edit the code in a small kupu side panel? Or can a code source have a editable field inside the main editing area?

Revision history for this message
Andy Altepeter (aaltepet) said :
#5

I spoke with Tuomas in the Silva IRC channel and we determined that marking the code source as "elaborate" (causing the params to open in a new window when adding / editing in kupu) was sufficient.