I'm looking for a lightweight php library that can load a markdown file (it doesn't matter what flavor of markdown) and generate the corresponding HTML. I also need to be able to generate PDFs from the markdown, and ebook files would be awesome as well.
I'm quite happy with Markdown Extra, which I e.g. use for my website. It's completely open source (available at Github), well documented, and a breeze to use. It supports "standard Markdown" and, via its Extra module, a bunch of additional features like tables, fenced code blocks, footnotes, and more.
Unfortunately, I cannot see it having PDF support built-in. So when deciding for it, you might need a second library for that. I've never needed that combination, but where I'm using PHP to create PDF documents, I'm using TCPDF for that – which again is free, open source, and produces pretty good results.
No recommendation towards eBooks currently – but that being a nice-to-have, I hope my answer is acceptable without it.
docbook, haddock, html, json, latex, markdown, markdown_github, markdown_mmd, markdown_phpextra, markdown_strict, mediawiki, native, opml, org, rst, textile
asciidoc, beamer, context, docbook, docx, dzslides, epub, epub3, fb2, html, html5, icml, json, latex, man, markdown, markdown_github, markdown_mmd, markdown_phpextra, markdown_strict, mediawiki, native, odt, opendocument, opml, org, pdf*, plain, revealjs, rst, rtf, s5, slideous, slidy, texinfo, textile