@@ -24,10 +24,10 @@ include-in-header:
2424# <span class =" hcode " >QUERY</span > <span class =" hviz-wrapper " >![ ] ( assets/visualize.svg ) {.hviz aria-hidden="true"}<span class =" sr-only " >VISUALIZE</span ></span > <span class =" hund " >UNDERSTAND</span >
2525
2626::: {.hero-body}
27- ggsql brings the elegance of the Grammar of Graphics to SQL. Write familiar queries, add visualization clauses, and see your data transform into beautiful, composable charts — no context switching, no separate tools, just SQL with superpowers.
27+ ggsql brings the elegance of the [ Grammar of Graphics] ( get_started/grammar.qmd ) to SQL. Write familiar queries, add visualization clauses, and see your data transform into beautiful, composable charts — no context switching, no separate tools, just SQL with superpowers.
2828
2929::: {.hero-buttons}
30- [ Get Started] ( get_started.qmd ) {.btn .btn-primary .btn-lg}
30+ [ Get Started] ( get_started/installation .qmd ) {.btn .btn-primary .btn-lg}
3131[ View Examples] ( gallery/index.qmd ) {.btn .btn-outline-primary .btn-lg}
3232:::
3333:::
@@ -37,8 +37,6 @@ ggsql brings the elegance of the Grammar of Graphics to SQL. Write familiar quer
3737::: {.content-block .dark-bg}
3838### Try it out
3939
40- ggsql runs in the browser as well! Edit the code and watch the plot update.
41-
4240``` {ggsql}
4341-- Regular query
4442SELECT * FROM ggsql:penguins
@@ -70,23 +68,37 @@ LABEL
7068::: {.content-block .dark-bg .install-section}
7169### Install it today
7270
73- ::: {#installer-buttons}
71+ ::: {.install-columns}
72+ ::: {.install-col .install-col-left}
73+ ::: {#installer-recommended}
7474<noscript >Download from [ GitHub Releases] ( https://github.com/posit-dev/ggsql/releases ) </noscript >
7575:::
7676
77- ::: {.install-cli-options}
78- ** Or via command line:**
79- ` uv pip install ggsql-jupyter && ggsql-jupyter --install `
80- ·
81- ` cargo install ggsql `
77+ [ Other platforms] ( get_started/installation.qmd ) {.other-platforms-link}
78+ :::
79+
80+ ::: {.install-divider}
81+ [ or] {.divider-text}
82+ :::
83+
84+ ::: {.install-col .install-col-right}
85+ ``` bash
86+ # Jupyter kernel
87+ uv tool install ggsql-jupyter
88+ ggsql-jupyter --install
89+
90+ # CLI
91+ uv tool install ggsql
92+ ```
93+ :::
8294:::
8395
8496``` {=html}
8597<script>
8698(function() {
8799 const repoOwner = 'posit-dev';
88100 const repoName = 'ggsql';
89- const includePreReleases = true; // Set to false to only show published releases
101+ const includePreReleases = true;
90102
91103 function detectOS() {
92104 const ua = navigator.userAgent.toLowerCase();
@@ -96,30 +108,30 @@ LABEL
96108 return 'unknown';
97109 }
98110
99- function getOSLabel (os) {
100- switch(os) {
101- case ' windows': return 'Windows';
102- case ' macos': return 'macOS';
103- case ' linux': return 'Linux';
104- default: return 'your platform' ;
105- }
111+ function getOSIcon (os) {
112+ const icons = {
113+ windows: 'bi-windows',
114+ macos: 'bi-apple',
115+ linux: 'bi-ubuntu'
116+ } ;
117+ return icons[os] ? `<i class="bi ${icons[os]}"></i>` : '';
106118 }
107119
108- async function loadInstallers() {
109- const container = document.getElementById('installer-buttons');
120+ const patterns = {
121+ windows_exe: /^ggsql[_-]\d.*x64.*-setup\.exe$/i,
122+ macos: /^ggsql[_-]\d.*(aarch64|arm64).*\.dmg$/i,
123+ linux: /^ggsql[_-]\d.*amd64.*\.deb$/i
124+ };
125+
126+ function findAsset(assets, pattern) {
127+ return assets?.find(a => pattern?.test(a.name));
128+ }
129+
130+ async function loadInstaller() {
131+ const container = document.getElementById('installer-recommended');
110132 if (!container) return;
111133
112134 const os = detectOS();
113- const jupyterPattern = {
114- windows: /ggsql-jupyter.*\.(exe|msi)$/i,
115- macos: /ggsql-jupyter.*\.dmg$/i,
116- linux: /ggsql-jupyter.*\.deb$/i
117- }[os];
118- const cliPattern = {
119- windows: /^ggsql[^-].*\.(exe|msi)$/i,
120- macos: /^ggsql[^-].*\.dmg$/i,
121- linux: /^ggsql[^-].*\.deb$/i
122- }[os];
123135
124136 try {
125137 const endpoint = includePreReleases
@@ -132,39 +144,35 @@ LABEL
132144 if (!release) throw new Error('No releases found');
133145
134146 const version = release.tag_name;
135- const jupyterAsset = release.assets?.find(a => jupyterPattern?.test(a.name));
136- const cliAsset = release.assets?.find(a => cliPattern?.test(a.name));
147+ const assets = release.assets || [];
148+
149+ let asset;
150+ if (os === 'windows') {
151+ asset = findAsset(assets, patterns.windows_exe);
152+ } else if (os === 'macos') {
153+ asset = findAsset(assets, patterns.macos);
154+ } else if (os === 'linux') {
155+ asset = findAsset(assets, patterns.linux);
156+ }
137157
138158 container.innerHTML = `
139- <p class="install-version">${version} · ${getOSLabel(os)} · <a href="${release.html_url}">Other platforms</a></p>
140- <div class="install-buttons-row">
141- <div class="install-option">
142- <a href="${jupyterAsset?.browser_download_url || release.html_url}" class="btn btn-primary install-btn">
143- Jupyter Kernel
144- </a>
145- <p class="install-description">For Jupyter and Quarto notebooks</p>
146- </div>
147- <div class="install-option">
148- <a href="${cliAsset?.browser_download_url || release.html_url}" class="btn btn-outline-primary install-btn">
149- CLI
150- </a>
151- <p class="install-description">For terminal and scripting workflows</p>
152- </div>
153- </div>
159+ <a href="${asset?.browser_download_url || release.html_url}" class="btn btn-primary install-btn">
160+ ${getOSIcon(os)} Download ggsql ${version}
161+ </a>
154162 `;
155163 } catch (e) {
156164 container.innerHTML = `
157- <a href="https://github.com/${repoOwner}/${repoName}/releases" class="btn btn-primary">
165+ <a href="https://github.com/${repoOwner}/${repoName}/releases" class="btn btn-primary install-btn ">
158166 View Downloads on GitHub
159167 </a>
160168 `;
161169 }
162170 }
163171
164172 if (document.readyState === 'loading') {
165- document.addEventListener('DOMContentLoaded', loadInstallers );
173+ document.addEventListener('DOMContentLoaded', loadInstaller );
166174 } else {
167- loadInstallers ();
175+ loadInstaller ();
168176 }
169177})();
170178</script>
@@ -193,7 +201,7 @@ DRAW line
193201::: {.feature}
194202### Grammar of Graphics
195203
196- Compose visualizations from independent layers, scales, and coordinates. Mix and match components for powerful custom visuals.
204+ Compose visualizations from independent layers, scales, and coordinates. Mix and match components for powerful custom visuals. The [ grammar of graphics ] ( get_started/grammar.qmd ) provides you with a single mental model for every type of plot.
197205
198206``` {.ggsql .code-example}
199207VISUALISE date AS x FROM sales
@@ -228,20 +236,16 @@ ggsql interfaces directly with your database. Want to create a histogram over 1
228236
229237::: {.tool-grid}
230238::: {.tool-item}
231- ![ ] ( assets/logos/positron.svg ) {.tool-logo}
232- [ Positron] ( https://positron.posit.co/ )
239+ [ ![ ] ( assets/logos/positron.svg ) {.tool-logo} Positron] ( get_started/installation.qmd#vs-code--positron-extension )
233240:::
234241::: {.tool-item}
235- ![ ] ( assets/logos/quarto.svg ) {.tool-logo}
236- [ Quarto] ( https://quarto.org/ )
242+ [ ![ ] ( assets/logos/quarto.svg ) {.tool-logo} Quarto] ( get_started/installation.qmd#jupyter-kernel )
237243:::
238244::: {.tool-item}
239- ![ ] ( assets/logos/jupyter.svg ) {.tool-logo}
240- [ Jupyter] ( https://jupyter.org )
245+ [ ![ ] ( assets/logos/jupyter.svg ) {.tool-logo} Jupyter] ( get_started/installation.qmd#jupyter-kernel )
241246:::
242247::: {.tool-item}
243- ![ ] ( assets/logos/vscode.svg ) {.tool-logo}
244- [ VS Code] ( https://code.visualstudio.com/ )
248+ [ ![ ] ( assets/logos/vscode.svg ) {.tool-logo} VS Code] ( get_started/installation.qmd#vs-code--positron-extension )
245249:::
246250:::
247251
@@ -256,9 +260,9 @@ ggsql interfaces directly with your database. Want to create a histogram over 1
256260Install ggsql and start creating visualizations in minutes.
257261
258262::: {.cta-buttons}
259- [ Installation] ( get_started.qmd ) {.btn .btn-primary .btn-lg}
263+ [ Installation] ( get_started/installation .qmd ) {.btn .btn-primary .btn-lg}
260264[ Documentation] ( syntax/index.qmd ) {.btn .btn-outline-primary .btn-lg}
261- [ Examples] ( examples .qmd) {.btn .btn-outline-secondary .btn-lg}
265+ [ Examples] ( gallery/index .qmd) {.btn .btn-outline-secondary .btn-lg}
262266:::
263267
264268Or try our [ online playground] ( wasm/ ) to experience the syntax _ right now_ .
0 commit comments