The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.

Number lines on code blocks

The hook_numberLines function automates line numbering on code blocks.

library(chunkhooks)
hook_numberLines()

Basic usage

By default, the feature affects only source codes.

# By default, Source lines are numbered
"Output lines are not numbered"
## [1] "Output lines are not numbered"

The feature can be introduced to other types of code blocks as well, i.e. output, message, warning, and error.

hook_numberLines(c("source", "output"))
# After `hook_numberLines(c("source", "output"))`,
# Source lines are numbered
"Output lines are also numbered"
## [1] "Output lines are also numbered"

In order to disable the feature on selected chunks, specify the numberLines chunk option that determines which types of code blocks need line numbers.

# numberLines="output" is specified as a chunk option
# Source lines are not numbered
"Output lines are also numbered"
## [1] "Output lines are also numbered"

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.