Skip to content

Commit

Permalink
Asciidoctor: Support adoc files (#709)
Browse files Browse the repository at this point in the history
The `adoc` extension is fairly common instead for asciidoc files. Most
of our files use `asciidoc` but a few of them, notable
elasticsearch-hadoop, uses `adoc`. This fixes support for them and adds
a test for it.
  • Loading branch information
nik9000 authored Mar 15, 2019
1 parent 8139b96 commit 0cd243d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
7 changes: 7 additions & 0 deletions integtest/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ check: \
beta_expected_files beta_same_files \
experimental_expected_files experimental_same_files \
missing_include_fails_asciidoc missing_include_fails_asciidoctor \
adoc_expected_files adoc_same_files \
migration_warnings \
readme_expected_files readme_same_files \
simple_all \
Expand Down Expand Up @@ -118,6 +119,12 @@ migration_warnings: migration_warnings.asciidoc
/tmp/readme_asciidoctor: /docs_build/README.asciidoc
$(BD) --asciidoctor --doc /docs_build/README.asciidoc

/tmp/adoc_asciidoc: minimal.adoc
$(BD) --doc $^

/tmp/adoc_asciidoctor: minimal.adoc
$(BD) --asciidoctor --doc $^

# These don't declare dependencies because we don't know in general which files
# are needed to build which asciidoc files.
.PRECIOUS: /tmp/%_asciidoc # don't try to remove the directory. you can't
Expand Down
7 changes: 7 additions & 0 deletions integtest/minimal.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
= Title

== Chapter

This is a minimal viable asciidoc file for use with build_docs. The actual
contents of this paragraph aren't important but having a paragraph here
is required.
4 changes: 2 additions & 2 deletions lib/ES/Util.pm
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ sub build_chunked {
my ( $output, $died );
if ( $asciidoctor ) {
my $dest_xml = $index->basename;
$dest_xml =~ s/\.asciidoc$/\.xml/;
$dest_xml =~ s/\.a(scii)?doc$/\.xml/;
$dest_xml = $dest->file($dest_xml);

%xsltopts = (%xsltopts,
Expand Down Expand Up @@ -201,7 +201,7 @@ sub build_single {
my ( $output, $died );
if ( $asciidoctor ) {
my $dest_xml = $index->basename;
$dest_xml =~ s/\.asciidoc$/\.xml/;
$dest_xml =~ s/\.a(scii)?doc$/\.xml/;
$dest_xml = $dest->file($dest_xml);

%xsltopts = (%xsltopts,
Expand Down

0 comments on commit 0cd243d

Please sign in to comment.