Tweaked ace mode
This commit is contained in:
parent
909b0dcde1
commit
239d378f2d
@ -59,7 +59,7 @@ define([
|
|||||||
}
|
}
|
||||||
var token = tokens.shift();
|
var token = tokens.shift();
|
||||||
var words = [];
|
var words = [];
|
||||||
if (!/code|code_block|reference|markup\.underline/.test(token.type)) {
|
if (!/code|code_block|link|reference|string|keyword|tag|markup\.underline/.test(token.type)) {
|
||||||
token.value.replace(wordRegExp, function(word, offset) {
|
token.value.replace(wordRegExp, function(word, offset) {
|
||||||
words.push({
|
words.push({
|
||||||
value: word,
|
value: word,
|
||||||
|
@ -81,8 +81,8 @@ var MarkdownHighlightRules = function() {
|
|||||||
regex : "\\$\\$|\\\\\\\\\\[|\\\\\\\\\\\\\\\\\\(",
|
regex : "\\$\\$|\\\\\\\\\\[|\\\\\\\\\\\\\\\\\\(",
|
||||||
next : "mathblock"
|
next : "mathblock"
|
||||||
}, { // LaTeX block
|
}, { // LaTeX block
|
||||||
token : "keyword",
|
token : ["keyword", "text"],
|
||||||
regex : "\\\\?\\\\begin\\{[a-z]*\\*?\\}",
|
regex : "(\\\\?\\\\begin)(\\{[a-z]*\\*?\\})",
|
||||||
next : "latexblock"
|
next : "latexblock"
|
||||||
}, {
|
}, {
|
||||||
include : "basic"
|
include : "basic"
|
||||||
@ -96,13 +96,13 @@ var MarkdownHighlightRules = function() {
|
|||||||
token : "code",
|
token : "code",
|
||||||
regex : "(`+)(.*?[^`])(\\1)"
|
regex : "(`+)(.*?[^`])(\\1)"
|
||||||
}, { // reference
|
}, { // reference
|
||||||
token : ["text", "reference", "text", "markup.underline", "description", "text"],
|
token : ["text", "reference", "text", "link", "description", "text"],
|
||||||
regex : "^([ ]{0,3}\\[)([^\\]]+)(\\]:\\s*)([^ ]+)(\\s*(?:[\"][^\"]+[\"])?(\\s*))$"
|
regex : "^([ ]{0,3}\\[)([^\\]]+)(\\]:\\s*)([^ ]+)(\\s*(?:[\"][^\"]+[\"])?(\\s*))$"
|
||||||
}, { // link by reference
|
}, { // link by reference
|
||||||
token : ["text", "description", "text", "markup.underline", "text"],
|
token : ["text", "markup.underline", "text", "reference", "text"],
|
||||||
regex : "(\\[)((?:[[^\\]]*\\]|[^\\[\\]])*)(\\][ ]?(?:\\n[ ]*)?\\[)(.*?)(\\])"
|
regex : "(\\[)((?:[[^\\]]*\\]|[^\\[\\]])*)(\\][ ]?(?:\\n[ ]*)?\\[)(.*?)(\\])"
|
||||||
}, { // link by url
|
}, { // link by url
|
||||||
token : ["text", "description", "text", "markup.underline", "string", "text"],
|
token : ["text", "markup.underline", "text", "link", "description", "text"],
|
||||||
regex : "(\\[)"+
|
regex : "(\\[)"+
|
||||||
"(\\[[^\\]]*\\]|[^\\[\\]]*)"+
|
"(\\[[^\\]]*\\]|[^\\[\\]]*)"+
|
||||||
"(\\]\\([ \\t]*)"+
|
"(\\]\\([ \\t]*)"+
|
||||||
@ -186,8 +186,8 @@ var MarkdownHighlightRules = function() {
|
|||||||
} ],
|
} ],
|
||||||
|
|
||||||
"latexblock" : [{
|
"latexblock" : [{
|
||||||
token : "keyword",
|
token : ["keyword", "text"],
|
||||||
regex : "\\\\?\\\\end\\{[a-z]*\\*?\\}",
|
regex : "(\\\\?\\\\end)(\\{[a-z]*\\*?\\})",
|
||||||
next : "start"
|
next : "start"
|
||||||
}, {
|
}, {
|
||||||
include : "latex"
|
include : "latex"
|
||||||
|
@ -16,8 +16,8 @@ define([
|
|||||||
var result;
|
var result;
|
||||||
_.find(doc.thumbnails, function(thumbnail) {
|
_.find(doc.thumbnails, function(thumbnail) {
|
||||||
var found = false;
|
var found = false;
|
||||||
thumbnail.url.replace(/(.*\/s)\d.*?(\/[^\/]+)/, function(match, sub1, sub2) {
|
thumbnail.url.replace(/^(.*[\/=]s)\d.*?(\/[^\/]+)?$/, function(match, sub1, sub2) {
|
||||||
result = sub1 + size + sub2;
|
result = sub1 + size + (sub2 || '');
|
||||||
found = true;
|
found = true;
|
||||||
});
|
});
|
||||||
return found;
|
return found;
|
||||||
|
@ -18,9 +18,9 @@
|
|||||||
@secondary-bg-light: lighten(@secondary-bg, 7%);
|
@secondary-bg-light: lighten(@secondary-bg, 7%);
|
||||||
@secondary-bg-dark: darken(@secondary-bg, 7%);
|
@secondary-bg-dark: darken(@secondary-bg, 7%);
|
||||||
@primary-color: #333;
|
@primary-color: #333;
|
||||||
@primary-color-light: lighten(@primary-color, 13%);
|
@primary-color-light: lighten(@primary-color, 12.5%);
|
||||||
@primary-color-lighter: lighten(@primary-color, 20%);
|
@primary-color-lighter: lighten(@primary-color, 25%);
|
||||||
@primary-color-lightest: lighten(@primary-color, 35%);
|
@primary-color-lightest: lighten(@primary-color, 37.5%);
|
||||||
@primary-color-inv: #fff;
|
@primary-color-inv: #fff;
|
||||||
@bg-navbar-hover: @primary-bg-lighter;
|
@bg-navbar-hover: @primary-bg-lighter;
|
||||||
@error-border: #ff8661;
|
@error-border: #ff8661;
|
||||||
@ -972,7 +972,7 @@ ul,ol {
|
|||||||
*****************************/
|
*****************************/
|
||||||
|
|
||||||
.ace_editor {
|
.ace_editor {
|
||||||
color: @primary-color-light;
|
color: @primary-color-lighter;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace-tm {
|
.ace-tm {
|
||||||
@ -996,7 +996,7 @@ ul,ol {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.ace_markup.ace_list {
|
.ace_markup.ace_list {
|
||||||
color: @primary-color-lightest;
|
color: @primary-color;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace_constant.ace_language {
|
.ace_constant.ace_language {
|
||||||
@ -1051,13 +1051,18 @@ ul,ol {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.ace_description {
|
.ace_description {
|
||||||
color: @primary-color-lighter;
|
color: @primary-color-lightest;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace_constant {
|
.ace_constant {
|
||||||
color: @primary-color-light;
|
color: @primary-color-light;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ace_comment {
|
||||||
|
color: fade(@primary-color-lighter, 50%);
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
.ace_marker-layer .misspelled {
|
.ace_marker-layer .misspelled {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: -2;
|
z-index: -2;
|
||||||
|
@ -8,9 +8,9 @@
|
|||||||
@secondary-bg-light: darken(@secondary-bg, 7%);
|
@secondary-bg-light: darken(@secondary-bg, 7%);
|
||||||
@secondary-bg-dark: lighten(@secondary-bg, 7%);
|
@secondary-bg-dark: lighten(@secondary-bg, 7%);
|
||||||
@primary-color: #fff;
|
@primary-color: #fff;
|
||||||
@primary-color-light: darken(@primary-color, 13%);
|
@primary-color-light: darken(@primary-color, 12.5%);
|
||||||
@primary-color-lighter: darken(@primary-color, 20%);
|
@primary-color-lighter: darken(@primary-color, 25%);
|
||||||
@primary-color-lightest: darken(@primary-color, 35%);
|
@primary-color-lightest: darken(@primary-color, 37.5%);
|
||||||
@primary-color-inv: #fff;
|
@primary-color-inv: #fff;
|
||||||
@disabled-color: #999;
|
@disabled-color: #999;
|
||||||
@panel-button-color: #777;
|
@panel-button-color: #777;
|
||||||
|
@ -9,9 +9,6 @@
|
|||||||
@navbar-default-bg: darken(@board-color, 2%);
|
@navbar-default-bg: darken(@board-color, 2%);
|
||||||
@bg-navbar-hover: lighten(@board-color, 4%);
|
@bg-navbar-hover: lighten(@board-color, 4%);
|
||||||
@primary-color: @blue-ink;
|
@primary-color: @blue-ink;
|
||||||
@primary-color-light: lighten(@primary-color, 13%);
|
|
||||||
@primary-color-lighter: lighten(@primary-color, 20%);
|
|
||||||
@primary-color-lightest: lighten(@primary-color, 35%);
|
|
||||||
@primary-bg: lighten(@board-border-color, 16%);
|
@primary-bg: lighten(@board-border-color, 16%);
|
||||||
@primary-bg-light: lighten(@board-border-color, 20%);
|
@primary-bg-light: lighten(@board-border-color, 20%);
|
||||||
@primary-bg-lighter: lighten(@board-border-color, 24%);
|
@primary-bg-lighter: lighten(@board-border-color, 24%);
|
||||||
@ -77,6 +74,10 @@
|
|||||||
.ace_code_block {
|
.ace_code_block {
|
||||||
color: @green-ink;
|
color: @green-ink;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ace_comment {
|
||||||
|
color: @green-ink;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
h1, h2, h3, h4, h5, h6 {
|
h1, h2, h3, h4, h5, h6 {
|
||||||
|
Loading…
Reference in New Issue
Block a user