Loading...
 
Skip to main content

Features / Usability


Posting code to forums

Hi all,

I am trying to post some c++ source code to forums but have a problem. All indentation and such will be messed up. I tried to use {CODE()} tags but with no success.

Also some syntax highlighting instructions would be helpfull. Like plugins (btw. how to install and use those? 😊 or such.

Thanks,
wom

Hi all,

I am not able to end the code tag;
in other word, since I put {CODE()} in a page, all the remaining page is
intenede to be code;
I would like to stop code and then write some lines, then eventually start another code tag

How can I stop CODE()}
?
Andrea


OK, found...
just CODE withount parenthesys to end



Actually tags work. Had to enable wiki syntaxing from settings.

Still some problems are caused by < < (without spaces). Like in cout < < "Hello World";

When put together without spaces line is cut from there to end. Can this be avoided somehow?

> Still some problems are caused by < < (without spaces). Like in cout < < "Hello World";
>
> When put together without spaces line is cut from there to end. Can this be avoided somehow?

Hi there,

I get this problem too and it's areal pain when trying to post XML examples to forums/articles. Anyone have a workaround for this?

If you want syntax highlighting you can use the GeshiQuestion library. It's not part of tw as standard so you'd have to integrate it yourself, but it's pretty straightforward. I managed to adapt the existing CODE plugin , but with mixed results. I found it generally worked OK, but there were some inconsistencies between previews and posted results for things like blogs and wiki pages, hence I've not published it.

rikrak

> Actually tags work. Had to enable wiki syntaxing from settings.
>
> Still some problems are caused by < < (without spaces). Like in cout < < "Hello World";
>
> When put together without spaces line is cut from there to end. Can this be avoided somehow?

You can simply use the entity number for any ascii character (are you looking for « or <<?). For example:

cout~171~ "Hellow World";

will produce:

cout« "Hellow World";

The reason your tags are being stripped is because (I believe), Tiki interprets anything that starts with a < as an HTML tag, which is prohibited in the forums as a security measure.

When I add code to a forum posting, I change all < tags to ~lt~.

HTH,

Rick