Some additional features of the code macro, I would like

Especially for the documentation of source code, I would like to see a few more features for the code macro:

  • a start specification for the numbering
  • a possibility to highlight individual lines with boldface. (This could be done by specifying line numbers or ranges or by (regular) patterns.)
  • a specification of the range of lines which are shown
  • a possibility - similar to live tables - to scroll through a (large) source.
1 Like

Hi, I think we’re going to deprecate the code macro soonish, in favor of the Highlight Macro (XWiki.org) macro.

This is now possible since we’re now doing client-side PDF export and thus highlighted code can now be exported when using the highlight macro.

Now I’m not sure that https://highlightjs.org/ supports line numbering or the other features you mentioned above… If you know of a good highlighting javascript library that does all you mention (and that supports lots of languages, let us know).

Thanks

Hi,
I think highlightjs-line-numbers will do most of it.
It is a plugin for highlightjs.
I have not tested the software yet.
The documentation looks like the requirements are met.

Thanks for the information
Norbert