目次

SyntaxHighlighter

カスタマイズTips

サンプル

shBrushTraceroute.js

traceroute用の適当なBrushです。
ご自由にお使いください。

shBrushTraceroute.js
/**
 * SyntaxHighlighter
 * http://alexgorbatchev.com/SyntaxHighlighter
 *
 * SyntaxHighlighter is donationware. If you are using it, please donate.
 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
 *
 * @version
 * 3.0.83 (July 02 2010)
 *
 * @copyright
 * Copyright (C) 2004-2010 Alex Gorbatchev.
 *
 * @license
 * Dual licensed under the MIT and GPL licenses.
 */
;(function()
{
        // CommonJS
        typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
 
        function Brush()
        {
                this.regexList = [
                           { regex: /(\d+\.\d+.(?=ms))/gm,                        css: 'value' },      // html colors
                           { regex: /(?=\(*)([0-9]+\.){3}[0-9]+(?=\))/g,          css: 'color2' },     // Like IPv4 address
                           { regex: /(?=\(*)([0-9a-fA-f:]+?)(?=\))/g,             css: 'color2' },     // Like IPv6 address
                           { regex: /(?=\s*)([0-9a-zA-Z\.\-:]+?)\s(?=\()/g,       css: 'keyword' },    // hostname
                           { regex: /(?=\s*)([0-9]+)\s(?=hops.max)/gi,            css:'value' },       // max hops
                           { regex: /(?=\s*)([0-9]+)\s(?=byte.packets)/gi,        css:'value' },       // byte packets
                           { regex: /^\s?[0-9]+/gm,                               css: 'string' },     // hop counts
                           { regex: /\*/g,                                        css: 'color3'},      // non responce
 
                        ];
        }
 
        Brush.prototype = new SyntaxHighlighter.Highlighter();
        Brush.aliases   = ['traceroute'];
 
        SyntaxHighlighter.brushes.Traceroute = Brush;
 
        // CommonJS
        typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();