Skip to content
Paper Theme
Go back

Code Blocks Demo

Updated:
Tags:

Paper Theme supports server-side code highlighting when code_highlight.server is enabled.

TypeScript

type Post = {
  title: string;
  tags: string[];
};

function sortByDate(posts: Post[]): Post[] {
  return [...posts].sort((a, b) => a.title.localeCompare(b.title));
}

Python

def fibonacci(n: int) -> list[int]:
    seq = [0, 1]
    while len(seq) < n:
        seq.append(seq[-1] + seq[-2])
    return seq[:n]

Shell

everkm-publish serve --work-dir ./my-site --theme paper