omd
omd copied to clipboard
Support for code highlighting
Requested in https://github.com/ocaml/omd/issues/236#issuecomment-826293442. This should probably be implemented in a lightweight way that takes advantage of the clean extension mechanism we want (but don't yet have) ;)
There is a project called lowlight which integrates highlight.js with vdoms. It might be useful to do the same here where there is another project for integrating with jsoo vdom implementations.
Hi, I am using Omd to make a static site generator. One of the features I wanted for my static site generator was syntax highlighting, so I went and implemented it myself. I have published the textmate-language
package for processing TextMate grammars on OPAM. I would love to work with the maintainers of Omd to integrate my existing work into Omd.
Hi, @alan-j-hu, thanks! I'll take a look at your package to get an idea. As @shonfeder suggests, this might be a good opportunity to think about extensions more concretely.
I guess one place to start is with this question:
Is it (a) sufficient for our purposes that "extension" be through OCaml library APIs, or (b) do we need a plugin system that would allow different external executables to serve as extension mechanisms?
My current inclination is that (a) will suffice for current needs. The cost is that using a plugin means that you are either leveraging omd as a library, or you are building a new executable. Would this be satisfactory for your current needs @alan-j-hu?
If (a) is the right target for now, I propose we expore implementing it via a functorial interface. Later, we might consider adding something which is midway between (a) and (b) via ocaml_plugin (this would allow dynamically loading ocaml modules as plugins, but wouldn't work with arbitrary executables).
Yes, accessing the extension mechanism through the OCaml library should be sufficient for my needs.