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

Switch Painless reference to Asciidoctor #783

Merged
merged 1 commit into from
Apr 8, 2019

Conversation

nik9000
Copy link
Member

@nik9000 nik9000 commented Apr 3, 2019

Switches the painless reference book from the no-longer-maintained
AsciiDoc backend to the actively-maintained Asciidoctor backend. In the
process this speeds up the build by a factor of three.

Switches the painless reference book from the no-longer-maintained
AsciiDoc backend to the actively-maintained Asciidoctor backend. In the
process this speeds up the build by a factor of three.
@nik9000 nik9000 requested a review from lcawl April 3, 2019 17:53
@nik9000
Copy link
Member Author

nik9000 commented Apr 3, 2019

This needs elastic/elasticsearch#40805 and maybe others.

@nik9000 nik9000 mentioned this pull request Apr 3, 2019
@lcawl
Copy link
Contributor

lcawl commented Apr 3, 2019

The build is successful with elastic/elasticsearch#40805 but I haven't compared the diffs

@nik9000
Copy link
Member Author

nik9000 commented Apr 3, 2019 via email

@nik9000
Copy link
Member Author

nik9000 commented Apr 4, 2019

Here is a summary of the diff:

painless-types.html:

-AsciiDoc
+Asciidoctor
@@ -746,11 +746,7 @@
               </span>
              </dt>
              <dd>
-              A 32-bit, signed, two’s complement integer. Range: [-2
-              <sup>
-               32, 2
-              </sup>
-              32-1]. Default value: 0. Reference type: Integer.
+              A 32-bit, signed, two’s complement integer. Range: [-2^32, 2^32-1]. Default value: 0. Reference type: Integer.
              </dd>
              <dt>
               <span class="term">
@@ -758,11 +754,7 @@
               </span>
              </dt>
              <dd>
-              A 64-bit, signed, two’s complement integer. Range: [-2
-              <sup>
-               64, 2
-              </sup>
-              64-1]. Default value: 0. Reference type: Long.
+              A 64-bit, signed, two’s complement integer. Range: [-2^64, 2^64-1]. Default value: 0. Reference type: Long.
              </dd>
              <dt>
               <span class="term">

Asciidoc is better here. The <sup> is great but it is in the wrong spot.... Asciidoctor doesn't make it at all. If we ant to make it right we'd but ^ around the 32 and 64.

painless-operators.html:

-AsciiDoc
+Asciidoctor
@@ -906,7 +906,7 @@
               </td>
               <td align="left" valign="top">
                <p>
-                --
+
                </p>
               </td>
               <td align="left" valign="top">
@@ -950,7 +950,7 @@
               </td>
               <td align="left" valign="top">
                <p>
-                --
+
                </p>
               </td>
               <td align="left" valign="top">

Either way is fine by me.

painless-execute-api.html:

-AsciiDoc
+Asciidoctor
@@ -753,14 +753,26 @@
              </code>
              , which can be used to access user defined values. The result of the script is always converted to a string. If no context is specified then this context is used by default.
             </p>
-            <p>
-             ====== Example
-            </p>
-            <p>
-             Request:
-            </p>
-            <div class="pre_wrapper">
-             <pre class="programlisting prettyprint lang-console">POST /_scripts/painless/_execute
+            <div class="section">
+             <div class="titlepage">
+              <div>
+               <div>
+                <h5 class="title">
+                 <a id="_example">
+                 </a>
+                 Example
+                 <a class="edit_me" href="https://github.com/elastic/elasticsearch/edit/6.5/docs/painless/painless-execute-script.asciidoc" rel="nofollow" title="Edit this page on GitHub">
+                  edit
+                 </a>
+                </h5>
+               </div>
+              </div>
+             </div>
+             <p>
+              Request:
+             </p>
+             <div class="pre_wrapper">
+              <pre class="programlisting prettyprint lang-console">POST /_scripts/painless/_execute
 {
   "script": {
     "source": "params.count / params.total",
@@ -770,16 +782,17 @@
     }
   }
 }</pre>
