hook_numberLines function automates line numbering on code blocks.
By default, the feature affects only source codes.
# By default, Source lines are numbered "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.
# After `hook_numberLines(c("source", "output"))`, # Source lines are numbered "Output lines are also numbered"
In order to disable the feature on selected chunks, specify the
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"
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.