Merge "Add support for yaml syntax highlighting"

This commit is contained in:
Jenkins
2014-09-14 01:41:55 +00:00
committed by Gerrit Code Review
3 changed files with 58 additions and 2 deletions

View File

@@ -1171,6 +1171,7 @@ WARNING: No more than six steps are allowed in a tutorial.
<xsl:when test="@language = 'java' or @language = 'JAVA'">java</xsl:when>
<xsl:when test="@language = 'json' or @language = 'JSON'">json</xsl:when>
<xsl:when test="@language = 'python' or @language = 'PYTHON' or @language = 'py' or @language = 'PY'">python</xsl:when>
<xsl:when test="@language = 'yaml' or @language = 'YAML' or @language = 'yml' or @language = 'YML'">yaml</xsl:when>
<xsl:otherwise>
<xsl:message>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -1295,6 +1296,7 @@ WARNING: No more than six steps are allowed in a tutorial.
<xsl:when test="@language = 'java' or @language = 'JAVA'">java</xsl:when>
<xsl:when test="@language = 'json' or @language = 'JSON'">json</xsl:when>
<xsl:when test="@language = 'python' or @language = 'PYTHON' or @language = 'py' or @language = 'PY'">python</xsl:when>
<xsl:when test="@language = 'yaml' or @language = 'YAML' or @language = 'yml' or @language = 'YML'">yaml</xsl:when>
<xsl:otherwise>
<xsl:message>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -1420,6 +1422,7 @@ WARNING: No more than six steps are allowed in a tutorial.
<xsl:when test="@language = 'java' or @language = 'JAVA'">java</xsl:when>
<xsl:when test="@language = 'json' or @language = 'JSON'">json</xsl:when>
<xsl:when test="@language = 'python' or @language = 'PYTHON' or @language = 'py' or @language = 'PY'">python</xsl:when>
<xsl:when test="@language = 'yaml' or @language = 'YAML' or @language = 'yml' or @language = 'YML'">yaml</xsl:when>
<xsl:otherwise>
<xsl:message>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

View File

@@ -724,6 +724,7 @@
<xsl:when test="@language = 'java' or @language = 'JAVA'">java</xsl:when>
<xsl:when test="@language = 'json' or @language = 'JSON'">json</xsl:when>
<xsl:when test="@language = 'python' or @language = 'PYTHON' or @language = 'py' or @language = 'PY'">python</xsl:when>
<xsl:when test="@language = 'yaml' or @language = 'YAML' or @language = 'yml' or @language = 'YML'">yaml</xsl:when>
<xsl:otherwise>
<xsl:message>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

View File

@@ -136,7 +136,7 @@ SyntaxHighlighter.brushes.Custom.aliases = ['json', 'JSON'];
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
* Licensed under the MIT license.
*/
;(function()
{
@@ -307,7 +307,7 @@ SyntaxHighlighter.brushes.Custom.aliases = ['json', 'JSON'];
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
* Licensed under the MIT license.
*/
;(function()
{
@@ -344,3 +344,55 @@ SyntaxHighlighter.brushes.Custom.aliases = ['json', 'JSON'];
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 2.0.320 (July 26 2009)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
* Copyright (C) 2009 Nicolas Perriault
*
* @license
* Licensed under the MIT license.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
// Contributed by Yegor Jbanov and David Bernard.
var constants = '~ true false on off';
this.regexList = [
{ regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // comment
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted string
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted string
{ regex: /^\s*([a-z0-9\._-])+\s*:/gmi, css: 'variable' }, // key
{ regex: /\s?(\.)([a-z0-9\._-])+\s?:/gmi, css: 'comments' }, // section
{ regex: /\s(@|:)([a-z0-9\._-])+\s*$/gmi, css: 'variable bold' }, // variable, reference
{ regex: /\s+\d+\s?$/gm, css: 'color2 bold' }, // integers
{ regex: /(\{|\}|\[|\]|,|~|:)/gm, css: 'constants' }, // inline hash and array, comma, null
{ regex: /^\s+(-)+/gm, css: 'string bold' }, // array list entry
{ regex: /^---/gm, css: 'string bold' }, // category
{ regex: new RegExp(this.getKeywords(constants), 'gmi'), css: 'constants' } // constants
];
}
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['yaml', 'yml'];
SyntaxHighlighter.brushes.Yaml = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();