diff --git a/Gemfile b/Gemfile index cbd97b7b..61920ab8 100644 --- a/Gemfile +++ b/Gemfile @@ -11,5 +11,5 @@ gem "org-ruby", "= 0.9.9" gem "creole", "~>0.3.6" gem "wikicloth", "=0.8.3" gem "twitter-text", "~> 1.14" -gem "asciidoctor", "= 1.5.6.1" +gem "asciidoctor", "~> 2.0.5" gem "rake" diff --git a/lib/github/markups.rb b/lib/github/markups.rb index c900594d..ea816c75 100644 --- a/lib/github/markups.rb +++ b/lib/github/markups.rb @@ -32,6 +32,7 @@ 'showtitle' => '@', 'idprefix' => '', 'idseparator' => '-', + 'sectanchors' => nil, 'docname' => File.basename(filename, (extname = File.extname(filename))), 'docfilesuffix' => extname, 'outfilesuffix' => extname, diff --git a/test/markups/README.asciidoc b/test/markups/README.asciidoc index d3c872f7..5f65dd2b 100644 --- a/test/markups/README.asciidoc +++ b/test/markups/README.asciidoc @@ -1,4 +1,6 @@ = Document Title +// sectanchors will be ignored +:sectanchors: == First Section @@ -7,7 +9,7 @@ Refer to <> or <>. -Navigate from {docname}{outfilesuffix} to <>. +Navigate from {docname}{outfilesuffix} to xref:another-document.asciidoc[another document]. == Another Section diff --git a/test/markups/README.hidetitle.asciidoc b/test/markups/README.hidetitle.asciidoc new file mode 100644 index 00000000..38cf76b0 --- /dev/null +++ b/test/markups/README.hidetitle.asciidoc @@ -0,0 +1,4 @@ += Not Shown +:!showtitle: + +This test verifies the author can disable the document title by adding `:!showtitle:` to the document header. diff --git a/test/markups/README.hidetitle.asciidoc.html b/test/markups/README.hidetitle.asciidoc.html new file mode 100644 index 00000000..ae6b258f --- /dev/null +++ b/test/markups/README.hidetitle.asciidoc.html @@ -0,0 +1,3 @@ +
+

This test verifies the author can disable the document title by adding :!showtitle: to the document header.

+
diff --git a/test/markups/README.toc.asciidoc b/test/markups/README.toc.asciidoc new file mode 100644 index 00000000..a8e42bdd --- /dev/null +++ b/test/markups/README.toc.asciidoc @@ -0,0 +1,15 @@ += Document Title +:toc: +:toc-title: Contents + +== Section A + +=== Subsection A-1 + +=== Subsection A-2 + +== Section B + +=== Subsection B-1 + +=== Subsection B-2 diff --git a/test/markups/README.toc.asciidoc.html b/test/markups/README.toc.asciidoc.html new file mode 100644 index 00000000..e6f598cf --- /dev/null +++ b/test/markups/README.toc.asciidoc.html @@ -0,0 +1,46 @@ +

Document Title

+
+
Contents
+ +
+
+

Section A

+
+
+

Subsection A-1

+ +
+
+

Subsection A-2

+ +
+
+
+
+

Section B

+
+
+

Subsection B-1

+ +
+
+

Subsection B-2

+ +
+
+