As promised, you can find the code for my little Markdown test app in my git repo now. You can check it out like this:
git clone http://git.henkelmann.eu/markdown_tester.git
Please note that this app was written in 2 1⁄2 hours and is utterly undocumented and unsupported. The code is public domain, use it in any way you want. However, I do not take any liability for it to work or do anything useful.
In order to run the test you will need Scala 2.8.0 or higher, sbt and some more or less recent Java version (for me it worked under 1.6.something). To run it, just
cd into the cloned repo and execute:
sbt update sbt run
This should run the test and print an HTML table with the results on the console.
As I said, it is just a quick’n’dirty hack, but if you are interested in playing around with it a few words on how it works:
There is an abstract trait
MarkdownTestGenerator that creates words, lines, blank lines and blocks of text with configurable length. The base implementation is
TestText which gets a string with the test text as parameter and loops it indefinitely. Then there are a bunch of traits that all extend
MarkdownTestGenerator and modify the behavior of the underlying implementation. One trait for example adds emhpasis around words at a configurable interval, the other adds manual line breaks. You can simply stack them to create a class that creates a test text the way you want it.
There is still to much copy-paste in this code, probably some of the stuff does not work already, so normally I wouldn’t consider it fit for release. Still, it does what it should, and it would be cheesy to publish test results and not make them repeatable by everybody else, wouldn’t it?
As usual, if you have comments, questions, problems, criticism (polite & constructive please), just drop me an Email! (I really need to get that comment functionality going…)