• Steam recently changed the default privacy settings for all users. This may impact tracking. Ensure your profile has the correct settings by following the guide on our forums.

M for Mature, now Developer friendly.

EvilSeph

Administrator
As a developer myself I know, firsthand, how difficult it can generally be to get a community or site to make the necessary changes to become Developer friendly. Even as a member of the Administration, it took some work convincing the rest of the team that making the community Developer friendly would be beneficial to the community and that our time was not better spent elsewhere.

As is the tradition around here, you spoke out and we listened. Once a few of you had expressed interest in a forum dedicated to the Developers in our community, I got right to work on putting together a strong case for it. Along with putting together a strong case, several of the people on the team who were incredibly enthusiastic of the idea, including myself, had begun work on not only making our community accessible to Developers but making things easier for them however we could.

Whether that work was developing an effective organization scheme for the forum, through the use of prefixes (in large part, thanks to Moca) or Chathurga working to add some very useful (and clearly needed) features to our Syntax Highlighter or the sweet looking Syntax Highlighter itself that supports 126+ languages, a lot of hard work went into bringing M for Mature more into the Developer area of things.

Speaking of the Syntax Highlighter, here's how you make use of it (along with some features I am sure most of you are not aware of yet ;)):
[noparse][highlight=language]Code to highlight[/highlight][/noparse]

Supported Languages:
Supported Languages:
ABAP - abap
Actionscript - actionscript or actionscript3
ADA - ada
Apache Log - apache
AppleScript - applescript
APT sources.list - apt_sources
ASM (m68k) - m68k
ASM (Microchip Assembler) - mpasm
ASM (pic16) - pic16
ASM (x86) - asm
ASM (z80) - z80
ASP - asp
AutoIT - autoit
AviSynth - avisynth
Backus-Naur form - bnf
Bash - bash
Basic4GL - basic4gl
BlitzBasic - blitzbasic
Boo - boo
Brainfuck - bf
C - c
C for Macs - c_mac
C# - csharp
C++ - cpp
C++ (with QT) - cpp-qt
CAD DCL - caddcl
CadLisp - cadlisp
CFDG - cfdg
CIL / MSIL - cil
COBOL - cobol
ColdFusion - cfm
CSS - css
D - d
Delphi - delphi
Diff File Format - diff
DIV - div
DOS - dos
DOT language - dot
Eiffel - eiffel
Email - email
Fortran - fortran
FourJ's Genero - genero
FreeBasic - freebasic
GetText - gettext
glSlang - glsl
GML - gml
gnuplot - gnuplot
Groovy - groovy
Haskell - haskell
HQ9+ - hq9plus
HTML - html4strict
INI (Config Files) - ini
Inno - inno
INTERCAL - intercal
IO - io
Java - java
Java 5 - java5
Javascript - javascript
KiXtart - kixtart
KLone C & C++ - klonec or klonecpp
LaTeX - latex
Lisp - lisp
LOLcode - lolcode
LotusScript - lotuscript
Lotus Formulas - lotusformulas
LScript - lscript
Lua - lua
Make - make
Matlab - matlab
mIRC - mirc
MXML - mxml
MySQL - mysql
NSIS - nsis
Objective C - objc
OCaml - ocaml or ocaml-brief
OpenOffice BASIC - oobas
Oracle 8 & 11 SQL - oracle8 or oracle11
Pascal - pascal
Perl - perl
PHP - php or php-brief
Pixel Bender - pixelbender
PL/SQL - plsql
Plaintext - text
POV-Ray - povray
PowerShell - powershell
Progress (OpenEdge ABL) - progress
Prolog - prolog
ProvideX - providex
Python - python
Q(uick)BASIC - qbasic
robots.txt - robots
Ruby - ruby
Ruby on Rails - rails
SAS - sas
Scala - scala
Scheme - scheme
Scilab - scilab
SDLBasic - sdlbasic
Smalltalk - smalltalk
Smarty - smarty
SQL - sql
T-SQL - tsql
TCL - tcl
Tera Term - teraterm
thinBasic - thinbasic
TypoScript - typoscript
Uno IDL - idl
VB.NET - vbnet
Verilog - verilog
VHDL - vhdl
VIM Script - vim
Visual BASIC - vb
Visual Fox Pro - visualfoxpro
Visual Prolog - visualprolog
Whitespace - whitespace
Winbatch - winbatch
Windows Registry Files - reg
X++ - xpp
XML - xml
Xorg.conf - xorg_conf
For example, use this:
[noparse][highlight=php]Code to highlight[/highlight][/noparse]

