For those of you not familiar with Markdown these are some good links for syntax.
http://daringfireball.net/projects/markdown/basics
http://daringfireball.net/projects/markdown/syntax

Under the covers I'm using PegDown which is a Java Markdown processor
https://github.com/sirthias/pegdown

I add a few "extensions" via a simple preprocessor to PegDown that I call MarkBook

1) Includes
You can use <<filename>> to include a markdown document.
The included document is preprocessed before being included.
PegDown is handed a single string containing all the included and pre-processes content for conversion to HTML.

2) Comments
You can use <!--- ---> to prevent content from showing up in the output HTML. I use this to prevent Apache license headers from showing up for each include.

3) Automatic Fragment Identifiers & Links
Any headers
# Book Title #
## Section Title ##
### Sub-Section Title ###
has an anchor added in the preprocessor so that
## Section Title ##
is turned into
## <a id="Section+Title"></a>Section Title ##

Then to add an internal fragment link you can use #[ ] markup.
For example
#[Section Title]
will be turned into
[Section Title](#Section+Title)

This makes things (espeically Table of Contents) much more readable.

All of this is poorly implemented in the site svn repo class
trunk/markbook/src/main/java/org/apache/hadoop/gateway/markbook/MarkBook.java

Feel free to add other conveniences.

--
CONFIDENTIALITY NOTICE
NOTICE: This message is intended for the use of the individual or entity to which it is addressed and may contain information that is confidential, privileged and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, you are hereby notified that any printing, copying, dissemination, distribution, disclosure or forwarding of this communication is strictly prohibited. If you have received this communication in error, please contact the sender immediately and delete it from your system. Thank You.

Reply via email to