User Tools

Site Tools


geshi:tagz

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
geshi:tagz [2005/01/26 17:58] – added comments foosiongeshi:tagz [2012/10/07 04:03] (current) – Reverted vandalism 98.248.89.12
Line 1: Line 1:
 +====== Syntax highlighting for Tagz ======
 +===== style.css =====
 +Save this as wiki/style.css.
 +<code css>
 +body {
 +  font: 80% "Lucida Grande", Verdana, Lucida, Helvetica, Arial, sans-serif;
 +  background-color: White;
 +  color: Black;
 +  margin: 0;
 +  padding: 0;
 +}
  
 +div.clearer {clear: both; line-height: 0; height: 0;}
 +
 +table {
 +  font-size: 100%;
 +  padding:0;
 +  margin:0;
 +}
 +
 +tr,td,th {padding:0; margin:0;}
 +
 +img {border:0}
 +
 +p {padding:0; margin: 0 0 1.0em 0;}
 +
 +hr {
 +  border: 0px;
 +  border-top: 1px solid #8cacbb;
 +  text-align:center;
 +  height: 0px;
 +}
 +
 +form {
 +  border: none;
 +  margin: 0;
 +  display: inline;
 +}
 +
 +label {
 +  display: block;
 +  text-align: right;
 +  font-weight: bold;
 +}
 +
 +label input {
 +  width: 50%;
 +}
 +
 +fieldset {
 +  width: 300px;
 +  text-align: center;
 +  border: 1px solid #8cacbb;
 +  padding: 0.5em;
 +}
 +
 +
 +a {
 +  color:#436976;
 +  text-decoration:none;
 +}
 +a:hover {
 +  color:#000000;
 +  text-decoration:underline;
 +}
 +
 +textarea.edit {
 +  font-family:monospace;
 +  border: 1px solid #8cacbb;  
 +  color: Black;
 +  background-color: white;
 +  font-size:14px;
 +  padding: 3px;
 +  width:100%;
 +}
 +
 +input.edit {
 +  font-size: 100%;
 +  border: 1px solid #8cacbb;
 +  height: 22px ! important;
 +  max-height: 22px ! important;
 +  min-height: 22px ! important;
 +  color: Black;
 +  background-color: white;
 +  vertical-align: middle;
 +  padding: 1px;
 +  display: inline;
 +}
 +
 +input.button {
 +  border: 1px solid #8cacbb;  
 +  color: Black;
 +  background-color: white;
 +  vertical-align: middle;
 +  text-decoration:none;
 +  font-size: 100%;
 +  cursor: pointer;
 +  height: 22px ! important;
 +  max-height: 22px ! important;
 +  min-height: 22px ! important;
 +  margin: 1px;
 +  display: inline;
 +}
 +
 +div.secedit input.button {
 +  border: 1px solid #8cacbb;
 +  color: Black;
 +  background-color: white;
 +  vertical-align: middle;
 +  text-decoration:none;
 +  margin: 0px;
 +  padding: 0px;
 +  font-size: 10px;
 +  cursor: pointer;
 +  height: 15px;
 +  max-height: 15px ! important;
 +  min-height: 15px ! important;
 +  float:right;
 +  display: inline;
 +}
 +
 +div.meta {
 +  clear: both;
 +  margin-top: 1em;
 +  color:#436976;
 +  font-size:70%;
 +  text-align:right;
 +}
 +
 +div.user {
 +  float:left;
 +}
 +
 +div.preview{
 +  background:#f7f9fa;
 +  margin-left:2em;
 +  padding: 4px;
 +  border: 1px dashed #000000;
 +}
 +
 +div.breadcrumbs{
 +  background-color: #f5f5f5;
 +  font-size:80%;
 +  color: #666666;
 +  padding-left: 4px;
 +}
 +
 +span.user{
 +  color: #cccccc;
 +  font-size: 90%;
 +}
 +
 +div.error{
 +  background: transparent url(images/error.png) 0.5em 0px no-repeat;
 +  background-color: #ff6666;
 +  font-size: 90%;
 +  margin: 0px;
 +  padding-left: 3em;
 +  height: 16px;
 +}
 +
 +div.info{
 +  background: transparent url(images/info.png) 0.5em 0px no-repeat;
 +  background-color: #ffff66;
 +  font-size: 90%;
 +  margin: 0;
 +  padding-left: 3em;
 +  height: 16px;
 +}
 +
 +div.success{
 +  background: transparent url(images/thumbup.gif) 0.5em 0px no-repeat;
 +  background-color: #66ff66;
 +  font-size: 90%;
 +  margin: 0;
 +  padding-left: 3em;
 +  height: 16px;
 +}
 +
 +/* ---------------------------- Diff rendering --------------------------*/
 +table.diff { background:white; }
 +td.diff-blockheader {font-weight:bold}
 +td.diff-header {
 +  border-bottom: 1px solid #8cacbb;
 +  font-size:120%;
 +}
 +td.diff-addedline {
 +    background:#ddffdd;
 +    font-family: monospace;
 +    font-size: 100%;
 +}
 +td.diff-deletedline { 
 +    background:#ffffbb;
 +    font-family: monospace;    
 +    font-size: 100%;
 +}
 +td.diff-context {
 +    background:#f7f9fa;
 +    font-family: monospace;
 +    font-size: 100%;
 +}
 +span.diffchange { color: red; }
 +
 +
 +
 +/* --------------------- Text formatting -------------------------------- */
 +
 +/* external link */
 +a.urlextern{
 +    background: transparent url(images/link_icon.gif) 0px 1px no-repeat;
 +    padding: 1px 0px 1px 16px;
 +    color:#436976;
 +    text-decoration:none;
 +}
 +a.urlextern:visited {
 +  color:Purple;
 +}
 +a.urlextern:hover {
 +  text-decoration:underline;
 +}
 +
 +/* windows share */
 +a.windows{
 +    background: transparent url(images/windows.gif) 0px 1px no-repeat;
 +    padding: 1px 0px 1px 16px;
 +    color:#436976;
 +    text-decoration:none;
 +
 +a.windows:visited {
 +  color:Purple;
 +}
 +a.windows:hover { 
 +  text-decoration:underline;
 +}
 +
 +/* interwiki link */
 +a.interwiki{
 +    background: transparent url(images/interwiki.png) 0px 1px no-repeat;
 +    padding: 1px 0px 1px 16px;
 +    color:#436976;
 +    text-decoration:none;
 +}
 +a.interwiki:visited {
 +  color:Purple;
 +}
 +a.interwiki:hover {
 +  text-decoration:underline;
 +}
 +
 +/* link to some embedded media */
 +a.media {
 +  color:#436976;
 +  text-decoration:none;
 +}
 +a.media:hover {
 +  color:#436976;
 +  text-decoration:underline
 +}
 +/* embedded images */
 +img.media {
 +  margin: 3px;
 +}
 +
 +/* email link */
 +a.mail {
 +  background: transparent url(images/mail_icon.gif) 0px 1px no-repeat;
 +  padding: 1px 0px 1px 16px;
 +  color:#436976;
 +  text-decoration:none;
 +}
 +a.mail:hover {
 +  text-decoration:underline;
 +}
 +
 +/* existing wikipage */
 +a.wikilink1:link    { color:#009900; text-decoration:none }
 +a.wikilink1:visited { color:#009900; text-decoration:none }
 +a.wikilink1:hover   { color:#009900; text-decoration:underline }
 +
 +/* not exisitng wikipage */
 +a.wikilink2:link    { color:#FF3300; text-decoration:none }
 +a.wikilink2:visited { color:#FF3300; text-decoration:none }
 +a.wikilink2:hover   { color:#FF3300; text-decoration:underline }
 +
 +acronym {
 +  cursor: help;
 +  border-bottom: 1px dotted #000;
 +}
 +
 +/* the document */
 +div.page {
 +  margin-top: 4px;
 +  margin-left:  1em;
 +  margin-right: 2em;
 +  text-align: justify;
 +}
 +
 +/* general headline setup */
 +h1, h2, h3, h4, h5 {
 +    color: Black;
 +    background-color: transparent;
 +    font-family: "Lucida Grande", Verdana, Lucida, Helvetica, Arial, sans-serif;
 +    font-size: 100%;
 +    font-weight: normal;
 +    margin-left:    0;
 +    margin-right:   0;
 +    margin-top:     0;
 +    margin-bottom:  1em;
 +    padding-left:   0;
 +    padding-right:  0;
 +    padding-top:    0.5em;
 +    padding-bottom: 0;
 +    border-bottom: 1px solid #8cacbb;
 +    clear: left;
 +}
 +
 +/* special headlines */
 +h1 {font-size: 160%; margin-left: 0px; font-weight: bold;}
 +h2 {font-size: 150%; margin-left: 20px;}
 +h3 {font-size: 140%; margin-left: 40px; border-bottom: none; font-weight: bold;}
 +h4 {font-size: 120%; margin-left: 60px; border-bottom: none; font-weight: bold;}
 +h5 {font-size: 100%; margin-left: 80px; border-bottom: none; font-weight: bold;}
 +
 +/* indent different sections */
 +div.level1 {margin-left: 3px;}
 +div.level2 {margin-left: 23px;}
 +div.level3 {margin-left: 43px;}
 +div.level4 {margin-left: 63px;}
 +div.level5 {margin-left: 83px;}
 +
 +/* unordered lists */
 +ul { 
 +  line-height: 1.5em;
 +  list-style-type: square;
 +  margin: 0.5em 0 0.5em 1.5em;
 +  padding: 0;
 +  list-style-image: url(images/bullet.gif);
 +}
 +
 +/* ordered lists */
 +ol {
 +  line-height: 1.5em;
 +  margin: 0.5em 0 0.5em 1.5em;
 +  padding: 0;
 +  color: #638c9c;
 +  font-weight: bold;
 +  list-style-image: none;
 +}
 +
 +/* the list items overriding the ol definition */
 +span.li {
 +  color: #000000;
 +  font-weight: normal;
 +}
 +
 +.quote {
 +  border-left: 2px solid #8cacbb;
 +  padding-left: 3px;
 +}
 +
 +/* code blocks by indention */
 +pre.pre {
 +  font-size: 120%;
 +  padding: 0.5em;
 +  border: 1px dashed #8cacbb;
 +  color: Black;
 +  background-color: #f7f9fa;
 +  overflow: auto;
 +}
 +
 +/* code blocks by code tag */
 +pre.code {
 +  font-size: 120%;
 +  padding: 0.5em;
 +  border: 1px dashed #8cacbb;
 +  color: Black;
 +  background-color: #f7f9fa;
 +  overflow: auto;
 +}
 +
 +/* code highlighting is at bottom of file */
 +
 +/* inline code words */
 +code {
 +  font-size: 120%;
 +}
 +
 +/* code blocks by file tag */
 +pre.file {
 +  font-size: 120%;
 +  padding: 0.5em;
 +  border: 1px dashed #8cacbb;
 +  color: Black;
 +  background-color: #dee7ec;
 +  overflow: auto;
 +}
 +
 +/* footnotes */
 +div.footnotes{
 +  clear:both;
 +  border-top: 1px solid #8cacbb;
 +  padding-left: 1em;
 +  margin-top: 1em;
 +}
 +
 +div.fn{
 +  font-size:90%;
 +}
 +
 +a.fn_top{
 +  vertical-align:super;
 +  font-size:80%;
 +}
 +
 +a.fn_bot{
 +  vertical-align:super;
 +  font-size:80%;
 +  font-weight:bold;
 +}
 +
 +/* inline tables */
 +table.inline {
 +  background-color: #ffffff;
 +  border-spacing: 0px;
 +  border-collapse: collapse;
 +}
 +
 +th.inline{
 +  padding: 3px;
 +  border: 1px solid #8cacbb;
 +  background-color: #dee7ec;
 +  text-align: left;
 +}
 +
 +td.inline{
 +  padding: 3px;
 +  border: 1px solid #8cacbb;
 +  text-align: left;
 +}
 +
 +
 +/* ---------- table of contents ------------------- */
 +
 +div.toc {
 +  margin-left: 2em;
 +  margin-top: 1.2em;
 +  margin-bottom: 0;
 +  float:right;
 +  width: 200px;
 +  font-size: 80%;
 +  clear:both;
 +}
 +
 +div.tocheader {
 +  padding: 3px;
 +  border: 1px solid #8cacbb;
 +  background-color: #dee7ec;
 +  text-align: left;
 +  font-weight:bold;
 +  margin-bottom: 2px;
 +}
 +
 +#tocinside {
 +  border: 1px solid #8cacbb;
 +  background-color: #ffffff;
 +  text-align: left;
 +  padding-top: 0.5em;
 +  padding-bottom: 0.7em;
 +}
 +
 +ul.toc {
 +  list-style-type: none;
 +  list-style-image: none;
 +  line-height: 1.2em;
 +  margin: 0;
 +  padding: 0;
 +  padding-left: 1em;
 +}
 +
 +ul.toc li {
 +  background: transparent url(images/tocdot2.gif) 0 0.6em no-repeat;
 +  padding-left:0.4em;
 +}
 +
 +a.toc {
 +  color: #436976;
 +  text-decoration:none;
 +}
 +
 +a.toc:hover {
 +  color: #000000;
 +  text-decoration:underline; 
 +}
 +
 +/* --------------- search result formating --------------- */
 +.search_result{
 +  margin-bottom: 6px;
 +  padding-left: 30px;
 +  padding-right: 10px;
 +}
 +
 +.search_snippet{
 +  color: #999999;
 +  font-size: 12px;
 +  margin-left: 20px;
 +}
 +
 +.search_sep{
 +  color: #000000;
 +}
 +
 +.search_hit{
 +  color: #000000;
 +  background: #FFFF99;
 +}
 +
 +div.search_quickresult{
 +  margin-bottom: 15px;
 +  padding-bottom: 5px;
 +  border-bottom: 1px dashed #8cacbb;
 +  margin-left: 30px;
 +  padding-right: 10px;
 +}
 +
 +div.search_quickhits {
 +  margin-left: 1em;
 +  float:left;
 +  background: transparent url(images/bullet.gif) 0px 1px no-repeat;
 +  padding: 1px 0px 1px 8px;
 +  width: 30%;
 +}
 +
 +/* debug */
 +pre.dbg{
 +  background-color:#ffffff;
 +  font-size: 120%;
 +}
 +
 +/* Tableless Headers and Footers */
 +/* Thanks to "moraes" <moraes@tipos.com.br> */
 +
 +.header {
 + height:35px;
 + padding:3px 0 2px 2px;
 +}
 +
 +.pagename {
 + height:25px;
 + float:left;
 + font-size:200%;
 + font-weight:bolder;
 + color:#DEE7EC;
 + text-align:left;
 + vertical-align:middle;
 + padding:1px 0 0 1px;
 +}
 +
 +.pagename a:link, .pagename a:visited {
 +  color:#436976;
 +  text-decoration:none;
 +}
 +
 +.pagename a:hover, .pagename a:active {
 +  color:#FF9933;
 +}
 +
 +.logo {
 + float:right;
 + font-size:220%;
 + font-weight:bolder;
 + text-align:right;
 + vertical-align:middle;
 +}
 +
 +.logo a:link, .logo a:visited, .logo a:hover, .logo a:active {
 + color:#dee7ec;
 + text-decoration:none;
 + font-variant:small-caps;
 + letter-spacing:2pt;
 +}
 +
 +.bar {
 + height:25px;
 + border-top:1px solid #8CACBB;
 + border-bottom:1px solid #8CACBB;
 + background:#DEE7EC;
 + padding:2px;
 + margin:0;
 +}
 +
 +.bar-left {
 + float:left;
 +  width:50%;
 +}
 +
 +.bar-right {
 + float:right;
 +  width:50%;
 +  text-align:right;
 +}
 +
 +#bar_bottom {
 +  margin-bottom:3px;
 +}
 +
 +.mediaselect-left {
 +  float:left;
 +  padding: 0.5em;
 +  height:230px;
 +  overflow:auto;
 +}
 +
 +.mediaselect-right {
 +  float:right;
 +  border-left: 1px solid #8cacbb;
 +  padding: 0.5em;
 +  width:350px;
 +  height:230px;
 +  overflow:auto;
 +}
 +
 +div.uploadform {
 +  margin-top: 0.5em;
 +  border-top: 1px solid #8cacbb;
 +}
 +
 +.footerinc a img {
 +    opacity: 0.5;
 +}
 +
 +.footerinc a:hover img {
 +    opacity: 1;
 +}
 +
 +/* syntax highlighting code */
 +.code .br0 { color: #000000; }
 +.code .co1 { color: #008000; }
 +.code .co2 { color: #008000; }
 +.code .coMULTI { color: #008000; }
 +.code .es0 { color: #000099; font-weight: bold; }
 +.code .kw1 { color: #4040ff; }
 +.code .kw2 { color: #4040ff; font-weight: bold; }
 +.code .kw3 { color: #000066; }
 +.code .kw4 { color: #993333; }
 +.code .kw5 { color: #0000ff; }
 +.code .me0 { color: #006600; }
 +.code .nu0 { color: #000000; }
 +.code .re0 { color: #c000c0; }
 +.code .re1 { color: #0000ff; }
 +.code .re2 { color: #0080ff; }
 +.code .re3 { color: #4040ff; }
 +.code .re4 { color: #4040ff; }
 +.code .sc0 { color: #00bbdd; }
 +.code .sc1 { color: #ddbb00; }
 +.code .sc2 { color: #009900; }
 +.code .st0 { color: #ff6000; }
 +</code>
 +
 +===== tagz.php =====
 +Save this as wiki/inc/geshi/tagz.php
 +<code php>
 +<?php
 +/*************************************************************************************
 + * lua.php
 + * -------
 + * Author: Holger Stenger (holger.stenger@gmx.de)
 + * Copyright: (c) 2004 Roberto Rossi (http://rsoftware.altervista.org)
 + * Release Version: 1.0.0
 + * CVS Revision Version: $Revision: 1.3 $
 + * Date Started: 2004/07/10
 + * Last Modified: $Date: 2004/10/27 03:18:40 $
 + *
 + * Tagz language file for GeSHi.
 + *
 + * CHANGES
 + * -------
 + * 2005/01/14 (1.0.0)
 +  -  First Version
 + *
 + * TODO (updated 2004/10/27)
 + * -------------------------
 + *
 + *
 + *************************************************************************************
 + *
 +     This file is part of GeSHi.
 + *
 +   GeSHi is free software; you can redistribute it and/or modify
 +   it under the terms of the GNU General Public License as published by
 +   the Free Software Foundation; either version 2 of the License, or
 +   (at your option) any later version.
 + *
 +   GeSHi is distributed in the hope that it will be useful,
 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 +   GNU General Public License for more details.
 + *
 +   You should have received a copy of the GNU General Public License
 +   along with GeSHi; if not, write to the Free Software
 +   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 + *
 + ************************************************************************************/
 +
 +$language_data = array (
 + 'LANG_NAME' => 'Tagz',
 + 'COMMENT_SINGLE' => array(1 => '//'),
 + 'COMMENT_MULTI' => array(),
 + 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
 + 'QUOTEMARKS' => array("'"),
 + 'ESCAPE_CHAR' => '',
 + 'KEYWORDS' => array(
 + 1 => array(
 +# Keywords don't work, since they can appear anywhere in the text.
 +# Tagz is quite unusual in that regard.
 +# '$xor',
 +# '$upper',
 +# '$trim', '$transition', '$tracknumber', '$tab',
 +# '$substr', '$sub', '$strstr', '$strrchr', '$stricmp',
 +# '$strcmp', '$strchr', '$shortest', '$select',
 +# '$roman', '$right', '$rgb', '$replace', '$repeat', '$rand',
 +# '$puts', '$put', '$progress2', '$progress', '$pad_right',
 +# '$padcut_right', '$padcut', '$pad',
 +# '$or',
 +# '$num', '$not',
 +# '$muldiv', '$mul', '$mod', '$min', '$meta_test', '$meta_sep',
 +# '$meta_num', '$meta', '$max',
 +# '$lower', '$longest', '$longer', '$len2', '$len', '$left',
 +# '$insert', '$info', '$iflonger', '$ifgreater', '$if3', '$if2', '$if',
 +# '$hex',
 +# '$greater', '$get',
 +# '$fix_eol', '$filename',
 +# '$ext',
 +# '$div', '$directory',
 +# '$cut', '$crlf', '$codec', '$char', '$caps2', '$caps',
 +# '$blend', '$ansi', '$and', '$add', '$abbr'
 + )
 + ),
 + 'SYMBOLS' => array(
 + ','
 + ),
 + 'CASE_SENSITIVE' => array(
 + GESHI_COMMENTS => true,
 + 1 => true
 + ),
 + 'STYLES' => array(
 + 'KEYWORDS' => array(
 + 1 => 'color: #800080;'
 + ),
 + 'COMMENTS' => array(
 + 1 => 'color: #008000; font-style: italic;',
 + 'MULTI' => 'color: #008000; font-style: italic;'
 + ),
 + 'ESCAPE_CHAR' => array(
 + 0 => 'color: #000099; font-weight: bold;'
 + ),
 + 'BRACKETS' => array(
 + 0 => 'color: #66cc66;'
 + ),
 + 'STRINGS' => array(
 + 0 => 'color: #800000;'
 + ),
 + 'NUMBERS' => array(
 + 0 => 'color: #cc66cc;'
 + ),
 + 'METHODS' => array(
 + 0 => 'color: #202020;'
 + ),
 + 'SYMBOLS' => array(
 + 0 => 'color: #66cc66;'
 + ),
 + 'REGEXPS' => array(
 + ),
 + 'SCRIPT' => array(
 + )
 + ),
 + 'OOLANG' => false,
 + 'OBJECT_SPLITTER' => '',
 + 'REGEXPS' => array(
 +# Highlighting variable names would be nice, if only I got the regexp working. :(
 +# 0 => array(
 +# GESHI_SEARCH => '([\\$](get|put|puts)[\\(])([a-zA-Z_]+)([\\),])',
 +# GESHI_REPLACE => '\\3',
 +# GESHI_MODIFIERS => '',
 +# GESHI_BEFORE => '\\1',
 +# GESHI_AFTER => '\\4'
 +# ),
 + 1 => array(
 + GESHI_SEARCH => '([\\$][a-z_][a-z0-9_]*)',
 + GESHI_REPLACE => '\\1',
 + GESHI_MODIFIERS => '',
 + GESHI_BEFORE => '',
 + GESHI_AFTER => ''
 + ),
 + 2 => array(
 + GESHI_SEARCH => '(\%[^%]+\%)',
 + GESHI_REPLACE => '\\1',
 + GESHI_MODIFIERS => '',
 + GESHI_BEFORE => '',
 + GESHI_AFTER => ''
 + ),
 + 3 => array(
 + GESHI_SEARCH => '()',
 + GESHI_REPLACE => '$char(3)',
 + GESHI_MODIFIERS => '',
 + GESHI_BEFORE => '',
 + GESHI_AFTER => ''
 + ),
 + 4 => array(
 + GESHI_SEARCH => '( )',
 + GESHI_REPLACE => '$tab()',
 + GESHI_MODIFIERS => '',
 + GESHI_BEFORE => '',
 + GESHI_AFTER => ''
 + ),
 +# Whitespace highlighting seems to break something in GeSHi.
 +# 4 => array(
 +# GESHI_SEARCH => '([ ]+)',
 +# GESHI_REPLACE => '\\1',
 +# GESHI_MODIFIERS => '',
 +# GESHI_BEFORE => '',
 +# GESHI_AFTER => ''
 +# )
 + ),
 + 'STRICT_MODE_APPLIES' => GESHI_NEVER,
 + 'SCRIPT_DELIMITERS' => array(
 + ),
 + 'HIGHLIGHT_STRICT_BLOCK' => array(
 + )
 +);
 +
 +?></code>