Skip to content

Commit

Permalink
Fix Callouts Test
Browse files Browse the repository at this point in the history
Amend the new syntax test for callout lists by providing consecutive
callout numbers, so that Asciidoctor can build the HTML document
without error.

Create a copy of the original test (disjointed numbering sequence)
with `.adoc` extension, so that it will be ignored by the Rake task
that builds the HTML docs from the test files.
  • Loading branch information
tajmone committed Feb 3, 2024
1 parent da9d434 commit 09018ac
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 40 deletions.
49 changes: 49 additions & 0 deletions Tests/lists/syntax_test_Callout-Lists.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// SYNTAX TEST "Packages/ST4-Asciidoctor/Syntaxes/Asciidoctor.sublime-syntax"

////
NOTE: This file is excluded from Rake's conversion to HTML because the non
sequential numbering of the callout list fails Asciidoctor conversion.
////

[source,ruby]
-----------------------
require 'sinatra' <1>
get '/hi' do <42> <333>
"Hello World!"
end
-----------------------

<1> Library import
//<- string.unquoted.list.callout.asciidoc
//<- constant.numeric.callout.asciidoc
//<- punctuation.definition.calloutlistnumber.begin.asciidoc
//<- string.unquoted.list.callout.asciidoc
//<- constant.numeric.callout.asciidoc
//^ string.unquoted.list.callout.asciidoc
//^ constant.numeric.callout.asciidoc
//^ punctuation.definition.calloutlistnumber.end.asciidoc
<42> URL mapping
//<- string.unquoted.list.callout.asciidoc
//<- constant.numeric.callout.asciidoc
//<- punctuation.definition.calloutlistnumber.begin.asciidoc
//<- string.unquoted.list.callout.asciidoc
//<- constant.numeric.callout.asciidoc
//<- string.unquoted.list.callout.asciidoc
//<- constant.numeric.callout.asciidoc
// ^ string.unquoted.list.callout.asciidoc
// ^ constant.numeric.callout.asciidoc
// ^ punctuation.definition.calloutlistnumber.end.asciidoc
<333> Response block
//<- string.unquoted.list.callout.asciidoc
//<- constant.numeric.callout.asciidoc
//<- punctuation.definition.calloutlistnumber.begin.asciidoc
//<- string.unquoted.list.callout.asciidoc
//<- constant.numeric.callout.asciidoc
//<- string.unquoted.list.callout.asciidoc
//<- constant.numeric.callout.asciidoc
//<- string.unquoted.list.callout.asciidoc
//<- constant.numeric.callout.asciidoc
// ^ string.unquoted.list.callout.asciidoc
// ^ constant.numeric.callout.asciidoc
// ^ punctuation.definition.calloutlistnumber.end.asciidoc
60 changes: 30 additions & 30 deletions Tests/lists/syntax_test_Callout-Lists.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,60 +2,60 @@
= Callout List

AsciiDoc Documentation reference:
https://docs.asciidoctor.org/asciidoc/latest/verbatim/callouts/[Callout Lists^]
https://docstor.org/asciidoc/latest/verbatim/callouts/[Callout Lists^]

== Callout Lists

[.big.red]*Source*

[source,asciidoc]
......................................
[source,ruby]
-----------------------
require 'sinatra' <1>
get '/hi' do <42> <333>
get '/hi' do <2> <3>
"Hello World!"
end
-----------------------
<1> Library import
<42> URL mapping
<333> Response block
<2> URL mapping
<3> Response block
......................................


[.big.red]*Result*

////
NOTE: In the first test below we're forced to add two spaces indentation before
the callout in order to test each character, due to comment delimiter being
two-chars wide. But that's fine as far as the ST syntax goes...
////

======================================
[source,ruby]
-----------------------
require 'sinatra' <1>
get '/hi' do <42> <333>
get '/hi' do <2> <3>
"Hello World!"
end
<1> Library import
//<- string.unquoted.list.callout.asciidoc
//<- string.unquoted.list.callout.asciidoc
//^ string.unquoted.list.callout.asciidoc
//<- constant.numeric.callout.asciidoc
//<- punctuation.definition.calloutlistnumber.begin.asciidoc
//^ punctuation.definition.calloutlistnumber.end.asciidoc
<42> URL mapping
//<- string.unquoted.list.callout.asciidoc
//<- string.unquoted.list.callout.asciidoc
//^^ string.unquoted.list.callout.asciidoc
//<- constant.numeric.callout.asciidoc
//^ constant.numeric.callout.asciidoc
//<- punctuation.definition.calloutlistnumber.begin.asciidoc
// ^ punctuation.definition.calloutlistnumber.end.asciidoc
<333> Response block
//<- string.unquoted.list.callout.asciidoc
//<- string.unquoted.list.callout.asciidoc
//^^^ string.unquoted.list.callout.asciidoc
//<- constant.numeric.callout.asciidoc
//^^ constant.numeric.callout.asciidoc
//<- punctuation.definition.calloutlistnumber.begin.asciidoc
// ^ punctuation.definition.calloutlistnumber.end.asciidoc
-----------------------
<1> Library import
//^^^ string.unquoted.list.callout
//^ punctuation.definition.calloutlistnumber.begin
// ^ constant.numeric.callout
// ^ punctuation.definition.calloutlistnumber.end
<2> URL mapping
//<- string.unquoted.list.callout
//<- constant.numeric.callout
//<- punctuation.definition.calloutlistnumber.begin
<3> Response block
//^ string.unquoted.list.callout
//^ constant.numeric.callout
//^ punctuation.definition.calloutlistnumber.end
======================================

