mirror of
https://github.com/jgm/pandoc.git
synced 2026-07-30 21:21:07 +00:00
'make pandoc.wasm' will compile a wasm version of pandoc. This also adds a 'repl' flag to pandoc-lua-engine, so that support for a Lua repl can be disabled for the wasm build. A new wasm directory contains: - pandoc.js, a JavaScript wrapper for pandoc.wasm - index.html + index.js, a web app exposing all of pandoc's functionality in a GUI interface - a set of illustrative examples that can be loaded from the web app Most of the code in index.html and index.js has been produced in interaction with Claude code.
40 lines
1.0 KiB
Plaintext
40 lines
1.0 KiB
Plaintext
---
|
|
title: Code with syntax highlighting
|
|
lang: en-US
|
|
...
|
|
|
|
Here's some code with syntax highlighting:
|
|
|
|
``` haskell
|
|
-- | Inefficient quicksort in haskell.
|
|
qsort :: (Enum a) => [a] -> [a]
|
|
qsort [] = []
|
|
qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++
|
|
qsort (filter (>= x) xs)
|
|
```
|
|
|
|
Try changing the highlighting style to see what effect this has.
|
|
|
|
Here's some python, with numbered lines:
|
|
|
|
``` python {.numberLines}
|
|
class FSM(object):
|
|
|
|
"""This is a Finite State Machine (FSM).
|
|
"""
|
|
|
|
def __init__(self, initial_state, memory=None):
|
|
|
|
"""This creates the FSM. You set the initial state here. The "memory"
|
|
attribute is any object that you want to pass along to the action
|
|
functions. It is not used by the FSM. For parsing you would typically
|
|
pass a list to be used as a stack. """
|
|
|
|
# Map (input_symbol, current_state) --> (action, next_state).
|
|
self.state_transitions = {}
|
|
# Map (current_state) --> (action, next_state).
|
|
self.state_transitions_any = {}
|
|
self.default_transition = None
|
|
...
|
|
```
|