From e8d3eb13d05b82555e24e630795a404a8ea3cc2e Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Wed, 24 Jul 2019 12:37:21 -0400 Subject: [PATCH] Docs: Different edit_me overrides for asciidoctor We added support for setting `edit_url` to override the url in the `edit_me` style links used by asciidoctor. This "override" doesn't properly emulate asciidoc when you set the `edit_url` to an empty string with lines like: ``` :edit_url: ``` While we *could* make it work the same way it is a conceptual mismatch with the whole "override" mechanics. Thus I propose we change logstash to use conditional evaluation in those lines. This does the right thing for AsciiDoc and for Asciidoctor. Once we switch to the build to Asciidoctor we can drop the conditions in a cleanup change. --- docs/index.asciidoc | 5 +++++ tools/logstash-docgen/templates/index-codecs.asciidoc.erb | 5 +++++ tools/logstash-docgen/templates/index-filters.asciidoc.erb | 5 +++++ tools/logstash-docgen/templates/index-inputs.asciidoc.erb | 5 +++++ tools/logstash-docgen/templates/index-outputs.asciidoc.erb | 5 +++++ 5 files changed, 25 insertions(+) diff --git a/docs/index.asciidoc b/docs/index.asciidoc index e00bd369555..5d012c7a78d 100644 --- a/docs/index.asciidoc +++ b/docs/index.asciidoc @@ -227,7 +227,12 @@ include::static/best-practice.asciidoc[] // :edit_url: https://github.com/elastic/logstash/edit/{branch}/docs/static/troubleshooting.asciidoc include::static/troubleshooting.asciidoc[] +ifdef::asciidoctor[] +:edit_url!: +endif::[] +ifndef::asciidoctor[] :edit_url: +endif::[] // Contributing to Logstash diff --git a/tools/logstash-docgen/templates/index-codecs.asciidoc.erb b/tools/logstash-docgen/templates/index-codecs.asciidoc.erb index af0659be09b..950679f19f4 100644 --- a/tools/logstash-docgen/templates/index-codecs.asciidoc.erb +++ b/tools/logstash-docgen/templates/index-codecs.asciidoc.erb @@ -18,4 +18,9 @@ The following codec plugins are available: include::<%=plugin.type%>/<%=plugin.name%>.asciidoc[] <% end %> +ifdef::asciidoctor[] +:edit_url!: +endif::[] +ifndef::asciidoctor[] :edit_url: +endif::[] diff --git a/tools/logstash-docgen/templates/index-filters.asciidoc.erb b/tools/logstash-docgen/templates/index-filters.asciidoc.erb index 47340c5c272..68650919bf5 100644 --- a/tools/logstash-docgen/templates/index-filters.asciidoc.erb +++ b/tools/logstash-docgen/templates/index-filters.asciidoc.erb @@ -18,4 +18,9 @@ The following filter plugins are available: include::<%=plugin.type%>/<%=plugin.name%>.asciidoc[] <% end %> +ifdef::asciidoctor[] +:edit_url!: +endif::[] +ifndef::asciidoctor[] :edit_url: +endif::[] diff --git a/tools/logstash-docgen/templates/index-inputs.asciidoc.erb b/tools/logstash-docgen/templates/index-inputs.asciidoc.erb index ecc477537d1..c2a66659fe0 100644 --- a/tools/logstash-docgen/templates/index-inputs.asciidoc.erb +++ b/tools/logstash-docgen/templates/index-inputs.asciidoc.erb @@ -17,4 +17,9 @@ The following input plugins are available: include::<%=plugin.type%>/<%=plugin.name%>.asciidoc[] <% end %> +ifdef::asciidoctor[] +:edit_url!: +endif::[] +ifndef::asciidoctor[] :edit_url: +endif::[] diff --git a/tools/logstash-docgen/templates/index-outputs.asciidoc.erb b/tools/logstash-docgen/templates/index-outputs.asciidoc.erb index 6d6d241bab6..71ea1e86d99 100644 --- a/tools/logstash-docgen/templates/index-outputs.asciidoc.erb +++ b/tools/logstash-docgen/templates/index-outputs.asciidoc.erb @@ -17,4 +17,9 @@ The following output plugins are available: include::<%=plugin.type%>/<%=plugin.name%>.asciidoc[] <% end %> +ifdef::asciidoctor[] +:edit_url!: +endif::[] +ifndef::asciidoctor[] :edit_url: +endif::[]