Hello List, I have recently started using Michel Fortin's PHP "Markdown Extra" implementation to programmatically transform my markdown text files into HTML. Firstly I'd like to say markdown is very cool -- thanks to everyone involved :) I'd also like to suggest two additions to markdown: 1) I very often use /this/ markdown to indicate emphasis since I find it much easier to type and read than _this_ or *this*. 2) I also use additional setext style headers like this: Header 1 XXXXXXXX Header 2 xxxxxxxx Header 3 ======= Header 4 ++++++++ Header 5 -------- Whether or not these suggestions would be a worthwhile addition to the markdown syntax is one topic. Another topic is about how to go about changing Michel Fortin's PHP code to implement these changes. Is this the right forum to discuss such code changes? Thanks List, Simon -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://six.pairlist.net/pipermail/markdown-discuss/attachments/20081128/5c991775/attachment.htm>
Le 2008-11-28 ? 2:34, Simon Bull a ?crit :> I have recently started using Michel Fortin's PHP "Markdown Extra" > implementation to programmatically transform my markdown text files > into > HTML. Firstly I'd like to say markdown is very cool -- thanks to > everyone > involved :) > > I'd also like to suggest two additions to markdown: > > 1) I very often use /this/ markdown to indicate emphasis since I > find it > much easier to type and read than _this_ or *this*.Not that you can add it for yourself, but I think Markdown already has enough syntaxes for emphasis.> 2) I also use additional setext style headers like this: > > Header 1 > XXXXXXXX > > Header 2 > xxxxxxxx > > Header 3 > =======> > Header 4 > ++++++++ > > Header 5 > -------- > > Whether or not these suggestions would be a worthwhile addition to the > markdown syntax is one topic.One problem with your header syntax is that it's not an addition but a change from what Markdown currently does. Nothing prevents you from doing it yourself though.> Another topic is about how to go about changing Michel Fortin's PHP > code to > implement these changes.Look for the doHeaders function.> Is this the right forum to discuss such code > changes?Sure. -- Michel Fortin michel.fortin at michelf.com http://michelf.com/
> Another topic is about how to go about changing Michel Fortin's PHP code to > implement these changes. Is this the right forum to discuss such code > changes?In Python Markdown we've put a lot of effort precisely into making such changes as painless as possible. For example, adding support for /emphasis/ just requires one line in _your_ code: import markdown md = markdown.Markdown() md.inlinePatterns["slash_emphasis"] = \ markdown.inlinepatterns.SimpleTagPattern(r'(\/)([^\/]*)\2', 'em') print md.convert("this /should/ work") (This is for the version currently in git. The last released version makes it a little more complicated, though not that much more.) - yuri -- http://sputnik.freewisdom.org/
On Fri, Nov 28, 2008 at 2:34 AM, Simon Bull <waysoftheearth at yahoo.com.au> wrote:> Another topic is about how to go about changing Michel Fortin's PHP code to > implement these changes. Is this the right forum to discuss such code > changes?Usually it's best to leverage the fact that Markdown won't touch existing markup. A preprocessor script -- perhaps abusing Michel's `doHeaders()` method -- would let you then run an unmodified `markdown.php` to finish the job. No hacks to maintain. LQ