And you'll get something like this:
[highlight=php] /**
* Returns the code in $this->source, highlighted and surrounded by the
* nessecary HTML.
*
* This should only be called ONCE, cos it's SLOW! If you want to highlight
* the same source multiple times, you're better off doing a whole lot of
* str_replaces to replace the <span>s
*
* @since 1.0.0
*/
function parse_code () {
// Start the timer
$start_time = microtime();

// Firstly, if there is an error, we won't highlight
if ($this->error) {
//Escape the source for output
$result = $this->hsc($this->source);

//This fix is related to SF#1923020, but has to be applied regardless of
//actually highlighting symbols.
$result = str_replace(array('<SEMI>', '<PIPE>'), array(';', '|'), $result);

// Timing is irrelevant
$this->set_time($start_time, $start_time);
$this->finalise($result);
return $result;
}
}[/highlight]

Unfortunately, since our syntax highlighter includes line numbering support and some browsers copy the lines or *s for whatever reason, I had to come up with some sort of way to remove that problem. So, I approached Chathurga to create a "Show Plain Text" function (that allows you to toggle between syntax highlighted code and plain text for easier copying), which, as you can see he did. However the container looked pretty thrown together after we added that functionality, so we just had to make the container look more sleeker ;).

While discussing the addition of the "Show Plain Text" feature, I mentioned that it might be cool to have a "Select All" feature, so that you guys don't have to scroll through long blocks of code, just to select them. Before I was even done suggesting it, Chathurga had it coded and ready to go.

Now, while I may be a slave driver ;), I don't tend to give out work without doing something myself. So, with everyone else busy with organizing the new forum and coding some functionality for you guys to use, I set to work further improving the sweet syntax highlighter we have.

The first thing I decided to add was a custom starting number feature that provides you guys with the ability to change the number that our syntax highlighter starts numbering lines from (which could prove to be useful when you are sharing the code with others who have the full code and want to discuss a particular block of code).

Say you have a block of code that is found deep within your program that you want to discuss with other developers. If we didn't have this feature, you'd probably have to use our syntax highlighter, then type up an explanation of where that code is within the program. Thankfully, you can just do this:
[highlight=php;30] /**
* Returns the code in $this->source, highlighted and surrounded by the
* nessecary HTML.
*
* This should only be called ONCE, cos it's SLOW! If you want to highlight
* the same source multiple times, you're better off doing a whole lot of
* str_replaces to replace the &lt;span&gt;s
*
* @since 1.0.0
*/
function parse_code () {
// Start the timer
$start_time = microtime();

// Firstly, if there is an error, we won't highlight
if ($this->error) {
//Escape the source for output
$result = $this->hsc($this->source);

//This fix is related to SF#1923020, but has to be applied regardless of
//actually highlighting symbols.
$result = str_replace(array('<SEMI>', '<PIPE>'), array(';', '|'), $result);

// Timing is irrelevant
$this->set_time($start_time, $start_time);
$this->finalise($result);
return $result;
}
}[/highlight]

As you can see, our syntax highlighter now starts the numbering from 30 onwards. To make use of this feature, you just have to add a second parameter to the [noparse][highlight=language][/noparse] tag, like so:
[noparse][highlight=language;customstartingnumber][/noparse]

If you didn't find that useful, maybe you'll find the second feature I was working on useful. As a Developer, I've lost count of the amount of times I have had to emphasise changed code when posting it for others.

