Adding additional output formats for Markdown?

Fletcher T. Penney fletcher at alumni.duke.edu
Tue Jul 26 20:27:21 EDT 2005


It's not ready for primetime, but I began hacking the Markdown.pl
file to allow flexibility with output formats. Basically, there are
a bunch of globals like `$g_paragraph_prefix`, `$g_paragraph_suffix`,
etc. to allow a config file to be used to create an output format.

I am still working with it, but have tested it with XHTML and LaTex
(the two formats I want first). Also, I have built in a template
system, so that you can have a LaTex (or whatever) template for an
article, a book, a letter, etc. The same could be used to convert a
markdown file to a complete web page, complete with headers, css
ref's, etc. (I have examples of both of these on my site)

Also, I added a metadata feature to allow you to include metadata at
the beginning of the file, that could be used in format-specific
ways. I tried to stick with the Markdown philosophy of looking like
an email/plain text...

For example:

Title: A Sample File
Authors: Fletcher T. Penney
John Doe
Copyright: 2005 Fletcher T. Penney


This would be at the beginning of the file, and is stripped out
before processing the actual Markdown text. The data is placed into
hashes which can be used by the formatting system in whatever way you
like.

For more info, and to see some examples, check out my web site;

http://fletcher.freeshell.org/wiki/MultiMarkdown

There are links to a sample MultiMarkdown file, as well as the html
and pdf versions of it's output.

Please let me know what you think. (Also, John (and anybody else) if
I have incorrectly used any code, or stepped on toes - please let me
know!!!)


Thanks!

Fletcher

--
Fletcher T. Penney
fletcher at alumni.duke.edu

A conscience does not prevent sin. It only prevents you from
enjoying it.




-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3949 bytes
Desc: not available
Url : http://six.pairlist.net/pipermail/markdown-discuss/attachments/20050726/4296bac6/smime.bin


More information about the Markdown-Discuss mailing list