Changes To Cookbook
Not logged in

Changes to "Cookbook" between 2009-01-27 21:40:05 and 2009-01-27 21:42:10

299
300
301
302
303
304
305
306

307
308
309
310
311
312
313
299
300
301
302
303
304
305

306
307
308
309
310
311
312
313







-
+







<h3>Problem</h3>
The main purpose of Fossil is to do versioning the source code. Although it provides a standalone server and lets you navigate through the repository files additional features like source code highlighting from my perspective (I am not a developer of Fossil) is out of scope for an SCM. Just keep the Unix principle: small little programs that do their task and do it well.

However to have a source code highlighting in the presented web pages would still be desirable.

<h3>Solution</h3>
There are two scenarios how to implement such a feature:
   *  Pipe the source code through a filter that could be defined as a configuration option. One solutions for this might be the <a href="http://www.gnu.org/software/src-highlite">GNU Source code Highlighting</a> program.
   *  Fossil pipes the source code through a filter before sending it to the browser. The filter could be defined as a configuration option to Fossil. One solution for this might be the <a href="http://www.gnu.org/software/src-highlite">GNU Source code Highlighting</a> program.
   *  Use a Javascript library that renders the code within your browser. One solution for this might be <a href="http://code.google.com/p/syntaxhighlighter">Google Syntax Highlighter</a>

I estimate that the <i>pipe</i> solution needs some more work/ code changes. Thus I am solely looking at the Javascript solution.

The SyntaxHighlighter is a library of some Javascript files, a little Flash application and a CSS file. The Flash application is for copying to clipboard, print and view source. You have the option to include all the files into your repository or use the files hosted at Google. The latter may only be an option if you are only all the time.

For syntax highlighting to work the Header and Footer templates need to be modified and a little code change has to be applied to the Fossil sources.