Usually this would mean using some bbcode within [noparse]
Code:
[/noparse] tags but having bbcode parsing within [noparse][code][/noparse] is usually a problem in and of itself. The problem (or well, in my opinion, the advantage) with our syntax highlighter is that all bbcode and smilies remain unparsed within posted code, provided they are enclosed in [noparse][highlight=language][/noparse] containers. While this is helpful, this prevents us from being able to highlight the code we want to emphasise within a snippet.

That is, until I decided to add this new feature:
[highlight=php;30;16,17,18,26]    /**
     * Returns the code in $this->source, highlighted and surrounded by the
     * nessecary HTML.
     *
     * This should only be called ONCE, cos it's SLOW! If you want to highlight
     * the same source multiple times, you're better off doing a whole lot of
     * str_replaces to replace the &lt;span&gt;s
     *
     * @since 1.0.0
     */
    function parse_code () {
        // Start the timer
        $start_time = microtime();

        // Firstly, if there is an error, we won't highlight
        if ($error) {
            //Escape the source for output
            $result = $hsc($source);

            //This fix is related to SF#1923020, but has to be applied regardless of
            //actually highlighting symbols.
            $result = str_replace(array('<SEMI>', '<PIPE>'), array(';', '|'), $result);

            // Timing is irrelevant
            $this->set_time($start_time, $start_time);
            $finalise($result);
            return $result;
        }
    }[/highlight]

As you can see, this enables you to [B]easily highlight and emphasise[/B] the [B]lines of code[/B] that are important or that you've changed.

The only limitation to this feature is that you the line numbers you want to highlight are as if the code is being numbered from 1, regardless of the custom start number you specified. While this can be confusing, I think we can cope :laugh:

Anyway, to make use of this feature, you just add a new parameter to the [noparse][highlight=language][/noparse] tag, like this:
[noparse][highlight=lang;1;numbers,of,the,lines,you,want,to,highlight][/noparse]

If you didn't notice, you have to either have a starting number of 1, a custom starting number or the starting number parameter can be omitted (but you need to keep the ";" separator):
[noparse][highlight=lang;;numbers,of,the,lines,you,want,to,highlight][/noparse]

As always, if you have any feedback, questions or concerns, we would [url=http://forums.mformature.net/forumdisplay.php?f=19]love to hear it[/url] :)

Thanks for all the hard work and feedback we've already received. We're glad you like what you saw before and we hope you like the new features I just featured above :D

If, for whatever insane reason, you have not taken a look at our new [URL="http://forums.mformature.net/forumdisplay.php?f=51"]Developer forum[/URL], aptly named Division by Zero, then I invite you to do so and ask a few questions. Our community is filled with friendly developers willing to help you out and push you in the right direction of becoming one of us ;).

As I write this, there are already a few useful and well written guides and tutorials for you to dig in with and we hope to have more written soon! Remember, though, that you're free to contribute your own too.
 

Seth

MD Party Room
SO wait we can post html code on the forums?

HTML:
<a href="http://tinypic.com" target="_blank"><img src="http://i43.tinypic.com/o52iok.jpg" border="0" alt="Image and video hosting by TinyPic"></a>

Edit I miss understood. You only added code tags.But still a welcome improvement to the forums.
 

NeilR

eXo Admin
Enforcer Team
SO wait we can post html code on the forums?

HTML:
<a href="http://tinypic.com" target="_blank"><img src="http://i43.tinypic.com/o52iok.jpg" border="0" alt="Image and video hosting by TinyPic"></a>

Edit I miss understood. You only added code tags.But still a welcome improvement to the forums.

Just to be clear the [NOPARSE]
HTML:
[/NOPARSE] code has always existed default with vBulletin (much like [NOPARSE][CODE][/NOPARSE]). If you read EvilSeph's post you will see he refers to the use of the new vbcode: [NOPARSE][HIGHLIGHT][/NOPARSE].

We will never enable html usage in posts as that's an invitation to disaster.
 
Top