Skip to content

Commit

Permalink
version badge (#1000)
Browse files Browse the repository at this point in the history
* version badge inspired by Plot's documentation

* badge tweaks

* more badges

---------

Co-authored-by: Mike Bostock <mbostock@gmail.com>
  • Loading branch information
Fil and mbostock committed Mar 6, 2024
1 parent e147f48 commit b36b4ad
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/config.md
Expand Up @@ -196,7 +196,7 @@ toc: false

Whether to enable [search](./search) on the project; defaults to false.

## markdownIt
## markdownIt <a href="https://github.com/observablehq/framework/releases/tag/v1.1.0" target="_blank" class="observablehq-version-badge" data-version="1.1.0" title="Added in v1.1.0"></a>

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):

Expand Down
2 changes: 1 addition & 1 deletion docs/lib/echarts.md
Expand Up @@ -2,7 +2,7 @@
index: true
---

# Apache ECharts
# Apache ECharts <a href="https://github.com/observablehq/framework/releases/tag/v1.1.0" target="_blank" class="observablehq-version-badge" data-version="1.1.0" title="Added in v1.1.0"></a>

[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:

Expand Down
4 changes: 2 additions & 2 deletions docs/markdown.md
Expand Up @@ -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** <a href="https://github.com/observablehq/framework/releases/tag/v1.1.0" target="_blank" class="observablehq-version-badge" data-version="1.1.0" title="Added in v1.1.0"></a> - additional words to index for [search](./search); boosted at the same weight as the title
- **draft** <a href="https://github.com/observablehq/framework/releases/tag/v1.1.0" target="_blank" class="observablehq-version-badge" data-version="1.1.0" title="Added in v1.1.0"></a> — whether to skip this page during build; drafts are also not listed in the default sidebar

## Headings

Expand Down
2 changes: 1 addition & 1 deletion docs/sql.md
Expand Up @@ -3,7 +3,7 @@ sql:
gaia: ./lib/gaia-sample.parquet
---

# SQL
# SQL <a href="https://github.com/observablehq/framework/releases/tag/v1.2.0" target="_blank" class="observablehq-version-badge" data-version="1.2.0" title="Added in v1.2.0"></a>

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).

Expand Down
14 changes: 14 additions & 0 deletions docs/style.css
Expand Up @@ -34,3 +34,17 @@
display: none;
}
}

a.observablehq-version-badge {
font: 500 12px var(--sans-serif);
display: inline-block;
vertical-align: top;
padding: 2px 8px;
color: var(--theme-green);
background: color-mix(in srgb, var(--theme-green), transparent 80%);
border-radius: 12px;
}

.observablehq-version-badge::before {
content: "^" attr(data-version);
}

0 comments on commit b36b4ad

Please sign in to comment.