// EOF //
19 changes: 9 additions & 10 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="Asciidoctor 2.0.17">
<meta name="generator" content="Asciidoctor 2.0.20">
<meta name="author" content="Tristano Ajmone">
<title>ST4-Asciidoctor User Guide</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700">
Expand Down Expand Up @@ -85,10 +85,10 @@
ul,ol,dl{line-height:1.6;margin-bottom:1.25em;list-style-position:outside;font-family:inherit}
ul,ol{margin-left:1.5em}
ul li ul,ul li ol{margin-left:1.25em;margin-bottom:0}
ul.square li ul,ul.circle li ul,ul.disc li ul{list-style:inherit}
ul.square{list-style-type:square}
ul.circle{list-style-type:circle}
ul.disc{list-style-type:disc}
ul.square{list-style-type:square}
ul.circle ul:not([class]),ul.disc ul:not([class]),ul.square ul:not([class]){list-style:inherit}
ol li ul,ol li ol{margin-left:1.25em;margin-bottom:0}
dl dt{margin-bottom:.3125em;font-weight:bold}
dl dd{margin-bottom:1.25em}
Expand Down Expand Up @@ -209,13 +209,10 @@
.admonitionblock>table td.content{padding-left:1.125em;padding-right:1.25em;border-left:1px solid #dddddf;color:rgba(0,0,0,.6);word-wrap:anywhere}
.admonitionblock>table td.content>:last-child>:last-child{margin-bottom:0}
.exampleblock>.content{border:1px solid #e6e6e6;margin-bottom:1.25em;padding:1.25em;background:#fff;border-radius:4px}
.exampleblock>.content>:first-child{margin-top:0}
.exampleblock>.content>:last-child{margin-bottom:0}
.sidebarblock{border:1px solid #dbdbd6;margin-bottom:1.25em;padding:1.25em;background:#f3f3f2;border-radius:4px}
.sidebarblock>:first-child{margin-top:0}
.sidebarblock>:last-child{margin-bottom:0}
.sidebarblock>.content>.title{color:#7a2518;margin-top:0;text-align:center}
.exampleblock>.content>:last-child>:last-child,.exampleblock>.content .olist>ol>li:last-child>:last-child,.exampleblock>.content .ulist>ul>li:last-child>:last-child,.exampleblock>.content .qlist>ol>li:last-child>:last-child,.sidebarblock>.content>:last-child>:last-child,.sidebarblock>.content .olist>ol>li:last-child>:last-child,.sidebarblock>.content .ulist>ul>li:last-child>:last-child,.sidebarblock>.content .qlist>ol>li:last-child>:last-child{margin-bottom:0}
.exampleblock>.content>:first-child,.sidebarblock>.content>:first-child{margin-top:0}
.exampleblock>.content>:last-child,.exampleblock>.content>:last-child>:last-child,.exampleblock>.content .olist>ol>li:last-child>:last-child,.exampleblock>.content .ulist>ul>li:last-child>:last-child,.exampleblock>.content .qlist>ol>li:last-child>:last-child,.sidebarblock>.content>:last-child,.sidebarblock>.content>:last-child>:last-child,.sidebarblock>.content .olist>ol>li:last-child>:last-child,.sidebarblock>.content .ulist>ul>li:last-child>:last-child,.sidebarblock>.content .qlist>ol>li:last-child>:last-child{margin-bottom:0}
.literalblock pre,.listingblock>.content>pre{border-radius:4px;overflow-x:auto;padding:1em;font-size:.8125em}
@media screen and (min-width:768px){.literalblock pre,.listingblock>.content>pre{font-size:.90625em}}
@media screen and (min-width:1280px){.literalblock pre,.listingblock>.content>pre{font-size:1em}}
Expand Down Expand Up @@ -394,7 +391,7 @@
dt,th.tableblock,td.content,div.footnote{text-rendering:optimizeLegibility}
h1,h2,p,td.content,span.alt,summary{letter-spacing:-.01em}
p strong,td.content strong,div.footnote strong{letter-spacing:-.005em}
p,blockquote,dt,td.content,span.alt,summary{font-size:1.0625rem}
p,blockquote,dt,td.content,td.hdlist1,span.alt,summary{font-size:1.0625rem}
p{margin-bottom:1.25rem}
.sidebarblock p,.sidebarblock dt,.sidebarblock td.content,p.tableblock{font-size:1em}
.exampleblock>.content{background:#fffef7;border-color:#e0e0dc;box-shadow:0 1px 4px #e0e0dc}
Expand Down Expand Up @@ -530,7 +527,9 @@ <h2 id="accessing_the_user_guide" class="discrete">Accessing the User Guide</h2>
<h1 id="package_features" class="sect0"><a class="anchor" href="#package_features"></a>Package Features</h1>
<div class="openblock partintro">
<div class="content">
The list of editing features natively supported by the package.
<div class="paragraph">
<p>The list of editing features natively supported by the package.</p>
</div>
</div>
</div>
<div class="sect1">
Expand Down

0 comments on commit 09018ac

Please sign in to comment.