Erlang/OTP Forums

Author Message

<  Trapexit Forums  ~  Code markup for HowTos

JuNC
Posted: Fri Jul 21, 2006 9:34 am Reply with quote
Joined: 21 Jul 2006 Posts: 3 Location: Plymouth, England
I've just added a new HowTo, but I couldn't find any easy way to notate code snippets (I just copy'n'pasted the table code from other HowTos). Is there some markup I missed or if not would it be possible to add a simple tag like [code] to automagically markup Erlang source?

EDIT: sorry, should have googled before posting:

http://meta.wikimedia.org/wiki/Syntax_Highlighting_Extension
View user's profile Send private message Visit poster's website
andreas
Posted: Fri Jul 21, 2006 10:10 am Reply with quote
User Joined: 03 Jul 2006 Posts: 17
If I understand your request correct you want syntax high lighting of erlang code in the wiki, and possibly in the forum with use of some simpel tag, like <code></code>.

JuNC wrote:
I've just added a new HowTo, but I couldn't find any easy way to notate code snippets (I just copy'n'pasted the table code from other HowTos). Is there some markup I missed or if not would it be possible to add a simple tag like [code] to automagically markup Erlang source?

EDIT: sorry, should have googled before posting:

http://meta.wikimedia.org/wiki/Syntax_Highlighting_Extension
View user's profile Send private message
Ludvig
Posted: Fri Jul 21, 2006 10:16 am Reply with quote
User Joined: 20 Jul 2006 Posts: 38 Location: London
Since I allso "allmost" just copied the howtos from the old trapexit site there are more things that is not that good looking. The old site used stylesheets to have the codeboxes look more nice but since this is not that easy to do in the wiki it looks a bit strange. If somebody knows how to fix it they are free to help us.

Allso thanks to JuNC for adding new HowTos...keep up the good work
View user's profile Send private message Visit poster's website MSN Messenger ICQ Number
JuNC
Posted: Fri Jul 21, 2006 10:36 am Reply with quote
Joined: 21 Jul 2006 Posts: 3 Location: Plymouth, England
andreas wrote:
If I understand your request correct you want syntax high lighting of erlang code in the wiki, and possibly in the forum with use of some simpel tag, like <code></code>.



Yep, thats right. Something which would highlight the syntax and possibly give the snippet a caption, maybe:

<code caption='Code snippet 1'>

blah() ->
ok.

</code>

The 'code' tag is built-in to media wiki though isn't it? It just seems to be a synonym for 'pre', with a background colour.

Currently I had to copy/paste about 6 lines of table header to make it look the same as the other HowTos.

I didn't know if it was an extension already enabled or something which I missed in the wiki docs. The extension I linked to looks reasonably simple to install/use although it doesn't look like it includes an Erlang mode. Should be simple to write one though.

I'm willing to help out however I can to get this working, for a language site this is quite an important feature Smile.
View user's profile Send private message Visit poster's website
Ludvig
Posted: Fri Jul 21, 2006 10:49 am Reply with quote
User Joined: 20 Jul 2006 Posts: 38 Location: London
JuNC wrote:
andreas wrote:
If I understand your request correct you want syntax high lighting of erlang code in the wiki, and possibly in the forum with use of some simpel tag, like <code></code>.



Yep, thats right. Something which would highlight the syntax and possibly give the snippet a caption, maybe:

<code caption='Code snippet 1'>

blah() ->
ok.

</code>

The 'code' tag is built-in to media wiki though isn't it? It just seems to be a synonym for 'pre', with a background colour.

Currently I had to copy/paste about 6 lines of table header to make it look the same as the other HowTos.

I didn't know if it was an extension already enabled or something which I missed in the wiki docs. The extension I linked to looks reasonably simple to install/use although it doesn't look like it includes an Erlang mode. Should be simple to write one though.

I'm willing to help out however I can to get this working, for a language site this is quite an important feature Smile.



If you would like to write an extension that would be great.
What do you mean by "I can to get this work"?
View user's profile Send private message Visit poster's website MSN Messenger ICQ Number
andreas
Posted: Fri Jul 21, 2006 11:33 am Reply with quote
User Joined: 03 Jul 2006 Posts: 17
JuNC wrote:

Yep, thats right. Something which would highlight the syntax and possibly give the snippet a caption, maybe:

<code caption='Code snippet 1'>
blah() ->
ok.
</code>

I have made an extension for the code-tag to expand to the "fancy" and colorful table we all gone used to. :wink:

We we would change the way of the "code box", it's just a mater of changing the extension.

From now the perferd way to enter code, in the wiki, should be:
Code:

<code caption="Code snippet 1">
blah() ->
  ok.
</code>

Any volenters up for the job of removin thos ugly html tables and replacing them by the code tag?

I'll look in to syntax high-lighting.
View user's profile Send private message
JuNC
Posted: Fri Jul 21, 2006 11:43 am Reply with quote
Joined: 21 Jul 2006 Posts: 3 Location: Plymouth, England
Wow that was fast Smile

Great job!

I volunteer to do at least some of the edits Wink
View user's profile Send private message Visit poster's website

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum