Repository: calcite Updated Branches: refs/heads/master fdbb81cf2 -> 24df135e9
Site: Rename pig and file adapter docs; remove whitespace per file in nav menu Project: http://git-wip-us.apache.org/repos/asf/calcite/repo Commit: http://git-wip-us.apache.org/repos/asf/calcite/commit/24df135e Tree: http://git-wip-us.apache.org/repos/asf/calcite/tree/24df135e Diff: http://git-wip-us.apache.org/repos/asf/calcite/diff/24df135e Branch: refs/heads/master Commit: 24df135e976ade48147c6d7f8d8302ae3aced9ce Parents: fdbb81c Author: Julian Hyde <[email protected]> Authored: Wed Mar 1 11:50:42 2017 -0800 Committer: Julian Hyde <[email protected]> Committed: Wed Mar 1 11:50:42 2017 -0800 ---------------------------------------------------------------------- site/_docs/adapter.md | 4 +- site/_docs/file.md | 236 -------------------------- site/_docs/file_adapter.md | 236 ++++++++++++++++++++++++++ site/_docs/pig.md | 90 ---------- site/_docs/pig_adapter.md | 90 ++++++++++ site/_includes/docs_contents_mobile.html | 9 +- site/_includes/docs_option.html | 20 +-- 7 files changed, 342 insertions(+), 343 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/calcite/blob/24df135e/site/_docs/adapter.md ---------------------------------------------------------------------- diff --git a/site/_docs/adapter.md b/site/_docs/adapter.md index 7597fad..ab585d4 100644 --- a/site/_docs/adapter.md +++ b/site/_docs/adapter.md @@ -31,10 +31,10 @@ presenting the data as tables within a schema. * CSV adapter (<a href="{{ site.apiRoot }}/org/apache/calcite/adapter/csv/package-summary.html">example/csv</a>) * [Druid adapter](druid_adapter.html) (<a href="{{ site.apiRoot }}/org/apache/calcite/adapter/druid/package-summary.html">calcite-druid</a>) * [Elasticsearch adapter](elasticsearch_adapter.html) (<a href="{{ site.apiRoot }}/org/apache/calcite/adapter/elasticsearch/package-summary.html">calcite-elasticsearch</a>) -* [File adapter](file.html) (<a href="{{ site.apiRoot }}/org/apache/calcite/adapter/file/package-summary.html">calcite-file</a>) +* [File adapter](file_adapter.html) (<a href="{{ site.apiRoot }}/org/apache/calcite/adapter/file/package-summary.html">calcite-file</a>) * JDBC adapter (part of <a href="{{ site.apiRoot }}/org/apache/calcite/adapter/jdbc/package-summary.html">calcite-core</a>) * MongoDB adapter (<a href="{{ site.apiRoot }}/org/apache/calcite/adapter/mongodb/package-summary.html">calcite-mongodb</a>) -* [Pig adapter](pig.html) (<a href="{{ site.apiRoot }}/org/apache/calcite/adapter/pig/package-summary.html">calcite-pig</a>) +* [Pig adapter](pig_adapter.html) (<a href="{{ site.apiRoot }}/org/apache/calcite/adapter/pig/package-summary.html">calcite-pig</a>) * Solr cloud adapter (<a href="https://github.com/bluejoe2008/solr-sql">solr-sql</a>) * Spark adapter (<a href="{{ site.apiRoot }}/org/apache/calcite/adapter/spark/package-summary.html">calcite-spark</a>) * Splunk adapter (<a href="{{ site.apiRoot }}/org/apache/calcite/adapter/splunk/package-summary.html">calcite-splunk</a>) http://git-wip-us.apache.org/repos/asf/calcite/blob/24df135e/site/_docs/file.md ---------------------------------------------------------------------- diff --git a/site/_docs/file.md b/site/_docs/file.md deleted file mode 100644 index 9a07f2e..0000000 --- a/site/_docs/file.md +++ /dev/null @@ -1,236 +0,0 @@ ---- -layout: docs -title: File adapter -permalink: /docs/file.html ---- -<!-- -{% comment %} -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to you under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -{% endcomment %} ---> - -# Overview - -The file adapter is able to read files in a variety of formats, -and can also read files over various protocols, such as HTTP. - -For example if you define: - -* States - http://en.wikipedia.org/wiki/List_of_states_and_territories_of_the_United_States -* Cities - http://en.wikipedia.org/wiki/List_of_United_States_cities_by_population - -You can then write a query like: - -{% highlight sql %} -select - count(*) "City Count", - sum(100 * c."Population" / s."Population") "Pct State Population" -from "Cities" c, "States" s -where c."State" = s."State" and s."State" = 'California'; -{% endhighlight %} - -And learn that California has 69 cities of 100k or more -comprising almost 1/2 of the state's population: - -``` -+---------------------+----------------------+ -| City Count | Pct State Population | -+---------------------+----------------------+ -| 69 | 48.574217177106576 | -+---------------------+----------------------+ -``` - -# A simple example - -Let's start with a simple example. First, we need a -[model definition]({{ site.baseurl }}/docs/model.html), -as follows. - -{% highlight json %} -{ - "version": "1.0", - "defaultSchema": "SALES", - "schemas": [ { - "name": "SALES", - "type": "custom", - "factory": "org.apache.calcite.adapter.file.FileSchemaFactory", - "operand": { - "tables": { - "name": "EMPS", - "url": "file:file/src/test/resources/sales/EMPS.html" - }, { - "name": "DEPTS" - "url": "file:file/src/test/resources/sales/DEPTS.html" - } - } - ] -} -{% endhighlight %} - -Schemas are defined as a list of tables, each containing minimally a -table name and a url. If a page has more than one table, you can -include in a table definition `selector` and `index` fields to specify the -desired table. If there is no table specification, the file adapter -chooses the largest table on the page. - -`EMPS.html` contains a single HTML table: - -{% highllight xml %} -<html> - <body> - <table> - <thead> - <tr> - <th>EMPNO</th> - <th>NAME</th> - <th>DEPTNO</th> - </tr> - </thead> - <tbody> - <tr> - <td>100</td> - <td>Fred</td> - <td>30</td> - </tr> - <tr> - <td>110</td> - <td>Eric</td> - <td>20</td> - </tr> - <tr> - <td>110</td> - <td>John</td> - <td>40</td> - </tr> - <tr> - <td>120</td> - <td>Wilma</td> - <td>20</td> - </tr> - <tr> - <td>130</td> - <td>Alice</td> - <td>40</td> - </tr> - </tbody> - </table> - </body> -</html> -{% endhighlight %} - -The model file is stored as `file/src/test/resources/sales.json`, -so you can connect via [`sqlline`](https://github.com/julianhyde/sqlline) -as follows: - -{% highlight bash %} -$ ./sqlline -sqlline> !connect jdbc:calcite:model=file/src/test/resources/sales.json admin admin -sqlline> select * from sales.emps; -+-------+--------+------+ -| EMPNO | DEPTNO | NAME | -+-------+--------+------+ -| 100 | 30 | Fred | -| 110 | 20 | Eric | -| 110 | 40 | John | -| 120 | 20 | Wilma | -| 130 | 40 | Alice | -+-------+--------+------+ -5 rows selected -{% endhighlight %} - -# Mapping tables - -Now for a more complex example. This time we connect to Wikipedia via -HTTP, read pages for US states and cities, and extract data from HTML -tables on those pages. The tables have more complex formats, and the -file adapter helps us locate and parse data in those tables. - -Tables can be simply defined for immediate gratification: - -{% highlight json %} -{ - tableName: "RawCities", - url: "http://en.wikipedia.org/wiki/List_of_United_States_cities_by_population" -} -{% endhighlight %} - -And subsequently refined for better usability / querying: - -{% highlight json %} -{ - tableName: "Cities", - url: "http://en.wikipedia.org/wiki/List_of_United_States_cities_by_population", - path: "#mw-content-text > table.wikitable.sortable", - index: 0, - fieldDefs: [ - {th: "2012 rank", name: "Rank", type: "int", pattern: "(\\d+)", matchGroup: 0}, - {th: "City", selector: "a", selectedElement: 0}, - {th: "State[5]", name: "State", selector: "a:eq(0)"}, - {th: "2012 estimate", name: "Population", type: "double"}, - {th: "2010 Census", skip: "true"}, - {th: "Change", skip: "true"}, - {th: "2012 land area", name: "Land Area (sq mi)", type: "double", selector: ":not(span)"}, - {th: "2012 population density", skip: "true"}, - {th: "ANSI", skip: "true"} - ] -} -{% endhighlight %} - -Connect and execute queries, as follows. - -{% highlight bash %} -$ ./sqlline -sqlline> !connect jdbc:calcite:model=file/src/test/resources/wiki.json admin admin -sqlline> select * from wiki."RawCities"; -sqlline> select * from wiki."Cities"; -{% endhighlight %} - -Note that `Cities` is easier to consume than `RawCities`, -because its table definition has a field list. - -The file adapter uses [Jsoup](http://jsoup.org/) for HTML DOM -navigation; selectors for both tables and fields follow the -[Jsoup selector specification](http://jsoup.org/cookbook/extracting-data/selector-syntax). - -Field definitions may be used to rename or skip source fields, to -select and condition the cell contents and to set a data type. - -# Parsing cell contents - -The file adapter can select DOM nodes within a cell, replace text -within the selected element, match within the selected text, and -choose a data type for the resulting database column. Processing -steps are applied in the order described and replace and match -patterns are based on -[Java regular expressions](http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html). - -# Further examples - -There are more examples in the form of a script: - -{% highlight bash %} -$ ./sqlline -f file/src/test/resources/webjoin.sql -{% endhighlight %} - -(When running `webjoin.sql` you will see a number of warning messages for -each query containing a join. These are expected and do not affect -query results. These messages will be suppressed in the next release.) - -# Future improvements - -We are continuing to enhance the adapter, and would welcome -contributions of new parsing capabilities (for example parsing JSON -files) and being able to form URLs dynamically to push down filters. http://git-wip-us.apache.org/repos/asf/calcite/blob/24df135e/site/_docs/file_adapter.md ---------------------------------------------------------------------- diff --git a/site/_docs/file_adapter.md b/site/_docs/file_adapter.md new file mode 100644 index 0000000..270eea1 --- /dev/null +++ b/site/_docs/file_adapter.md @@ -0,0 +1,236 @@ +--- +layout: docs +title: File adapter +permalink: /docs/file_adapter.html +--- +<!-- +{% comment %} +Licensed to the Apache Software Foundation (ASF) under one or more +contributor license agreements. See the NOTICE file distributed with +this work for additional information regarding copyright ownership. +The ASF licenses this file to you under the Apache License, Version 2.0 +(the "License"); you may not use this file except in compliance with +the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +{% endcomment %} +--> + +# Overview + +The file adapter is able to read files in a variety of formats, +and can also read files over various protocols, such as HTTP. + +For example if you define: + +* States - http://en.wikipedia.org/wiki/List_of_states_and_territories_of_the_United_States +* Cities - http://en.wikipedia.org/wiki/List_of_United_States_cities_by_population + +You can then write a query like: + +{% highlight sql %} +select + count(*) "City Count", + sum(100 * c."Population" / s."Population") "Pct State Population" +from "Cities" c, "States" s +where c."State" = s."State" and s."State" = 'California'; +{% endhighlight %} + +And learn that California has 69 cities of 100k or more +comprising almost 1/2 of the state's population: + +``` ++---------------------+----------------------+ +| City Count | Pct State Population | ++---------------------+----------------------+ +| 69 | 48.574217177106576 | ++---------------------+----------------------+ +``` + +# A simple example + +Let's start with a simple example. First, we need a +[model definition]({{ site.baseurl }}/docs/model.html), +as follows. + +{% highlight json %} +{ + "version": "1.0", + "defaultSchema": "SALES", + "schemas": [ { + "name": "SALES", + "type": "custom", + "factory": "org.apache.calcite.adapter.file.FileSchemaFactory", + "operand": { + "tables": { + "name": "EMPS", + "url": "file:file/src/test/resources/sales/EMPS.html" + }, { + "name": "DEPTS" + "url": "file:file/src/test/resources/sales/DEPTS.html" + } + } + ] +} +{% endhighlight %} + +Schemas are defined as a list of tables, each containing minimally a +table name and a url. If a page has more than one table, you can +include in a table definition `selector` and `index` fields to specify the +desired table. If there is no table specification, the file adapter +chooses the largest table on the page. + +`EMPS.html` contains a single HTML table: + +{% highlight xml %} +<html> + <body> + <table> + <thead> + <tr> + <th>EMPNO</th> + <th>NAME</th> + <th>DEPTNO</th> + </tr> + </thead> + <tbody> + <tr> + <td>100</td> + <td>Fred</td> + <td>30</td> + </tr> + <tr> + <td>110</td> + <td>Eric</td> + <td>20</td> + </tr> + <tr> + <td>110</td> + <td>John</td> + <td>40</td> + </tr> + <tr> + <td>120</td> + <td>Wilma</td> + <td>20</td> + </tr> + <tr> + <td>130</td> + <td>Alice</td> + <td>40</td> + </tr> + </tbody> + </table> + </body> +</html> +{% endhighlight %} + +The model file is stored as `file/src/test/resources/sales.json`, +so you can connect via [`sqlline`](https://github.com/julianhyde/sqlline) +as follows: + +{% highlight bash %} +$ ./sqlline +sqlline> !connect jdbc:calcite:model=file/src/test/resources/sales.json admin admin +sqlline> select * from sales.emps; ++-------+--------+------+ +| EMPNO | DEPTNO | NAME | ++-------+--------+------+ +| 100 | 30 | Fred | +| 110 | 20 | Eric | +| 110 | 40 | John | +| 120 | 20 | Wilma | +| 130 | 40 | Alice | ++-------+--------+------+ +5 rows selected +{% endhighlight %} + +# Mapping tables + +Now for a more complex example. This time we connect to Wikipedia via +HTTP, read pages for US states and cities, and extract data from HTML +tables on those pages. The tables have more complex formats, and the +file adapter helps us locate and parse data in those tables. + +Tables can be simply defined for immediate gratification: + +{% highlight json %} +{ + tableName: "RawCities", + url: "http://en.wikipedia.org/wiki/List_of_United_States_cities_by_population" +} +{% endhighlight %} + +And subsequently refined for better usability / querying: + +{% highlight json %} +{ + tableName: "Cities", + url: "http://en.wikipedia.org/wiki/List_of_United_States_cities_by_population", + path: "#mw-content-text > table.wikitable.sortable", + index: 0, + fieldDefs: [ + {th: "2012 rank", name: "Rank", type: "int", pattern: "(\\d+)", matchGroup: 0}, + {th: "City", selector: "a", selectedElement: 0}, + {th: "State[5]", name: "State", selector: "a:eq(0)"}, + {th: "2012 estimate", name: "Population", type: "double"}, + {th: "2010 Census", skip: "true"}, + {th: "Change", skip: "true"}, + {th: "2012 land area", name: "Land Area (sq mi)", type: "double", selector: ":not(span)"}, + {th: "2012 population density", skip: "true"}, + {th: "ANSI", skip: "true"} + ] +} +{% endhighlight %} + +Connect and execute queries, as follows. + +{% highlight bash %} +$ ./sqlline +sqlline> !connect jdbc:calcite:model=file/src/test/resources/wiki.json admin admin +sqlline> select * from wiki."RawCities"; +sqlline> select * from wiki."Cities"; +{% endhighlight %} + +Note that `Cities` is easier to consume than `RawCities`, +because its table definition has a field list. + +The file adapter uses [Jsoup](http://jsoup.org/) for HTML DOM +navigation; selectors for both tables and fields follow the +[Jsoup selector specification](http://jsoup.org/cookbook/extracting-data/selector-syntax). + +Field definitions may be used to rename or skip source fields, to +select and condition the cell contents and to set a data type. + +# Parsing cell contents + +The file adapter can select DOM nodes within a cell, replace text +within the selected element, match within the selected text, and +choose a data type for the resulting database column. Processing +steps are applied in the order described and replace and match +patterns are based on +[Java regular expressions](http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html). + +# Further examples + +There are more examples in the form of a script: + +{% highlight bash %} +$ ./sqlline -f file/src/test/resources/webjoin.sql +{% endhighlight %} + +(When running `webjoin.sql` you will see a number of warning messages for +each query containing a join. These are expected and do not affect +query results. These messages will be suppressed in the next release.) + +# Future improvements + +We are continuing to enhance the adapter, and would welcome +contributions of new parsing capabilities (for example parsing JSON +files) and being able to form URLs dynamically to push down filters. http://git-wip-us.apache.org/repos/asf/calcite/blob/24df135e/site/_docs/pig.md ---------------------------------------------------------------------- diff --git a/site/_docs/pig.md b/site/_docs/pig.md deleted file mode 100644 index 4a85330..0000000 --- a/site/_docs/pig.md +++ /dev/null @@ -1,90 +0,0 @@ ---- -layout: docs -title: Pig adapter -permalink: /docs/pig.html ---- -<!-- -{% comment %} -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to you under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -{% endcomment %} ---> - -# Overview - -The Pig adapter allows you to write queries in SQL and execute them using -<a href="http://pig.apache.org">Apache Pig</a>. - -# A simple example - -Let's start with a simple example. First, we need a -[model definition]({{ site.baseurl }}/docs/model.html), -as follows. - -{% highlight json %} -{ - "version": "1.0", - "defaultSchema": "SALES", - "schemas": [ { - "name": "PIG", - "type": "custom", - "factory": "org.apache.calcite.adapter.pig.PigSchemaFactory", - "tables": [ { - "name": "t", - "type": "custom", - "factory": "org.apache.calcite.adapter.pig.PigTableFactory", - "operand": { - "file": "data.txt", - "columns": ["tc0", "tc1"] - } - }, { - "name": "s", - "type": "custom", - "factory": "org.apache.calcite.adapter.pig.PigTableFactory", - "operand": { - "file": "data2.txt", - "columns": ["sc0", "sc1"] - } - } ] - } ] -} -{% endhighlight %} - -Now, if you write the SQL query - -{% highlight sql %} -select * -from "t" -join "s" on "tc1" = "sc0" -{% endhighlight %} - -the Pig adapter will generate the Pig Latin script - -{% highlight sql %} -t = LOAD 'data.txt' USING PigStorage() AS (tc0:chararray, tc1:chararray); -s = LOAD 'data2.txt' USING PigStorage() AS (sc0:chararray, sc1:chararray); -t = JOIN t BY tc1, s BY sc0; -{% endhighlight %} - -which is then executed using Pig's runtime, typically MapReduce on -<a href="http://hadoop.apache.org/">Apache Hadoop</a>. - -# Relationship to Piglet - -Calcite has another component called -<a href="{{ site.apiRoot }}/org/apache/calcite/piglet/package-summary.html">Piglet</a>. -It allows you to write queries in a subset of Pig Latin, -and execute them using any applicable Calcite adapter. -So, Piglet is basically the opposite of the Pig adapter. http://git-wip-us.apache.org/repos/asf/calcite/blob/24df135e/site/_docs/pig_adapter.md ---------------------------------------------------------------------- diff --git a/site/_docs/pig_adapter.md b/site/_docs/pig_adapter.md new file mode 100644 index 0000000..4357c6f --- /dev/null +++ b/site/_docs/pig_adapter.md @@ -0,0 +1,90 @@ +--- +layout: docs +title: Pig adapter +permalink: /docs/pig_adapter.html +--- +<!-- +{% comment %} +Licensed to the Apache Software Foundation (ASF) under one or more +contributor license agreements. See the NOTICE file distributed with +this work for additional information regarding copyright ownership. +The ASF licenses this file to you under the Apache License, Version 2.0 +(the "License"); you may not use this file except in compliance with +the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +{% endcomment %} +--> + +# Overview + +The Pig adapter allows you to write queries in SQL and execute them using +<a href="http://pig.apache.org">Apache Pig</a>. + +# A simple example + +Let's start with a simple example. First, we need a +[model definition]({{ site.baseurl }}/docs/model.html), +as follows. + +{% highlight json %} +{ + "version": "1.0", + "defaultSchema": "SALES", + "schemas": [ { + "name": "PIG", + "type": "custom", + "factory": "org.apache.calcite.adapter.pig.PigSchemaFactory", + "tables": [ { + "name": "t", + "type": "custom", + "factory": "org.apache.calcite.adapter.pig.PigTableFactory", + "operand": { + "file": "data.txt", + "columns": ["tc0", "tc1"] + } + }, { + "name": "s", + "type": "custom", + "factory": "org.apache.calcite.adapter.pig.PigTableFactory", + "operand": { + "file": "data2.txt", + "columns": ["sc0", "sc1"] + } + } ] + } ] +} +{% endhighlight %} + +Now, if you write the SQL query + +{% highlight sql %} +select * +from "t" +join "s" on "tc1" = "sc0" +{% endhighlight %} + +the Pig adapter will generate the Pig Latin script + +{% highlight sql %} +t = LOAD 'data.txt' USING PigStorage() AS (tc0:chararray, tc1:chararray); +s = LOAD 'data2.txt' USING PigStorage() AS (sc0:chararray, sc1:chararray); +t = JOIN t BY tc1, s BY sc0; +{% endhighlight %} + +which is then executed using Pig's runtime, typically MapReduce on +<a href="http://hadoop.apache.org/">Apache Hadoop</a>. + +# Relationship to Piglet + +Calcite has another component called +<a href="{{ site.apiRoot }}/org/apache/calcite/piglet/package-summary.html">Piglet</a>. +It allows you to write queries in a subset of Pig Latin, +and execute them using any applicable Calcite adapter. +So, Piglet is basically the opposite of the Pig adapter. http://git-wip-us.apache.org/repos/asf/calcite/blob/24df135e/site/_includes/docs_contents_mobile.html ---------------------------------------------------------------------- diff --git a/site/_includes/docs_contents_mobile.html b/site/_includes/docs_contents_mobile.html index b3e0110..523c6e7 100644 --- a/site/_includes/docs_contents_mobile.html +++ b/site/_includes/docs_contents_mobile.html @@ -1,10 +1,11 @@ <div class="docs-nav-mobile unit whole show-on-mobiles"> <select onchange="if (this.value) window.location.href=this.value"> <option value="">Navigate the docsâ¦</option> - {% for section in site.data.docs %} - <optgroup label="{{ section.title }}"> - {% include docs_option.html items=section.docs %} - </optgroup> + {% for section in site.data.docs %}{% comment %} +{% endcomment %} <optgroup label="{{ section.title }}">{% comment %} +{% endcomment %} {% include docs_option.html items=section.docs %}{% comment %} +{% endcomment %} </optgroup>{% comment %} +{% endcomment %} {% endfor %} </select> </div> http://git-wip-us.apache.org/repos/asf/calcite/blob/24df135e/site/_includes/docs_option.html ---------------------------------------------------------------------- diff --git a/site/_includes/docs_option.html b/site/_includes/docs_option.html index 8c61578..fabf046 100644 --- a/site/_includes/docs_option.html +++ b/site/_includes/docs_option.html @@ -1,11 +1,9 @@ -{% assign items = include.items %} - -{% for item in items %} - {% assign item_url = item | prepend:"{{ site.baseurl }}/docs/" | append:".html" %} - - {% for p in site.docs %} - {% if p.url == item_url %} - <option value="{{ site.url }}{{ p.url }}">{{ p.title }}</option> - {% endif %} - {% endfor %} -{% endfor %} +{% assign items = include.items %}{% comment %} +{% endcomment %}{% for item in items %}{% comment %} +{% endcomment %} {% assign item_url = item | prepend:"{{ site.baseurl }}/docs/" | append:".html" %}{% comment %} +{% endcomment %} {% for p in site.docs %}{% comment %} +{% endcomment %} {% if p.url == item_url %}{% comment %} +{% endcomment %} <option value="{{ site.url }}{{ p.url }}">{{ p.title }}</option>{% comment %} +{% endcomment %} {% endif %}{% comment %} +{% endcomment %} {% endfor %}{% comment %} +{% endcomment %}{% endfor %}
