summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorShaun McCance <shaunm@redhat.com>2021-02-12 21:48:10 -0500
committerShaun McCance <shaunm@redhat.com>2021-02-12 21:48:10 -0500
commit4631313258e869cb1935851f932563282f6364f3 (patch)
treef9a6281f9d5bb77fe8cb7da1e9f485335b7cf2f1 /test
parent83285ef73649359eba97a27deb151a6758db4538 (diff)
downloadyelp-xsl-4631313258e869cb1935851f932563282f6364f3.tar.gz
Update highlight.js to 10.5+ and add SML highlighter
Fixes https://gitlab.gnome.org/GNOME/yelp-xsl/-/issues/29 highlight.js renamed cs->csharp and tex->latex, so I had to do the same. This means that the highlight.js included with yelp-xsl as of this commit might not highlight those two languages if you drop it into html built with yelp-xsl before this commit. That's a thing that could potentially happen in multiple-document sites with partial rebuilds.
Diffstat (limited to 'test')
-rw-r--r--test/syntax/source/code/csharp (renamed from test/syntax/source/code/cs)0
-rw-r--r--test/syntax/source/code/latex (renamed from test/syntax/source/code/tex)0
-rw-r--r--test/syntax/source/code/sml26
-rw-r--r--test/syntax/source/dita.dita20
-rw-r--r--test/syntax/source/docbook.docbook18
-rw-r--r--test/syntax/source/mallard.page22
6 files changed, 69 insertions, 17 deletions
diff --git a/test/syntax/source/code/cs b/test/syntax/source/code/csharp
index f58190a1..f58190a1 100644
--- a/test/syntax/source/code/cs
+++ b/test/syntax/source/code/csharp
diff --git a/test/syntax/source/code/tex b/test/syntax/source/code/latex
index 10b25557..10b25557 100644
--- a/test/syntax/source/code/tex
+++ b/test/syntax/source/code/latex
diff --git a/test/syntax/source/code/sml b/test/syntax/source/code/sml
new file mode 100644
index 00000000..954c561b
--- /dev/null
+++ b/test/syntax/source/code/sml
@@ -0,0 +1,26 @@
+structure List : LIST =
+ struct
+
+ val op + = InlineT.DfltInt.+
+
+ datatype list = datatype list
+
+ exception Empty = Empty
+
+ fun last [] = raise Empty
+ | last [x] = x
+ | last (_::r) = last r
+
+ fun loop ([], []) = EQUAL
+ | loop ([], _) = LESS
+ | loop (_, []) = GREATER
+ | loop (x :: xs, y :: ys) =
+ (case compare (x, y) of
+ EQUAL => loop (xs, ys)
+ | unequal => unequal)
+ in
+ loop
+ end
+
+ end (* structure List *)
+
diff --git a/test/syntax/source/dita.dita b/test/syntax/source/dita.dita
index c6c032fd..f6489e5b 100644
--- a/test/syntax/source/dita.dita
+++ b/test/syntax/source/dita.dita
@@ -94,16 +94,16 @@ int main(char** argv) {
</body>
</topic>
-<topic id="cs">
+<topic id="csharp">
<title>C#</title>
<body>
<section>
<title><codeph>outputclass="cs"</codeph></title>
- <codeblock outputclass="cs"><xi:include parse="text" href="code/cs"/></codeblock>
+ <codeblock outputclass="cs"><xi:include parse="text" href="code/csharp"/></codeblock>
</section>
<section>
<title><codeph>outputclass="csharp"</codeph></title>
- <codeblock outputclass="csharp"><xi:include parse="text" href="code/cs"/></codeblock>
+ <codeblock outputclass="csharp"><xi:include parse="text" href="code/csharp"/></codeblock>
</section>
</body>
</topic>
@@ -568,6 +568,16 @@ int main(char** argv) {
</body>
</topic>
+<topic id="sml">
+ <title>SML</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="sml"</codeph></title>
+ <codeblock outputclass="sml"><xi:include parse="text" href="code/sml"/></codeblock>
+ </section>
+ </body>
+</topic>
+
<topic id="sql">
<title>SQL</title>
<body>
@@ -605,11 +615,11 @@ int main(char** argv) {
<body>
<section>
<title><codeph>outputclass="tex"</codeph></title>
- <codeblock outputclass="tex"><xi:include parse="text" href="code/tex"/></codeblock>
+ <codeblock outputclass="tex"><xi:include parse="text" href="code/latex"/></codeblock>
</section>
<section>
<title><codeph>outputclass="latex"</codeph></title>
- <codeblock outputclass="latex"><xi:include parse="text" href="code/tex"/></codeblock>
+ <codeblock outputclass="latex"><xi:include parse="text" href="code/latex"/></codeblock>
</section>
</body>
</topic>
diff --git a/test/syntax/source/docbook.docbook b/test/syntax/source/docbook.docbook
index 06dd96ae..98369876 100644
--- a/test/syntax/source/docbook.docbook
+++ b/test/syntax/source/docbook.docbook
@@ -82,15 +82,15 @@ int main(char** argv) {
</example>
</section>
-<section id="cs">
+<section id="csharp">
<title>C#</title>
<example>
<title><code>language="cs"</code></title>
- <programlisting language="cs"><xi:include parse="text" href="code/cs"/></programlisting>
+ <programlisting language="cs"><xi:include parse="text" href="code/csharp"/></programlisting>
</example>
<example>
<title><code>language="csharp"</code></title>
- <programlisting language="csharp"><xi:include parse="text" href="code/cs"/></programlisting>
+ <programlisting language="csharp"><xi:include parse="text" href="code/csharp"/></programlisting>
</example>
</section>
@@ -478,6 +478,14 @@ int main(char** argv) {
</example>
</section>
+<section id="sml">
+ <title>SML</title>
+ <example>
+ <title><code>language="sml"</code></title>
+ <programlisting language="sml"><xi:include parse="text" href="code/sml"/></programlisting>
+ </example>
+</section>
+
<section id="sql">
<title>SQL</title>
<example>
@@ -510,11 +518,11 @@ int main(char** argv) {
<title>TeX</title>
<example>
<title><code>language="tex"</code></title>
- <programlisting language="tex"><xi:include parse="text" href="code/tex"/></programlisting>
+ <programlisting language="tex"><xi:include parse="text" href="code/latex"/></programlisting>
</example>
<example>
<title><code>language="latex"</code></title>
- <programlisting language="latex"><xi:include parse="text" href="code/tex"/></programlisting>
+ <programlisting language="latex"><xi:include parse="text" href="code/latex"/></programlisting>
</example>
</section>
diff --git a/test/syntax/source/mallard.page b/test/syntax/source/mallard.page
index 8ba7f925..be9902cf 100644
--- a/test/syntax/source/mallard.page
+++ b/test/syntax/source/mallard.page
@@ -102,19 +102,19 @@ int main(char** argv) {
</listing>
</section>
-<section id="cs">
+<section id="csharp">
<title>C#</title>
<listing ui:expanded="false">
<title><code>mime="text/x-csharp"</code></title>
- <code mime="text/x-csharp"><xi:include parse="text" href="code/cs"/></code>
+ <code mime="text/x-csharp"><xi:include parse="text" href="code/csharp"/></code>
</listing>
<listing ui:expanded="false">
<title><code>type="cs"</code></title>
- <code type="cs"><xi:include parse="text" href="code/cs"/></code>
+ <code type="cs"><xi:include parse="text" href="code/csharp"/></code>
</listing>
<listing ui:expanded="false">
<title><code>type="csharp"</code></title>
- <code type="csharp"><xi:include parse="text" href="code/cs"/></code>
+ <code type="csharp"><xi:include parse="text" href="code/csharp"/></code>
</listing>
</section>
@@ -650,6 +650,14 @@ int main(char** argv) {
</listing>
</section>
+<section id="sml">
+ <title>SML</title>
+ <listing ui:expanded="false">
+ <title><code>type="sml"</code></title>
+ <code type="sml"><xi:include parse="text" href="code/sml"/></code>
+ </listing>
+</section>
+
<section id="sql">
<title>SQL</title>
<listing ui:expanded="false">
@@ -678,15 +686,15 @@ int main(char** argv) {
<title>TeX</title>
<listing ui:expanded="false">
<title><code>mime="text/x-tex"</code></title>
- <code mime="text/x-tex"><xi:include parse="text" href="code/tex"/></code>
+ <code mime="text/x-tex"><xi:include parse="text" href="code/latex"/></code>
</listing>
<listing ui:expanded="false">
<title><code>type="tex"</code></title>
- <code type="tex"><xi:include parse="text" href="code/tex"/></code>
+ <code type="tex"><xi:include parse="text" href="code/latex"/></code>
</listing>
<listing ui:expanded="false">
<title><code>type="latex"</code></title>
- <code type="latex"><xi:include parse="text" href="code/tex"/></code>
+ <code type="latex"><xi:include parse="text" href="code/latex"/></code>
</listing>
</section>