maruku 0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. data/bin/maruku +25 -0
  2. data/bin/marutex +29 -0
  3. data/docs/Makefile +25 -0
  4. data/docs/char_codes.xml +884 -0
  5. data/docs/color-package-demo.aux +1 -0
  6. data/docs/color-package-demo.log +127 -0
  7. data/docs/color-package-demo.tex +149 -0
  8. data/docs/index.html +74 -0
  9. data/docs/markdown_syntax.aux +13 -0
  10. data/docs/markdown_syntax.html +266 -0
  11. data/docs/markdown_syntax.log +287 -0
  12. data/docs/markdown_syntax.md +920 -0
  13. data/docs/markdown_syntax.out +0 -0
  14. data/docs/markdown_syntax.pdf +0 -0
  15. data/docs/markdown_syntax.tex +1203 -0
  16. data/docs/maruku.aux +13 -0
  17. data/docs/maruku.html +74 -0
  18. data/docs/maruku.log +294 -0
  19. data/docs/maruku.md +394 -0
  20. data/docs/maruku.out +0 -0
  21. data/docs/maruku.pdf +0 -0
  22. data/docs/maruku.tex +548 -0
  23. data/docs/style.css +65 -0
  24. data/docs/todo.md +12 -0
  25. data/lib/maruku.rb +20 -0
  26. data/lib/maruku/parse_block.rb +577 -0
  27. data/lib/maruku/parse_span.rb +336 -0
  28. data/lib/maruku/string_utils.rb +270 -0
  29. data/lib/maruku/structures.rb +31 -0
  30. data/lib/maruku/to_html.rb +430 -0
  31. data/lib/maruku/to_latex.rb +345 -0
  32. data/lib/maruku/to_latex_strings.rb +330 -0
  33. data/tests/abbreviations.md +11 -0
  34. data/tests/blank.md +4 -0
  35. data/tests/code.md +5 -0
  36. data/tests/code2.md +8 -0
  37. data/tests/code3.md +16 -0
  38. data/tests/email.md +4 -0
  39. data/tests/entities.md +19 -0
  40. data/tests/escaping.md +14 -0
  41. data/tests/extra_dl.md +101 -0
  42. data/tests/extra_header_id.md +13 -0
  43. data/tests/extra_table1.md +40 -0
  44. data/tests/footnotes.md +17 -0
  45. data/tests/headers.md +10 -0
  46. data/tests/hrule.md +10 -0
  47. data/tests/images.md +20 -0
  48. data/tests/inline_html.md +35 -0
  49. data/tests/links.md +31 -0
  50. data/tests/list1.md +4 -0
  51. data/tests/list2.md +5 -0
  52. data/tests/list3.md +8 -0
  53. data/tests/lists.md +32 -0
  54. data/tests/lists_ol.md +39 -0
  55. data/tests/misc_sw.md +105 -0
  56. data/tests/one.md +1 -0
  57. data/tests/paragraphs.md +13 -0
  58. data/tests/sss06.md +352 -0
  59. data/tests/test.md +4 -0
  60. metadata +113 -0
