book_generator/static/js/lib/org.min.js

83 lines
1.9 KiB
JavaScript

<html>
<head><title>404 Not Found</title></head>
<body>
<center><h1>404 Not Found</h1></center>
<hr><center>nginx</center>
</body>
</html>
CodeMirror.defineMode("org", function () {
return {
token: function (stream, state) {
// Titres
if (stream.match(/^\*+\s/)) {
stream.skipToEnd();
return "header";
}
// Commentaires
if (stream.match(/^#\s/)) {
stream.skipToEnd();
return "comment";
}
// Blocs de commentaires
if (stream.match(/^#\+BEGIN_COMMENT/)) {
state.inComment = true;
return "comment";
}
if (state.inComment && stream.match(/^#\+END_COMMENT/)) {
state.inComment = false;
return "comment";
}
if (state.inComment) {
stream.skipToEnd();
return "comment";
}
// Blocs de code
if (stream.match(/^#\+BEGIN_SRC/)) {
state.inCode = true;
return "comment";
}
if (state.inCode && stream.match(/^#\+END_SRC/)) {
state.inCode = false;
return "comment";
}
if (state.inCode) {
stream.skipToEnd();
return "string";
}
// Citations
if (stream.match(/^#\+BEGIN_QUOTE/)) {
state.inQuote = true;
return "comment";
}
if (state.inQuote && stream.match(/^#\+END_QUOTE/)) {
state.inQuote = false;
return "comment";
}
if (state.inQuote) {
stream.skipToEnd();
return "string";
}
// Liens
if (stream.match(/\[\[(.*?)\]\]/)) {
return "link";
}
// Texte normal
stream.next();
return null;
},
startState: function () {
return {
inComment: false,
inCode: false,
inQuote: false
};
}
};
});