source: project/wiki/eggref/4/lowdown @ 27198

Last change on this file since 27198 was 27198, checked in by Moritz Heidkamp, 8 years ago

lowdown: Add documentation

File size: 3.0 KB
Line 
1[[tags: egg]]
2
3== lowdown
4
5Lowdown is a pure Scheme
6[[http://daringfireball.net/projects/markdown/|Markdown]] parser
7library. It's mostly a port of
8[[https://github.com/jgm/peg-markdown/|John MacFarlane's Markdown
9PEG]] to [[comparse]] parser combinators (not yet documented). Unlike
10the [[discount]] parser (and the original {{Markdown.pl}} for that
11matter) it passes all 22 tests of the MarkdownTest suite (version
121.0.3) and emits [[http://okmij.org/ftp/Scheme/SXML.html|SXML]] rather
13than a serialized HTML string. This allows for flexible
14post-processing of the parsing result using, for example,
15[[sxml-transforms]].
16
17[[toc:]]
18
19=== API
20
21<procedure>(markdown->sxml input)</procedure>
22
23Parses the Markdown formatted {{input}} and returns an SXML
24representation of the resulting HTML document. {{input}} may be a
25string, an input port or a list of characters.
26
27
28<procedure>(markdown->sxml* input)</procedure>
29
30Parses the Markdown formatted {{input}} and returns an SXML
31represenation of it. {{input}} may be a string, an input port or a
32list of characters.
33
34
35<procedure>(markdown-sxml->html-sxml markdown-sxml)</procedure>
36
37Turns the {{markdown-sxml}} structure as returned by
38{{markdown->sxml*}} into an SXML structure as returned by
39{{markdown->sxml}}.
40
41=== About this egg
42
43==== Source
44
45The [[https://bitbucket.org/DerGuteMoritz/lowdown|source code is
46hosted at Bitbucket]]. Feel free to fork it and send pull requests
47there.
48
49==== Author
50
51[[/users/moritz-heidkamp|Moritz Heidkamp]]
52
53==== Version history
54
55; 0.0.1 : Initial release
56
57==== License
58
59  Copyright (c) 2012, Moritz Heidkamp
60  All rights reserved.
61 
62  Redistribution and use in source and binary forms, with or without
63  modification, are permitted provided that the following conditions are
64  met:
65 
66  Redistributions of source code must retain the above copyright
67  notice, this list of conditions and the following disclaimer.
68 
69  Redistributions in binary form must reproduce the above copyright
70  notice, this list of conditions and the following disclaimer in the
71  documentation and/or other materials provided with the distribution.
72 
73  Neither the name of the author nor the names of its contributors may
74  be used to endorse or promote products derived from this software
75  without specific prior written permission.
76 
77  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
78  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
79  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
80  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
81  COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
82  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
83  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
84  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
85  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
86  STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
87  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
88  OF THE POSSIBILITY OF SUCH DAMAGE.
89
Note: See TracBrowser for help on using the repository browser.