Skip to content

Commit

Permalink
[DOCS] Remove unneeded options from [source,sql] code blocks (#42759)
Browse files Browse the repository at this point in the history
In AsciiDoc, `subs="attributes,callouts,macros"` options were required
to render `include-tagged::` in a code block.

With elastic/docs#827, Elasticsearch Reference documentation migrated
from AsciiDoc to Asciidoctor.

In Asciidoctor, the `subs="attributes,callouts,macros"` options are no
longer needed to render `include-tagged::` in a code block. This commit
removes those unneeded options.

Resolves #41589
  • Loading branch information
jrodewig committed May 31, 2019
1 parent ff597db commit e47fca9
Show file tree
Hide file tree
Showing 13 changed files with 99 additions and 100 deletions.
24 changes: 12 additions & 12 deletions docs/reference/sql/functions/date-time.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,72 +7,72 @@ experimental[]

* Extract the year from a date (`YEAR`)

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/datetime.csv-spec[year]
--------------------------------------------------

* Extract the month of the year from a date (`MONTH_OF_YEAR` or `MONTH`)

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/datetime.csv-spec[monthOfYear]
--------------------------------------------------

* Extract the week of the year from a date (`WEEK_OF_YEAR` or `WEEK`)

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/datetime.csv-spec[weekOfYear]
--------------------------------------------------

* Extract the day of the year from a date (`DAY_OF_YEAR` or `DOY`)

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/datetime.csv-spec[dayOfYear]
--------------------------------------------------

* Extract the day of the month from a date (`DAY_OF_MONTH`, `DOM`, or `DAY`)

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/datetime.csv-spec[dayOfMonth]
--------------------------------------------------

* Extract the day of the week from a date (`DAY_OF_WEEK` or `DOW`).
Monday is `1`, Tuesday is `2`, etc.

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/datetime.csv-spec[dayOfWeek]
--------------------------------------------------

* Extract the hour of the day from a date (`HOUR_OF_DAY` or `HOUR`).
Monday is `1`, Tuesday is `2`, etc.

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/datetime.csv-spec[hourOfDay]
--------------------------------------------------

* Extract the minute of the day from a date (`MINUTE_OF_DAY`).

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/datetime.csv-spec[minuteOfDay]
--------------------------------------------------

* Extract the minute of the hour from a date (`MINUTE_OF_HOUR`, `MINUTE`).

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/datetime.csv-spec[minuteOfHour]
--------------------------------------------------

* Extract the second of the minute from a date (`SECOND_OF_MINUTE`, `SECOND`).

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/datetime.csv-spec[secondOfMinute]
--------------------------------------------------
Expand All @@ -83,14 +83,14 @@ As an alternative, one can support `EXTRACT` to extract fields from datetimes.
You can run any <<sql-functions-datetime,datetime function>>
with `EXTRACT(<datetime_function> FROM <expression>)`. So

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/datetime.csv-spec[extractDayOfYear]
--------------------------------------------------

is the equivalent to

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/datetime.csv-spec[dayOfYear]
--------------------------------------------------
30 changes: 15 additions & 15 deletions docs/reference/sql/functions/operators.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,42 +9,42 @@ Boolean operator for comparing against one or multiple expressions.

* Equality (`=`)

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/filter.sql-spec[whereFieldEquality]
--------------------------------------------------

* Inequality (`<>` or `!=` or `<=>`)

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/filter.sql-spec[whereFieldNonEquality]
--------------------------------------------------

* Comparison (`<`, `<=`, `>`, `>=`)

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/filter.sql-spec[whereFieldLessThan]
--------------------------------------------------

* `BETWEEN`

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/filter.sql-spec[whereBetween]
--------------------------------------------------

* `IS NULL`/`IS NOT NULL`

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/filter.sql-spec[whereIsNotNullAndIsNull]
--------------------------------------------------

* `IN (<value1>, <value2>, ...)`

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/filter.sql-spec[whereWithInAndMultipleValues]
--------------------------------------------------
Expand All @@ -58,21 +58,21 @@ Boolean operator for evaluating one or two expressions.

* `AND`

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/filter.sql-spec[whereFieldAndComparison]
--------------------------------------------------

* `OR`

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/filter.sql-spec[whereFieldOrComparison]
--------------------------------------------------

* `NOT`

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/filter.sql-spec[whereFieldEqualityNot]
--------------------------------------------------
Expand All @@ -87,42 +87,42 @@ The result is a value of numeric type.

* Add (`+`)

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/arithmetic.sql-spec[plus]
--------------------------------------------------

* Subtract (infix `-`)

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/arithmetic.sql-spec[minus]
--------------------------------------------------

* Negate (unary `-`)

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/arithmetic.sql-spec[unaryMinus]
--------------------------------------------------

* Multiply (`*`)

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/arithmetic.sql-spec[multiply]
--------------------------------------------------

* Divide (`/`)

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/arithmetic.sql-spec[divide]
--------------------------------------------------

* https://en.wikipedia.org/wiki/Modulo_operation[Modulo] or Reminder(`%`)

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/arithmetic.sql-spec[mod]
--------------------------------------------------
4 changes: 2 additions & 2 deletions docs/reference/sql/functions/search.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ combined using the same rules as {es}'s

Typically `SCORE` is used for ordering the results of a query based on their relevance:

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
----
include-tagged::{sql-specs}/docs.csv-spec[orderByScore]
----

However, it is perfectly fine to return the score without sorting by it:

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
----
include-tagged::{sql-specs}/docs.csv-spec[scoreWithMatch]
----
Loading

0 comments on commit e47fca9

Please sign in to comment.