[ocamlweb-devel] syntax highlighting

Maxence Guesdon maxence.guesdon at inria.fr
Wed Dec 19 15:10:17 GMT 2012


Hello,

I'm having a look at syntax highlighting, since it's missing on code
from pages in tutorials/.

Looking at the source of main page, I see that highlighting requires
adding attributes to <pre> nodes:
  <pre class="listing" ml:content="ocaml noeval">
   ...
  </pre>

I find it quite heavy to type all this each time a piece of ocaml code
is to be included. Is there a lighter way ?

Another question: Is there a way to include an ocaml file ?

And more generally: Is there a way to define some kind of rewrite rules
on nodes ? For example to we able to define that
  <ocaml>...</ocaml>
should be rewritten
  <pre class="listing" ml:content="ocaml noeval">...</pre>
?
(this could be useful tool in the 99problems page, so avoid having to
type all these "buttons" code for each problem.

<self-promotion>
This would be done very easily in stog :-)
</self-promotion>

Regards,

Maxence



More information about the Infrastructure mailing list