Feature/codelines: Add support for numbering source code lines #51
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We add three more properties to the
source element
of the formatThe
firstnumber
determines how we remap the first actual input line.By default this is the identity, that is, the first input line is set as
first line in the output:
firstnumber=0
.The range specifies what parts of the code we want to print.
It depends on the value of
firstnumber
, that is, if we usefirstnumber=10
andrange 11-14
it will print the 2st to 6nd (thx @aLuc) line of the input.By default all lines are printed.
Finally, we can turn line numbers on or off.
This PR also changes the following:
Monad.fail
and introducesMonadFail
Pipeline markup_secfault/pipelines/8981 passed.
Note on design: Since this simply prepends each line with a line number, highlighters will break. The "proper" way to fix this would probably to introduce an
ItemLineNo
or the like and writing a specific renderer for each target (LO + HTML). This works for now, though.