forked from GitHub/gf-core
RGL Browser: proper syntax highlighting for GF
This commit is contained in:
15
lib/doc/browse/google-code-prettify/lang-gf.js
Normal file
15
lib/doc/browse/google-code-prettify/lang-gf.js
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
/*
|
||||||
|
GF language
|
||||||
|
Customised from lang-hs.js (Haskell)
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([
|
||||||
|
["pln", /^[\t-\r ]+/, null, "\t\n\r "],
|
||||||
|
["str", /^"(?:[^\n\f\r"\\]|\\[\S\s])*(?:"|$)/, null, '"'],
|
||||||
|
// ["str", /^'(?:[^\n\f\r'\\]|\\[^&])'?/, null, "'"],
|
||||||
|
["lit", /^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)/i, null, "0123456789"]
|
||||||
|
], [
|
||||||
|
["com", /^(?:--[^\n\f\r]*|{-(?:[^-]|-+[^}-])*-})/],
|
||||||
|
["kwd", /^(?:abstract|case|cat|concrete|data|def|flags|fun|in|incomplete|instance|interface|let|lin|lincat|lindef|of|open|oper|param|pre|printname|resource|strs|table|transfer|variants|where|with)(?=[^\d'A-Za-z_]|$)/, null],
|
||||||
|
["pln", /^(?:[A-Z][\w']*\.)*[A-Za-z][\w']*/],
|
||||||
|
["pun", /^[^\d\t-\r "'A-Za-z]+/]
|
||||||
|
]), ["gf"]);
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
}
|
}
|
||||||
.kwd
|
.kwd
|
||||||
{
|
{
|
||||||
color:#008
|
color:#c0f
|
||||||
}
|
}
|
||||||
.com
|
.com
|
||||||
{
|
{
|
||||||
@@ -49,49 +49,6 @@
|
|||||||
color:red
|
color:red
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@media print,projection
|
|
||||||
{
|
|
||||||
.str
|
|
||||||
{
|
|
||||||
color:#060
|
|
||||||
}
|
|
||||||
.kwd
|
|
||||||
{
|
|
||||||
color:#006;
|
|
||||||
font-weight:bold
|
|
||||||
}
|
|
||||||
.com
|
|
||||||
{
|
|
||||||
color:#600;
|
|
||||||
font-style:italic
|
|
||||||
}
|
|
||||||
.typ
|
|
||||||
{
|
|
||||||
color:#404;
|
|
||||||
font-weight:bold
|
|
||||||
}
|
|
||||||
.lit
|
|
||||||
{
|
|
||||||
color:#044
|
|
||||||
}
|
|
||||||
.pun,.opn,.clo
|
|
||||||
{
|
|
||||||
color:#440
|
|
||||||
}
|
|
||||||
.tag
|
|
||||||
{
|
|
||||||
color:#006;
|
|
||||||
font-weight:bold
|
|
||||||
}
|
|
||||||
.atn
|
|
||||||
{
|
|
||||||
color:#404
|
|
||||||
}
|
|
||||||
.atv
|
|
||||||
{
|
|
||||||
color:#060
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pre.prettyprint
|
pre.prettyprint
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
<meta name="viewport" content="width=device-width">
|
<meta name="viewport" content="width=device-width">
|
||||||
<link rel="stylesheet" href="http://www.grammaticalframework.org/css/style.css">
|
<link rel="stylesheet" href="http://www.grammaticalframework.org/css/style.css">
|
||||||
<link rel="stylesheet" href="style.css">
|
<link rel="stylesheet" href="style.css">
|
||||||
<link rel="stylesheet" href="google-code-prettify/prettify-own.css">
|
<link rel="stylesheet" href="google-code-prettify/prettify-gf.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<header>
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
<table id="scope_list"></table>
|
<table id="scope_list"></table>
|
||||||
</div>
|
</div>
|
||||||
<div id="code" class="panel code">
|
<div id="code" class="panel code">
|
||||||
<pre class="prettyprint lang-hs linenums"></pre>
|
<pre class="prettyprint lang-gf linenums"></pre>
|
||||||
</div>
|
</div>
|
||||||
<div id="help" class="panel help">
|
<div id="help" class="panel help">
|
||||||
|
|
||||||
@@ -77,7 +77,6 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li>Some way of browsing just the API</li>
|
<li>Some way of browsing just the API</li>
|
||||||
<li>Better visual cues for functions in scope</li>
|
<li>Better visual cues for functions in scope</li>
|
||||||
<li>Customised GF syntax highlighting (currently using a Haskell default)</li>
|
|
||||||
<li>The page sometimes stalls when handling large files (in particular the dictionary modules)</li>
|
<li>The page sometimes stalls when handling large files (in particular the dictionary modules)</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@@ -85,10 +84,11 @@
|
|||||||
<br style="clear:both" />
|
<br style="clear:both" />
|
||||||
</div>
|
</div>
|
||||||
<footer id="footer">
|
<footer id="footer">
|
||||||
John J. Camilleri. <em>Updated 2012-05-15.</em>
|
John J. Camilleri. <em>Updated 2012-05-16.</em>
|
||||||
</footer>
|
</footer>
|
||||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
|
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
|
||||||
<script src="google-code-prettify/prettify.js"></script>
|
<script src="google-code-prettify/prettify.js"></script>
|
||||||
|
<script src="google-code-prettify/lang-gf.js"></script>
|
||||||
<script src="script.js"></script>
|
<script src="script.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Reference in New Issue
Block a user