Welcome - Markdown to HTML transpiler


Date/Time - By Mike
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 unittest to otherwise make sure things are rendering well enough. I expect over time as I add features (or perhaps even rewrite the markdown parser, this page could change in how robust it is.

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);}

Here is an example with more lists

  • First row
  • Indented - with exactly 2 spaces starts a nested item.
  • Four spaces
  • six spaces
  • Back to the start
  • My markdown to html generator lets me count to 15...here's a few numbers

    1. one
    2. two
    3. three
    4. four
    5. five
    6. six
    7. seven
    8. eight
    9. ==nine==
    10. Oops, skipped one, but you should still see 10!

    Some design notes

    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

    More stuff

    It may be fun to support more features that I find from [Markdown Guide](https://www.markdownguide.org/basic-syntax/)

    This is some very important text that I want sort of to stand out

    There are also glossary items with a custom tag for stuff that should go in an index for.

    This html was generated from markdown in Dlang

    Broken up with some text here

    Yet another heading

    This is a subtitle


    // Here is some more codeimport std.stdio;  okay here's some more stuff

    And that's all folks!

    Glossary (Alphabetical)

  • fun:71
  • glossary:76
  • some:74
  • unittest:8