Why Markdown

Markdown has very little to do with python testing.
But I need a project to test, so I’m writing my own Markdown script.
This is a brief introduction to Markdown from my perspective.


Writing HTML sucks. Use Markdown.

I think it’s reasonably safe to say that HTML is very, very cool.
It’s the basis, the foundation, of the web.
I think one of the goals for it was that humans could reasonably easily edit it.
If that was one of the goals, we’ve kind of failed.
Because writing stuff in HTML by hand really, really sucks.

That’s the conclusion that lots of people have come to, including John Gruber, (and me).

So what do we do about it?

One of the solutions to the problem is to create an intermediate language that is easy to write for humans, and easy to convert to HTML.

This is where people like John Gruber step in to help us.

Mr. Gruber wrote a thing called the Markdown Syntax, and a perl script to convert that syntax into html.

If I want a grocery list:

  • eggs
  • milk
  • cheese
  • beer

I used to have to write:

But now with markdown, I just need to write:

And then I send this through the handy perl script to convert it.
That already is way better, and it’s easy to read as is.

But it’s still not good enough!!!

At least for lots of people who have decided they needed the script to be in php, or ruby, or python, or any number of other languages.

They have also extended the syntax to do even more things like fenced code blocks, nchors, etc.

So now we have many varieants of mardown in lots of different languages.

I’m sure they are all great in their own right.

But I’m pretty picky.

These are some of the reasons I really loved the original markdown.pl script:

  1. It is only one file. It’s just one perl script file. Nothing extra to install. No extra libraries needed.
  2. You can give it a file name if you already have a file saved somewhere.
  3. You can pass it some text through its input stream.
  4. It just simply works without a lot of fuss.

If that’s not good enough, I have lots of choices of other implementations.

So, if everybody and their dog has already written an implementation of Markdown, why on earth am I
doing one?

  1. I need a project to use on this site as a demonstration project. Something to demonstrate testing strategy, and to some degree, software development strategy.
  2. Markdown is a well-defined, known problem.
  3. I am used to regular expressions in perl, but not so much in python. Markdown is a good problem space to learn about regular expressions.
  4. I’d like to have a markdwon implementation I control, so I can extend it any way I feel like. Selfish, yes, but true.

Before I start writing my own version, I think I should:

  • define the requirements for my new markdown script
  • jot down my testing strategy
  • get some revision control in place

Then, you know, I ought to start writing the darn thing.

If you want to keep up on my progress, please subscribe to the newsletter.

Also, I’d really like to know what others are using python to test.

Comment on any of the posts, or fill out the contact form, to let me know.

Leave a Reply