SynTag, Version 0.2b (alt)

Hinweis: dies ist nicht die neueste Version!

Zurück zur Übersicht

Datei: syntag/syntag.css.php

<?php

/*
    "SynTag" - Flocke's Syntax Highlighter

    A PHP class to create syntax highlighted HTML from sourcecode. See the
    base file "syntag.php" resp. the included file README.txt for information
    on how to use it.

    This file: syntag.css.php
    Syntax definition for HTML Stylesheets
    Filetypes: css (also used for html)

    Version 0.2b - always find the latest version at
    http://flocke.vssd.de/prog/code/php/syntag/

    Copyright (C) 2005 Volker Siebert <flocke@vssd.de>
    All rights reserved.

    Permission is hereby granted, free of charge, to any person obtaining a
    copy of this software and associated documentation files (the "Software"),
    to deal in the Software without restriction, including without limitation
    the rights to use, copy, modify, merge, publish, distribute, sublicense,
    and/or sell copies of the Software, and to permit persons to whom the
    Software is furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included in
    all copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
    DEALINGS IN THE SOFTWARE.
*/

SynTag::AddLanguage('stylesheet.style', array(
    'flags' => 'i',
    'items' => array(
        'keywords'      => array(
            'k' => array(
                'background', 'background-attachment', 'background-color', 
                'background-image', 'background-position', 'background-repeat', 'border', 
                'border-color', 'border-style', 'border-width', 'border-bottom', 
                'border-bottom-color', 'border-bottom-style', 'border-bottom-width', 
                'border-left', 'border-left-color', 'border-left-style', 
                'border-left-width', 'border-right', 'border-right-color', 
                'border-right-style', 'border-right-width', 'border-top', 
                'border-top-color', 'border-top-style', 'border-top-width', 
                'border-collapse', 'border-spacing', 'caption-side', 'color', 
                'empty-cells', 'font', 'font-family', 'font-size', 'font-stretch', 
                'font-style', 'font-variant', 'font-weight', 'letter-spacing', 
                'line-height', 'list-style', 'list-style-image', 'list-style-position', 
                'list-style-type', 'margin', 'margin-bottom', 'margin-left', 
                'margin-right', 'margin-top', 'padding', 'padding-bottom', 'padding-left', 
                'padding-right', 'padding-top', 'speak-header', 'table-layout', 
                'text-align', 'text-decoration', 'text-indent', 'text-shadow', 
                'text-transform', 'vertical-align', 'white-space', 'word-spacing', 
            ),
            'o' => '#keyword'
        ),
        'names'         => array(
            'k' => array(
                'activeborder', 'activecaption', 'always', 'appworkspace', 'auto', 
                'background', 'baseline', 'blink', 'bold', 'bolder', 'bottom',
                'buttonface', 'buttonhighlight', 'buttontext', 'capitalize', 'captiontext',
                'center', 'circle', 'cjk-ideographic', 'collapse', 'condensed', 'cursive', 
                'dashed', 'decimal', 'decimal-leading-zero', 'disc', 'dotted', 'double', 
                'expanded', 'extra-condensed', 'extra-expanded', 'fantasy', 'fixed', 
                'graytext', 'groove', 'hebrew', 'hidden', 'hide', 'highlight',
                'highlighttext', 'hiragana', 'hiragana-iroha', 'inactiveborder',
                'inactivecaption', 'infobackground', 'infotext', 'inset', 'inside',
                'italic', 'justify', 'katakana', 'katakana-iroha', 'large', 'larger',
                'left', 'lighter', 'line-through', 'lower-alpha', 'lowercase',
                'lower-greek', 'lower-latin', 'lower-roman', 'medium', 'menu', 'menutext',
                'middle', 'monospace', 'narrower', 'none', 'no-repeat', 'normal',
                'nowrap', 'oblique', 'once', 'outset', 'outside', 'overline', 'pre', 
                'repeat', 'repeat-x', 'repeat-y', 'ridge', 'right', 'sans-serif', 'scroll',
                'scrollbar', 'semi-condensed', 'semi-expanded', 'separate', 'serif',
                'show', 'small', 'small-caps', 'smaller', 'solid', 'square', 'sub',
                'super', 'text-bottom', 'text-top', 'thick', 'thin', 'threeddarkshadow',
                'threedface', 'threedhighlight', 'threedlightshadow', 'threedshadow',
                'top', 'ultra-condensed', 'ultra-expanded', 'underline', 'upper-alpha',
                'uppercase', 'upper-latin', 'upper-roman', 'wider', 'window',
                'windowframe', 'windowtext', 'x-large', 'x-small', 'xx-large', 'xx-small', 
            ),
            'o' => '#name'
        ),
        'color'         => array(
            '(' => "#[0-9a-f]{3,6}[[:>:]]",
            'o' => '#number'
        ),
        'measure'       => array(
            '(' => '[[:sign:]]([0-9]+|[0-9]*\.[0-9]+|[0-9]*\.[0-9]+e[-+]?[0-9]+)' .
                   '(pt|pc|in|mm|cm|px|em|ex|%|deg|grad|rad|ms|s|Hz|kHz)?[[:>:]]',
            'o' => '#number'
        ),
        'string.dq'     => array(
            '(' => '"',
            ')' => '"',
            'o' => '#label',
            'i' => '#string'
        ),
        'string.sq'     => array(
            '(' => "'",
            ')' => "'",
            'o' => '#label',
            'i' => '#string'
        ),
    ),
));

SynTag::AddLanguage('stylesheet', array(
    'flags' => 'i',
    'file'  => '\.(css)$',
    'items' => array(
        'keywords'      => 'html.keyword/keywords',
        'style'         => array(
            '(' => '{',
            ')' => '}',
            'i' => 'stylesheet.style'
        ),
    ),
));

?>
Flocke's Garage
Valid HTML 4.01 Transitional Valid CSS!
(C) 2005-2018 Volker Siebert.
Creative Commons-LizenzvertragDer gesamte Inhalt dieser Webseite steht unter einer Creative Commons-Lizenz (sofern nicht anders angegeben).