Code BlocksCode blocks are delimited by ~~~ and support syntax highlighting for several languages. Basic Syntax~~~{Optional Title}{language} code here ~~~ The first brace pair is an optional title, the second is the language for highlighting. PythonHello World
import numpy as np def greet(name): # Say hello to someone. print(f"Hello, {name}!") return True # Create an array and call the function x = np.array([1, 2, 3]) greet("world") C++Fibonacci
#include <iostream> int fibonacci(int n) { if (n <= 1) return n; return fibonacci(n - 1) + fibonacci(n - 2); } int main() { for (int i = 0; i < 10; i++) { std::cout << fibonacci(i) << " "; } return 0; } ShellBuild and install
# Clone the repository git clone https://github.com/haozhu10015/jemdoc-rs.git cd jemdoc-rs # Build and install cargo install --path . # Convert jemdoc files jemdoc-rs -c mysite.conf *.jemdoc echo "Done!" RubyRuby example
class Greeter def initialize(name) @name = name end def greet puts "Hello, world!" end end Greeter.new("world").greet MATLABMATLAB example
% Generate random data x = randn(1, 100); y = cumsum(x); % Find the maximum [val, idx] = max(y); help cumsum RustFibonacci
use std::collections::HashMap; fn fibonacci(n: u64, memo: &mut HashMap<u64, u64>) -> u64 { if n <= 1 { return n; } if let Some(&val) = memo.get(&n) { return val; } let result = fibonacci(n - 1, memo) + fibonacci(n - 2, memo); memo.insert(n, result); result } fn main() { let mut memo = HashMap::new(); for i in 0..10 { println!("fib({}) = {}", i, fibonacci(i, &mut memo)); } } jemdoc SyntaxUse the jemdoc language for jemdoc source highlighting. It renders in a monospace font with special handling for jemdoc markers: # jemdoc: menu{MENU}{index.html}
== My Page Title
- A list item - Another item : {Term} Definition here. Python InteractiveThe pyint language highlights Python interactive sessions: Python REPL
>>> import math >>> math.sqrt(144) 12.0 >>> print("Hello!") Hello! Raw BlocksUse {}{raw} to output content verbatim with no wrapping or highlighting:
Custom HTML block
This content passes through without any jemdoc processing. Useful for embedding widgets, iframes, or complex HTML layouts. Code Block Without TitleOmit the title to get an untitled code block: print("No title on this block") Supported Languages
|