Thus, before scripting the above approach, I looked for other options. Two seem promising: Pygments and highlight. Both provide shell filters for converting program text into HTML. For now, I've settled on highlight, since Pygments lacks support for highlighting Standard ML.
Several command line options are appropriate. For example, I can format an SML file with
cat real-ord.sml | highlight --inline-css -f --enclose-pre -S sml -s seashell | pbcopy
Pasting that into MarsEdit nicely formats the contents of
real-ord.sml
:structure RealOrdKey : ORD_KEY where type ord_key = Real.real = struct
open Real
type ord_key = real
end
I'm sure I'll need to refine the approach a bit as I go, but this already seems easier than the approach I'd been using.
No comments:
Post a Comment