Hey I like that syntax. And you have done almost all the work already... This should be a pretty simple plugin to do... Let me take a quick tinker...
Ok, I just pulled together a very quick release. Maybe you can give it a whirl and check it for bugs whatever. Just download the script, drop it in your farm/plugins folder, then in your wiki go to action.plugins. One click install and you should have instant bbcode support. http://www.boltwire.com/index.php?p=solutions.community.bbcode I've done almost no testing... There are possibly going to be some conflicts with other markups (I'm thinking bullets, which are even smarter in BoltWire, just use * by itself, no list needed), but these can be enabled or we can find various work arounds. Let me know what you think... Cheers, Dan On Wed, Sep 2, 2009 at 4:58 AM, Kevin<[email protected]> wrote: > > Again Dan, thanks again for the info. > > I had found the <code> CSS to make the monospace change earlier. > > I created some BBCode like parsers before for pulling data out of a > forum and displaying on a website. Will dig them up and see how they > work. It only covered some of the basic more common ones. I am okay > with regex, not a wizard at it though. > > There are lot of positives for BBcode in that it is pretty standard > across various forum software packages, so it is commonly used and you > can use it to nest a number of commands without messing up the content > like: > > [size=12][b][color=red]THIS IS IMPORTAINT[/color][/b][/size] > > So that you can make the text larger than normal, bold, red text all > with some simple to use commands. > > All BBcode commands are in []'s so they are never confused with html > <> commands. > > When doing documentation, I use stuff like below for like showing > example showing a unix command and its results (I'm a formatting nut): > > [tt] > # [b]command[/b] > output from command shown here > [/tt] > > Teletype or typewriter mode, monospace but other BBcode commands are > acted on. So you see two lines, one with the Unix prompt followed by > the command in bold, followed by the result of the command the person > had typed. this way the user looking at the page knows what was typed > and what was output by the computer. > > If on the other hand you wanted to show how BBcode looked, the > commands etc... you would use [code] which would also be monospace, > but would not act on any of the commands, just show them as they were. > > [code] > # [b]command[/b] > output from command shown here > [/code] > > Some of it is very easy to do like: > > // [img]http://elouai.com/images/star.gif[/img] > // [url="http://elouai.com"]eLouai[/url] > // [mail="[email protected]"]Webmaster[/mail] > // [size="25"]HUGE[/size] > // [color="red"]RED[/color] > // [b]bold[/b] > // [i]italic[/i] > // [u]underline[/u] > // [list][*]item[*]item[*]item[/list] > // [code]value="123";[/code] > // [quote]John said yadda yadda yadda[/quote] > > function bb2html($text) > { > $bbcode = array("<", ">", > "[list]", "[*]", "[/list]", > "[img]", "[/img]", > "[b]", "[/b]", > "[u]", "[/u]", > "[i]", "[/i]", > '[color="', "[/color]", > "[size=\"", "[/size]", > '[url="', "[/url]", > "[mail=\"", "[/mail]", > "[code]", "[/code]", > "[quote]", "[/quote]", > '"]'); > $htmlcode = array("<", ">", > "<ul>", "<li>", "</ul>", > "<img src=\"", "\">", > "<b>", "</b>", > "<u>", "</u>", > "<i>", "</i>", > "<span style=\"color:", "</span>", > "<span style=\"font-size:", "</span>", > '<a href="', "</a>", > "<a href=\"mailto:", "</a>", > "<code>", "</code>", > "<table width=100% bgcolor=lightgray><tr><td > bgcolor=white>", "</td></tr></table>", > '">'); > $newtext = str_replace($bbcode, $htmlcode, $text); > //$newtext = nl2br($newtext);//second pass > return $newtext; > } > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "BoltWire" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/boltwire?hl=en -~----------~----~----~----~------~----~------~--~---
