> On Sun, May 22, 2011 at 6:17 PM, Ambrose Bonnaire-Sergeant <
> abonnaireserge...@gmail.com> wrote:
>
>> I personally would be interested in any advancements you make with
>> javascript, or any other improvements from the basic fossil ui.
>>
>
> Me as well. If you extend the GoCo theme to include diff highlighting (a
> list member posted an easy-to-use JS script for this), i will immediately
> import it into my sites :).
>
> --
> ----- stephan beal

The biggest problem of getting highlighting to work in fossil is the
problem of choice: it's not easy to pick one JavaScript higlighter from
the many ones that are available. For me, the winner is called
highlight.js [1] Its killer feature is language auto-detection (you don't
need to specify explicitly "treat this code snippet as
C/Python/diff/whatever and color it accordingly"). A minor mismatch is
that fossil puts code snippets inside <pre> blocks, while higlight.js
looks for code inside <pre><code> blocks. This is easily mitigated by
manually patching the code of highlight.js, as consequence no fiddling
with fossil's source is required at all. Achieving diff highlight becomes
trivial, one needs to pick only the diff.js file from the available
languages when creating the bundle containing needed languages for a
project and the general higlight machinery itself. The bundle is a big
piece of javascript that is inserted directly into the repo header. A
color template is chosen as well (highlight.js has a lot of them, as CSS)
and is inserted into repo's CSS code. This is enough to get colored diffs
everywhere and also colors for source code files as well, if support for
languages included in a project is bundled.

1. http://softwaremaniacs.org/soft/highlight/en/


_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to