I'm actually challenged with documenting aspects/problems/usages of inherited source code to teach and train co-workers as well as to identify problems that should be future maintenance tasks... The idea is to create an internal wiki or blog with short articles that highlight certain features and provide hints for using the API.
We already have a Plone instance installed to capture knowledge, what I'm missing is a syntax highlighting feature, which to me is essential for this task.
Does anyone have experience with syntax highlighting in Plone, preferable with integrating Google Prettify or Pygments so that tagged content on a Plone page becomes syntax highlighted and can provide hints or solution how it can be done?
Any suggestions even for a different tool that could support that mission are highly welcome as well!
Edit
What I tried so far (with Google Prettify) with a little help from a tutorial on plone.org:
- added prettify.css and prettify.js as files to portal_skins/custom
- added prettify.css to portal_css, switched on Debug mode
- added prettify.js to portal_javascripts, switched on Debug mode
Then I created a plone page, added some java code and encapsulated it with <pre class="prettyprint">...</pre>
tags. But it's not getting highlighted. When I look at the pages souce code (from firefox) I cleary see that prettify.js is included... So at least I'm on the correct path!?
Edit
As suggested by Martijn:
- added prettify-glue.js (
jQuery(prettyprint);
)as file to portal_skins/custom - added prettify-glue.js to portal_javascripts after prettify.js
... didn't change anything. pre formatted blocks with "prettyprint" class still appear in standard Plone theme style.
Edit
Finally made it. I reversed steps 4 and 5 and customized main_template.pt
: added onload="prettyPrint()"
to the body tag. And I disabled compression for both prettify.js and prettify.css and unchecked 'merging' for the script in the according registries. Now I have proper syntax highlighting on Plone pages.