10000 upgrade to Asciidoctor 2.0.x · github/markup@34a7975 · GitHub
[go: up one dir, main page]

Skip to content

Commit 34a7975

Browse files
committed
upgrade to Asciidoctor 2.0.x
- upgrade to Asciidoctor 2.0.x (starting with 2.0.5) - switch to fuzzy version match for asciidoctor gem - disable sectanchors (since they get removed by the sanitizer anyway) - use formal xref macro for interdocument xref in test - add test for toggling the document title using showtitle/!showtitle - add test to verify toc is generated at top of document when toc attribute is set
1 parent 24d25cb commit 34a7975

File tree

7 files changed

+73
-2
lines changed
10000

7 files changed

+73
-2
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ gem "org-ruby", "= 0.9.9"
1111
gem "creole", "~>0.3.6"
1212
gem "wikicloth", "=0.8.3"
1313
gem "twitter-text", "~> 1.14"
14-
gem "asciidoctor", "= 1.5.6.1"
14+
gem "asciidoctor", "~> 2.0.5"
1515
gem "rake"

lib/github/markups.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
'showtitle' => '@',
3333
'idprefix' => '',
3434
'idseparator' => '-',
35+
'sectanchors' => nil,
3536
'docname' => File.basename(filename, (extname = File.extname(filename))),
3637
'docfilesuffix' => extname,
3738
'outfilesuffix' => extname,

test/markups/README.asciidoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
= Document Title
2+
// sectanchors will be ignored
3+
:sectanchors:
24

35
== First Section
46

@@ -7,7 +9,7 @@
79

810
Refer to <<another-section>> or <<another-section-1>>.
911

10-
Navigate from {docname}{outfilesuffix} to <<another-document#,another document>>.
12+
Navigate from {docname}{outfilesuffix} to xref:another-document.asciidoc[another document].
1113

1214
== Another Section
1315

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
= Not Shown
2+
:!showtitle:
3+
4+
This test verifies the author can disable the document title by adding `:!showtitle:` to the document header.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<div>
2+
<p>This test verifies the author can disable the document title by adding <code>:!showtitle:</code> to the document header.</p>
3+
</div>

test/markups/README.toc.asciidoc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
= Document Title
2+
:toc:
3+
:toc-title: Contents
4+
5+
== Section A
6+
7+
=== Subsection A-1
8+
9+
=== Subsection A-2
10+
11+
== Section B
12+
13+
=== Subsection B-1
14+
15+
=== Subsection B-2

test/markups/README.toc.asciidoc.html

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<h1>Document Title</h1>
2+
<div>
3+
<div>Contents</div>
4+
<ul>
5+
<li>
6+
<a href="#section-a">Section A</a>
7+
<ul>
8+
<li><a href="#subsection-a-1">Subsection A-1</a></li>
9+
<li><a href="#subsection-a-2">Subsection A-2</a></li>
10+
</ul>
11+
</li>
12+
<li>
13+
<a href="#section-b">Section B</a>
14+
<ul>
15+
<li><a href="#subsection-b-1">Subsection B-1</a></li>
16+
<li><a href="#subsection-b-2">Subsection B-2</a></li>
17+
</ul>
18+
</li>
19+
</ul>
20+
</div>
21+
<div>
22+
<h2>Section A</h2>
23+
<div>
24+
<div>
25+
<h3>Subsection A-1</h3>
26+
27+
</div>
28+
<div>
29+
<h3>Subsection A-2</h3>
30+
31+
</div>
32+
</div>
33+
</div>
34+
<div>
35+
<h2>Section B</h2>
36+
<div>
37+
<div>
38+
<h3>Subsection B-1</h3>
39+
40+
</div>
41+
<div>
42+
<h3>Subsection B-2</h3>
43+
44+
</div>
45+
</div>
46+< 323B div class="diff-text-inner"></div>

0 commit comments

Comments
 (0)
0