Skip to content

Asciidoctor: Work around "cramped" include statements - #529

Merged
nik9000 merged 4 commits into
elastic:masterfrom
nik9000:asciidoctor_callouts_at_end
Jan 8, 2019
Merged

Asciidoctor: Work around "cramped" include statements#529
nik9000 merged 4 commits into
elastic:masterfrom
nik9000:asciidoctor_callouts_at_end

Conversation

@nik9000

@nik9000 nik9000 commented Jan 8, 2019

Copy link
Copy Markdown
Member

We do a fair bit of:

include::resources/1.adoc[]
include::resources/2.adoc[]

In our asciidoc files. Asciidoctor would prefer that we do:

include::resources/1.adoc[]

include::resources/2.adoc[]

but asciidoc doesn't care. To be compatible with asciidoc this works
around asciidoctor's preference, preventing the parsing error that come
about because of using these "cramped" include statements by adding a
trailing new line every time we include an asciidoc file. This is a
little crude but it works like a charm.

With this, I can now build the Elasticsearch Java REST Client reference
without --lenient and the document looks great! This is how long the
build takes with asciidoctor:

real  0m7.652s
user  0m7.080s
sys   0m0.538s

And this is how long it takes with asciidoc:

real  0m44.987s
user  0m38.715s
sys   0m6.256s

We do a fair bit of:

```
include::resources/1.adoc[]
include::resources/2.adoc[]
```

In our asciidoc files. Asciidoctor would prefer that we do:

```
include::resources/1.adoc[]

include::resources/2.adoc[]
```

but asciidoc doesn't care. To be compatible with asciidoc this works
around asciidoctor's preference, preventing the parsing error that come
about because of using these "cramped" include statements by adding a
trailing new line every time we include an asciidoc file. This is a
little crude but it works like a charm.

With this, I can now build the Elasticsearch Java REST Client reference
without `--lenient` and the document looks great! This is how long the
build takes with asciidoctor:

```
real  0m7.652s
user  0m7.080s
sys   0m0.538s
```

And this is how long it takes with asciidoc:

```
real  0m44.987s
user  0m38.715s
sys   0m6.256s
```
@nik9000
nik9000 requested a review from ddillinger January 8, 2019 16:03
@nik9000 nik9000 mentioned this pull request Jan 8, 2019
@nik9000

nik9000 commented Jan 8, 2019

Copy link
Copy Markdown
Member Author

@ddillinger I've fixed the line numbers.

@@ -0,0 +1,73 @@
require 'added/extension'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This filename is typo'd

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah. We don't need it here. I'll drop it.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No I mean literally the filename. You meant cramped but it is creamped :)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ah!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed!

@nik9000

nik9000 commented Jan 8, 2019

Copy link
Copy Markdown
Member Author

@ddillinger I've pushed a fix for your requested change. Thanks for finding it!

@ddillinger ddillinger left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

lgtm!

@nik9000
nik9000 merged commit 95dc7a3 into elastic:master Jan 8, 2019
@nik9000

nik9000 commented Jan 8, 2019

Copy link
Copy Markdown
Member Author

Thanks for keeping me honest @ddillinger!

bmorelli25 pushed a commit to bmorelli25/docs that referenced this pull request Feb 15, 2019
We do a fair bit of:

```
include::resources/1.adoc[]
include::resources/2.adoc[]
```

In our asciidoc files. Asciidoctor would prefer that we do:

```
include::resources/1.adoc[]

include::resources/2.adoc[]
```

but asciidoc doesn't care. To be compatible with asciidoc this works
around asciidoctor's preference, preventing the parsing error that come
about because of using these "cramped" include statements by adding a
trailing new line every time we include an asciidoc file. This is a
little crude but it works like a charm.

With this, I can now build the Elasticsearch Java REST Client reference
without `--lenient` and the document looks great! This is how long the
build takes with asciidoctor:

```
real  0m7.652s
user  0m7.080s
sys   0m0.538s
```

And this is how long it takes with asciidoc:

```
real  0m44.987s
user  0m38.715s
sys   0m6.256s
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants