]> sipb.mit.edu Git - ikiwiki.git/blobdiff - doc/plugins/contrib/sourcehighlight.mdwn
change example to override a real function
[ikiwiki.git] / doc / plugins / contrib / sourcehighlight.mdwn
index 99896971bb9486751080591406f64e9ba257b38b..2eb22e6edd01b27778e68ee41bf81dc789ded23c 100644 (file)
@@ -1,10 +1,22 @@
+[[!template id=plugin name=sourcehighlight core=0 author="[[DavidBremner]]"]]
+
 I noticed several places in the wiki talking about similar ideas, so I decided to put a page here to point to what I am working on.
 
-I have copied otl.pm and am wrapping source-highlight (why this instead of vim highlight, I dunno, I must be a real emacs guy).  You can find more or less the latest 
-version on 
-[my wiki](http://www.cs.unb.ca/~bremner/wiki/software/sourcehighlight.pm)
+I have implemented a simple wrapper around
+ [source-highlight](http://www.gnu.org/software/src-highlite/).  You can find the latest version in 
+[git](http://pivot.cs.unb.ca/git?p=ikiplugins.git;a=blob_plain;f=IkiWiki/Plugin/sourcehighlight.pm;hb=HEAD).
+You must specify `highlight_lang=>"foo,bar"` in your setup file.
+where foo and bar are the (source-supported) languages you want to
+highlight
+### Issues
+
+- I would like to have a link to the raw source; using will_render() and then copying the file should work. 
+
+- the common case of foo.c and foo.h breaks
+because they both generate page working/dir/foo. 
+It looks to me like ikiwiki is hardcoded to strip the extension in `pagename()` (IkiWiki.pm).
+This problem with sourcehighlight needs to be fixed before it is very useful.
 
-In the tradition of publish early and often, this just supports java 
-at the moment. I will add more languages soon.
-You can (and I will) add more languages by cutting and pasting the hook line.
+- Is there a way to configure the colors used by source-highlight (other than editing the globally installed "default.style" file)? It would help if I could pass the command arbitrary command-line arguments; then I could configure which config file it's supposed to use. For instance, I'm not a fan of hard-coding the colors into the HTML output. IMHO, css-style formatting should be preferred. All that can be set via the command line ... --Peter
 
+> I don't really have time right now, but it should be easy to add, if you look at how src-lang is handled.  Patches are welcome :-) --[[DavidBremner]]