diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2008-02-09 03:22:22 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2008-02-09 03:22:22 +0000 |
commit | a2acc54014e0d9fd1ba121e1e7f3113f132ac60e (patch) | |
tree | f3d72a107393e3dc2c3c7bf546b6c5060044879d /web | |
parent | d4e89c3cbe5eba8fa7e17123b74d6f6bf6499d26 (diff) | |
download | pandoc-a2acc54014e0d9fd1ba121e1e7f3113f132ac60e.tar.gz |
Moved code.txt -> code.text.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1228 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'web')
-rw-r--r-- | web/code.text | 45 | ||||
-rw-r--r-- | web/demos | 2 |
2 files changed, 46 insertions, 1 deletions
diff --git a/web/code.text b/web/code.text new file mode 100644 index 000000000..c15ccfc9b --- /dev/null +++ b/web/code.text @@ -0,0 +1,45 @@ +% Code with syntax highlighting + +Here's what a delimited code block looks like: + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.haskell} + -- | Inefficient quicksort in haskell. + qsort :: (Enum a) => [a] -> [a] + qsort [] = [] + qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++ + qsort (filter (>= x) xs) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +And here's how it looks after 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) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here's some python, with numbered lines (specify `{.python .numberLines}`): + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.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 + ... +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + @@ -85,5 +85,5 @@ click on the name of the output file: 18. Syntax highlighting of delimited code blocks: -@ pandoc @@code.txt@@ -s -o @@example18.html@@ +@ pandoc @@code.text@@ -s -o @@example18.html@@ |