Skip to content

boynton/markdown-clj

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

99 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#Markdown parser written in Clojure

A markdown parser which compiles to both Clojure and ClojureScript.

boynton: Fixed some code block handling to be more consistent with multimarkdown. These are bug fixes for me, YMMV.

Installation

Leiningen

[boynton/markdown-clj "0.9.8"]

Maven

<dependency>
  <groupId>markdown-clj</groupId>
  <artifactId>markdown-clj</artifactId>
  <version>0.9.8</version>
</dependency>

Building

To build the Clojure jar

lein install

To compile the ClojureScript portion

lein cljsbuild once

Supported syntax

Basic Elements

Blockquote, Bold, Emphasis, Heading, Italics, Line, Paragraph, Strikethrough

Links

Image, Link

Lists

Ordered List, Unordered List

Code

Code Block, Indented Code, Inline Code


Heading

the number of hashes indicates the level of the heading

#Heading

##Sub-heading 

###Sub-sub-heading 

Line

***

* * *

*****

- - -

Emphasis

*foo*

Italics

_foo_

Bold

**foo**
__foo__

Blockquote

>This is a blockquote
with some content

>this is another blockquote

Paragraph

This is a paragraph, it's
split into separate lines.

This is another paragraph.

Unordered List

indenting an item makes it into a sublist of the item above it, ordered and unordered lists can be nested within one another

* Foo
* Bar
 * Baz
* foo
* bar

   * baz
     1. foo
     2. bar

   * fuzz

      * blah
      * blue
* brass

Ordered List

1. Foo
2. Bar
3. Baz

Inline Code

Here's some code `x + y = z` that's inlined.

Code block

Using three backquotes indicates a start of a code block, the next three backquotes ends the code block section. Optionally, the language name can be put after the backquotes to produce a tag compatible with the Syntax Highlighter, eg:

```clojure

(defn foo [bar] "baz")

```

Indented Code

indenting by at least 4 spaces creates a code block

some
code 
here

note: XML is escaped in code sections

Strikethrough

~~foo~~

Superscript

a^2 + b^2 = c^2

Link

[github](http://github.com)

Image

![Alt text](http://server/path/to/img.jpg)
![Alt text](/path/to/img.jpg "Optional Title")

License

Copyright (C) 2012 Yogthos

Distributed under the Eclipse Public License, the same as Clojure.

About

Markdown parser in Clojure

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Clojure 100.0%