Skip to:
Content
Pages
Categories
Search
Top
Bottom

plugin: Markdown


  • tisme
    Member

    @tisme

    which bb filters ($tag, $func, $prio) I need to add/remove to get working [**PHP Markdown**]( http://www.michelf.com/projects/php-markdown/ )?

    quick and dirty:


    remove_filter('pre_post', 'balanceTags');

    add_filter('pre_post', 'Markdown', 1);


    doesn’t seem to be sufficient as HTML tags should be converted back to Markdown while ‘edit_text’, also extraneous P elements (paragraphs) ought to be stripped off.

    does it require anything else?

    PS and yes, I know about A.King’s ‘Quick Tags’.

Viewing 12 replies - 1 through 12 (of 12 total)

  • fel64
    Member

    @fel64

    I don’t know. But do you know about the plugin I wrote that does things similar to markdown? No. No you don’t. Because I haven’t mentioned it yet. Basically it lets you italicise, bolden, and link in a very elegant way (although I think syntax-wise slightly different way to markdown). It respects code and it auto-converts the lists you only wrote casually (list items starting with #, -, *, (1, 2, 3 …), (a, b, c …)) into proper HTML. If I could think of a goddamned name I would have uploaded it yesterday. But it is a different, very likely smaller feature set to Markdown, and if you need Markdown then that’s no use at all to you. If you’re interested I’m happy to provide a copy of the script.

    Have you tried these filters ck removed? https://bbpress.org/forums/topic/new-plugin-admin-post-anything Check for the last post because he made some changes, but those should be all.


    tisme
    Member

    @tisme

    hello fel,

    some name suggestions:’bbMark’, ‘markMini’ etc and possible permutations ;-)

    italic, bold, blockquote and link is basically what I need.

    ck removed a lot of filters, I’ve tried remove them too — works better, but his plugin is for admin user level, isn’t it?

    I just can’t dig it: how do I encode HTML back to Markdown at ‘edit_text’?

    PS a bit of documentation on “bbPress text flow” (something like: http://www.michelf.com/img/blog/wordpress1.5-text-flow.png) wont hurt ;-)


    _ck_
    Participant

    @_ck_

    “her” plugin is for admin… yes… and very dangerous to override to allow visitors to have that kind of override…

    Do you want me to port “TextControl” to bbpress?

    It has markdown among many other options.

    http://dev.wp-plugins.org/wiki/TextControl

    http://ckon.wordpress.com/2006/08/14/updated-version-of-text-control-that-works-with-wp-21/


    tisme
    Member

    @tisme

    wow, that’d be totally cool!

    at the first glance “TextControl” seems to be a rather complicated plugin by itself, though.

    I just thought if the “Markdown PHP” (which is quite small and relatively simple — hence less bugs and problems) can successfully work with WP, it should also work w/ bbPress…

    perhaps, I do miss something and it can’t without having to be redone heavily?

    Edit:

    oh, I get it (just download plugin itself) “TextControl” require_once(‘text-control/markdown.php’); — I thought authors did their own implementation of Markdown.


    fel64
    Member

    @fel64

    http://rapidshare.com/files/43804950/felise.php.html

    Hmm. Still don’t know about a name. Ignore the name there and upload, activate.

    In addition to what I said last post,

    *bolded stuff* => bolded stuff

    _italic words_ => italic words

    **notbold** => *notbold*

    __notitalic__ => _notitalic_

    link@http://somerealurl… => link

    “link text blah”@http://somerealurl… => link text blah

    #, *, -, (1, 2, 3), (a, b, c) => <ul/ol><li> .... </li> .... </ul/ol> (Numbers, letters need to be in order. Any punctuation after it will also be accepted.)

    >>Name[post#] => >> Name

    (Not italicised or bolded in: u*blah*, _ blah_)

    I believe that covers everything. I’ll have a look at Markdown, see if it does anything cool that I’d want too. :P

    The last one is pretty neat but mostly for another plugin that I have on my site that’s also unreleased. Might ask for plugin space for that one now I guess.

    Oh, also worth noting that standard behaviour for this plugin is ‘compiling’ the text when the post is saved. That means that it doesn’t make your forum any slower (all the work is done when the post is saved) and that if at any point you remove this plugin, old posts written with it will look exactly the same so you can do that anytime without problems.

    [Edit] Markdown is … complicated. When I wrote this, I wrote it to go along with bbPress, so it’s a lot simpler. It doesn’t support stuff like paragraphing because bbPress already does that. And I wrote it so you wouldn’t have to remember anything, but so that the stuff you’d write anyway is formatted nice. No need to think what the syntax is or anything like that. I like what it did with blockquotes. I’ll put in some syntax for blockquotes, even if having to put > in front of every line sounds tiresome. But what do people think about italicising or bolding inside words? I took it out to avoid unintentional formatting, but Markdown has it in (for stuff like un*fucking*believable) and now I’m not so sure.


    tisme
    Member

    @tisme

    thanks a lot, fel!

    It’ll be interesting to see it. (“You have reached the download-limit for free-users. Wait 55 minutes” ;-)

    >> I’ll put in some syntax for blockquotes, even if having to put > in front of every line sounds tiresome.

    I guess ‘>’ in front of every _paragraph_.


    fel64
    Member

    @fel64

    > I guess ‘>’ in front of every _paragraph_.

    It’s still annoying somewhat annoying :P. I don’t want to have to scroll through a wall of text looking for new paragraphs. Perhaps >>Quote …. << ? What would also be interesting is the ability to add the name of who you’re quoting. Name>>Quote<< or “Name blah”>>Quote<<? Although that’s starting to get a bit artificial.

    It is an option to make this plugin rewrite the posts as they’re being read, but I was worried about the extra server load (although it’s pretty light code) and it’s playing pretty badly with the Allow Images plugin.

    I don’t want to keep hosting it on my server, so I’ll take this down the next time I think about it. http://www.loinhead.net/files/felise

    http://www.loinhead.net/files/felise.php is a working, non-bb copy of the script so you can test it (note that >>Name[post#] doesn’t work). Ignore the sucky name, I hate naming things and needed something just temporarily :P


    tisme
    Member

    @tisme

    > I don’t want to have to scroll through a wall of text looking for new paragraphs.

    Daring Fireball says:

    > Any decent text editor should make email-style quoting easy. For example, with BBEdit, you can make a selection and choose Increase Quote Level from the Text menu.

    ;-) anyway, that doesn’t seem to be a big issue as folks usually quote just 1-2 para to mantain a coherent (connected) dialog on web forums (like we do now ;-)

    basically, most used syntax is just as on http://programming.reddit.com/help/commenting and it works pretty well out there, although they have a threaded *nested* comments, which eases communications alots since there’s no need in usual for web-forums perverted form of addressing like “@username: …” etc.

    as I noted on misc web-boards its quite popular to use a JS to grab the quoted username. though, it doesn’t seem to me related to this kind of *text-formatting* plugins we’re discussing. as it is more like up to a higher-level of software — if it doesn’t have a “Reply” (to a particular post) function there’s nothing much can be done about it.

    your plugin is working just fine. I guess its syntax rules will be enough for the most folks. the only thing is just the same as with that ‘Markdown PHP’ — I think it would be logical to have deal only with its (markdownifed 8-) syntax _while editing a post_, not with HTML tags again — as it may produce some kind of schismo in non-savvy users minds ;-)

    once again, thanks for sharing!


    fel64
    Member

    @fel64

    Had a bit of a rewrite and now blockquotes are also possible, to infinite depth. Currently this is one blockquote:

    > block

    > quote

    because I figured if you were writing something and you had two paragraphs that’d be more likely. But I would *love* advice on the syntax or feedback from you tisme. New source is http://www.loinhead.net/files/felise and to check out how it works you can still use http://www.loinhead.net/files/felise.php (same basic code, just modified without bb).

    Hi all,

    I just successfully got Michel Fortin’s Markdown to work in bbPress… I’ve submitted it as a plugin here on bbPress.org, but as that page isn’t updating for some reason, you can download it from the WordPress.org page.

    Enjoy, and of course let me know if you have any problems with it.

    mitcho

    Lol, I was searching the plugin, but I couldn’t find it in the plugin section here. Thanks for your post (and plugin), although it was a year ago!

    This is what I need, thanks a lot.

    Best

    bmx

Viewing 12 replies - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.
Skip to toolbar