brettaufheber / asciidoc-with-gh-pages-action

JavaScript Action that generates static websites for GitHub Pages using AsciiDoc
MIT License
0 stars 0 forks source link

Support for line numbers in syntax highlighting blocks #3

Closed brettaufheber closed 2 years ago

brettaufheber commented 2 years ago

The attributes "linenums" and "highlight" as described here are currently ignored by the highlight.js extension.

Also, another attribute is required to start code snippets at a specific line number.

A treeProcessor can be implemented to solve the issue.

const language = block.getAttribute('language', 'nohighlight');
const useLineNumbers = block.getAttribute('linenums', null) === 'linenums';
const startFrom = block.getAttribute('start-from', 1);
const highlights = block.getAttribute('highlight', null);
brettaufheber commented 2 years ago

Moved issue to another repository. https://github.com/brettaufheber/asciidoc-site-generator/issues/1