From: Waylan L. <wa...@gm...> - 2012-12-10 19:27:58
|
On Mon, Dec 10, 2012 at 1:31 PM, Dave Pawson <dav...@gm...> wrote: > > Now working, Glad to hear > ps. Why is it called xhtml1 output, when there is no <html> and <head/> markup? > It's clearly wrong. Python-Markdown has two goals: 1. Implement markdown in Python as closely as reasonably possible to the original perl implementation. 2. Provide an API which allows any of the behavior to be overriden. The answer to your question (which I believe is a follow-up to an earlier question you asked and I failed to respond to) relates to the first goal. Simply put, that is the way markdown.pl does it. It outputs xhtml style syntax (for example `<br />` rather than `<br>`) so we do too. Of course, unlike markdown.pl we also provide html style output as an option (and even allow the serializer to be overridden via python subclassing). But that's not the only reason. Python-Markdown is a library first and a commandline script second (the commandline script is a light wrapper around the library). Most users are using the library from within python based web server backends (like Django) and pass the output to various template systems. A oversimplfied `<html>` wrapper would be useless in such settings. Even when I use it from the commandline, I always want something more complex than I could justify including in a default implementation. In fact, whenever I use other tools which do wrap their output in `<html>` tags, I always find myself writing code to strip those wrappers and then passing the contents of the body to my own templates. Therefore, in Python-Markdown it is left for the user to implement however s/he wishes. Of course, given goal #2, it wouldn't be too much trouble to write an extension which wrapped the output. Although, if you're using the commandline, a shell script certainly makes more sense. -- ---- \X/ /-\ `/ |_ /-\ |\| Waylan Limberg |