Navigation
Learn About
Developing With
Ingres Talk
Information
Toolbox
Views
Wiki Syntax Highlighting
From Ingres Community Wiki
Jump to: navigation, search
It's now possible to make code examples more accessible and pretty (slightly less important) using the MediaWiki port of Alex Gorbatchev's Syntax Highlighter. This allows you to convert code such as:
-- Ingres
-- SQL to create the base schema for MediaWiki
-- set autocommit on;
CREATE SEQUENCE user_user_id_seq MINVALUE 0 START WITH 0 NOCACHE;
CREATE TABLE mwuser (
user_id INTEGER DEFAULT user_user_id_seq.nextval NOT NULL PRIMARY KEY,
user_name VARCHAR(255) NOT NULL UNIQUE,
user_real_name VARCHAR(255),
user_password VARCHAR(1024),
user_newpassword VARCHAR(1024),
user_newpass_time TIMESTAMP,
user_token VARCHAR(255),
user_email VARCHAR(255),
user_email_token VARCHAR(255),
user_email_token_expires TIMESTAMP,
user_email_authenticated TIMESTAMP,
user_options CLOB,
user_touched TIMESTAMP,
user_registration TIMESTAMP,
user_editcount INTEGER
);
CREATE INDEX user_email_token_idx ON mwuser (user_email_token);
-- Create a dummy user to satisfy fk contraints especially with revisions
INSERT INTO mwuser
VALUES (DEFAULT,'Anonymous',,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,date('now'),date('now'),0);
Into:
-- Ingres
-- SQL to create the base schema for MediaWiki
-- set autocommit on;
CREATE SEQUENCE user_user_id_seq MINVALUE 0 START WITH 0 NOCACHE;
CREATE TABLE mwuser (
user_id INTEGER DEFAULT user_user_id_seq.nextval NOT NULL PRIMARY KEY,
user_name VARCHAR(255) NOT NULL UNIQUE,
user_real_name VARCHAR(255),
user_password VARCHAR(1024),
user_newpassword VARCHAR(1024),
user_newpass_time TIMESTAMP,
user_token VARCHAR(255),
user_email VARCHAR(255),
user_email_token VARCHAR(255),
user_email_token_expires TIMESTAMP,
user_email_authenticated TIMESTAMP,
user_options CLOB,
user_touched TIMESTAMP,
user_registration TIMESTAMP,
user_editcount INTEGER
);
CREATE INDEX user_email_token_idx ON mwuser (user_email_token);
-- Create a dummy user to satisfy fk contraints especially with revisions
INSERT INTO mwuser
VALUES (DEFAULT,'Anonymous','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,date('now'),date('now'),0);
[edit]
How it works
Using the<PRE> tag we add a brush class to paint the code using the following syntax:<pre class="brush:[brush-alias]">
For example if you wish to highlight some SQL code you can use the following:
<pre class="brush:[sql]">CREATE INDEX user_email_token_idx ON mwuser (user_email_token);</pre>
This will generate:
CREATE INDEX user_email_token_idx ON mwuser (user_email_token);
[edit]
What languages are supported?
The list of brushes/languages supported by this extension are:
| Base Language | Aliases |
| ActionScript3 | as3, actionscript3 |
| Bash/shell | bash, shell |
| C# | c-sharp, csharp |
| C++ | cpp, c |
| CSS | css |
| Delphi | delphi, pas, pascal |
| Diff | diff, patch |
| Groovy | groovy |
| JavaScript | js, jscript, javascript |
| Java | java |
| JavaFX | jfx, javafx |
| Perl | perl, pl |
| PHP | php |
| Plain Text | plain, text |
| PowerShell | ps, powershell |
| Python | py, python |
| Ruby | rails, ror, ruby |
| Scala | scala |
| SQL | sql |
| Visual Basic | vb, vbnet |
| XML | xml, xhtml, xslt, html, xhtml |
If you wish to add support for another language, say OpenROAD 4GL, contact Grant Croker.
Retrieved from "http://community.ingres.com/wiki/Wiki_Syntax_Highlighting"