File without changes
Binary file
@@ -0,0 +1,548 @@
1
+ \documentclass{article}
2
+
3
+ \usepackage{listings}
4
+
5
+ \usepackage{hyperref}
6
+ %\usepackage[x11names]{xcolor}
7
+ \usepackage[usenames,dvipsnames]{color}
8
+ \hypersetup{colorlinks=true}
9
+ \begin{document}
10
+ \section*{Mar{\bf u}k{\bf u}: a Markdown interpreter}
11
+
12
+ Maruku is a Markdown interpreter written in \href{http://www.ruby-lang.org}{Ruby}.
13
+
14
+ Maruku allows you to write in an easy-to-read-and-write syntax, like this:
15
+
16
+ \begin{quote}%
17
+ \href{http://maruku.rubyforge.org/maruku.md}{This document in Markdown}
18
+
19
+
20
+ \end{quote}
21
+ Then it can be translated to HTML:
22
+
23
+ \begin{quote}%
24
+ \href{http://maruku.rubyforge.org/maruku.html}{This document in HTML}
25
+
26
+
27
+ \end{quote}
28
+ or Latex, which is then converted to PDF:
29
+
30
+ \begin{quote}%
31
+ \href{http://maruku.rubyforge.org/maruku.pdf}{This document in PDF}
32
+
33
+
34
+ \end{quote}
35
+ Maruku implements the original \href{http://daringfireball.net/projects/markdown/syntax}{Markdown syntax} (\href{http://maruku.rubyforge.org/markdown_syntax.html}{HTML} or \href{http://maruku.rubyforge.org/markdown_syntax.pdf}{PDF}, translated by Maruku).
36
+
37
+ Markdown implements also all the improvements in \href{http://www.michelf.com/projects/php-markdown/extra/}{PHP Markdown Extra}.
38
+
39
+ Moreover, it implements ideas from \href{http://fletcher.freeshell.org/wiki/MultiMarkdown}{MultiMarkdown}.
40
+
41
+
42
+ \vspace{.5em} \hrule \vspace{.5em}
43
+ {\em Table of contents}:
44
+
45
+ \begin{itemize}%
46
+ \item \hyperlink{download}{Download}
47
+
48
+
49
+ \item \hyperlink{usage}{Usage}
50
+
51
+
52
+ \item \hyperlink{extra}{Examples of PHP Markdown extra syntax}
53
+
54
+
55
+ \item \hyperlink{meta}{New metadata syntax}
56
+
57
+
58
+ \item \hyperlink{metalist}{List of metadata}
59
+
60
+
61
+ \item \hyperlink{maruku-and-bluecloth}{Maruku and Bluecloth}
62
+
63
+
64
+ \item \hyperlink{future}{Future developments}
65
+
66
+ \begin{itemize}%
67
+ \item \hyperlink{future-export}{Export to other formats}
68
+ \item \hyperlink{future-syntax}{Syntax additions}
69
+
70
+ \end{itemize}
71
+
72
+
73
+ \end{itemize}
74
+
75
+ \vspace{.5em} \hrule \vspace{.5em}
76
+ \hypertarget{download}{}\subsection*{{Download}}
77
+
78
+ The development site is \href{http://maruku.rubyforge.net/}{http://maruku.rubyforge.net/}.
79
+
80
+ Download current \href{http://rubygems.rubyforge.org/}{gem} at \href{http://maruku.rubyforge.net/gem1.0}{http://maruku.rubyforge.net/gem1.0}
81
+
82
+ \subsection*{Usage}
83
+
84
+ This is the basic usage:
85
+
86
+ \lstset{columns=fixed,frame=shadowbox}\lstset{showspaces=false,showtabs=false}
87
+ \definecolor{maruku_color0}{rgb}{0.941176470588235,0.941176470588235,0.87843137254902}
88
+ \lstset{backgroundcolor=\color{maruku_color0}}
89
+ \lstset{basicstyle=\ttfamily\footnotesize}
90
+ \lstset{language=ruby}
91
+
92
+ \begin{lstlisting}
93
+ require 'maruku'
94
+
95
+ doc = Maruku.new(markdown_string)
96
+ puts doc.to_html
97
+
98
+ \end{lstlisting}or, if you install through RubyGems,
99
+
100
+ \lstset{columns=fixed,frame=shadowbox}\lstset{showspaces=false,showtabs=false}
101
+ \lstset{backgroundcolor=\color{maruku_color0}}
102
+ \lstset{basicstyle=\ttfamily\footnotesize}
103
+ \lstset{language=ruby}
104
+
105
+ \begin{lstlisting}
106
+ require 'rubygems'
107
+ require 'maruku'
108
+
109
+ \end{lstlisting}This outputs a complete XHTML 1.0 document:
110
+
111
+ \lstset{columns=fixed,frame=shadowbox}\lstset{showspaces=false,showtabs=false}
112
+ \lstset{backgroundcolor=\color{maruku_color0}}
113
+ \lstset{basicstyle=\ttfamily\footnotesize}
114
+ \lstset{language=ruby}
115
+
116
+ \begin{lstlisting}
117
+ puts doc.to_html_document
118
+ \end{lstlisting}You can have the REXML document tree with:
119
+
120
+ \lstset{columns=fixed,frame=shadowbox}\lstset{showspaces=false,showtabs=false}
121
+ \lstset{backgroundcolor=\color{maruku_color0}}
122
+ \lstset{basicstyle=\ttfamily\footnotesize}
123
+ \lstset{language=ruby}
124
+
125
+ \begin{lstlisting}
126
+ tree = doc.to_html_document_tree
127
+
128
+ \end{lstlisting}\subsubsection*{From the command line}
129
+
130
+ There are two command-line programs installed: \colorbox{maruku_color0}{\tt \char109\char97\char114\char117\char107\char117} and \colorbox{maruku_color0}{\tt \char109\char97\char114\char117\char116\char101\char120}
131
+
132
+ \colorbox{maruku_color0}{\tt \char109\char97\char114\char117\char107\char117} converts Markdown in HTML:
133
+
134
+ \lstset{columns=fixed,frame=shadowbox}\lstset{showspaces=false,showtabs=false}
135
+ \lstset{backgroundcolor=\color{maruku_color0}}
136
+ \lstset{basicstyle=\ttfamily\footnotesize}
137
+ \lstset{language={}}
138
+
139
+ \begin{lstlisting}
140
+ $ maruku file.md # creates file.html
141
+
142
+ \end{lstlisting}\colorbox{maruku_color0}{\tt \char109\char97\char114\char117\char116\char101\char120} converts Markdown in TeX, then calls \colorbox{maruku_color0}{\tt \char112\char100\char102\char108\char97\char116\char101\char120} to transform to PDF:
143
+
144
+ \lstset{columns=fixed,frame=shadowbox}\lstset{showspaces=false,showtabs=false}
145
+ \lstset{backgroundcolor=\color{maruku_color0}}
146
+ \lstset{basicstyle=\ttfamily\footnotesize}
147
+ \lstset{language={}}
148
+
149
+ \begin{lstlisting}
150
+ $ marutex file.md # creates file.tex and file.pdf
151
+
152
+
153
+ \end{lstlisting}\hypertarget{extra}{}\subsection*{{Examples of PHP Markdown Extra syntax}}
154
+
155
+ \begin{itemize}%
156
+ \item tables
157
+
158
+ \lstset{columns=fixed,frame=shadowbox}\lstset{showspaces=false,showtabs=false}
159
+ \lstset{backgroundcolor=\color{maruku_color0}}
160
+ \lstset{basicstyle=\ttfamily\footnotesize}
161
+ \lstset{language={}}
162
+
163
+ \begin{lstlisting}
164
+ Col1 | Very very long head | Very very long head|
165
+ -----|:-------------------:|-------------------:|
166
+ cell | center-align | right-align |
167
+
168
+ \end{lstlisting}\begin{tabular}{l|c|r}
169
+ Col1&Very very long head&Very very long head\\
170
+ \hline
171
+ cell&center-align&right-align\\
172
+ \end{tabular}
173
+
174
+
175
+ \item footnotes \footnote{I really was missing those.}
176
+
177
+ \lstset{columns=fixed,frame=shadowbox}\lstset{showspaces=false,showtabs=false}
178
+ \lstset{backgroundcolor=\color{maruku_color0}}
179
+ \lstset{basicstyle=\ttfamily\footnotesize}
180
+ \lstset{language={}}
181
+
182
+ \begin{lstlisting}
183
+ *footnotes [^foot]
184
+
185
+ [^foot]: I really was missing those.
186
+ \end{lstlisting}
187
+ \item Markdown inside HTML elememnts
188
+
189
+
190
+
191
+ \end{itemize}
192
+ \lstset{columns=fixed,frame=shadowbox}\lstset{showspaces=false,showtabs=false}
193
+ \lstset{backgroundcolor=\color{maruku_color0}}
194
+ \lstset{basicstyle=\ttfamily\footnotesize}
195
+ \lstset{language=html}
196
+
197
+ \begin{lstlisting}
198
+ <div markdown="1" style="border: solid 1px black">
199
+ This is a div with Markdown **strong text**
200
+ </div>
201
+
202
+ \end{lstlisting}{\bf Raw HTML removed in latex version }\begin{itemize}%
203
+ \item header ids
204
+
205
+ \lstset{columns=fixed,frame=shadowbox}\lstset{showspaces=false,showtabs=false}
206
+ \lstset{backgroundcolor=\color{maruku_color0}}
207
+ \lstset{basicstyle=\ttfamily\footnotesize}
208
+ \lstset{language={}}
209
+
210
+ \begin{lstlisting}
211
+ ## Header ## {#id}
212
+ \end{lstlisting}For example, \hyperlink{download}{a link to the download} header.
213
+
214
+
215
+ \item definition lists
216
+
217
+ \lstset{columns=fixed,frame=shadowbox}\lstset{showspaces=false,showtabs=false}
218
+ \lstset{backgroundcolor=\color{maruku_color0}}
219
+ \lstset{basicstyle=\ttfamily\footnotesize}
220
+ \lstset{language={}}
221
+
222
+ \begin{lstlisting}
223
+ Definition list
224
+ : something very hard to parse
225
+
226
+ \end{lstlisting}\begin{description}
227
+
228
+ \item[Definition list] something very hard to parse
229
+ \end{description}
230
+
231
+ \item abbreviations or ABB for short.
232
+
233
+
234
+
235
+ \end{itemize}
236
+ \hypertarget{maruku-and-bluecloth}{}\subsection*{{Maruku and Bluecloth}}
237
+
238
+ The other Ruby implementation of Markdown is \href{http://www.deveiate.org/projects/BlueCloth}{Bluecloth}.
239
+
240
+ Maruku is much different in philosophy from Bluecloth: the biggest difference is that {\em parsing} is separated from {\em rendering}. In Maruku, an in-memory representation of the Markdown document is created. Instead, Bluecloth mantains the document in memory as a String at all times, and does a series of \colorbox{maruku_color0}{\tt \char103\char115\char117\char98} to transform to HTML.\footnote{"a different philosophy" stands for "ugly" \colorbox{maruku_color0}{\tt \char58\char45\char41}}
241
+
242
+ The in-memory representation makes it very easy to export to various formats (altough, for, now)
243
+
244
+ Other improvements over Bluecloth:
245
+
246
+ \begin{itemize}%
247
+ \item the HTML output is provided also as a \colorbox{maruku_color0}{\tt \char82\char69\char88\char77\char76} document tree.
248
+
249
+
250
+ \item PHP Markdown Syntax support.
251
+
252
+
253
+
254
+ \end{itemize}
255
+ \hypertarget{meta}{}\subsection*{{New meta-data syntax}}
256
+
257
+ Maruku implements a syntax that allows to attach "meta" information to objects.
258
+
259
+ \subsubsection*{Meta-data for the document}
260
+
261
+ Meta-data for the document itself is specified through the use of email headers:
262
+
263
+ \lstset{columns=fixed,frame=shadowbox}\lstset{showspaces=false,showtabs=false}
264
+ \lstset{backgroundcolor=\color{maruku_color0}}
265
+ \lstset{basicstyle=\ttfamily\footnotesize}
266
+ \lstset{language={}}
267
+
268
+ \begin{lstlisting}
269
+ Title: A simple document containing meta-headers
270
+ CSS: style.css
271
+
272
+ Content of the document
273
+
274
+ \end{lstlisting}When creating the document through
275
+
276
+ \lstset{columns=fixed,frame=shadowbox}\lstset{showspaces=false,showtabs=false}
277
+ \lstset{backgroundcolor=\color{maruku_color0}}
278
+ \lstset{basicstyle=\ttfamily\footnotesize}
279
+ \lstset{language=ruby}
280
+
281
+ \begin{lstlisting}
282
+ Maruku.new(s).to_html_document
283
+
284
+ \end{lstlisting}the title and stylesheet are added as expected.
285
+
286
+ \subsubsection*{Meta-data for elements}
287
+
288
+ Maruku introduces a new syntax for attaching metadata to paragraphs, tables, and so on.
289
+
290
+ For example, consider the creation of two paragraphs:
291
+
292
+ \lstset{columns=fixed,frame=shadowbox}\lstset{showspaces=false,showtabs=false}
293
+ \lstset{backgroundcolor=\color{maruku_color0}}
294
+ \lstset{basicstyle=\ttfamily\footnotesize}
295
+ \lstset{language={}}
296
+
297
+ \begin{lstlisting}
298
+ Paragraph 1 is a warning.
299
+
300
+ Paragraph 2
301
+
302
+ \end{lstlisting}Now you really want to attach a 'class' attribute to the paragraphs (for example for CSS styling). Maruku allows you to use:
303
+
304
+ \lstset{columns=fixed,frame=shadowbox}\lstset{showspaces=false,showtabs=false}
305
+ \lstset{backgroundcolor=\color{maruku_color0}}
306
+ \lstset{basicstyle=\ttfamily\footnotesize}
307
+ \lstset{language={}}
308
+
309
+ \begin{lstlisting}
310
+ @ class: warning
311
+ Paragraph 1 is a warning
312
+
313
+ Paragraph 2
314
+
315
+
316
+ \end{lstlisting}You can add more by separating with a \colorbox{maruku_color0}{\tt \char59}:
317
+
318
+ \lstset{columns=fixed,frame=shadowbox}\lstset{showspaces=false,showtabs=false}
319
+ \lstset{backgroundcolor=\color{maruku_color0}}
320
+ \lstset{basicstyle=\ttfamily\footnotesize}
321
+ \lstset{language={}}
322
+
323
+ \begin{lstlisting}
324
+ @ class: warning; id: warning1
325
+ Paragraph 1 is a warning
326
+
327
+ \end{lstlisting}A meta-data declaration is composed of
328
+
329
+ \begin{enumerate}%
330
+ \item newline
331
+ \item an at-symbol '@'
332
+ \item a series of name-value pairs. Each name-value is separated by a colon \colorbox{maruku_color0}{\tt \char58}, pairs are separated by semi-colons \colorbox{maruku_color0}{\tt \char59}
333
+
334
+ \end{enumerate}
335
+ Many declaration can be used, and they refer to {\em the following} object:
336
+
337
+ \lstset{columns=fixed,frame=shadowbox}\lstset{showspaces=false,showtabs=false}
338
+ \lstset{backgroundcolor=\color{maruku_color0}}
339
+ \lstset{basicstyle=\ttfamily\footnotesize}
340
+ \lstset{language={}}
341
+
342
+ \begin{lstlisting}
343
+ @ class: warning
344
+ @ id: warning1
345
+ Paragraph 1 is a warning
346
+
347
+ \end{lstlisting}These can also be separated by newlines:
348
+
349
+ \lstset{columns=fixed,frame=shadowbox}\lstset{showspaces=false,showtabs=false}
350
+ \lstset{backgroundcolor=\color{maruku_color0}}
351
+ \lstset{basicstyle=\ttfamily\footnotesize}
352
+ \lstset{language={}}
353
+
354
+ \begin{lstlisting}
355
+ @ class: warning
356
+
357
+ @ id: warning1
358
+
359
+ Paragraph 1 is a warning
360
+
361
+ \end{lstlisting}Also, if the value is not present, it defaults to \colorbox{maruku_color0}{\tt \char116\char114\char117\char101}:
362
+
363
+ \lstset{columns=fixed,frame=shadowbox}\lstset{showspaces=false,showtabs=false}
364
+ \lstset{backgroundcolor=\color{maruku_color0}}
365
+ \lstset{basicstyle=\ttfamily\footnotesize}
366
+ \lstset{language={}}
367
+
368
+ \begin{lstlisting}
369
+ @ test
370
+
371
+ This paragraph has the attribute 'test' set.
372
+
373
+ \end{lstlisting}
374
+ \vspace{.5em} \hrule \vspace{.5em}
375
+ \hypertarget{metalist}{}\subsection*{{List of meta-data}}
376
+
377
+ \begin{description}
378
+
379
+ \item[{\bf \colorbox{maruku_color0}{\tt \char116\char105\char116\char108\char101}, \colorbox{maruku_color0}{\tt \char115\char117\char98\char106\char101\char99\char116}}] (document) Sets the title of the document use in \colorbox{maruku_color0}{\tt \char116\char105\char116\char108\char101} element.
380
+
381
+
382
+
383
+ \item[{\bf \colorbox{maruku_color0}{\tt \char99\char115\char115}}] (document, HTML) Url of stylesheet.
384
+
385
+
386
+
387
+ \item[{\bf \colorbox{maruku_color0}{\tt \char108\char97\char116\char101\char120\char95\char117\char115\char101\char95\char115\char121\char110\char116\char97\char120}}] (document, HTML) Use the [\colorbox{maruku_color0}{\tt \char115\char121\char110\char116\char97\char120} library][syntax] to add source highlighting.
388
+
389
+
390
+
391
+ \item[{\bf \colorbox{maruku_color0}{\tt \char108\char97\char116\char101\char120\char95\char117\char115\char101\char95\char108\char105\char115\char116\char105\char110\char103\char115}}] (document, LaTex) Use fancy \colorbox{maruku_color0}{\tt \char108\char105\char115\char116\char105\char110\char103} package for better displaying code blocks.
392
+
393
+
394
+
395
+ \item[{\bf \colorbox{maruku_color0}{\tt \char115\char116\char121\char108\char101}, \colorbox{maruku_color0}{\tt \char105\char100}, \colorbox{maruku_color0}{\tt \char99\char108\char97\char115\char115}}] (any block object, HTML) Standard CSS attributes are copied.
396
+
397
+
398
+
399
+ \item[{\bf \colorbox{maruku_color0}{\tt \char108\char97\char110\char103}}] (code blocks) Name of programming language (\colorbox{maruku_color0}{\tt \char114\char117\char98\char121}) for syntax highlighting (does not work yet)
400
+
401
+ Default for this is \colorbox{maruku_color0}{\tt \char99\char111\char100\char101\char95\char108\char97\char110\char103} in document.
402
+
403
+
404
+
405
+ \item[{\bf \colorbox{maruku_color0}{\tt \char99\char111\char100\char101\char95\char115\char104\char111\char119\char95\char115\char112\char97\char99\char101\char115}}] Shows tabs and newlines (default is read in the document object).
406
+
407
+
408
+
409
+ \item[{\bf \colorbox{maruku_color0}{\tt \char99\char111\char100\char101\char95\char98\char97\char99\char107\char103\char114\char111\char117\char110\char100\char95\char99\char111\char108\char111\char114}}] Background color for code blocks. (default is read in the document object).
410
+
411
+ The format is either a named color (\colorbox{maruku_color0}{\tt \char103\char114\char101\char101\char110}, \colorbox{maruku_color0}{\tt \char114\char101\char100}) or a CSS color of the form \colorbox{maruku_color0}{\tt \char35\char102\char102\char48\char48\char102\char102}.
412
+
413
+ \begin{itemize}%
414
+ \item for {\bf HTML output}, the value is put straight in the \colorbox{maruku_color0}{\tt \char98\char97\char99\char107\char103\char114\char111\char117\char110\char100\char45\char99\char111\char108\char111\char114} CSS property of the block.
415
+
416
+
417
+ \item for {\bf LaTeX output}, if it is a named color, it must be a color accepted by the latex \colorbox{maruku_color0}{\tt \char99\char111\char108\char111\char114} packages. If it is of the form \colorbox{maruku_color0}{\tt \char35\char102\char102\char48\char48\char102\char102}, Maruku defines a color using the \colorbox{maruku_color0}{\tt \char92\char100\char101\char102\char105\char110\char101\char99\char111\char108\char111\char114} macro.
418
+
419
+ For example, for \colorbox{maruku_color0}{\tt \char35\char48\char48\char48\char48\char102\char102}, the macro is called as:
420
+
421
+ \lstset{columns=fixed,frame=shadowbox}\lstset{showspaces=false,showtabs=false}
422
+ \lstset{backgroundcolor=\color{maruku_color0}}
423
+ \lstset{basicstyle=\ttfamily\footnotesize}
424
+ \lstset{language=tex}
425
+
426
+ \begin{lstlisting}
427
+ \definecolor{DummyName}{rgb}{0,0,1}
428
+ \end{lstlisting}
429
+
430
+ \end{itemize}
431
+
432
+ \end{description}
433
+ \subsubsection*{Examples}
434
+
435
+ An example of this is the following:
436
+
437
+ \lstset{columns=fixed,frame=shadowbox}\lstset{showspaces=true,showtabs=true}
438
+ \lstset{backgroundcolor=\color{maruku_color0}}
439
+ \lstset{basicstyle=\ttfamily\footnotesize}
440
+ \lstset{language={}}
441
+
442
+ \begin{lstlisting}
443
+ @ code_show_spaces; code_background_color: green
444
+
445
+ One space
446
+ Two spaces
447
+ Tab, space, tab
448
+ Tab, tab, tab and all is green!
449
+
450
+ \end{lstlisting}That will produce:
451
+
452
+ \lstset{columns=fixed,frame=shadowbox}\lstset{showspaces=true,showtabs=true}
453
+ \lstset{backgroundcolor=\color{green}}
454
+ \lstset{basicstyle=\ttfamily\footnotesize}
455
+ \lstset{language={}}
456
+
457
+ \begin{lstlisting}
458
+ One space
459
+ Two spaces
460
+ Tab, space, tab
461
+ Tab, tab, tab and all is green!
462
+
463
+ \end{lstlisting}Example with css-style color:
464
+
465
+ \lstset{columns=fixed,frame=shadowbox}\lstset{showspaces=false,showtabs=false}
466
+ \lstset{backgroundcolor=\color{maruku_color0}}
467
+ \lstset{basicstyle=\ttfamily\footnotesize}
468
+ \lstset{language={}}
469
+
470
+ \begin{lstlisting}
471
+ @ code_background_color: #455678
472
+
473
+ A strange color
474
+
475
+ \end{lstlisting}produces:
476
+
477
+ \lstset{columns=fixed,frame=shadowbox}\lstset{showspaces=false,showtabs=false}
478
+ \definecolor{maruku_color1}{rgb}{0.270588235294118,0.337254901960784,0.470588235294118}
479
+ \lstset{backgroundcolor=\color{maruku_color1}}
480
+ \lstset{basicstyle=\ttfamily\footnotesize}
481
+ \lstset{language={}}
482
+
483
+ \begin{lstlisting}
484
+ A strange color
485
+
486
+ \end{lstlisting}Or highlighting (does not work well yet):
487
+
488
+ \lstset{columns=fixed,frame=shadowbox}\lstset{showspaces=false,showtabs=false}
489
+ \lstset{backgroundcolor=\color{maruku_color0}}
490
+ \lstset{basicstyle=\ttfamily\footnotesize}
491
+ \lstset{language={}}
492
+
493
+ \begin{lstlisting}
494
+ @ lang: xml
495
+ <div style="text-align:center">Div</div>
496
+
497
+ \end{lstlisting}produces:
498
+
499
+ \lstset{columns=fixed,frame=shadowbox}\lstset{showspaces=false,showtabs=false}
500
+ \lstset{backgroundcolor=\color{maruku_color0}}
501
+ \lstset{basicstyle=\ttfamily\footnotesize}
502
+ \lstset{language=xml}
503
+
504
+ \begin{lstlisting}
505
+ <div style="text-align:center">Div</div>
506
+
507
+ \end{lstlisting}
508
+ \vspace{.5em} \hrule \vspace{.5em}
509
+ \hypertarget{future}{}\subsection*{{Future developments}}
510
+
511
+ I think that \href{http://sophos.berkeley.edu/macfarlane/pandoc/}{Pandoc} and \href{http://fletcher.freeshell.org/wiki/MultiMarkdown}{MultiMarkdown} are very cool projects. However, they are written in Haskell and Perl, respectively. I would love to have an equivalent in Ruby.
512
+
513
+ \hypertarget{future-syntax}{}\subsubsection*{{Syntax improvements}}
514
+
515
+ Things I'm thinking about:
516
+
517
+ \begin{itemize}%
518
+ \item a syntax for commenting parts of the document:
519
+
520
+ \lstset{columns=fixed,frame=shadowbox}\lstset{showspaces=false,showtabs=false}
521
+ \lstset{backgroundcolor=\color{maruku_color0}}
522
+ \lstset{basicstyle=\ttfamily\footnotesize}
523
+ \lstset{language={}}
524
+
525
+ \begin{lstlisting}
526
+ This is a paragraph
527
+ % This is a comment
528
+ \end{lstlisting}
529
+ \item choose a syntax for adding math:
530
+
531
+ \lstset{columns=fixed,frame=shadowbox}\lstset{showspaces=false,showtabs=false}
532
+ \lstset{backgroundcolor=\color{maruku_color0}}
533
+ \lstset{basicstyle=\ttfamily\footnotesize}
534
+ \lstset{language={}}
535
+
536
+ \begin{lstlisting}
537
+ This is inline math: $\alpha$
538
+
539
+ This is an equation with label:
540
+
541
+ $ \alpha = \beta + \gamma $ (eq:1)
542
+
543
+ This is a reference to equation: please see (eq:1)
544
+ \end{lstlisting}
545
+
546
+ \end{itemize}
547
+
548
+ \end{document}