Skip to content

Commit ac00c9e

Browse files
committed
tab-size CSS is up to user.
1 parent 371b17e commit ac00c9e

8 files changed

+64
-6
lines changed

dist/base/jquery.syntax.core.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
.syntax-theme-base {
2-
tab-size: 4;
32
font-family: Menlo, Monaco, Consolas, monospace;
43
line-height: 1.15em; }
54
.syntax-theme-base .function {

dist/jquery.syntax.brush.swift.js

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
// brush: "ruby" aliases: []
2+
3+
// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
4+
// Copyright (c) 2016 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
5+
// See <jquery.syntax.js> for licensing details.
6+
7+
Syntax.register('swift', function(brush) {
8+
var keywords = [
9+
"associatedtype", "class", "deinit", "enum", "extension", "fileprivate", "func", "import", "init", "inout", "internal", "let", "operator", "private", "protocol", "static", "struct", "subscript", "typealias", "var", "break", "case", "continue", "default", "defer", "do", "else", "fallthrough", "for", "guard", "if", "in", "repeat", "return", "switch", "where", "while", "as", "catch", "is", "rethrows", "throw", "throws", "try", "_", "#available", "#colorLiteral", "#column", "#else", "#elseif", "#endif", "#file", "#fileLiteral", "#function", "#if", "#imageLiteral", "#line", "#selector", "#sourceLocation", "associativity", "convenience", "dynamic", "didSet", "final", "get", "infix", "indirect", "lazy", "left", "mutating", "none", "nonmutating", "optional", "override", "postfix", "precedence", "prefix", "Protocol", "required", "right", "set", "Type", "unowned", "weak", "willSet"];
10+
11+
var operators = ["+", "*", "/", "-", "&", "|", "~", "!", "%", "<", "=", ">",
12+
"(", ")", "{", "}", "[", "]", ".", ",", ":", ";", "=", "@", "#", "->", "`", "?", "!"];
13+
14+
var values = ["self", "super", "true", "false", "nil"];
15+
16+
var access = ["fileprivate", "open", "private", "public"];
17+
18+
brush.push(access, {klass: 'access'});
19+
brush.push(values, {klass: 'constant'});
20+
21+
brush.push({
22+
pattern: /`[^`]+`/g,
23+
klass: 'identifier'
24+
});
25+
26+
brush.push({
27+
pattern: /\\\(([^)]*)\)/g,
28+
matches: Syntax.extractMatches({
29+
brush: 'swift',
30+
only: ['string']
31+
})
32+
});
33+
34+
brush.push(Syntax.lib.camelCaseType);
35+
brush.push(keywords, {klass: 'keyword'});
36+
brush.push(operators, {klass: 'operator'});
37+
38+
// Comments
39+
brush.push(Syntax.lib.cStyleComment);
40+
brush.push(Syntax.lib.cppStyleComment);
41+
brush.push(Syntax.lib.webLink);
42+
43+
// Strings
44+
brush.push(Syntax.lib.singleQuotedString);
45+
brush.push(Syntax.lib.doubleQuotedString);
46+
brush.push(Syntax.lib.stringEscape);
47+
48+
// Numbers
49+
brush.push(Syntax.lib.decimalNumber);
50+
brush.push(Syntax.lib.hexNumber);
51+
52+
// Functions
53+
brush.push(Syntax.lib.cStyleFunction);
54+
});
55+

dist/jquery.syntax.cache.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Syntax.alias("scala", []);
3535
Syntax.alias("smalltalk", []);
3636
Syntax.alias("sql", []);
3737
Syntax.alias("super-collider", ["sc"]);
38+
Syntax.alias("ruby", []);
3839
Syntax.alias("html", []);
3940
Syntax.alias("xml", []);
4041
Syntax.alias("yaml", []);

dist/jquery.syntax.core.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,6 +1105,8 @@ Syntax.highlight = function (elements, options, callback) {
11051105
Syntax.layouts.get(options.layout, function(layout) {
11061106
if (layout) {
11071107
html = layout(options, jQuery(html), container);
1108+
} else {
1109+
html = jQuery(html);
11081110
}
11091111

11101112
// If there is a theme specified, ensure it is added to the top level class.

dist/jquery.syntax.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,5 +256,7 @@ jQuery.fn.syntax = function (options, callback) {
256256
};
257257

258258
jQuery.syntax = function (options, callback) {
259-
jQuery(Syntax.codeSelector, options.context).syntax(options, callback);
259+
var context = options ? options.context : null;
260+
261+
jQuery(Syntax.codeSelector, context).syntax(options, callback);
260262
};

dist/jquery.syntax.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

install.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ themes:
88
- bright
99
- paper
1010
# Enable minification
11-
# minify: true
11+
minify: false

themes/base/jquery.syntax.core.sass

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// See <jquery.syntax.js> for licensing details.
44
55
.syntax-theme-base
6-
tab-size: 4
76
font-family: Menlo, Monaco, Consolas, monospace
87
line-height: 1.15em
98

0 commit comments

Comments
 (0)