Open main menu

Changes

3,362 bytes added ,  22:06, 1 December 2008
info on highlighting source code
== Syntax Highlighting in Quanta ==
Quanta has syntax defintion files which are called 'DTEP' files.
See the quanta dev list, website, or help:/quanta (Quanta Manual in konqueror). These files are stored in
<source lang="bash">
# application directory
/usr/share/apps/quanta/dtep/
# local user directory
~/.kde/share/apps/quanta/dtep/
</source>
placing a new directory, which includes all tag definitions, in one of those locations will provide all the info Quanta needs to understand the syntax. On the Quanta site there is a DTEP for TaskJuggler syntax.

== Syntax Highlighing in VIM ==
To add syntax highlighting for a particular language or syntax, you need to have a syntax definition file, and then you need to 'turn it on' by setting it up in your local configuration file. For example, there is a syntax file for TaskJuggler, which can be turned on thusly:
<source lang="bash">
sudo cp /usr/local/src/taskjuggler-2.2.0/Contrib/vim/tjp.vim /usr/share/vim/vimcurrent/syntax/
sudo chmod o+r /usr/share/vim/vimcurrent/syntax/tjp.vim
echo 'if has("autocmd")
augroup taskjuggler
au! BufNewFile,BufRead *.tj{p,i} set ft=tjp
augroup END
endif' >> ~/.vimrc
</source>

== Syntax Highlighting in Konsole ==

== Syntax Highlighting in Websvn ==
The current syntax highlighting in websvn is handled via GNU enscript

== Syntax Highlighting in MediaWiki ==
Writing good code, especially in open source context, requires illustrating best practices and tutorials. Those tutorials are made ever more useful with syntax-highlighting.

MediaWiki is able to incorporate a nice 3rd-party project called [http://qbnz.com/highlighter/faq.php Generic Syntax Highlighter] or GeSHi for short. Fortunately GeSHi is now packaged with debian for easy installation on Debian or Debian-based systems. There is a [[mw:Extension:SyntaxHighlight_GeSHi]] extension which provides a tie-in between MediaWiki and GeSHi. (note that there are a few different GeSHi extensions for mediawiki, and we use the one in use on mediawiki.org http://www.mediawiki.org/wiki/Special:Version).

To install the actual GeSHi software package (it installs in /usr/share)
<source lang="bash">
sudo apt-get install php-geshi
ls /usr/share/php-geshi/
contrib geshi geshi.php
</source>

Incorporating GeSHi into Mediawiki is just a matter of adding the extension to the source tree and including it in LocalSettings.

=== Usage ===
See the [[mw:Extension:SyntaxHighlight_GeSHi#Examples]]

<nowiki>
<source lang="php">
$v = array_pop($foo); // just a comment
</source>
</nowiki>

=== Supported Languages ===
[[mw:Extension:SyntaxHighlight_GeSHi#Supported_languages]]

=== Documentation ===
See http://qbnz.com/highlighter/geshi-doc.html for the extensive documentation. GeSHi is used in a number of other software projects like
* Dokuwiki - An advanced wiki engine
* gtk.php.net - Their manual uses GeSHi for syntax highlighting
* WordPress - A powerful blogging system*
* PHP-Fusion - A constantly evovling CMS
* SQL Manager - A Postgres DBAL
* Mambo - A popular open source CMS
* MediaWiki - A leader in Wikis*
* TikiWiki - A megapowerful Wiki/CMS
* TikiPro - Another powerful Wiki based on Tikiwiki
* RWeb - A site-building tool

[[Category:Howto]]
[[Category:Help]]
[[Category:Best Practices]]
[[Category:Development]]
[[Category:Wiki]]
[[Category:Collaboration]]
[[Category:Documentation]]
4,558

edits