From 8daa915a7548b307fe94fc305805802fe5d80a95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Rivi=C3=A8re?= Date: Wed, 6 Mar 2024 19:43:47 +0100 Subject: [PATCH 1/3] version badge inspired by Plot's documentation --- docs/sql.md | 2 +- docs/style.css | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/sql.md b/docs/sql.md index 7bdaeb656..d992a059d 100644 --- a/docs/sql.md +++ b/docs/sql.md @@ -5,7 +5,7 @@ sql: # SQL -Observable Framework includes built-in support for client-side SQL powered by [DuckDB](./lib/duckdb). You can use SQL to query data from [CSV](./lib/csv), [TSV](./lib/csv), [JSON](./javascript/files#json), [Apache Arrow](./lib/arrow), and [Apache Parquet](./lib/arrow#apache-parquet) files, which can either be static or generated by [data loaders](./loaders). +Observable Framework includes built-in support for client-side SQL^1.2.0 powered by [DuckDB](./lib/duckdb). You can use SQL to query data from [CSV](./lib/csv), [TSV](./lib/csv), [JSON](./javascript/files#json), [Apache Arrow](./lib/arrow), and [Apache Parquet](./lib/arrow#apache-parquet) files, which can either be static or generated by [data loaders](./loaders). To use SQL, first register the desired tables in the page’s [front matter](./markdown#front-matter) using the **sql** option. Each key is a table name, and each value is the path to the corresponding data file. For example, to register a table named `gaia` from a Parquet file: diff --git a/docs/style.css b/docs/style.css index 247c4d867..f29657c43 100644 --- a/docs/style.css +++ b/docs/style.css @@ -34,3 +34,17 @@ display: none; } } + +a.observablehq-version-badge { + font-size: 12px; + font-family: var(--sans-serif); + display: inline-block; + transform: translateY(-0.8em); + padding: 2px 8px; + color: var(--theme-foreground-focus); + background: color-mix(in srgb, var(--theme-foreground-focus), transparent 75%); + border-radius: 12px; + content: attr(data-version-badge); + text-decoration: underline; + text-underline-offset: 2px; +} From 7afd2f450afa27b08d6e755fd70bee6c9928accc Mon Sep 17 00:00:00 2001 From: Mike Bostock Date: Wed, 6 Mar 2024 11:01:38 -0800 Subject: [PATCH 2/3] badge tweaks --- docs/sql.md | 4 ++-- docs/style.css | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/sql.md b/docs/sql.md index d992a059d..d5cbf4924 100644 --- a/docs/sql.md +++ b/docs/sql.md @@ -3,9 +3,9 @@ sql: gaia: ./lib/gaia-sample.parquet --- -# SQL +# SQL -Observable Framework includes built-in support for client-side SQL^1.2.0 powered by [DuckDB](./lib/duckdb). You can use SQL to query data from [CSV](./lib/csv), [TSV](./lib/csv), [JSON](./javascript/files#json), [Apache Arrow](./lib/arrow), and [Apache Parquet](./lib/arrow#apache-parquet) files, which can either be static or generated by [data loaders](./loaders). +Observable Framework includes built-in support for client-side SQL powered by [DuckDB](./lib/duckdb). You can use SQL to query data from [CSV](./lib/csv), [TSV](./lib/csv), [JSON](./javascript/files#json), [Apache Arrow](./lib/arrow), and [Apache Parquet](./lib/arrow#apache-parquet) files, which can either be static or generated by [data loaders](./loaders). To use SQL, first register the desired tables in the page’s [front matter](./markdown#front-matter) using the **sql** option. Each key is a table name, and each value is the path to the corresponding data file. For example, to register a table named `gaia` from a Parquet file: diff --git a/docs/style.css b/docs/style.css index f29657c43..4bd1b4fe9 100644 --- a/docs/style.css +++ b/docs/style.css @@ -36,15 +36,15 @@ } a.observablehq-version-badge { - font-size: 12px; - font-family: var(--sans-serif); + font: 500 12px var(--sans-serif); display: inline-block; - transform: translateY(-0.8em); + vertical-align: top; padding: 2px 8px; - color: var(--theme-foreground-focus); - background: color-mix(in srgb, var(--theme-foreground-focus), transparent 75%); + color: var(--theme-green); + background: color-mix(in srgb, var(--theme-green), transparent 80%); border-radius: 12px; - content: attr(data-version-badge); - text-decoration: underline; - text-underline-offset: 2px; +} + +.observablehq-version-badge::before { + content: "^" attr(data-version); } From 007a68078056234b246d35ea373bc80822b41de3 Mon Sep 17 00:00:00 2001 From: Mike Bostock Date: Wed, 6 Mar 2024 11:04:30 -0800 Subject: [PATCH 3/3] more badges --- docs/config.md | 2 +- docs/lib/echarts.md | 2 +- docs/markdown.md | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/config.md b/docs/config.md index d5fb99a5e..9faf2aa88 100644 --- a/docs/config.md +++ b/docs/config.md @@ -196,7 +196,7 @@ toc: false Whether to enable [search](./search) on the project; defaults to false. -## markdownIt +## markdownIt A hook for registering additional [markdown-it](https://github.com/markdown-it/markdown-it) plugins. For example, to use [markdown-it-footnote](https://github.com/markdown-it/markdown-it-footnote): diff --git a/docs/lib/echarts.md b/docs/lib/echarts.md index bd08bd9e4..08eebd86a 100644 --- a/docs/lib/echarts.md +++ b/docs/lib/echarts.md @@ -2,7 +2,7 @@ index: true --- -# Apache ECharts +# Apache ECharts [Apache ECharts](https://echarts.apache.org), an open-source JavaScript visualization library, is available by default as `echarts` in Markdown. You can also import it explicitly like so: diff --git a/docs/markdown.md b/docs/markdown.md index 6158252a2..941f7f11d 100644 --- a/docs/markdown.md +++ b/docs/markdown.md @@ -18,8 +18,8 @@ The front matter supports the following options: - **title** — the page title; defaults to the (first) first-level heading of the page, if any - **toc** — if false, disables the [table of contents](./config#toc) - **index** — whether to index this page if [search](./search) is enabled; defaults to true for listed pages -- **keywords** - additional words to index for [search](./search); boosted at the same weight as the title -- **draft** — whether to skip this page during build; drafts are also not listed in the default sidebar +- **keywords** - additional words to index for [search](./search); boosted at the same weight as the title +- **draft** — whether to skip this page during build; drafts are also not listed in the default sidebar ## Headings