gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gm2] Bitbucket updated rendering of Modula-2 sources with GM2 support


From: Benjamin Kowarsch
Subject: [Gm2] Bitbucket updated rendering of Modula-2 sources with GM2 support
Date: Tue, 29 Mar 2016 21:24:03 +0900

About a year ago I had updated my Modula-2 plugin for the Pygments rendering framework to support multiple dialects, including GM2 extensions.

Bitbucket.org have now finally updated their Pygments installation and the multi-dialect plugin is now active, although it is not the latest version.

If you host any of your Modula-2 sources on Bitbucket, you can have them rendered specific to the dialect and GM2 extensions you might use by inserting a special comment with a dialect tag in each source file.

For example, if you are using GM2 with PIM, you can insert tag

(*!m2pim+gm2*)

or if you are using GM2 with ISO, you can insert tag

(*!m2iso+gm2*)

and the plugin will recognise all the appropriate reserved words, predefined identifiers etc and render them accordingly.

Until some time ago, Github were also using Pygments but they have since migrated away from Python to Ruby. Since there is no renderer for Ruby that covers as many languages, they embarked on a migration path where a mishmash of multiple renderers are used until all previous capabilities are available under Ruby. This is a moving target and I have refrained from any effort to port the plugin.

Nevertheless, the Pygments framework can also be used standalone to render sources to PDF, RTF and other formats. Using it standalone allows more control over the output by supplying one's own style sheets. The plugin also supports Algol rendering mode, whereby all reserved words and predefined identifiers are rendered in the style of the Algol-60 report, that is to say, reserved words in lowercase boldface (and optionally underlined), predefined identifiers lowercase boldface italic.

You can get the latest version here:

https://bitbucket.org/trijezdci/m2r10/src/9767a567c711b92c6dedc87540d3600c5210cba8/_GRAMMAR/pygments.lexers.modula2.py 

https://bitbucket.org/trijezdci/m2r10/src/9767a567c711b92c6dedc87540d3600c5210cba8/_GRAMMAR/pygments.styles.algol.py 

https://bitbucket.org/trijezdci/m2r10/src/9767a567c711b92c6dedc87540d3600c5210cba8/_GRAMMAR/pygments.styles.algol_nu.py

Pygments is available from pygments.org.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]