Skip to content

Asciidoctor: Work around "cramped" include statements #529

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

Merged
merged 4 commits into from
Jan 8, 2019

Conversation

nik9000
Copy link
Member

@nik9000 nik9000 commented Jan 8, 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

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
Copy link
Member Author

nik9000 commented Jan 8, 2019

@ddillinger I've fixed the line numbers.

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

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
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.

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
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
Member Author

Choose a reason for hiding this comment

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

Fixed!

@nik9000
Copy link
Member Author

nik9000 commented Jan 8, 2019

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

Copy link

@ddillinger ddillinger left a comment

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
Copy link
Member Author

nik9000 commented Jan 8, 2019

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