From: Ben W. <da...@gm...> - 2007-04-10 11:56:41
|
I'm currently playing with a Python-based flat-file wiki that relies on Markdown syntax (mostly). This is more for my education as I understand MoinMoin is the premier wiki-engine for Python and it seems to support some Markdown markup.[1] So, I've made a few observations that I'm trying to explain here. I would like to say the Python-Markdown class is great. I like being able to extend it. For example, I have a different way of handling the ==== and ---- headings that encourages me to short-circuit the headings_preprocessor. The reason for my short-circuiting is that I order headers differently and include ++++ and ~~~~, and the preprocessor presupposes that a section heading (====) should be <h1>.[2] I'm able to get both lines of a heading (the title and markup) by a regex without lookaheads, but it may not be stable. I would also like to change the output to Tex/LaTeX format if possible. I was thinking that _perhaps_ the pre-processors could be a dictionary instead of an array, which would allow deleting by name. Presently, I set all the preprocessors by copying from the class, then delete the one preprocessor I don't want. This would also allow use of has_key(), as the present implementation (correct me if I'm wrong) does not allow listing or deleting a preprocessor directly. I'm also having a bit of a problem with the documentation. I'm used to an "undue experimentation" rule for documentation. This means that a programmer should be able to look to the documentation alone to explain _how_ to use the class---such as adding a preprocessor. I ended up having to look in the class itself to see how it added a preprocessor. Perhaps the example given could be an actual implementation of a simple preprocessor? FWIW, I am adding some non-Markdown syntax that is more expected in wiki markup (e.g. [[free links]] Anyway, thanks for a great Markdown class. It moved my development of my wiki up by about three weekends. -- Ben Wilson "Words are the only thing which will last forever" Churchill [1]: Why Python? I am already a strong Perl and PHP programmer, and I'm trying to extend my language skills. [2]: The only <h1> I have on the page is the page title. This means section headings (====) are <h2>; sub-sections (----) <h3>; paragraph headings (~~~~) is <h4> and sub-paragraph headings (++++) are <h5>. I never use <h6>. The use of <h1> as a page is based on some older web standard that's been around for a while that I am never able to find when I want to cite to it. |