Customizing SMF > SMF Coding Discussion

[BETA] SMF Syntax Highlighter

(1/21) > >>

X3mE:
SMF Syntax Highlighter
by X3mE, version 0.1b
Description

This modification will add extra functionality to the code BBC tag, enabling syntax highlighting when a language code is passed as a parameter. For example:


--- Code: ---[ code=langname]Some code here...[/ code]
--- End code ---

The old-fashioned code display will still be available, if used without any parameters.

The list of supported highlighting "brushes" can be seen above the post box, as a new combo box.

Works with both SMF 1.1.7 and 2.0 Beta 4. There are no setting in the admin panel, nor database entries.

Note: This modification is still beta and hasn't been submited on the SMF Mod site yet.


Screenshot



Live Demo: http://x3me.iz.rs/index.php?board=11.0


Changelog

* Version 0.1b (02. 02. 2009.)
- Initial version for SMF 2.0 Beta 4 and SMF 1.1.7


Credits

Based on the free Syntax Highlighter 1.5.1, written by Alex Gorbatchev.
Project Home Page

Notes

Please post all your support questions and comments in the support thread. You can also use the Issue Tracker on the Demo Website.

Note: For issues regarding the highlight itself, it would probably be best to notify the author of the original script here. You can also notify me, and I'll try to fix it myself.



Languages

Languages included:
- English (english, english-utf8)
- Serbian (serbian, serbian-utf8, serbian-utf8-lat)

To translate it to your own language, add the translation for:


--- Code: ---$txt['SMF_Syntax_Highlighting'] = 'Syntax Highlighting';
$txt['SMF_Syntax_Highlighting_C'] = 'C';
$txt['SMF_Syntax_Highlighting_Csharp'] = 'C#';
$txt['SMF_Syntax_Highlighting_Cpp'] = 'C++';
$txt['SMF_Syntax_Highlighting_ColdFusion'] = 'ColdFusion';
$txt['SMF_Syntax_Highlighting_CSS'] = 'CSS';
$txt['SMF_Syntax_Highlighting_Delphi'] = 'Delphi';
$txt['SMF_Syntax_Highlighting_HTML'] = 'HTML';
$txt['SMF_Syntax_Highlighting_Java'] = 'Java';
$txt['SMF_Syntax_Highlighting_JavaScript'] = 'JavaScript';
$txt['SMF_Syntax_Highlighting_Pascal'] = 'Pascal';
$txt['SMF_Syntax_Highlighting_Perl'] = 'Perl';
$txt['SMF_Syntax_Highlighting_PHP'] = 'PHP';
$txt['SMF_Syntax_Highlighting_PlSQL'] = 'Pl/SQL';
$txt['SMF_Syntax_Highlighting_Python'] = 'Python';
$txt['SMF_Syntax_Highlighting_Ruby'] = 'Ruby';
$txt['SMF_Syntax_Highlighting_SQL'] = 'SQL';
$txt['SMF_Syntax_Highlighting_VB'] = 'Visual Basic';
$txt['SMF_Syntax_Highlighting_VBNET'] = 'VB .NET';
$txt['SMF_Syntax_Highlighting_XML'] = 'XML';
$txt['SMF_Syntax_Highlighting_XHTML'] = 'XHTML';
--- End code ---

in the appropriate Modifications.language.php file. You are welcome to post your translations in the support topic.

Note: This will probably be changed (new stuff added) before the mod gets submited.


Donations

If you like this mod, please donate to support its further development. Any amount would be highly appreciated. Thank you.


X3mE:
Ok, I'm waiting for some feedback :)

Zyos:
If this has a select link to highlight code AND can display syntax with configurable colours for Microsoft INI based files (example)


--- Code: ---[entry]
attribute = variable
attribute = variable
attribute = variable

--- End code ---

I will literally have a womb implanted in me so I can have your babies (ok thats a bit extreme, but this is a feature I really REALLY would like)

X3mE:
Currently there ain't a brush for ini files, but I'll try to make one. All colors are customizable, but you'll have to edit the java script sources.

I seem to have accidentally removed the Select button while modifying how the code tag works for SMF 2 :P. I'll fix that.

karlbenson:
I think this might be the same script i integrated in the summer, but ditched because of buggy parsing of php code.

Navigation

[0] Message Index

[#] Next page

Go to full version