Tighten up sourceDocumentExtensions used for single and multi-page docs

Previously, the sourceDocumentExtension used for the single-page
documentation was htmlsingleadoc and for the multi-page docs they
were adoc and htmladoc. When finding source files to render, the
Asciidoctor Maven Plugin looks for files with a name that ends with
one of the configured extensions. This resulted in the
index.htmlsingleadoc file matching the adoc extention in the
multi-page configuration in addition to the intended match for the
index.htmladoc. As a result both the single-page and multi-page
indexes were rendered when rendering the multi-page documentation.

In addition to this unwanted rendering, if the single-page index was
rendered after the multi-page index, the multi-page index would be
overwritten by the single-page index, leaving the multi-page docs with
the wrong index file. Asciidoctor uses File.listFiles() during its
source file discovery which is documented as having no guarantee
that the resulting array will be in any specific order. As a result,
there was also no guarantee about which index we'd end up with.

Closes gh-17263
This commit is contained in:
Andy Wilkinson 2019-07-19 14:55:10 +01:00
parent ea1dc85d50
commit 78871d7a5d
1 changed files with 3 additions and 3 deletions

View File

@ -1476,8 +1476,8 @@
<configuration>
<backend>html5</backend>
<sourceDocumentExtensions>
<sourceDocumentExtension>adoc</sourceDocumentExtension>
<sourceDocumentExtension>htmladoc</sourceDocumentExtension>
<sourceDocumentExtension>.adoc</sourceDocumentExtension>
<sourceDocumentExtension>.htmladoc</sourceDocumentExtension>
</sourceDocumentExtensions>
<outputDirectory>${project.build.directory}/generated-docs/reference/html</outputDirectory>
<sourceHighlighter>highlight.js</sourceHighlighter>
@ -1509,7 +1509,7 @@
<configuration>
<backend>html5</backend>
<sourceDocumentExtensions>
<sourceDocumentExtension>htmlsingleadoc</sourceDocumentExtension>
<sourceDocumentExtension>.htmlsingleadoc</sourceDocumentExtension>
</sourceDocumentExtensions>
<outputDirectory>${project.build.directory}/generated-docs/reference/htmlsingle</outputDirectory>
<sourceHighlighter>highlight.js</sourceHighlighter>