MW

Markdownify Tests and PEAR Text_Diff

Yes, I’m finally gearing towards the release of my html2text.php successor, dubbed Markdownify. I’m using exessive testing and utilize the MDTest suite to find potential regressions etc. I’m really enjoying to program little CLI scripts with PHP, it just works like a charm.

Here’s an example of how my test suite currently looks like:

alt text

To the left is the original input (HTML), in the middle you find the generated Markdown and to the right HTML again - but now generated via PHP Markdown by Michel Fortin. The pretty colors mark changes between the two HTML versions. I use PEAR Text_Diff for this and a little of my own code. But since all of the existing diff engines for Text_Diff took ages for the Markdown Documentation (~400 lines afair), I wrote a Text_Diff engine which utilizes [shell_exec](http://www.php.net/shell_exec)() and GNU diff. This is blazingly fast and works like a charm! You can get the source code over at pastebin.org. Also take a look on the feature request I made. Dunno if this was the correct place for that…

Update 1: My work got submitted into the PEAR repository. To obtain the up to date source code, please head over to shell.php in Horde’s Web CVS.

Yay, my first contribution to a PEAR project :-)

Update 2: The official Markdownify website launched! Take a look, download it and convert your HTML today.

Comments

Want to comment? Send me an email!

Comment by Anonymous (not verified) (2011-04-01 17:10:00)

http://www.altincilekzayiflama.web.tr

Published on April 01, 2011.