# R code
data <- c(1, 2, 3, 4, 5)
mean(data)[1] 3
This document demonstrates the regurgitate extension with language grouping enabled, e.g. group-by-language: true. Code blocks will be organized by programming language at the end.
Here’s some Python code:
def hello():
print("Hello, world!")
hello()Let’s do some calculations:
# R code
data <- c(1, 2, 3, 4, 5)
mean(data)[1] 3
Some bash commands:
echo "Building project..."
make clean
make allAnother Python snippet:
import numpy as np
arr = np.array([1, 2, 3])
print(arr.mean())A quick JavaScript function:
function greet(name) {
return `Hello, ${name}!`;
}
console.log(greet("World"));With group-by-language: true, all code blocks are grouped by language in the Code Appendix. Languages appear in alphabetical order with subsection headers.
Since show-code-inline: true (the default), code blocks remain in their original positions above and are also copied to the appendix.
echo "Building project..."
make clean
make allfunction greet(name) {
return `Hello, ${name}!`;
}
console.log(greet("World"));def hello():
print("Hello, world!")
hello()import numpy as np
arr = np.array([1, 2, 3])
print(arr.mean())# R code
data <- c(1, 2, 3, 4, 5)
mean(data)[1] 3