Always start off with a quote....testing 1..2..3
This page was generated from a markdown(.md) file and translated to html automatically in a program written in DLang. I am primarily using this page as a 'test page', and I expect it may even be broken at various times depending on when you look at it. I'll sporadically adde some notes on the design over time, and remove this paragraph once I consider it mostly finished.
I use 'two' passes to do the translation. The first pass does basic substitute, and the second pass does a little bit more work to otherwise handle 'sequences' such as blockquotes to translate multiple >'s into a single...tag. The result of the simplicity is a very fast translator from a subset of markdown into html. This blog post serves as a sort of
The total project time was probably around 8 hours of time to complete.
For my build system, I simply run rdmd ./src/.d test.md on any markdown file.
/// Here is the main() function of my D program/// Yes -- this block of code is totally just testing that/// I have some way to showoff code./// Perhaps in the future when you view this, there will be syntax highlighting.void main(string[] args){ // Handle program Arguments if(args.length < 2){ writeln("Usage: rdmd blog.d file.md"); return; } // Creates an html file from a markdown file. CreateHTMLFile(args);}
My markdown to html generator lets me count to 15...here's a few numbers
There will probably be a third pass in order to build a table of contents, or perhaps automatically 'search' for important terms in a glossary. The advantage of writing your own tools, is you can make up whatever tags you want and do anything with them.
This is a quote spread over multiple
lines with some other formatting goodies
to try to break the parser
A few features I should think about
It may be
This is
There are also
Broken up with some text here
// Here is some more codeimport std.stdio; okay here's some more stuff
And that's all folks!