From 171e7a112b85c103358bf9e45f60a35c71d298c3 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Wed, 31 Jul 2024 14:44:23 +0200 Subject: added Lua-based HIGHLIGHT macro and groff-ms.outlang for ms macros * the highlight.sno and highlight.lua macros are considerde deprecated in favor of pygments-groff.py. --- README.md | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index bfb27ec..73a9fe1 100644 --- a/README.md +++ b/README.md @@ -23,19 +23,20 @@ To build the sample `select-from.ebnf`, type something like: cat samples/select-from.ebnf | ./ebnf.sno | pic | groff -Tps >select-from.ps -## HIGHLIGHT +## HIGHLIGHT (SNOBOL4) `highlight.sno` is a small preprocessor written in [CSNOBOL4](http://www.snobol4.org/csnobol4/) that processes blocks of source code embedded in your Groff document with [GNU Source-highlight](http://www.gnu.org/software/src-highlite/) to produce syntax highlighted text. -The output is formatted according to `groff.outlang` which currently only works with -the [mom macros](http://www.schaffter.ca/mom/). +The output is formatted according to `groff.outlang`. +Versions for the [mom macros](http://www.schaffter.ca/mom/) (`groff-mom.outlang`) and +for the classic ms macros (`groff-ms.outlang`) are provided. -Example: +Example (mom): -``` +```groff .QUOTE .CODE .HIGHLIGHT c @@ -51,6 +52,18 @@ int main(int argc, char **argv) .QUOTE OFF ``` +## HIGHLIGHT (Lua) + +`highlight.lua` is a reimplementation of `highlight.sno` in Lua 5.2 and may work +better on some operating systems. + +In addition to the aforementioned syntax, the Lua version allows you to specify a filename after +the language identifier to process an external file: + +```groff +.HIGHLIGHT c hello.c +``` + ## UML `uml.sno` is a small preprocessor (again requires CSNOBOL4) that -- cgit v1.2.3