-            </div>
-            <div class="console_widget" data-snippet="snippet">
-            </div>
-            <p>
-             Response:
-            </p>
-            <div class="pre_wrapper">
-             <pre class="programlisting prettyprint lang-console">{
+             </div>
+             <div class="console_widget" data-snippet="snippet">
+             </div>
+             <p>
+              Response:
+             </p>
+             <div class="pre_wrapper">
+              <pre class="programlisting prettyprint lang-console">{
   "result": "0.1"
 }</pre>
+             </div>
             </div>
            </div>
            <div class="section">
@@ -835,11 +848,23 @@
               </dd>
              </dl>
             </div>
-            <p>
-             ====== Example
-            </p>
-            <div class="pre_wrapper">
-             <pre class="programlisting prettyprint lang-console">PUT /my-index
+            <div class="section">
+             <div class="titlepage">
+              <div>
+               <div>
+                <h5 class="title">
+                 <a id="_example_2">
+                 </a>
+                 Example
+                 <a class="edit_me" href="https://github.com/elastic/elasticsearch/edit/6.5/docs/painless/painless-execute-script.asciidoc" rel="nofollow" title="Edit this page on GitHub">
+                  edit
+                 </a>
+                </h5>
+               </div>
+              </div>
+             </div>
+             <div class="pre_wrapper">
+              <pre class="programlisting prettyprint lang-console">PUT /my-index
 {
   "mappings": {
     "_doc": {
@@ -868,16 +893,17 @@
     }
   }
 }</pre>
-            </div>
-            <div class="console_widget" data-snippet="snippet">
-            </div>
-            <p>
-             Response:
-            </p>
-            <div class="pre_wrapper">
-             <pre class="programlisting prettyprint lang-console">{
+             </div>
+             <div class="console_widget" data-snippet="snippet">
+             </div>
+             <p>
+              Response:
+             </p>
+             <div class="pre_wrapper">
+              <pre class="programlisting prettyprint lang-console">{
   "result": true
 }</pre>
+             </div>
             </div>
            </div>
            <div class="section">
@@ -949,11 +975,23 @@
               </dd>
              </dl>
             </div>
-            <p>
-             ====== Example
-            </p>
-            <div class="pre_wrapper">
-             <pre class="programlisting prettyprint lang-console">PUT /my-index
+            <div class="section">
+             <div class="titlepage">
+              <div>
+               <div>
+                <h5 class="title">
+                 <a id="_example_3">
+                 </a>
+                 Example
+                 <a class="edit_me" href="https://github.com/elastic/elasticsearch/edit/6.5/docs/painless/painless-execute-script.asciidoc" rel="nofollow" title="Edit this page on GitHub">
+                  edit
+                 </a>
+                </h5>
+               </div>
+              </div>
+             </div>
+             <div class="pre_wrapper">
+              <pre class="programlisting prettyprint lang-console">PUT /my-index
 {
   "mappings": {
     "_doc": {
@@ -986,16 +1024,17 @@
     }
   }
 }</pre>
-            </div>
-            <div class="console_widget" data-snippet="snippet">
-            </div>
-            <p>
-             Response:
-            </p>
-            <div class="pre_wrapper">
-             <pre class="programlisting prettyprint lang-console">{
+             </div>
+             <div class="console_widget" data-snippet="snippet">
+             </div>
+             <p>
+              Response:
+             </p>
+             <div class="pre_wrapper">
+              <pre class="programlisting prettyprint lang-console">{
   "result": 0.8
 }</pre>
+             </div>
             </div>
            </div>
           </div>

It looks like asciidoctor is fixing a bug for us!

painless-bucket-script-agg-context.html:

-AsciiDoc
+Asciidoctor
@@ -689,7 +689,7 @@
             <div>
              <div>
               <h3 class="title">
-               <a id="_example">
+               <a id="_example_4">
                </a>
                Example
                <a class="edit_me" href="https://github.com/elastic/elasticsearch/edit/6.5/docs/painless/painless-contexts/painless-bucket-script-agg-context.asciidoc" rel="nofollow" title="Edit this page on GitHub">

This isn't great but not too big a deal.

@nik9000 nik9000 marked this pull request as ready for review April 4, 2019 15:56
@nik9000
Copy link
Member Author

nik9000 commented Apr 4, 2019

@lcawl this is ready for you when you have a chance!

@nik9000 nik9000 merged commit 9e6f396 into elastic:master Apr 8, 2019
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