|
| 1 | +# `doc/` — Quarto documentation site |
| 2 | + |
| 3 | +Source for the public ggsql documentation at <https://ggsql.org>. **This directory is the authoritative reference for ggsql syntax and semantics.** Other CLAUDE.md files in the repo link here rather than restate. |
| 4 | + |
| 5 | +If you are about to document a clause, layer type, scale, or aesthetic anywhere else: stop and put it here instead. |
| 6 | + |
| 7 | +## Layout |
| 8 | + |
| 9 | +``` |
| 10 | +doc/ |
| 11 | +├── _quarto.yml Quarto project config (navbar, sidebar, theme, llms-txt) |
| 12 | +├── _brand.yml, styles.scss, ggsql.xml Branding + the ggsql syntax-highlight definition |
| 13 | +├── index.qmd Landing page |
| 14 | +├── faq.qmd |
| 15 | +├── get_started/ |
| 16 | +│ ├── installation.qmd Platform-specific install + CLI quick reference |
| 17 | +│ ├── first_plot.qmd Tutorial: first visualization |
| 18 | +│ ├── grammar.qmd Grammar of Graphics conceptual foundation |
| 19 | +│ ├── anatomy.qmd Anatomy of a ggsql query |
| 20 | +│ ├── tooling.qmd VS Code / Positron / Jupyter / Python / R / CLI integrations |
| 21 | +│ └── the_rest.qmd Advanced features |
| 22 | +├── syntax/ |
| 23 | +│ ├── index.qmd |
| 24 | +│ ├── clause/ draw, facet, label, place, project, scale, visualise |
| 25 | +│ ├── layer/ |
| 26 | +│ │ ├── type/ one .qmd per layer type (point, line, bar, …) |
| 27 | +│ │ └── position/ identity, stack, dodge, jitter |
| 28 | +│ ├── scale/ |
| 29 | +│ │ ├── type/ binned, continuous, discrete, identity, ordinal |
| 30 | +│ │ └── aesthetic/ position, color, opacity, size, linewidth, shape, linetype, faceting |
| 31 | +│ └── coord/ cartesian, polar |
| 32 | +├── gallery/ |
| 33 | +│ ├── index.qmd |
| 34 | +│ └── examples/ Runnable example queries |
| 35 | +├── assets/, vendor/ Static resources |
| 36 | +├── data/CSVs Sample datasets used by examples (data.csv, sales.csv, …) |
| 37 | +└── wasm/ Built playground (copied from /ggsql-wasm/demo/dist by build-wasm.sh) |
| 38 | +``` |
| 39 | + |
| 40 | +Generated artefacts not to edit by hand: |
| 41 | + |
| 42 | +- `_site/` — Quarto build output. Not committed (see `.gitignore`). |
| 43 | +- `*.quarto_ipynb*` — Quarto's intermediate notebook files for `.qmd` pages with executable cells. Regenerated on build. |
| 44 | +- `wasm/` — produced by [`/ggsql-wasm/build-wasm.sh`](../ggsql-wasm/build-wasm.sh). |
| 45 | + |
| 46 | +## Authoring conventions |
| 47 | + |
| 48 | +- Pages are Quarto markdown (`.qmd`) — markdown plus YAML front-matter. |
| 49 | +- Code blocks tagged ```` ```ggsql ```` use the syntax definition in `ggsql.xml` (referenced from `_quarto.yml` under `syntax-definitions`). Use that fence for runnable / illustrative ggsql snippets. |
| 50 | +- Each clause page under `syntax/clause/` follows the same shape: short narrative, a "Clause syntax" code block listing all subclauses, then sections per subclause with examples. Mirror that shape when adding pages. |
| 51 | +- Examples that need data reference the CSV files at the top of `doc/` (e.g. `data.csv`, `sales.csv`, `metrics.csv`, `timeseries.csv`). |
| 52 | +- The site has `llms-txt: true` in `_quarto.yml`, so an `llms.txt` is generated for AI tooling — keep page titles and descriptions clean. |
| 53 | + |
| 54 | +## Site structure (from `_quarto.yml`) |
| 55 | + |
| 56 | +- **Navbar**: Get started · Syntax (drop-down per clause) · Gallery · FAQ · News · Playground · Python · R. |
| 57 | +- **Syntax sidebar**: clauses → layers (type + position) → scales (type + aesthetic) → coordinate systems. New `.qmd` files in those folders are picked up automatically via `auto:` glob entries. |
| 58 | +- **Get-started sidebar**: hand-ordered list (`installation` → `first_plot` → `grammar` → `anatomy` → `tooling` → `the_rest`). |
| 59 | + |
| 60 | +## Build & preview |
| 61 | + |
| 62 | +```sh |
| 63 | +cd doc |
| 64 | +quarto preview # local server with hot reload |
| 65 | +quarto render # full site build → _site/ |
| 66 | +``` |
| 67 | + |
| 68 | +The site is published from the `gh-pages` branch (see `_quarto.yml`'s `repo-branch`). Quarto extensions live in `_extensions/`. |
| 69 | + |
| 70 | +## What goes here vs. CLAUDE.md |
| 71 | + |
| 72 | +- **Here**: anything a ggsql user might want to read — clause syntax, layer types, scales, aesthetics, examples, CLI usage, installation. |
| 73 | +- **In CLAUDE.md files**: implementation details for contributors — module layouts, build pipelines, where to add a new geom, internal types. |
| 74 | + |
| 75 | +If you find clause/layer/scale syntax described in any CLAUDE.md file, that is a duplication bug — move it here and link from there. |
| 76 | + |
| 77 | +## See also |
| 78 | + |
| 79 | +- [`/CLAUDE.md`](../CLAUDE.md) — workspace overview. |
| 80 | +- [`/ggsql-wasm/CLAUDE.md`](../ggsql-wasm/CLAUDE.md) — how the embedded playground at `wasm/` is built. |
0 commit comments