Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOCS] Add : to render multiple inline macros in Asciidoctor #41615

Merged
merged 3 commits into from
May 1, 2019
Merged

[DOCS] Add : to render multiple inline macros in Asciidoctor #41615

merged 3 commits into from
May 1, 2019

Conversation

jrodewig
Copy link
Contributor

@jrodewig jrodewig commented Apr 26, 2019

Without some breaking text, Asciidoctor cannot render two consecutive inline macros without an : character. This adds that character so both AsciiDoc and AsciiDoctor render the macros as intended.

Relates to /elastic/docs#827

Asciidoctor before changes

Screen Shot 2019-04-26 at 5 37 11 PM

Asciidoctor after changes

Screen Shot 2019-04-26 at 5 35 08 PM

AsciiDoc after changes

Screen Shot 2019-04-26 at 5 34 49 PM

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-docs

@@ -35,8 +35,10 @@ required. For more information, see
{xpack-ref}/encrypting-data.html[Encrypting sensitive data in {watcher}].

`xpack.watcher.history.cleaner_service.enabled`::
added[6.3.0,Default changed to `true`.]
deprecated[7.0.0,Watcher history indices are now managed by the `watch-history-ilm-policy` ILM policy]
// {empty} attributes are included so both macros render as intended.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'd prefer to use ifdef::asciidoctor[] blocks to handle the different way to write this. I think this way works but we only need it if we're going to support both Asciidoctor and AsciiDoc with the same source exactly. I think having ifdef::asciidoctor[] will let us search for it after the migration and we can remove all of the usages. Though we could also remove all the usages of {empty}. Either way is fine, but I think ifdef::asciidoctor[] is a little more consistent.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The {empty} usage is needed to get Asciidoctor to render correctly, not AsciiDoc. I'm not sure we can remove it after migration, even if we implement ifdef::asciidoctor[].

It seems Asciidoctor won't render two consecutive inline macros without any text between. The {empty} attribute is a hacky way around that.

I'm happy to implement ifdef::asciidoctor[] if we find a better way of rendering the two inline macros in Asciidoctor. My research hasn't turned up any alternative solutions though.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work for Ascidoctor?

added:[6.3.0,Default changed to `true`.]
deprecated:[7.0.0,Watcher history indices ...]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately not.

Input

added[6.3.0,Default changed to `true`.]
deprecated[7.0.0,Watcher history indices are now managed by the `watch-history-ilm-policy` ILM policy] 

Asciidoctor output
Screen Shot 2019-05-01 at 1 50 34 PM

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the single :s between the name and the [. That is asciidoctor's native syntax. Nothing between the name and the [ is a thing we twist into place based on heuristics that don't work here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:doh: That did the trick. Fixed it up with f31252b. Thanks again for your near-infinite patience and help, @nik9000.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pushed f7ba3b0 to implement ifdef::asciidoctor[]. Thanks again, Nik!

@jrodewig jrodewig changed the title [DOCS] Add {empty} to render multiple inline macros in Asciidoctor [DOCS] Add : to render multiple inline macros in Asciidoctor May 1, 2019
Copy link
Member

@nik9000 nik9000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

This'll give us an obvious thing to clean up once we don't have to build with AsciiDoc any more!

@jrodewig jrodewig merged commit bf23246 into elastic:master May 1, 2019
@jrodewig jrodewig deleted the asciidoctor-notification-settings branch May 1, 2019 19:53
akhil10x5 pushed a commit to akhil10x5/elasticsearch that referenced this pull request May 2, 2019
gurkankaymak pushed a commit to gurkankaymak/elasticsearch that referenced this pull request May 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants