Has anyone been able to get a package like SyntaxHighlighter to work with SharePoint wikis?
3 Answers
Not with wikis (haven't tried) but I did get it to work with a Blog site.
Just a matter of putting the javascript packages into a document library and referencing them within a content editor web part. Had to edit the HTML for a blog post that had code in, right enough.
-
I'm getting closer - I'm now trying to wrap everything into a custom ribbon button and solution package. Commented Jan 27, 2011 at 18:47
-
Cool, I never got that far - only just did a proof of concept. Suppose you could have a Ribbon Button toolbar that woudl switch on/off a user control that spits out the required javascript. Commented Jan 27, 2011 at 19:25
I created a syntax highlighter for SharePoint Wiki you will find the code here: http://code.msdn.microsoft.com/SharePoint-Syntax-ac532d71
About the backgrounds you will find my blog post here: http://www.n8d.at/blog/use-syntax-highlighter-in-sharepoint-rich-text-editor/
If you're the site owner, you can edit the master page to load the required javascript on all your pages.
I've made a blog post about it where I do a step-by-step (also makes formulas work with MathJax, enables redirects and a basic version of templates). But basically you go to Site settings, open the master pages library, click the button to open it in Explorer, download the file seattle.master and add the required scripts in the section (and re-upload of course). Then they're called and ready on all your wiki pages.