From dd2d85175c4710df6c20b40135f1c1eaefce2101 Mon Sep 17 00:00:00 2001 From: Matthew Davidson Date: Wed, 5 Jun 2024 14:12:51 +0700 Subject: [PATCH] fix: Convert Asciidoc source blocks to gensql blocks for runnable examples in browser --- docs/modules/ROOT/partials/base/commands.adoc | 4 ++-- docs/modules/ROOT/partials/base/scalar-expressions.adoc | 4 ++-- docs/modules/ROOT/partials/base/statements/alter.adoc | 2 +- .../modules/ROOT/partials/base/statements/create-table.adoc | 2 +- docs/modules/ROOT/partials/base/statements/drop-model.adoc | 2 +- docs/modules/ROOT/partials/base/statements/drop-table.adoc | 2 +- docs/modules/ROOT/partials/base/statements/insert-into.adoc | 2 +- docs/modules/ROOT/partials/base/statements/update.adoc | 2 +- .../modules/ROOT/partials/base/table-expressions/alter.adoc | 2 +- .../ROOT/partials/base/table-expressions/insert.adoc | 2 +- .../modules/ROOT/partials/base/table-expressions/joins.adoc | 4 ++-- .../ROOT/partials/base/table-expressions/literal.adoc | 2 +- .../ROOT/partials/base/table-expressions/renaming.adoc | 2 +- .../ROOT/partials/base/table-expressions/select.adoc | 6 +++--- .../ROOT/partials/base/table-expressions/update.adoc | 2 +- .../ROOT/partials/permissive/model-expressions/given.adoc | 4 ++-- .../scalar-expressions/mutual-information-of.adoc | 4 ++-- .../permissive/scalar-expressions/probability-of.adoc | 2 +- .../ROOT/partials/permissive/statements/create-model.adoc | 2 +- .../partials/permissive/table-expressions/generate.adoc | 4 ++-- .../permissive/table-expressions/generative-join.adoc | 2 +- .../ROOT/partials/permissive/table-expressions/with.adoc | 2 +- .../partials/strict/model-expressions/conditioned-by.adoc | 4 ++-- .../partials/strict/model-expressions/constrained-by.adoc | 2 +- .../strict/scalar-expressions/mutual-information-of.adoc | 4 ++-- .../partials/strict/scalar-expressions/probability-of.adoc | 4 ++-- .../ROOT/partials/strict/statements/create-model.adoc | 2 +- .../ROOT/partials/strict/table-expressions/generate.adoc | 4 ++-- .../partials/strict/table-expressions/generative-join.adoc | 2 +- .../ROOT/partials/strict/table-expressions/with.adoc | 2 +- 30 files changed, 42 insertions(+), 42 deletions(-) diff --git a/docs/modules/ROOT/partials/base/commands.adoc b/docs/modules/ROOT/partials/base/commands.adoc index 66cb8810..3384cbd4 100644 --- a/docs/modules/ROOT/partials/base/commands.adoc +++ b/docs/modules/ROOT/partials/base/commands.adoc @@ -13,7 +13,7 @@ The `+.import+` command creates a table from a `+.csv+` file. .Import a table from a `+.csv+` file [example] ==== -[source,gensql] +[gensql] ---- .import /path/to/satellites.csv satellites ---- @@ -26,7 +26,7 @@ The `+.export+` command writes a table to disk as a `+.csv+` file. .Export a table to a `+.csv+` file [example] ==== -[source,gensql] +[gensql] ---- .export /path/to/satellites.csv satellites ---- diff --git a/docs/modules/ROOT/partials/base/scalar-expressions.adoc b/docs/modules/ROOT/partials/base/scalar-expressions.adoc index 8ab38596..f7c9dfc5 100644 --- a/docs/modules/ROOT/partials/base/scalar-expressions.adoc +++ b/docs/modules/ROOT/partials/base/scalar-expressions.adoc @@ -44,7 +44,7 @@ Basic arithmetic like multiplication, subtraction, addition, and division can be [example] ==== -[source,gensql] +[gensql] ---- SELECT PROBABILITY OF VAR Apogee_km > Apogee_km UNDER military_model ---- @@ -54,7 +54,7 @@ SELECT PROBABILITY OF VAR Apogee_km > Apogee_km UNDER military_model [example] ==== -[source,gensql] +[gensql] ---- SELECT PROBABILITY DENSITY OF VAR Apogee_km < 1000 UNDER model CONDITIONED BY VAR Users = "Military" diff --git a/docs/modules/ROOT/partials/base/statements/alter.adoc b/docs/modules/ROOT/partials/base/statements/alter.adoc index ad9f26c1..f1bda758 100644 --- a/docs/modules/ROOT/partials/base/statements/alter.adoc +++ b/docs/modules/ROOT/partials/base/statements/alter.adoc @@ -5,7 +5,7 @@ The `+ALTER+` command adds new columns to a table in the database. .Add a column to the `+satellites+` table [example] ==== -[source,gensql] +[gensql] ---- ALTER satellites ADD Swath! ---- diff --git a/docs/modules/ROOT/partials/base/statements/create-table.adoc b/docs/modules/ROOT/partials/base/statements/create-table.adoc index 2b708243..6dde0e1e 100644 --- a/docs/modules/ROOT/partials/base/statements/create-table.adoc +++ b/docs/modules/ROOT/partials/base/statements/create-table.adoc @@ -5,7 +5,7 @@ The `+CREATE TABLE+` statement assigns a name to a table so it can be referenced .Assign a name to a <> [example] ==== -[source,gensql] +[gensql] ---- CREATE TABLE launch_sites AS (Launch_Site, State) VALUES diff --git a/docs/modules/ROOT/partials/base/statements/drop-model.adoc b/docs/modules/ROOT/partials/base/statements/drop-model.adoc index aa4d7c96..dcde295d 100644 --- a/docs/modules/ROOT/partials/base/statements/drop-model.adoc +++ b/docs/modules/ROOT/partials/base/statements/drop-model.adoc @@ -4,7 +4,7 @@ The `+DROP MODEL+` statement removes a model from the database. [example] ==== -[source,gensql] +[gensql] ---- DROP MODEL model! ---- diff --git a/docs/modules/ROOT/partials/base/statements/drop-table.adoc b/docs/modules/ROOT/partials/base/statements/drop-table.adoc index 474ce9a4..83176396 100644 --- a/docs/modules/ROOT/partials/base/statements/drop-table.adoc +++ b/docs/modules/ROOT/partials/base/statements/drop-table.adoc @@ -4,7 +4,7 @@ The `+DROP TABLE+` statement removes a table from the database. [example] ==== -[source,gensql] +[gensql] ---- DROP TABLE satellites! ---- diff --git a/docs/modules/ROOT/partials/base/statements/insert-into.adoc b/docs/modules/ROOT/partials/base/statements/insert-into.adoc index 4ada0ba9..cbdb47fa 100644 --- a/docs/modules/ROOT/partials/base/statements/insert-into.adoc +++ b/docs/modules/ROOT/partials/base/statements/insert-into.adoc @@ -5,7 +5,7 @@ The `+INSERT INTO+` statement inserts a table into a table. .Insert two rows into the `+satellites+` table [example] ==== -[source,gensql] +[gensql] ---- INSERT INTO satellites (Users, Apogee_km, Perigee_km) VALUES diff --git a/docs/modules/ROOT/partials/base/statements/update.adoc b/docs/modules/ROOT/partials/base/statements/update.adoc index 4e7b19b9..7457e5f0 100644 --- a/docs/modules/ROOT/partials/base/statements/update.adoc +++ b/docs/modules/ROOT/partials/base/statements/update.adoc @@ -5,7 +5,7 @@ The `+UPDATE+` statement modifies the contents of a table in the database. .Rename a launch site [example] ==== -[source,gensql] +[gensql] ---- UPDATE satellites SET Launch_Site = "Majestic Cape Canaveral" diff --git a/docs/modules/ROOT/partials/base/table-expressions/alter.adoc b/docs/modules/ROOT/partials/base/table-expressions/alter.adoc index ca08e509..98407f13 100644 --- a/docs/modules/ROOT/partials/base/table-expressions/alter.adoc +++ b/docs/modules/ROOT/partials/base/table-expressions/alter.adoc @@ -5,7 +5,7 @@ The `+ALTER+` expression evaluates to the a copy of a table with a new empty col .Retrieve the `+satellites+` table with a new column added [example] ==== -[source,gensql] +[gensql] ---- ALTER satellites ADD Swath ---- diff --git a/docs/modules/ROOT/partials/base/table-expressions/insert.adoc b/docs/modules/ROOT/partials/base/table-expressions/insert.adoc index 8f32ab49..2d010aed 100644 --- a/docs/modules/ROOT/partials/base/table-expressions/insert.adoc +++ b/docs/modules/ROOT/partials/base/table-expressions/insert.adoc @@ -5,7 +5,7 @@ The `+INSERT+` expression evaluates to a new table with additional values. .Retrieve the `+satellites+` table with two rows inserted [example] ==== -[source,gensql] +[gensql] ---- INSERT INTO satellites (Users, Apogee_km, Perigee_km) VALUES diff --git a/docs/modules/ROOT/partials/base/table-expressions/joins.adoc b/docs/modules/ROOT/partials/base/table-expressions/joins.adoc index 5baa7a42..5c8c8b64 100644 --- a/docs/modules/ROOT/partials/base/table-expressions/joins.adoc +++ b/docs/modules/ROOT/partials/base/table-expressions/joins.adoc @@ -6,7 +6,7 @@ Join expressions combine columns from two tables into a new table. [example] ==== -[source,gensql] +[gensql] ---- satellites CROSS JOIN launch_sites ---- @@ -16,7 +16,7 @@ satellites CROSS JOIN launch_sites [example] ==== -[source,gensql] +[gensql] ---- satellites INNER JOIN launch_sites ON satellites.Launch_Site = launch_sites.Launch_Site diff --git a/docs/modules/ROOT/partials/base/table-expressions/literal.adoc b/docs/modules/ROOT/partials/base/table-expressions/literal.adoc index 1ead6a4c..4d1f3818 100644 --- a/docs/modules/ROOT/partials/base/table-expressions/literal.adoc +++ b/docs/modules/ROOT/partials/base/table-expressions/literal.adoc @@ -4,7 +4,7 @@ Tables can be expressed literally using the `+VALUES+` keyword. [example] ==== -[source,gensql] +[gensql] ---- (Users, Apogee_km, Perigee_km) VALUES ("Military", 36012, 35559), diff --git a/docs/modules/ROOT/partials/base/table-expressions/renaming.adoc b/docs/modules/ROOT/partials/base/table-expressions/renaming.adoc index 4e7e4897..e22b986d 100644 --- a/docs/modules/ROOT/partials/base/table-expressions/renaming.adoc +++ b/docs/modules/ROOT/partials/base/table-expressions/renaming.adoc @@ -4,7 +4,7 @@ Table expressions can be renamed with the `+AS+` keyword. [example] ==== -[source,gensql] +[gensql] ---- (Launch_Site, State) VALUES ("Cape Canaveral", "Florida"), diff --git a/docs/modules/ROOT/partials/base/table-expressions/select.adoc b/docs/modules/ROOT/partials/base/table-expressions/select.adoc index 63e458e1..2abc44b1 100644 --- a/docs/modules/ROOT/partials/base/table-expressions/select.adoc +++ b/docs/modules/ROOT/partials/base/table-expressions/select.adoc @@ -6,7 +6,7 @@ The `+SELECT+` expression evaluates a <> i .Retrieving an entire table [example] ==== -[source,gensql] +[gensql] ---- SELECT * FROM satellites ---- @@ -15,7 +15,7 @@ SELECT * FROM satellites .Retrieve a subset of a table's columns [example] ==== -[source,gensql] +[gensql] ---- SELECT Users, Apogee_km, Perigee_km FROM satellites ---- @@ -24,7 +24,7 @@ SELECT Users, Apogee_km, Perigee_km FROM satellites .Exclude a subset of a table's columns [example] ==== -[source,gensql] +[gensql] ---- SELECT * EXCEPT Contractor, Country_of_Operator FROM satellites ---- diff --git a/docs/modules/ROOT/partials/base/table-expressions/update.adoc b/docs/modules/ROOT/partials/base/table-expressions/update.adoc index edf981db..d66a8cb0 100644 --- a/docs/modules/ROOT/partials/base/table-expressions/update.adoc +++ b/docs/modules/ROOT/partials/base/table-expressions/update.adoc @@ -5,7 +5,7 @@ The `+UPDATE+` expression evaluates to the a copy of a table with a set of chang .Retrieve the `+satellites+` table with a launch site renamed [example] ==== -[source,gensql] +[gensql] ---- UPDATE satellites SET Launch_Site = "Majestic Cape Canaveral" diff --git a/docs/modules/ROOT/partials/permissive/model-expressions/given.adoc b/docs/modules/ROOT/partials/permissive/model-expressions/given.adoc index 6985024d..91c5b1d0 100644 --- a/docs/modules/ROOT/partials/permissive/model-expressions/given.adoc +++ b/docs/modules/ROOT/partials/permissive/model-expressions/given.adoc @@ -3,7 +3,7 @@ .Compute the probability of the satellite's period from the model, given the class of orbit. [example] ==== -[source,gensql] +[gensql] ---- SELECT PROBABILITY OF Period_minutes @@ -16,7 +16,7 @@ FROM satellites .Compute the probability of the satellite's period from the model, given everything but the period, contractor, and operator's country. [example] ==== -[source,gensql] +[gensql] ---- SELECT PROBABILITY OF Period_minutes diff --git a/docs/modules/ROOT/partials/permissive/scalar-expressions/mutual-information-of.adoc b/docs/modules/ROOT/partials/permissive/scalar-expressions/mutual-information-of.adoc index 6a39442b..40b194bc 100644 --- a/docs/modules/ROOT/partials/permissive/scalar-expressions/mutual-information-of.adoc +++ b/docs/modules/ROOT/partials/permissive/scalar-expressions/mutual-information-of.adoc @@ -2,7 +2,7 @@ [example] ==== -[source,gensql] +[gensql] ---- SELECT MUTUAL INFORMATION OF Apogee_km < 1000 @@ -14,7 +14,7 @@ FROM satellites [example] ==== -[source,gensql] +[gensql] ---- SELECT MUTUAL INFORMATION OF Apogee_km diff --git a/docs/modules/ROOT/partials/permissive/scalar-expressions/probability-of.adoc b/docs/modules/ROOT/partials/permissive/scalar-expressions/probability-of.adoc index a6e99845..d84f8f8a 100644 --- a/docs/modules/ROOT/partials/permissive/scalar-expressions/probability-of.adoc +++ b/docs/modules/ROOT/partials/permissive/scalar-expressions/probability-of.adoc @@ -2,7 +2,7 @@ [example] ==== -[source,gensql] +[gensql] ---- SELECT PROBABILITY OF Period_minutes UNDER satellites_model ---- diff --git a/docs/modules/ROOT/partials/permissive/statements/create-model.adoc b/docs/modules/ROOT/partials/permissive/statements/create-model.adoc index 509e0744..495d3836 100644 --- a/docs/modules/ROOT/partials/permissive/statements/create-model.adoc +++ b/docs/modules/ROOT/partials/permissive/statements/create-model.adoc @@ -4,7 +4,7 @@ The `+CREATE MODEL+` statement assigns a name to a model so it can be referenced [example] ==== -[source,gensql] +[gensql] ---- CREATE MODEL military_model AS satellites_model GIVEN Users = "Military"! ---- diff --git a/docs/modules/ROOT/partials/permissive/table-expressions/generate.adoc b/docs/modules/ROOT/partials/permissive/table-expressions/generate.adoc index 8bd86c9d..e7879938 100644 --- a/docs/modules/ROOT/partials/permissive/table-expressions/generate.adoc +++ b/docs/modules/ROOT/partials/permissive/table-expressions/generate.adoc @@ -7,7 +7,7 @@ WARNING: The tables returned by `+GENERATE+` are infinite. A query comprised of .Generate 10 rows of 3 columns from the model [example] ==== -[source,gensql] +[gensql] ---- SELECT * FROM @@ -23,7 +23,7 @@ LIMIT 10 .Generate 10 rows containing almost all columns from the model, but excluding 2 [example] ==== -[source,gensql] +[gensql] ---- SELECT * FROM diff --git a/docs/modules/ROOT/partials/permissive/table-expressions/generative-join.adoc b/docs/modules/ROOT/partials/permissive/table-expressions/generative-join.adoc index 63c7f848..9a91330e 100644 --- a/docs/modules/ROOT/partials/permissive/table-expressions/generative-join.adoc +++ b/docs/modules/ROOT/partials/permissive/table-expressions/generative-join.adoc @@ -4,7 +4,7 @@ The `+GENERATIVE JOIN+` expression evaluates to a table by combining a model and [example] ==== -[source,gensql] +[gensql] ---- satellites GENERATIVE JOIN satellites_model GIVEN Users AND Apogee_km AND Perigee_km ---- diff --git a/docs/modules/ROOT/partials/permissive/table-expressions/with.adoc b/docs/modules/ROOT/partials/permissive/table-expressions/with.adoc index 9845ac76..971c3064 100644 --- a/docs/modules/ROOT/partials/permissive/table-expressions/with.adoc +++ b/docs/modules/ROOT/partials/permissive/table-expressions/with.adoc @@ -4,7 +4,7 @@ The `+WITH+` keyword allows you to bind names to values for the lifetime of a qu [example] ==== -[source,gensql] +[gensql] ---- WITH (satellites_model GIVEN Users = "Military") AS military_model: SELECT PROBABILITY OF Apogee_km UNDER military_model diff --git a/docs/modules/ROOT/partials/strict/model-expressions/conditioned-by.adoc b/docs/modules/ROOT/partials/strict/model-expressions/conditioned-by.adoc index f5cc2120..2eadaa60 100644 --- a/docs/modules/ROOT/partials/strict/model-expressions/conditioned-by.adoc +++ b/docs/modules/ROOT/partials/strict/model-expressions/conditioned-by.adoc @@ -3,7 +3,7 @@ .Compute the probability density of a model variable after conditioning on another variable [example] ==== -[source,gensql] +[gensql] ---- SELECT PROBABILITY DENSITY OF VAR Apogee_km < 1000 @@ -16,7 +16,7 @@ FROM satellites_model .Compute the probability density of a model variable after conditioning on all other variables except one [example] ==== -[source,gensql] +[gensql] ---- SELECT PROBABILITY DENSITY OF VAR Apogee_km < 1000 diff --git a/docs/modules/ROOT/partials/strict/model-expressions/constrained-by.adoc b/docs/modules/ROOT/partials/strict/model-expressions/constrained-by.adoc index 31da8b18..8e34a6f3 100644 --- a/docs/modules/ROOT/partials/strict/model-expressions/constrained-by.adoc +++ b/docs/modules/ROOT/partials/strict/model-expressions/constrained-by.adoc @@ -2,7 +2,7 @@ [example] ==== -[source,gensql] +[gensql] ---- SELECT PROBABILITY OF VAR Users = "Military" diff --git a/docs/modules/ROOT/partials/strict/scalar-expressions/mutual-information-of.adoc b/docs/modules/ROOT/partials/strict/scalar-expressions/mutual-information-of.adoc index 5dffe95a..917e5d44 100644 --- a/docs/modules/ROOT/partials/strict/scalar-expressions/mutual-information-of.adoc +++ b/docs/modules/ROOT/partials/strict/scalar-expressions/mutual-information-of.adoc @@ -2,7 +2,7 @@ [example] ==== -[source,gensql] +[gensql] ---- SELECT MUTUAL INFORMATION OF VAR Apogee_km < 1000 @@ -16,7 +16,7 @@ FROM satellites [example] ==== -[source,gensql] +[gensql] ---- SELECT APPROXIMATE MUTUAL INFORMATION OF VAR Apogee_km diff --git a/docs/modules/ROOT/partials/strict/scalar-expressions/probability-of.adoc b/docs/modules/ROOT/partials/strict/scalar-expressions/probability-of.adoc index 2a91fc5e..598c7c6a 100644 --- a/docs/modules/ROOT/partials/strict/scalar-expressions/probability-of.adoc +++ b/docs/modules/ROOT/partials/strict/scalar-expressions/probability-of.adoc @@ -2,7 +2,7 @@ [example] ==== -[source,gensql] +[gensql] ---- SELECT PROBABILITY OF VAR Apogee_km > Apogee_km UNDER military_model ---- @@ -12,7 +12,7 @@ SELECT PROBABILITY OF VAR Apogee_km > Apogee_km UNDER military_model [example] ==== -[source,gensql] +[gensql] ---- SELECT PROBABILITY DENSITY OF VAR Apogee_km < 1000 UNDER model CONDITIONED BY VAR Users = "Military" diff --git a/docs/modules/ROOT/partials/strict/statements/create-model.adoc b/docs/modules/ROOT/partials/strict/statements/create-model.adoc index 2c71c822..5516160e 100644 --- a/docs/modules/ROOT/partials/strict/statements/create-model.adoc +++ b/docs/modules/ROOT/partials/strict/statements/create-model.adoc @@ -4,7 +4,7 @@ The `+CREATE MODEL+` statement assigns a name to a model so it can be referenced [example] ==== -[source,gensql] +[gensql] ---- CREATE MODEL military_model AS model CONDITIONED BY VAR Users = "Military"! ---- diff --git a/docs/modules/ROOT/partials/strict/table-expressions/generate.adoc b/docs/modules/ROOT/partials/strict/table-expressions/generate.adoc index 6b7dc726..547fd7dc 100644 --- a/docs/modules/ROOT/partials/strict/table-expressions/generate.adoc +++ b/docs/modules/ROOT/partials/strict/table-expressions/generate.adoc @@ -7,7 +7,7 @@ WARNING: The tables returned by `+GENERATE+` are infinite. A query comprised of .Generate 10 rows of three columns from the model [example] ==== -[source,gensql] +[gensql] ---- SELECT * FROM @@ -23,7 +23,7 @@ LIMIT 10 .Generate 10 rows containing almost all columns from the model, but excluding 2 [example] ==== -[source,gensql] +[gensql] ---- SELECT * FROM diff --git a/docs/modules/ROOT/partials/strict/table-expressions/generative-join.adoc b/docs/modules/ROOT/partials/strict/table-expressions/generative-join.adoc index 10e3b829..1fe8d892 100644 --- a/docs/modules/ROOT/partials/strict/table-expressions/generative-join.adoc +++ b/docs/modules/ROOT/partials/strict/table-expressions/generative-join.adoc @@ -4,7 +4,7 @@ The `+GENERATIVE JOIN+` expression evaluates to a table by combining a model and [example] ==== -[source,gensql] +[gensql] ---- satellites GENERATIVE JOIN satellites_model CONDITIONED BY VAR Users = Users AND VAR Apogee_km = Apogee_km AND VAR Perigee_km = Perigee_km ---- diff --git a/docs/modules/ROOT/partials/strict/table-expressions/with.adoc b/docs/modules/ROOT/partials/strict/table-expressions/with.adoc index 5e8c7694..d8caafea 100644 --- a/docs/modules/ROOT/partials/strict/table-expressions/with.adoc +++ b/docs/modules/ROOT/partials/strict/table-expressions/with.adoc @@ -4,7 +4,7 @@ The `+WITH+` keyword allows you to bind names to values for the lifetime of a qu [example] ==== -[source,gensql] +[gensql] ---- WITH (satellites_model CONDITIONED BY VAR Users = "Military") AS military_model: SELECT PROBABILITY OF VAR Apogee_km > Apogee_km UNDER military_model