Commit 78871d7a authored by Andy Wilkinson's avatar Andy Wilkinson

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
parent ea1dc85d
......@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment