-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Alan XSHL: Fix syntax: - Add missing keywords: `meta`, `transitively`, `indirectly`. - Add `literal` to predefined classes. - Create new group `hero` for highligting `hero` instance (optional). - XSL Stylesheets: integrate new `hero` syntax element. - Add to `_dev/hl/syntax-highlighting.asciidoc` new code to test predefined classes and `hero`. (see #15 and #17 for details)
- Loading branch information
Showing
8 changed files
with
366 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -438,8 +438,8 @@ <h1>Syntax Highlighting in Alan Documentation</h1> | |
<div class="details"> | ||
<span id="author" class="author">Tristano Ajmone</span><br> | ||
<span id="email" class="email"><a href="mailto:[email protected]">[email protected]</a></span><br> | ||
<span id="revnumber">v 1.0,</span> | ||
<span id="revdate">September 9, 2018</span> | ||
<span id="revnumber">v 1.1,</span> | ||
<span id="revdate">September 12, 2018</span> | ||
<br><span id="revremark">Backend: Asciidoctor’s native HTML5</span> | ||
</div> | ||
<div id="toc" class="toc2"> | ||
|
@@ -455,6 +455,7 @@ <h1>Syntax Highlighting in Alan Documentation</h1> | |
<ul class="sectlevel2"> | ||
<li><a href="#_syntax_tests">Syntax Tests</a> | ||
<ul class="sectlevel3"> | ||
<li><a href="#_predefined_classes_and_instances">Predefined Classes and Instances</a></li> | ||
<li><a href="#_quoted_identifiers">Quoted Identifiers</a> | ||
<ul class="sectlevel4"> | ||
<li><a href="#_single_quotes_escaping">Single Quotes Escaping</a></li> | ||
|
@@ -549,6 +550,62 @@ <h3 id="_syntax_tests">Syntax Tests</h3> | |
<p>Here follow some code snippets for testing both common- and edge-cases in the language and ensure they are rendered as expected.</p> | ||
</div> | ||
<div class="sect3"> | ||
<h4 id="_predefined_classes_and_instances">Predefined Classes and Instances</h4> | ||
<div class="paragraph"> | ||
<p>Although it’s usually unnecessary to highlight with separate styling the predefined Alan classes and instances (i.e. the <code>hero</code>), it might be desirable to be able to do so in tutorials and documentation, for educational purposes. | ||
For this reason, I’ve added a special highlighting group for the predefined classes, and another one for the <code>hero</code>. | ||
Both can be optionally enabled by assigning styles to them, or just be ignored (or set to the same style as normal text) to hide them in the highlighted source.</p> | ||
</div> | ||
<div class="listingblock"> | ||
<div class="content"> | ||
<pre class="highlight"><code class="language-alan" data-lang="alan">Synonyms me = hero. | ||
|
||
The basement IsA location. | ||
Description "What a dark ang gloomy place!" | ||
End The. | ||
|
||
The vampire IsA actor At basement. | ||
End The. | ||
|
||
The coffin IsA object At basement. | ||
Container taking thing. | ||
End The. | ||
|
||
ADD TO EVERY thing | ||
VERB examine | ||
Does | ||
"You examine $+1, but find nothing unusual." | ||
END VERB. | ||
END ADD TO. | ||
|
||
ADD TO EVERY string | ||
VERB 'say' | ||
Does | ||
"You say ""$$" Say This. "$$""!" | ||
END VERB. | ||
END ADD TO. | ||
|
||
ADD TO EVERY integer | ||
VERB shout | ||
Does | ||
"You shout ""$$" Say This. "$$"" out loud!" | ||
END VERB. | ||
END ADD TO. | ||
|
||
ADD TO EVERY literal | ||
VERB whisper | ||
Does | ||
"You whisper ""$$" Say This. "$$""!" | ||
END VERB. | ||
END ADD TO. | ||
|
||
-------------------------------------------------------------------------------- | ||
|
||
Start at basement.</code></pre> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="sect3"> | ||
<h4 id="_quoted_identifiers">Quoted Identifiers</h4> | ||
<div class="paragraph"> | ||
<p>Although quoted identifiers shouldn’t receive any special coloring in the highlighted code, the syntax definition must be made aware of them to prevent false-positive keywords matches for tokens inside quoted identifiers:</p> | ||
|
@@ -636,8 +693,8 @@ <h2 id="_bnf_syntax">BNF Syntax</h2> | |
</div> | ||
<div id="footer"> | ||
<div id="footer-text"> | ||
v 1.0<br> | ||
Last updated 2018-09-08 23:46:19 ora legale Europa occidentale | ||
v 1.1<br> | ||
Last updated 2018-09-12 10:59:31 ora legale Europa occidentale | ||
</div> | ||
</div> | ||
</body> | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.