From: Waylan L. <wa...@gm...> - 2008-02-05 04:37:57
|
Blake, On Feb 4, 2008 7:50 PM, Blake Winton <bw...@la...> wrote: > Hi, > > uh, you don't know me, but I'm investigating switching a home-grown wiki > parser over to use Markdown syntax instead. Since everything else is > written in Python, I'm mainly considering python-markdown and > python-markdown2. I think you guys have the edge in terms of my being > able to add wiki links, and generically extend it, I'd say you nailed it. That about sums up the difference. With python-markdown2, you'd need to hack the core to add or change behavior. Personally, I'd much rather use python-markdown's extension api. In fact if you run into a few dead ends, let us know. We may be able to improve the api to make more things possible. > but I was wondering > if you had any suggestions of wikis that were using your project? I'm aware of a few. There's one I don't remember the name of that has added all sorts of ridiculous (IMHO) macros to the syntax. All I remember is that it's built on the Django framework. Another django wiki, which I'm quite impressed with is monk-wiki[1], although its still in development. The source code is available though. I've copied the list[2]. Perhaps others will be able to point you to some more. Please let us know what you come up with. I'm been interested in building a wiki that uses markdown for some time. I just haven't had the spare time. [1]: http://code.google.com/p/monk-wiki/ [2]: http://sourceforge.net/mailarchive/forum.php?forum_name=python-markdown-discuss > > Oh, and do you handle definition lists? The examples I saw were all of > the form: > > definition term > : definition description > > If you don't handle them, how hard do you think it would be to create a > plugin that would handle them? > Unfortunately, that's the one thing I haven't tried to tackle yet. I find the whole 'description gets the markup (:), not the term' a little hard to wrap my mind around. I keep getting the feeling that we'll need to make some changes to the core to get that one to work, although I could be wrong. If you have any suggestions, I'm game. -- ---- Waylan Limberg wa...@gm... |
From: Herbert P. <her...@gm...> - 2008-02-05 08:20:28
|
hi, On Feb 5, 2008 5:37 AM, Waylan Limberg <wa...@gm...> wrote: > I'm aware of a few. There's one I don't remember the name of that has > added all sorts of ridiculous (IMHO) macros to the syntax. All I > remember is that it's built on the Django framework. do you by any chance mean my wiki: SCT - http://sct.sphene.net/ if you think {macroname parameter=value} is weird .. it's probably it ;) http://sct.sphene.net/wiki/show/WikiDocumentation/ although .. i don't know why the syntax should be weird ;) i actually copied it from another wiki engine i've used in the java world (radeox) the nice thing about it is that it makes it very easy to add addtional macros: http://yourhell.com/wsvn/root/django/communitytools/trunk/sphenecoll/sphene/sphwiki/wikimacros.py .. without dealing with strings or anything .. anyway ... i'm simpy using the (slightly modified) wikilink extension for python-markdown: http://achinghead.com/markdown/wikilink/ cu, herbert > Another django > wiki, which I'm quite impressed with is monk-wiki[1], although its > still in development. The source code is available though. > > I've copied the list[2]. Perhaps others will be able to point you to > some more. Please let us know what you come up with. I'm been > interested in building a wiki that uses markdown for some time. I just > haven't had the spare time. > > [1]: http://code.google.com/p/monk-wiki/ > [2]: http://sourceforge.net/mailarchive/forum.php?forum_name=python-markdown-discuss > > > > > Oh, and do you handle definition lists? The examples I saw were all of > > the form: > > > > definition term > > : definition description > > > > If you don't handle them, how hard do you think it would be to create a > > plugin that would handle them? > > > > Unfortunately, that's the one thing I haven't tried to tackle yet. I > find the whole 'description gets the markup (:), not the term' a > little hard to wrap my mind around. I keep getting the feeling that > we'll need to make some changes to the core to get that one to work, > although I could be wrong. If you have any suggestions, I'm game. > > > > > > -- > ---- > Waylan Limberg > wa...@gm... > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Python-markdown-discuss mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/python-markdown-discuss > |
From: Waylan L. <wa...@gm...> - 2008-02-05 14:03:48
|
On Feb 5, 2008 3:20 AM, Herbert Poul <her...@gm...> wrote: > > although .. i don't know why the syntax should be weird ;) i actually > copied it from another wiki engine i've used in the java world > (radeox) > the nice thing about it is that it makes it very easy to add addtional > macros: http://yourhell.com/wsvn/root/django/communitytools/trunk/sphenecoll/sphene/sphwiki/wikimacros.py > .. without dealing with strings or anything .. > Sorry Herbert. Perhaps that was a poor choice of words. I just don't like macros in general. Nothing personal against yours. I like markdown because its easier to read and edit than html with little to no markup (the very reason M.G. called is mark*down*). IMO, macros take away from that and don't add any value that *I* want. In fact I don't even use the wikilinks extension, which I wrote and maintain. -- ---- Waylan Limberg wa...@gm... |
From: Blake W. <bw...@la...> - 2008-02-05 12:59:24
|
Waylan Limberg wrote: > [1]: http://code.google.com/p/monk-wiki/ > [2]: http://sourceforge.net/mailarchive/forum.php?forum_name=python-markdown-discuss I'll check these out (and the link that Herbert suggested). >> Oh, and do you handle definition lists? The examples I saw were all of >> the form: >> definition term >> : definition description >> If you don't handle them, how hard do you think it would be to create a >> plugin that would handle them? > > Unfortunately, that's the one thing I haven't tried to tackle yet. I > find the whole 'description gets the markup (:), not the term' a > little hard to wrap my mind around. I keep getting the feeling that > we'll need to make some changes to the core to get that one to work, > although I could be wrong. If you have any suggestions, I'm game. It seems to me, (after a total of 5 minutes of thinking about it ;) that you could use a combination of pre- and post-processors. The pre-processor would turn a line that preceeds a line that starts with a colon (should be easy enough to find, just get lines[index-1]) into something more recognizable for the parser, and the post processor could turn those things into dt/dd sets. Actually, I think you could just turn them into lines of the form "<dt>...</dt>" and "<dd>...</dd>". Thanks, Blake. |
From: Waylan L. <wa...@gm...> - 2008-02-05 14:20:03
|
On Feb 5, 2008 7:59 AM, Blake Winton <bw...@la...> wrote: > > >> Oh, and do you handle definition lists? The examples I saw were all of > >> the form: > >> definition term > >> : definition description > >> If you don't handle them, how hard do you think it would be to create a > >> plugin that would handle them? > > > > Unfortunately, that's the one thing I haven't tried to tackle yet. I > > find the whole 'description gets the markup (:), not the term' a > > little hard to wrap my mind around. I keep getting the feeling that > > we'll need to make some changes to the core to get that one to work, > > although I could be wrong. If you have any suggestions, I'm game. > > It seems to me, (after a total of 5 minutes of thinking about it ;) that > you could use a combination of pre- and post-processors. The > pre-processor would turn a line that preceeds a line that starts with a > colon (should be easy enough to find, just get lines[index-1]) into > something more recognizable for the parser, and the post processor could > turn those things into dt/dd sets. Actually, I think you could just > turn them into lines of the form "<dt>...</dt>" and "<dd>...</dd>". > Don't forget that you can associate more than one term with a definition. Second, python-markdown doesn't just substitute text for html. Rather the text is inserted into a dom object, which is later output as html when processing is complete. To do that, you need to be within the core (after preprocessors), although, I suppose you could set them aside and use a postprocessor for that. But, then what happens when a definition list is nested in an ordered or unordered list, or a blockquote? Or what if such blocklevel elements are nested within a definition? What we need is a easier way to insert additional blocklevel parsers into the core. This is something I've been chewing on for a while now and the reason I haven't tackled definition lists yet. I wanted to work out this addition extension mechanism (which I've tentatively named blockparsers) first. If anyone has any suggestions, I'm all ears. -- ---- Waylan Limberg wa...@gm... |
From: Yuri T. <qar...@gm...> - 2008-02-07 03:15:58
|
On Mon, Feb 4, 2008 at 8:37 PM, Waylan Limberg <wa...@gm...> wrote: > I'd say you nailed it. That about sums up the difference. With > python-markdown2, you'd need to hack the core to add or change > behavior. Personally, I'd much rather use python-markdown's extension > api. In fact if you run into a few dead ends, let us know. We may be > able to improve the api to make more things possible. Hey, let a hundred flowers bloom... I haven't been following python-markdown2 development closely enough to say how much of an effort it would be to hack it. But Waylan is right that python-markdown was designed with the assumption that people would want something-but-not-quite like the standard behavior and that extensibility and readability is more important than 100% compliance with the Perl implementation or performance. I've tried to keep both in the acceptable range (and Waylan really helped with this recently), but it hasn't been top priority. Maybe at some point someone would find time to combine the best of both worlds... > > but I was wondering > > if you had any suggestions of wikis that were using your project? http://infogami.org/ We've even almost moved the python-markdown wiki to infogami, but then this got stalled because I didn't have time to work out some minor issues. BTW, I am wondering if we should just add some a pattern for wikilinks, perhaps [[...]] into markdown.py so that one would be able to activate it with just a flag or something. > > definition term > > : definition description > > > > If you don't handle them, how hard do you think it would be to create a > > plugin that would handle them? Easy. You should do it! - yuri -- http://sputnik.freewisdom.org/ |
From: Trent M. <tr...@gm...> - 2008-02-07 18:58:54
|
> On Feb 4, 2008 7:50 PM, Blake Winton <bw...@la...> wrote: > > Hi, > > > > uh, you don't know me, but I'm investigating switching a home-grown wiki > > parser over to use Markdown syntax instead. Since everything else is > > written in Python, I'm mainly considering python-markdown and > > python-markdown2. I think you guys have the edge in terms of my being > > able to add wiki links, and generically extend it, > > I'd say you nailed it. That about sums up the difference. With > python-markdown2, you'd need to hack the core to add or change > behavior. Personally, I'd much rather use python-markdown's extension > api. In fact if you run into a few dead ends, let us know. We may be > able to improve the api to make more things possible. Blake, I missed the start of this thread, so I may be mistaken at what you are trying to do, but markdown2.py has a "link-patterns" feature that you might be able to use for auto-linking WikiWords (I'm not sure if that was the wiki syntax you are using): >>> import re, markdown2 >>> link_patterns = [ ... # Match a wiki page link LikeThis. ... (re.compile(r"(\b[A-Z][a-z]+[A-Z]\w+\b)"), r"/\1") ... ] >>> processor = markdown2.Markdown(extras=["link-patterns"], ... link_patterns=link_patterns) >>> wiki_page = """ ... # This is my WikiPage! ... ... This is AnotherPage and YetAnotherPage. ... """ >>> print processor.convert(wiki_page) <h1>This is my <a href="/WikiPage">WikiPage</a>!</h1> <p>This is <a href="/AnotherPage">AnotherPage</a> and <a href="/YetAnotherPage"> YetAnotherPage</a>.</p> More details here: http://code.google.com/p/python-markdown2/wiki/LinkPatterns Cheers, Trent -- Trent Mick tr...@gm... |