ssqch 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/bundled/completions/bash +62 -16
  2. package/bundled/completions/elvish +28 -12
  3. package/bundled/completions/fish +36 -23
  4. package/bundled/completions/powershell +30 -12
  5. package/bundled/completions/zsh +40 -19
  6. package/bundled/docs/agents.md +12 -1
  7. package/bundled/docs/build-summary.md +31 -1
  8. package/bundled/docs/comparing-builds.md +37 -5
  9. package/bundled/docs/configuring.md +30 -5
  10. package/bundled/docs/field-guide.md +1 -1
  11. package/bundled/docs/github-pages.md +1 -1
  12. package/bundled/docs/index.md +1 -1
  13. package/bundled/docs/known-gaps.md +1 -1
  14. package/bundled/docs/markdown.md +63 -5
  15. package/bundled/docs/multilingual.md +20 -3
  16. package/bundled/docs/nav.yml +1 -0
  17. package/bundled/docs/netlify.md +2 -2
  18. package/bundled/docs/plugins.md +4 -4
  19. package/bundled/docs/seo.md +39 -1
  20. package/bundled/docs/template-languages.md +6 -4
  21. package/bundled/docs/templates.md +3 -3
  22. package/bundled/docs/trailheads/from-eleventy.md +25 -13
  23. package/bundled/docs/trailheads/from-hugo.md +103 -0
  24. package/bundled/docs/trailheads/from-jekyll.md +49 -15
  25. package/bundled/docs/trailheads/from-mkdocs.md +54 -9
  26. package/bundled/docs/trailheads/from-zola.md +2 -2
  27. package/bundled/docs/trailheads.md +22 -5
  28. package/bundled/docs/where-values-come-from.md +1 -1
  29. package/bundled/mkdocs/404.jinja +6 -0
  30. package/bundled/ssqch.d.ts +78 -18
  31. package/lib/assets.js +11 -12
  32. package/lib/{chunk-3HHRKG33.js → chunk-2L3HR67O.js} +71 -19
  33. package/lib/{chunk-LCPSKHAV.js → chunk-2QTJTEBV.js} +1 -1
  34. package/lib/{chunk-RVBNVGZV.js → chunk-3HZZY3Y7.js} +5 -6
  35. package/lib/{chunk-RKFZSVNF.js → chunk-3K237XAX.js} +10 -11
  36. package/lib/{chunk-HXCLCXRT.js → chunk-443ZQLVX.js} +5 -3
  37. package/lib/{chunk-Q4LFTYK2.js → chunk-5ELAUHRL.js} +20 -20
  38. package/lib/{chunk-SA5KSJ4Y.js → chunk-A75EVUJX.js} +10 -12
  39. package/lib/{chunk-BGCBSQ4A.js → chunk-AIMEXBTK.js} +163 -29
  40. package/lib/{chunk-Y2ESFAAD.js → chunk-B5E27PLU.js} +10 -41
  41. package/lib/{chunk-RJFWTW2Y.js → chunk-CMJ7X5WW.js} +3 -3
  42. package/lib/{chunk-NKXEPHRZ.js → chunk-ERAIEV3O.js} +106 -4
  43. package/lib/{chunk-E5UB2YY7.js → chunk-FCM3NYFR.js} +11 -9
  44. package/lib/{chunk-3EPHKJEG.js → chunk-GJNIQAIH.js} +8 -8
  45. package/lib/{chunk-CB6YFUXU.js → chunk-GLJQ4C76.js} +40 -21
  46. package/lib/{chunk-DDV6JEC2.js → chunk-GS5B3CBW.js} +1 -1
  47. package/lib/chunk-H5K2ZE7B.js +219 -0
  48. package/lib/{chunk-NFJJKDRI.js → chunk-HFSWUTXX.js} +1 -1
  49. package/lib/{chunk-4Q6WMTER.js → chunk-HWW5NCVJ.js} +1 -1
  50. package/lib/{chunk-LAV3DEY4.js → chunk-I3HYKEEW.js} +1 -1
  51. package/lib/{chunk-JWCCVTTR.js → chunk-IOBC665M.js} +2 -4
  52. package/lib/chunk-JC54PHIT.js +7992 -0
  53. package/lib/{chunk-2LEOPLTZ.js → chunk-KCF2Z6N7.js} +3 -5
  54. package/lib/{chunk-DMVJ53SM.js → chunk-KZZS4W2V.js} +15 -15
  55. package/lib/{chunk-RM5Q3KFB.js → chunk-LJOURBYT.js} +14 -13
  56. package/lib/chunk-OQGXZYZS.js +45 -0
  57. package/lib/chunk-OSBEH67S.js +6296 -0
  58. package/lib/{chunk-DW7VMJEZ.js → chunk-QJ5ZFTML.js} +14 -13
  59. package/lib/{chunk-NUUEOGLZ.js → chunk-QLUTNR37.js} +11 -11
  60. package/lib/{chunk-HGJ5VWUR.js → chunk-RBNPBTDP.js} +1 -1
  61. package/lib/{chunk-F65YUXZ7.js → chunk-RIAOXEXC.js} +10 -4
  62. package/lib/chunk-RVXGUMFI.js +21 -0
  63. package/lib/{chunk-N4O5MDIB.js → chunk-RYIWYWRQ.js} +5 -7
  64. package/lib/{chunk-EEJDLCD3.js → chunk-RZYAIX2R.js} +12 -11
  65. package/lib/{chunk-7HXCQEGA.js → chunk-V2FSMOFX.js} +3 -3
  66. package/lib/{chunk-HDQ4SRWM.js → chunk-X2GAVYV2.js} +525 -75
  67. package/lib/chunk-XS4EJSEK.js +279 -0
  68. package/lib/chunk-YCOTX2VM.js +37 -0
  69. package/lib/{chunk-QMA7CK7B.js → chunk-Z44IAMNG.js} +137 -32
  70. package/lib/chunk-Z5OP43HU.js +2945 -0
  71. package/lib/{chunk-JXZT5L7W.js → chunk-ZINLHOX4.js} +2 -3
  72. package/lib/{chunk-SRNLKWXL.js → chunk-ZR3JYLFB.js} +893 -12382
  73. package/lib/cli.js +82 -41
  74. package/lib/elements.js +11 -12
  75. package/lib/image.js +11 -11
  76. package/lib/links.js +11 -12
  77. package/lib/minify.js +71 -13
  78. package/lib/redirects.js +11 -12
  79. package/lib/rss.js +13 -11
  80. package/lib/sass.js +13 -245
  81. package/lib/sitemap.js +19 -18
  82. package/lib/ssqch.js +6 -5
  83. package/package.json +1 -1
  84. package/types/index.d.ts +59 -13
  85. package/types/minify.d.ts +15 -3
  86. package/types/sass.d.ts +2 -0
  87. package/types/sitemap.d.ts +2 -2
  88. package/wasm/markdown.wasm +0 -0
  89. package/wasm/minify.wasm +0 -0
  90. package/wasm/sass.wasm +0 -0
  91. package/lib/chunk-5DNDSNTP.js +0 -1541
  92. package/lib/chunk-VJWQSYEG.js +0 -119
  93. package/lib/chunk-ZM6TU2JB.js +0 -1287
  94. /package/lib/{chunk-BGCBSQ4A.js.LEGAL.txt → chunk-AIMEXBTK.js.LEGAL.txt} +0 -0
  95. /package/lib/{chunk-SRNLKWXL.js.LEGAL.txt → chunk-ZR3JYLFB.js.LEGAL.txt} +0 -0
@@ -7,9 +7,9 @@ Zola is a single Rust binary, and SiteSquatch runs on Node (from npm), so the mo
7
7
 
8
8
  blog.rust-lang.org was ported this way as a trial: all of its URLs and most pages came out the same. The [`blog-tags`](https://github.com/reverentgeek/sitesquatch/tree/main/examples/sites/blog-tags/) example is a small blog laid out like a Zola site (sections, tags with feeds, aliases, highlighting), distilled from blog.rust-lang.org.
9
9
 
10
- ## Importing
10
+ ## Scouting
11
11
 
12
- `ssqch import zola` does the mechanical part of this guide. In each page's `+++` front matter it moves `tags` out of `[taxonomies]` to the top level and turns `path` into a `permalink`. It writes a first `ssqch.config.js` from `config.toml`: `content/` as the input and `templates/` for layouts, `config.title` and `config.extra` as data so templates keep reading them, the Markdown options, Sass, a sitemap, redirects for `aliases`, and `static/` copied as it is. Then it lists what's left with where it is: each section (`_index.md`), each shortcode used in the content, and counts of the Tera constructs in your templates that read differently in Jinja. Run it once to read the list (it changes nothing), then with `--write` in a clean git checkout.
12
+ `ssqch scout` (see [Scouting a site](../trailheads.md#scouting-a-site)) lists what this guide describes for your site and drafts the mechanical part. Its edits, in each page's `+++` front matter, move `tags` out of `[taxonomies]` to the top level and turn `path` into a `permalink`. Its draft is a first `ssqch.config.js` from `config.toml`: `content/` as the input and `templates/` for layouts, `config.title` and `config.extra` as data so templates keep reading them, the Markdown options, Sass, a sitemap, redirects for `aliases`, and `static/` copied as it is. Then it lists what's left with where it is: each section (`_index.md`), each shortcode used in the content, and counts of the Tera constructs in your templates that read differently in Jinja. It changes nothing on its own: `--write-draft` writes the draft and `--patch move.patch` the edits, to read and `git apply`.
13
13
 
14
14
  ## The config
15
15
 
@@ -3,17 +3,34 @@ title: "Trailheads: moving from another generator"
3
3
  navTitle: "Moving to ssqch"
4
4
  description: "Everything migrates eventually."
5
5
  ---
6
- Everything migrates eventually. The trailheads map another generator's config, front matter and templates onto ssqch's, and `ssqch docs --from <generator>` prints the one you need: [from Zola](trailheads/from-zola.md), [from Eleventy](trailheads/from-eleventy.md), [from Docusaurus](trailheads/from-docusaurus.md), [from MkDocs](trailheads/from-mkdocs.md), [from Hexo](trailheads/from-hexo.md), [from Jekyll](trailheads/from-jekyll.md) and [from component frameworks](trailheads/from-component-frameworks.md) (Astro, VitePress, Next.js, Gatsby). [`examples/sites/`](https://github.com/reverentgeek/sitesquatch/tree/main/examples/sites/) has small, complete sites to start from or copy parts of, each built in CI: `blog-tags`, `blog-categories`, `docs-sidebar`, `glossary-docs`, `versioned-docs`, `component-docs`, `reference-pages` and `islands`.
6
+ Everything migrates eventually. The trailheads map another generator's config, front matter and templates onto ssqch's, and `ssqch docs --from <generator>` prints the one you need: [from Zola](trailheads/from-zola.md), [from Hugo](trailheads/from-hugo.md), [from Eleventy](trailheads/from-eleventy.md), [from Docusaurus](trailheads/from-docusaurus.md), [from MkDocs](trailheads/from-mkdocs.md), [from Hexo](trailheads/from-hexo.md), [from Jekyll](trailheads/from-jekyll.md) and [from component frameworks](trailheads/from-component-frameworks.md) (Astro, VitePress, Next.js, Gatsby). [`examples/sites/`](https://github.com/reverentgeek/sitesquatch/tree/main/examples/sites/) has small, complete sites to start from or copy parts of, each built in CI: `blog-tags`, `blog-categories`, `docs-sidebar`, `glossary-docs`, `versioned-docs`, `component-docs`, `reference-pages`, `islands` and `jekyll-guides`.
7
7
 
8
- For a Zola site, `ssqch import zola` moves `tags` out of `[taxonomies]` and turns `path` into `permalink` in each page's front matter, writes a first `ssqch.config.js` from `config.toml` (the site's data, Markdown options, Sass, redirects, a sitemap), and lists what the Tera templates, shortcodes and sections need.
8
+ ## Scouting a site
9
9
 
10
- For an Eleventy site, `ssqch import eleventy` does the mechanical part. It renames `*.11tydata.*` files, rewrites front matter keys and image attributes to ssqch's names, writes a first `ssqch.config.js` from what it can read in the Eleventy config (folders, passthrough copies, template engines, `pathPrefix`), and lists what's left to port by hand, each with its file and line and what it becomes: filters, shortcodes, collections, plugins and their ssqch equivalents. Without `--write` it only prints the list, so run it in a clean git checkout, read it, then run it again with `--write`:
10
+ `ssqch scout` tells you what moving a site to ssqch takes, before you start and at any point during the move. Run it in the old site's folder (or name the folder: `ssqch scout ../old-site`). It finds the generator from its files (`_config.yml`, `hugo.toml`, `mkdocs.yml`, an Eleventy config; `--from <generator>` chooses when it can't tell or guesses wrong) and prints:
11
+
12
+ - **Reference build:** the `ssqch baseline` command that builds the site with its own generator to compare with, from the site's own build command (`netlify.toml`, a `build` script), and what that build needs (`PAGES_REPO_NWO` for a GitHub Pages site, an `npm install` for Tailwind).
13
+ - **A summary first:** how many things there are to do, across how many pages, and how many of them ssqch does as it is, an option does (the draft turns it on), are not in ssqch yet, or are the site's own code to port. It's the first answer to "how big is this move?".
14
+ - **To do:** what the site uses that needs doing in ssqch, each with its file and line, ssqch's way to do it, or "not in ssqch yet", the most files first. A thing used many times is one line, with a count and the first place it's used. Each line is marked `[option]` (an option does it, in the draft), `[not yet]` or `[port]` (the site's own code: templates, plugins, hooks); a line without a mark is something ssqch does.
15
+ - **Draft:** the new files a move starts with: a first `ssqch.config.js` from the old config, directory data for posts and collections, includes and render hooks for the old generator's plugins. `--write-draft` writes the ones that aren't there, and never overwrites a file.
16
+ - **Edits:** the changes to the site's own files that are mechanical and clearly right (a data file's name, an image attribute, `{% seo %}` to an include, a `package.json` script). `--patch move.patch` writes them as a patch to read and apply with `git apply move.patch`; scout never applies it. It doesn't rewrite templates: where a template would need a rewrite, ssqch has the compatibility instead (`jekyllTemplates`, Eleventy's front matter keys as aliases), or the list says so.
17
+
18
+ It changes nothing unless it's asked, so it's safe to run again during a move: the draft files you've written show as there already, applied edits are gone from the list, an `[option]` the site's `ssqch.config.js` sets already is done (scout loads the config and checks each value the option names: `3 done already: ssqch.config.js sets markdown: { admonitions: "mkdocs" }, ...`), and what's left is what still needs doing. An option that's a plugin call or a list stays on the list for you to check, and a config that doesn't load says why and counts nothing as done. `--compare` also builds the site with ssqch and compares the output with the reference build (`ssqch baseline`'s `ref-common`, or `ref-1`; `--reference <dir>` names another), and adds the result to the report: how many files differ, and the biggest groups of differences, the most files first, with the first file and the change. It builds with the clock `ssqch baseline` pins (`TZ=UTC`, and `SOURCE_DATE_EPOCH` at the HEAD commit's time, or 2026-01-01 outside git; one you set wins), so a sitemap's dates aren't a difference of their own. The comparison is the normalized one `ssqch diff` makes; `ssqch diff --exact` checks byte for byte. Fix the top group, and run `ssqch scout --compare` again: it's the move's loop in one command.
19
+
20
+ `--format json` prints the same report for agents and scripts: `generator`, `detectedBy`, `underWay` (an `ssqch.config.js` is there), `configError` (why it couldn't be read, or `null`), `summary` (`pages`, how many to-dos are `ssqch`, `option`, `notYet` and `site`, and how many are `done`), `build` (`command`, `output`, `baseline`, `needs`), `todo` (`at`, `what`, a stable `code` such as `hugo-shortcode` or `mkdocs-admonitions`, `status`: `ssqch`, `option`, `not-yet` or `site`, `count` and `files` when it's counted, `option` for the config that does it, and `docs` for an `ssqch docs` query), `done` (the to-dos the config does already: `at`, `what`, `code`, `option`), `draft` (`path`, `from`, `there`), `edits` (`path`, `to` for a rename, `changes`), `wroteDraft`, `patch`, `trailhead`, and with `--compare`, `compare` (`reference`, `output`, `built`, `errors`, `same`, `summary`, `groups` with `files`, `kind`, `first`, `removed` and `added`, `files` with the paths `changed`, `added` and `removed`, the first 20 of each, and `problem` when there was nothing to compare).
11
21
 
12
22
  ```sh
13
- ssqch import eleventy # what would change, and what's left (or: ssqch import zola)
14
- ssqch import eleventy --write # make the changes
23
+ ssqch scout # what moving this site takes
24
+ ssqch scout --write-draft --patch move.patch # write the draft and the patch
25
+ git apply move.patch # after reading it
26
+ ssqch scout # later: what's left
15
27
  ```
16
28
 
29
+ What it reads in depth: Eleventy (the config and the modules it loads, filters and shortcodes, plugins, data files, `package.json`), Jekyll (`_config.yml`, the Gemfile's plugins, collections, `_plugins/*.rb`, templates that read Jekyll's `page` and `site`), Zola (`config.toml`, sections, Tera templates and shortcodes), Hugo (shortcodes and their calls, sections and `cascade`, render hooks, Go templates and Hugo Pipes; the draft turns on `shortcodes: "hugo"` and has a container template to port for each of the site's shortcodes) and MkDocs (`mkdocs.yml`'s nav, theme, plugins and Markdown extensions, and the MkDocs syntax the pages use: admonitions, tabs, `.md` links, icons; the draft turns on the options that read them as they are, and writes the nav as `_data/nav.yml`). For Docusaurus (MDX and its imports, `<Tabs>`, admonitions, the sidebar, versions, plugins), Astro (`.astro` and framework components, content collections, integrations), VitePress (containers, Vue in pages, the config's sidebar, the theme) and Hexo (tag plugins, the theme, scaffolds, plugins) it lists what the pages use, without a draft yet. If it finds no generator's files, or two generators', it says so and asks for `--from`.
30
+
31
+
32
+ ## Words you bring with you
33
+
17
34
  Habits come along too. Where another generator's word means the same thing in ssqch, it works, and says ssqch's name once (`--quiet` hides it):
18
35
 
19
36
  ```text
@@ -4,7 +4,7 @@ description: "A page's data is a cascade."
4
4
  ---
5
5
  A page's data is a cascade. From the lowest level to the highest:
6
6
 
7
- 1. **Global data:** files in a theme's `_data/`, then the site's `_data/` (`site.json` is `site`), then the config's `data`.
7
+ 1. **Global data:** files in a theme's `_data/`, then the site's `_data/` (`site.json` is `site`), then the config's `data`. A `layout` there (`data: { layout: "base.jinja" }`) is every page's that doesn't set one lower down: in directory data or front matter, where `layout: false` turns it off.
8
8
  2. **Layouts:** the front matter of the page's layouts, the outermost layout first.
9
9
  3. **Directory data:** `posts/posts.json` (or `.yaml`, `.toml`, `posts.data.js`) applies to everything in `posts/` and below it. The outermost folder goes first.
10
10
  4. **The page's data file:** `pine.json` or `pine.data.js` next to `pine.md`.
@@ -0,0 +1,6 @@
1
+ ---
2
+ # mkdocsTemplates: the 404 page MkDocs renders from the theme's 404.html, with no page.
3
+ permalink: /404.html
4
+ mkdocsPage: false
5
+ ---
6
+ {% extends "404.html" %}
@@ -75,16 +75,20 @@ declare module "ssqch" {
75
75
 
76
76
  /** How Markdown renders. */
77
77
  export interface MarkdownOptions {
78
- /** Automatic heading `id`s: `"github"` (the default: GitHub's and github-slugger's anchors, character for character), `"blackfriday"` (Hugo's older style: `a-b` for `A -- B`), or `false` for none. A `{#id}` on the heading always wins. */
79
- headingIds?: "github" | "blackfriday" | "ascii" | false | ((text: string) => string);
78
+ /** Automatic heading `id`s: `"github"` (the default: GitHub's and github-slugger's anchors, character for character), `"blackfriday"` (Hugo's older style: `a-b` for `A -- B`), `"kramdown"` (Jekyll's: GitHub's ids for the page's headings, and kramdown's ASCII ones, `section` for none, for headings inside `markdown="1"` HTML), `"markdown-it-anchor"` (that plugin's default: the lowercase text with spaces as `-`, percent-encoded, `what%E2%80%99s-new%3F`), `"python-markdown"` (MkDocs': Python-Markdown's `toc` ids, ASCII, `cafe-notes` for `Café notes`), or `false` for none. A `{#id}` on the heading always wins. */
79
+ headingIds?: "github" | "blackfriday" | "ascii" | "kramdown" | "markdown-it-anchor" | "python-markdown" | false | ((text: string) => string);
80
80
  /** `## Heading {#id .class key=value}`. Default `true`. */
81
81
  headingAttributes?: boolean;
82
82
  /** `[^1]` references, with the notes at the end of the page. Default `true`. */
83
83
  footnotes?: boolean;
84
84
  /** `- [ ]` and `- [x]` items. Default `true`. */
85
85
  taskLists?: boolean;
86
- /** Bare `https://` and `www.` URLs become links. Default `true`. */
87
- autolinks?: boolean;
86
+ /** Bare `https://` and `www.` URLs become links. `"fuzzy"` links bare domains (`example.com`, with a common or two-letter country TLD) and email addresses too, as markdown-it's `linkify` does. Default `true`. */
87
+ autolinks?: boolean | "fuzzy";
88
+ /** A single newline inside a paragraph (or a list item) becomes a `<br>`, as markdown-it's `breaks: true` makes it. Default `false`. */
89
+ breaks?: boolean;
90
+ /** An image (or a linked image) alone in a paragraph becomes `<figure><img alt=""><figcaption>its alt text</figcaption></figure>`, as markdown-it-implicit-figures with `figcaption: true` writes it. Default `false`. */
91
+ figures?: boolean;
88
92
  /** GitHub's `> [!NOTE]` alerts: note, tip, important, warning and caution. Default `true`. */
89
93
  alerts?: boolean;
90
94
  /** `::: name args` blocks, rendered by `_includes/containers/name.*`. Default `true`. */
@@ -95,8 +99,22 @@ declare module "ssqch" {
95
99
  smartPunctuation?: boolean;
96
100
  /** Lines indented four spaces are code blocks. `false` renders them as ordinary Markdown (HTML indented inside Markdown, say); fences are still code. Default `true`. */
97
101
  indentedCode?: boolean;
98
- /** Highlight fenced code at build time, with `hl-*` classes. The build writes their stylesheet to `/highlight.css`, or to `css` (a URL path), or not at all with `css: false`. `languages` adds languages or replaces built-in ones. Default `false`. */
99
- highlight?: boolean | { css?: string | false; languages?: Record<string, Highlighter> };
102
+ /** Link and image URLs are percent-encoded, as CommonMark's reference renderer writes them (`#كتابة` as `#%D9%83...`, `café.png` as `caf%C3%A9.png`). `false` writes them as the page has them, HTML-escaped only (`&` as `&amp;`), as kramdown (Jekyll) does; browsers go to the same place either way. A link or image hook gets the URL as written in both. Default `true`. */
103
+ encodeUrls?: boolean;
104
+ /** Highlight fenced code at build time, with `hl-*` classes. The build writes their stylesheet to `/highlight.css`, or to `css` (a URL path), or not at all with `css: false`. `languages` adds languages or replaces built-in ones. `classes` names the tokens as another highlighter does, so a site keeps its theme's CSS: `"prism"` (`token keyword`, `<pre class="language-js">`, marked lines as `<mark class="highlight-line highlight-line-active">`), `"pygments"` or `"chroma"` (Pygments' short names, `k`, `s`, `nf`, which MkDocs' and Hugo's themes style), or `{ keyword: "tok-keyword" }` for some kinds; the stylesheet uses the same names. Default `false`. */
105
+ /** Markdown inside HTML, as Jekyll's kramdown reads it: `"kramdown"` renders the content of an element with `markdown="1"` (span-level for `p`, headings and inline elements, block-level for the others; `"block"` and `"span"` choose) and drops the attribute, and keeps kramdown's HTML rules: a block-level element is raw HTML to its end tag, blank lines and all. Default `false`: HTML is CommonMark's, and Markdown inside it stays text. */
106
+ htmlMarkdown?: "kramdown" | false;
107
+ /** MkDocs' admonitions: `"mkdocs"` writes `!!! note "Title"` (body indented four spaces) as Python-Markdown's `<div class="admonition note"><p class="admonition-title">Title</p>...</div>`, and `??? note` and `???+ note` (pymdownx.details) as `<details class="note">`, open with `+`. The title is the type's name when there's none, and left out for `""`. Default `false`. */
108
+ admonitions?: "mkdocs" | false;
109
+ /** MkDocs' content tabs: `"mkdocs"` writes `=== "Tab"` blocks (body indented four spaces; tabs one after another are one set, `===+` selected, `===!` a new set) as pymdownx.tabbed's `alternate_style` writes them (`<div class="tabbed-set tabbed-alternate">`), which Material's CSS styles. Default `false`. */
110
+ tabs?: "mkdocs" | false;
111
+ /** Hugo's shortcodes: `"hugo"` reads a shortcode on a line of its own as a container: `{{< note type="tip" >}}` to `{{< /note >}}` (or `{{% %}}`) renders `_includes/containers/note.*` with `container.args`, `container.props` and the content as Markdown; one with no closing tag has no content. A shortcode inside a line of text is left as written. Default `false`. */
112
+ shortcodes?: "hugo" | false;
113
+ /** Links to `.md` files (`[Setup](setup/install.md#first)`) go to the page built from that file, with the `#` part: `true` writes its URL from the site's root (`/setup/install/#first`), `"relative"` from the page, as MkDocs does (`setup/install/#first`). A link to a file that isn't a page stays as written, for the link checker. Default `false`. */
114
+ sourceLinks?: boolean | "relative";
115
+ /** Another Markdown's ways, where they're CommonMark's otherwise. `"python-markdown"` (MkDocs'): a raw HTML block runs to its closing tag, blank lines and all; a list nests at four spaces (an item indented less is the next item); and the HTML is Python-Markdown's: `"` as it is in text, `<hr />`, `<br />`, `<img alt="" src="" />`, a tight item's nested list right after its text, nothing at the end. Default `false`. */
116
+ dialect?: "python-markdown" | false;
117
+ highlight?: boolean | { css?: string | false; languages?: Record<string, Highlighter>; classes?: "prism" | "pygments" | "chroma" | Partial<Record<TokenKind, string>> };
100
118
  }
101
119
 
102
120
  /** What a collection function gets. */
@@ -136,8 +154,13 @@ declare module "ssqch" {
136
154
  type MaybePromise<T> = T | Promise<T>;
137
155
  /** A function, or `{ run: "command" }` to run a program in the project root (through `sh -c`, or `cmd /C` on Windows). It gets `SSQCH_ENV`, `SSQCH_SERVING`, `SSQCH_QUIET`, `SSQCH_INPUT` and `SSQCH_OUTPUT`; a failure fails the build. */
138
156
  type Hook = ((event: BuildEvent) => MaybePromise<void>) | { run: string };
139
- /** Renders a template's body (front matter removed) with the page's data. */
140
- type EngineRender = (source: string, data: Record<string, any>) => MaybePromise<string>;
157
+ /** What a site's own engine is rendering, its third argument: a page's body, a layout, a Markdown render hook, or a page's `permalink` or `computed` string; and the file, as `page.inputPath` names it (`./src/posts/pine.md`). */
158
+ interface EngineContext {
159
+ kind: "body" | "layout" | "hook" | "permalink" | "computed";
160
+ path: string;
161
+ }
162
+ /** Renders a template's body (front matter removed) with the page's data. The third argument says what's being rendered. */
163
+ type EngineRender = (source: string, data: Record<string, any>, context: EngineContext) => MaybePromise<string>;
141
164
 
142
165
  /**
143
166
  * A field's type: `"string"`, `"number"`, `"integer"`, `"boolean"`, `"date"`, `"file"` (a path to a file that exists), `"object"`, `"array"` or `"any"`;
@@ -185,15 +208,15 @@ declare module "ssqch" {
185
208
  /** Shows up in error messages. */
186
209
  name?: string;
187
210
  /** Functions templates can call: `{{ slug(title) }}`. Async functions are awaited. */
188
- filters?: Record<string, (...args: any[]) => unknown>;
211
+ filters?: Record<string, (this: FilterContext | undefined, ...args: any[]) => unknown>;
189
212
  /** Data for every template. A value that's a function (sync or async) is called on each build, and its answer is that name's value. */
190
213
  data?: Record<string, unknown>;
191
214
  /** Custom collections, from the pages in collections. */
192
215
  collections?: Record<string, (pages: Pages) => unknown>;
193
216
  /** Run on every output file. Return the content, changed or not. */
194
217
  transforms?: Record<string, (content: string, page: TransformPage) => MaybePromise<string>>;
195
- /** Template engines of your own, by file extension: a function, or an object with `render`. Return the rendered text. */
196
- engines?: Record<string, EngineRender | { render: EngineRender }>;
218
+ /** Template engines of your own, by file extension: a function, or an object with `render` (a markdown-it instance is one: `render(source, env)` gets the page's data as `env`). Return the rendered text. `md` replaces ssqch's Markdown for `.md` files and `md` in a `render` chain, after the `markdownEngine`; the `markdown` filter stays ssqch's. `cache: true` keeps the page bodies it renders by their source, so a body with the same text isn't rendered again, in a build or the next one in `ssqch serve`: for an engine whose output depends on the source alone. */
219
+ engines?: Record<string, EngineRender | { render: EngineRender; cache?: boolean }>;
197
220
  /** Files or folders to copy: a path, or `{ from: to }`, or an array of them. */
198
221
  passthrough?: string | Record<string, string> | Array<string | Record<string, string>>;
199
222
  /** More paths for `ssqch serve` to watch. */
@@ -247,12 +270,22 @@ declare module "ssqch" {
247
270
  bundles?: boolean;
248
271
  /** Printing an undefined value (`{{ titel }}`) is an error, in every template language. Conditionals and defaults still work. Default `false`. */
249
272
  strict?: boolean;
273
+ /** Start a template's body at its first line with text, dropping the blank lines after the closing `---`, as Jekyll does (its layouts and includes print no blank line there). Off by default: the body starts on the line after `---`, as Eleventy and gray-matter have it. */
274
+ trimAfterFrontMatter?: boolean;
275
+ /** Templates see Jekyll's `page` and `site`, so a Jekyll site's layouts and includes run as written: `page` has the page's front matter too (`page.title`; ssqch's own keys, like `url` and `date`, win) and `page.path` and `page.categories`; `site` has the site's own keys, `posts` (newest first), each collection by its tag (`site.articles`), `pages`, `html_pages`, `categories`, `tags`, `data` (the global data) and `time`; and their items read in Jekyll's shape (`post.title`, `post.content`, `post.excerpt`). Off by default: front matter is at the top level (`title`) and items keep it under `data`. */
276
+ jekyllTemplates?: boolean;
277
+ /** Templates see what MkDocs gives a theme's, so an MkDocs theme's Jinja templates (Material for MkDocs') run as written: `config` (mkdocs.yml, with the theme's `mkdocs_theme.yml` under its `theme`), `nav` (Sections, Pages and Links, with `active` on the page being rendered), `page` in a layout (MkDocs' page: `title`, `url` without its first `/`, `abs_url`, `canonical_url`, `edit_url`, `content`, `toc`, `meta`, `previous_page`, `next_page`, `ancestors`, `is_homepage`), `base_url`, `mkdocs_version` and `build_date_utc`, and the `url` and `script_tag` filters, relative to the page. A Markdown page's layout is `main.html` (or its front matter's `template`), the theme's `404.html` makes `/404.html`, and Jinja doesn't escape (`jinja: { autoescape }` says otherwise). `true` reads `mkdocs.yml`; a string names another file. Off by default. */
278
+ mkdocsTemplates?: boolean | string;
279
+ /** Jinja's settings for `.jinja` and `.j2` templates. `autoescape: false` prints values as they are, as MkDocs' Jinja does (`| e` still escapes); default `true`, or `false` with `mkdocsTemplates`. `.njk` always escapes. */
280
+ jinja?: { autoescape?: boolean };
250
281
  /** `page.lastModified`: `"git"` for the last commit that changed the page's file (its modification time when it has uncommitted changes), or `"file"` for the modification time. Off by default. Needs the full history in CI (`fetch-depth: 0`). */
251
282
  lastModified?: "git" | "file" | false;
252
283
  /** The date of a page with no date of its own (in its data or its file name): `"git"` for the last commit that changed its file, the same in every checkout, or `"file"` (the default) for the file's modification time, which is when the checkout wrote it. Either way it sorts after the dated pages, by path. Needs the full history in CI (`fetch-depth: 0`). */
253
284
  dateFallback?: "git" | "file";
254
285
  /** The time zone the site's own JavaScript runs in, as an IANA name (`"UTC"`, `"America/New_York"`): `Date`'s local methods and libraries like luxon and date-fns, in data files, filters, hooks and Edge templates, so a laptop and CI build the same pages. ssqch's own date filters are UTC whatever this says. Default: the machine's. The config's own top-level code runs before it applies. */
255
286
  timeZone?: string;
287
+ /** Other names for layouts: `{ post: "layouts/post.njk" }` makes `layout: post` that file (where it would be `_includes/post.*`), as Eleventy's `addLayoutAlias` did. A page's `layout` is still the name it gave. */
288
+ layoutAliases?: Record<string, string>;
256
289
  /** The path the site is served under, when that isn't the root of its domain: `"/repo/"` for `https://you.github.io/repo/`. Templates and `page.url` stay as they are; ssqch adds the base to URLs from the site's root in the HTML it writes. Use the `withBase()` filter outside HTML attributes. */
257
290
  base?: string;
258
291
  /** A theme under the site: a folder (`"themes/docs"`), or a git repository pinned to a tag or a commit's full hash (`"https://github.com/you/theme#v1.2.0"`, with `#v1.2.0:folder` for a theme in a folder of its repository), fetched once and kept in `.cache/ssqch/themes/`. The site's own includes, data, pages and files win over the theme's, one by one. In a list, earlier themes sit on top of later ones. */
@@ -270,10 +303,19 @@ declare module "ssqch" {
270
303
 
271
304
  /** Returns its argument. It's there so the config reads as one, and for these types. */
272
305
  export function defineConfig<T extends Config | ((context: ConfigContext) => MaybePromise<Config>)>(config: T): T;
273
- /** Render Markdown with the site's `markdown` options (render hooks and containers are for templates). `inline` drops the `<p>` around a single paragraph. */
274
- export function markdown(text: string, options?: { inline?: boolean }): string;
306
+ /** Render Markdown with the site's `markdown` options (render hooks and containers are for templates). `inline` drops the `<p>` around a single paragraph: `markdown(text, { inline: true })`, or `markdown(text, "inline")` as in templates. */
307
+ export function markdown(text: string, options?: { inline?: boolean } | "inline"): string;
275
308
  /** Read a JSON, YAML or TOML file (from the project root) into data: `readData("src/_data/sites/en.yml")`. */
276
309
  export function readData(path: string): any;
310
+ /** HTML that templates print as it is, in every template language: a filter's answer that's markup, `return safe(`<b>${text}</b>`)`. Anything else gets the text as a string. Escape what goes in it yourself. */
311
+ export function safe(html: unknown): string;
312
+ /** `this` in a config filter written as a `function` (an arrow function has no `this`): the page being rendered. `undefined` outside a render (in a collection, a data file or a hook). */
313
+ export interface FilterContext {
314
+ /** The page being rendered, as its templates see `page`: `url`, `inputPath`, `outputPath`, `date`, and in a layout `headings` and `excerpt`. */
315
+ page: Record<string, any>;
316
+ /** Everything the template sees: front matter, the cascade, `collections`, and in a layout `content`. */
317
+ data: Record<string, any>;
318
+ }
277
319
  /** A file that `files()` found. */
278
320
  export interface FoundFile {
279
321
  /** From the project root, with `/`: `"images/albums/v1/20011222_08.JPG"`. */
@@ -305,6 +347,10 @@ declare module "ssqch" {
305
347
  separator?: string;
306
348
  /** `"drop"` (the default): `Drew's Brownies` is `drews-brownies`. `"separate"`: an apostrophe splits words like other punctuation, `drew-s-brownies`, to keep a site's existing URLs. */
307
349
  apostrophes?: "drop" | "separate";
350
+ /** `true` takes accents off and spells out a few letters and symbols first, as the slugify package does: `Thomas Sjögren` is `thomas-sjogren`, `Straße & 50%` is `strasse-and-50-percent`. Other scripts stay as they are. Default `false`. */
351
+ ascii?: boolean;
352
+ /** `true` drops HTML tags first: `Use <code>title</code>` is `use-title`, not `use-code-title-code`. Default `false`. */
353
+ stripTags?: boolean;
308
354
  }
309
355
  /** The `slugify` template filter, for data files: `slugify("Taco Bake", { separator: "_" })` is `"taco_bake"`. Lowercase letters and digits, with `separator` (a dash by default) for each run of anything else. A string is the separator. */
310
356
  export function slugify(text: string, options?: SlugifyOptions | string): string;
@@ -427,14 +473,26 @@ declare module "ssqch/minify" {
427
473
  removeComments?: boolean;
428
474
  /** Default `true`. */
429
475
  shortDoctype?: boolean;
430
- /** Drop boolean attributes' values (`defer="defer"` to `defer`) and extra whitespace in `class`, `srcset`, URLs and the viewport `<meta>`. Default `true`. */
476
+ /** Drop boolean attributes' values (`defer="defer"` to `defer`) and extra whitespace in `class`, `srcset`, URLs and the viewport `<meta>` (whose numbers it writes as html-minifier-terser does: `initial-scale=1`). Default `true`. */
431
477
  shortenAttributes?: boolean;
432
478
  }
433
479
 
434
- /** Minifies HTML output, after the image transform, with ssqch's own minifier (Rust, as WebAssembly): it doesn't write html-minifier-terser's bytes. */
435
- export function minifyPlugin(options?: MinifyOptions): BuiltinPlugin;
480
+ /** `minifyPlugin()`'s options: the minifier's, and what else it minifies, all off by default. */
481
+ export interface MinifyPluginOptions extends MinifyOptions {
482
+ /** Compress each page's `<style>` elements with ssqch's Sass, as `minifyCss` does; one it can't read (Sass syntax, native CSS nesting) stays as it is, with a warning. Default `false`. */
483
+ css?: boolean;
484
+ /** Take the whitespace between tags out of `.xml`, `.rss` and `.atom` files (feeds, sitemaps), not inside text, CDATA or comments. Default `false`. */
485
+ xml?: boolean;
486
+ /** Write `.json` and `.webmanifest` files without spaces. Default `false`. */
487
+ json?: boolean;
488
+ }
489
+
490
+ /** Minifies HTML output, after the image transform, with ssqch's own minifier (Rust, as WebAssembly): it doesn't write html-minifier-terser's bytes. With `css`, `xml` and `json`, inline CSS, feeds and manifests too. */
491
+ export function minifyPlugin(options?: MinifyPluginOptions): BuiltinPlugin;
436
492
  /** Minify one string of HTML, with the plugin's options. */
437
493
  export function minify(html: string, options?: MinifyOptions): string;
494
+ /** Compress CSS text as `style: "compressed"` Sass writes it (`.a{color:#fff}`), for CSS inlined by a template: `{{ css | minifyCss }}` in a filter of your own. Sass's own syntax, and CSS ssqch's Sass can't read (native nesting), is an error. */
495
+ export function minifyCss(css: string): string;
438
496
  }
439
497
 
440
498
  declare module "ssqch/assets" {
@@ -475,8 +533,8 @@ declare module "ssqch/sitemap" {
475
533
  import type { BuiltinPlugin } from "ssqch";
476
534
 
477
535
  export interface SitemapPluginOptions {
478
- /** The site's address, like `"https://example.com"`. */
479
- url: string;
536
+ /** The site's address, like `"https://example.com"`. Without one (or with `""`, as a Jekyll site's `url` often is), each `<loc>` is a path from the site's root, as jekyll-sitemap writes it, and every build warns: search engines read only whole addresses. */
537
+ url?: string;
480
538
  /** URL globs to leave out, like `["/tags/**"]`. Pages with `sitemap: false` and 404 pages are always left out. */
481
539
  exclude?: string[];
482
540
  /** Add `<lastmod>` from each page's date. Default `true`. */
@@ -535,6 +593,8 @@ declare module "ssqch/sass" {
535
593
  style?: "compressed" | "expanded";
536
594
  /** More folders `@use` and `@import` look in, relative to the project root. */
537
595
  loadPaths?: string[];
596
+ /** `false` leaves out what CSS with a character outside ASCII starts with: a byte order mark (compressed) or `@charset "UTF-8";` (expanded), as Dart Sass's `--no-charset` does and jekyll-sass-converter's output has it. Default `true`. */
597
+ charset?: boolean;
538
598
  }
539
599
 
540
600
  /** Compiles Sass at the start of each build, with grass (Rust, as WebAssembly: no Dart Sass), so fingerprinting and the link checker see the CSS. */
package/lib/assets.js CHANGED
@@ -2,30 +2,29 @@ import { createRequire as __ssqchCreateRequire } from "node:module";
2
2
  const require = __ssqchCreateRequire(import.meta.url);
3
3
  import {
4
4
  Options
5
- } from "./chunk-HGJ5VWUR.js";
5
+ } from "./chunk-RBNPBTDP.js";
6
6
  import {
7
7
  BUILTINS,
8
8
  blake3Hex,
9
9
  rewriteHtml
10
- } from "./chunk-QMA7CK7B.js";
11
- import "./chunk-LCPSKHAV.js";
12
- import "./chunk-NKXEPHRZ.js";
10
+ } from "./chunk-Z44IAMNG.js";
11
+ import "./chunk-2QTJTEBV.js";
12
+ import "./chunk-ERAIEV3O.js";
13
13
  import "./chunk-AD3HAW3W.js";
14
- import "./chunk-DDV6JEC2.js";
15
- import "./chunk-5DNDSNTP.js";
14
+ import "./chunk-YCOTX2VM.js";
15
+ import "./chunk-GS5B3CBW.js";
16
+ import "./chunk-JC54PHIT.js";
17
+ import "./chunk-HFSWUTXX.js";
16
18
  import "./chunk-FVZ5JBRI.js";
17
- import "./chunk-NFJJKDRI.js";
18
19
  import "./chunk-UU43WIZG.js";
19
- import "./chunk-JWCCVTTR.js";
20
+ import "./chunk-IOBC665M.js";
20
21
  import "./chunk-CMUWRPSQ.js";
21
22
  import {
22
23
  bail,
24
+ displayPath,
23
25
  warn,
24
26
  warning
25
- } from "./chunk-BGCBSQ4A.js";
26
- import {
27
- displayPath
28
- } from "./chunk-VJWQSYEG.js";
27
+ } from "./chunk-AIMEXBTK.js";
29
28
  import "./chunk-I3PS26CI.js";
30
29
 
31
30
  // src/modules/assets.ts
@@ -2,35 +2,37 @@ import { createRequire as __ssqchCreateRequire } from "node:module";
2
2
  const require = __ssqchCreateRequire(import.meta.url);
3
3
  import {
4
4
  modules
5
- } from "./chunk-3EPHKJEG.js";
5
+ } from "./chunk-GJNIQAIH.js";
6
6
  import {
7
7
  BUILTIN_FILTERS
8
- } from "./chunk-CB6YFUXU.js";
8
+ } from "./chunk-GLJQ4C76.js";
9
9
  import {
10
10
  longHelp
11
- } from "./chunk-F65YUXZ7.js";
11
+ } from "./chunk-RIAOXEXC.js";
12
12
  import {
13
- agentsMd,
14
- bundled,
15
- bundledNames,
16
- types
17
- } from "./chunk-Y2ESFAAD.js";
13
+ agentsMd
14
+ } from "./chunk-B5E27PLU.js";
18
15
  import {
19
16
  configOptions
20
- } from "./chunk-QMA7CK7B.js";
21
- import "./chunk-LCPSKHAV.js";
22
- import "./chunk-NKXEPHRZ.js";
17
+ } from "./chunk-Z44IAMNG.js";
18
+ import "./chunk-2QTJTEBV.js";
19
+ import "./chunk-ERAIEV3O.js";
23
20
  import {
24
21
  VERSION
25
22
  } from "./chunk-AD3HAW3W.js";
26
- import "./chunk-DDV6JEC2.js";
27
- import "./chunk-5DNDSNTP.js";
23
+ import {
24
+ bundled,
25
+ bundledNames,
26
+ types
27
+ } from "./chunk-YCOTX2VM.js";
28
+ import "./chunk-GS5B3CBW.js";
29
+ import "./chunk-JC54PHIT.js";
30
+ import "./chunk-HFSWUTXX.js";
28
31
  import {
29
32
  closest
30
33
  } from "./chunk-FVZ5JBRI.js";
31
- import "./chunk-NFJJKDRI.js";
32
34
  import "./chunk-UU43WIZG.js";
33
- import "./chunk-JWCCVTTR.js";
35
+ import "./chunk-IOBC665M.js";
34
36
  import "./chunk-CMUWRPSQ.js";
35
37
  import {
36
38
  OTHER_CONFIGS,
@@ -38,8 +40,7 @@ import {
38
40
  jsYaml,
39
41
  red,
40
42
  toJson
41
- } from "./chunk-BGCBSQ4A.js";
42
- import "./chunk-VJWQSYEG.js";
43
+ } from "./chunk-AIMEXBTK.js";
43
44
  import "./chunk-I3PS26CI.js";
44
45
 
45
46
  // src/commands/docs.ts
@@ -511,6 +512,27 @@ function guide(generator) {
511
512
  ${body.trim()}
512
513
  ` };
513
514
  }
515
+ function trailheadSection(query) {
516
+ const wanted = query.trim().toLowerCase();
517
+ for (const file of bundledNames("docs/trailheads").sort()) {
518
+ const { title, body } = docsPage(bundled(`docs/trailheads/${file}`));
519
+ const lines = body.split("\n");
520
+ for (let i = 0; i < lines.length; i++) {
521
+ const m = /^(#{2,6})\s+(.+?)\s*#*\s*$/.exec(lines[i]);
522
+ if (!m || m[2].toLowerCase() !== wanted) continue;
523
+ let end = i + 1;
524
+ let fence = false;
525
+ for (; end < lines.length; end++) {
526
+ if (/^(```|~~~)/.test(lines[end])) fence = !fence;
527
+ const next = !fence && /^(#{2,6})\s/.exec(lines[end]);
528
+ if (next && next[1].length <= m[1].length) break;
529
+ }
530
+ return { page: title, generator: file.replace(/^from-/, "").replace(/\.md$/, ""), heading: m[2], text: `${lines.slice(i, end).join("\n").trim()}
531
+ ` };
532
+ }
533
+ }
534
+ return void 0;
535
+ }
514
536
  var guideUrl = (file) => `${SITE_URL}/docs/trailheads/${file.replace(/\.md$/, "")}/`;
515
537
  function from(generator, json) {
516
538
  const known = generators();
@@ -552,6 +574,8 @@ ${rows(everyone)}`;
552
574
  The trailhead (${guideUrl(g.file)}):
553
575
 
554
576
  ${g.text.trimEnd()}
577
+
578
+ The move, step by step (reference builds with \`ssqch baseline\`, the biggest group of differences first): \`ssqch docs "moving a site with an agent"\`.
555
579
  `;
556
580
  else if (g) out += `
557
581
  The trailhead: ${guideUrl(g.file)}
@@ -559,6 +583,17 @@ The trailhead: ${guideUrl(g.file)}
559
583
  else out += "\nThere's no trailhead for it yet; `ssqch docs trailheads` has the general route.\n";
560
584
  return out;
561
585
  }
586
+ function pageNamed(query) {
587
+ const name = query.trim().replace(/^.*\/docs\//, "").replace(/^\/+|\/+$/g, "").replace(/\.md$/, "");
588
+ if (!/^[\w-]+(\/[\w-]+)?$/.test(name)) return void 0;
589
+ const nav = jsYaml.load(bundled("docs/nav.yml")) ?? [];
590
+ const files = nav.flatMap((group) => group.pages).filter((p) => typeof p === "string");
591
+ const file = files.find((f) => f.replace(/\.md$/, "") === name || !name.includes("/") && f.replace(/\.md$/, "").split("/").pop() === name);
592
+ if (file === void 0) return void 0;
593
+ const trail = /^trailheads\/from-([\w-]+)\.md$/.exec(file);
594
+ if (trail) return { file, trailhead: trail[1] };
595
+ return { file, title: docsPage(bundled(`docs/${file}`)).title };
596
+ }
562
597
  function runDocs(grammar, command) {
563
598
  const fail = (message) => {
564
599
  process.stderr.write(`${red("error:")} ${message}
@@ -587,8 +622,25 @@ function runDocs(grammar, command) {
587
622
  const text = agentsMd();
588
623
  return out(json ? JSON.stringify({ query, found: true, agentsMd: text }, null, 2) + "\n" : text);
589
624
  }
590
- const a = answer(grammar, all, known, query);
591
- if (a) return out(json ? JSON.stringify(answerJson(all, a), null, 2) + "\n" : answerText(all, a));
625
+ const page = known.some((n) => n.name === query) ? void 0 : pageNamed(query);
626
+ if (page?.trailhead !== void 0) {
627
+ try {
628
+ return out(from(page.trailhead, json));
629
+ } catch {
630
+ const { title, body } = docsPage(bundled(`docs/${page.file}`));
631
+ const text = `# ${title}
632
+
633
+ ${body.trim()}
634
+ `;
635
+ return out(json ? JSON.stringify({ query, found: true, page: { file: `site/src/docs/${page.file}`, url: guideUrl(page.file.replace(/^trailheads\//, "")), text } }, null, 2) + "\n" : text);
636
+ }
637
+ }
638
+ const a = page?.title !== void 0 ? { query, names: [], passages: [], also: [], section: all.findIndex((s) => s.level <= 2 && s.title === page.title) } : answer(grammar, all, known, query);
639
+ if (a && a.section !== -1) return out(json ? JSON.stringify(answerJson(all, a), null, 2) + "\n" : answerText(all, a));
640
+ const trail = trailheadSection(query);
641
+ if (trail) return out(json ? JSON.stringify({ query, found: true, trailhead: trail }, null, 2) + "\n" : `From "${trail.page}" (ssqch docs --from ${trail.generator}):
642
+
643
+ ${trail.text}`);
592
644
  const near = closestName(all, known, query);
593
645
  const next = near === void 0 ? nextStep(grammar, all, known, query) : void 0;
594
646
  if (json) {
@@ -8,7 +8,7 @@ import {
8
8
  } from "./chunk-CMUWRPSQ.js";
9
9
  import {
10
10
  bail
11
- } from "./chunk-BGCBSQ4A.js";
11
+ } from "./chunk-AIMEXBTK.js";
12
12
 
13
13
  // src/budgets.ts
14
14
  var BUDGETS = [
@@ -8,15 +8,14 @@ import {
8
8
  measure,
9
9
  overBudget,
10
10
  urlOf
11
- } from "./chunk-N4O5MDIB.js";
12
- import "./chunk-LCPSKHAV.js";
13
- import "./chunk-NKXEPHRZ.js";
14
- import "./chunk-DDV6JEC2.js";
11
+ } from "./chunk-RYIWYWRQ.js";
12
+ import "./chunk-2QTJTEBV.js";
13
+ import "./chunk-ERAIEV3O.js";
14
+ import "./chunk-GS5B3CBW.js";
15
15
  import "./chunk-FVZ5JBRI.js";
16
16
  import "./chunk-UU43WIZG.js";
17
17
  import "./chunk-CMUWRPSQ.js";
18
- import "./chunk-BGCBSQ4A.js";
19
- import "./chunk-VJWQSYEG.js";
18
+ import "./chunk-AIMEXBTK.js";
20
19
  import "./chunk-I3PS26CI.js";
21
20
  export {
22
21
  buildFiles,
@@ -1,37 +1,36 @@
1
1
  import { createRequire as __ssqchCreateRequire } from "node:module";
2
2
  const require = __ssqchCreateRequire(import.meta.url);
3
- import "./chunk-QMA7CK7B.js";
4
- import "./chunk-LCPSKHAV.js";
5
- import "./chunk-NKXEPHRZ.js";
3
+ import "./chunk-Z44IAMNG.js";
4
+ import "./chunk-2QTJTEBV.js";
5
+ import "./chunk-ERAIEV3O.js";
6
6
  import "./chunk-AD3HAW3W.js";
7
+ import "./chunk-YCOTX2VM.js";
7
8
  import {
8
9
  dirsOf,
9
10
  shownDir
10
- } from "./chunk-DDV6JEC2.js";
11
+ } from "./chunk-GS5B3CBW.js";
11
12
  import {
12
13
  slugWith
13
- } from "./chunk-5DNDSNTP.js";
14
+ } from "./chunk-JC54PHIT.js";
15
+ import "./chunk-HFSWUTXX.js";
14
16
  import "./chunk-FVZ5JBRI.js";
15
- import "./chunk-NFJJKDRI.js";
16
17
  import {
17
18
  FIELD_NOTES
18
19
  } from "./chunk-UU43WIZG.js";
19
- import "./chunk-JWCCVTTR.js";
20
+ import "./chunk-IOBC665M.js";
20
21
  import {
21
22
  serdeFloat
22
23
  } from "./chunk-CMUWRPSQ.js";
23
24
  import {
24
25
  bail,
25
26
  context,
26
- parseFrontMatter
27
- } from "./chunk-BGCBSQ4A.js";
28
- import {
29
27
  isDir,
30
28
  isFile,
31
29
  isInside,
30
+ parseFrontMatter,
32
31
  realPath,
33
32
  slashes
34
- } from "./chunk-VJWQSYEG.js";
33
+ } from "./chunk-AIMEXBTK.js";
35
34
  import "./chunk-I3PS26CI.js";
36
35
 
37
36
  // src/commands/new.ts
@@ -5,16 +5,18 @@ import {
5
5
  count,
6
6
  duration,
7
7
  fixed,
8
+ profileText,
8
9
  summary
9
- } from "./chunk-NKXEPHRZ.js";
10
- import "./chunk-DDV6JEC2.js";
10
+ } from "./chunk-ERAIEV3O.js";
11
+ import "./chunk-GS5B3CBW.js";
11
12
  import "./chunk-UU43WIZG.js";
12
- import "./chunk-VJWQSYEG.js";
13
+ import "./chunk-AIMEXBTK.js";
13
14
  import "./chunk-I3PS26CI.js";
14
15
  export {
15
16
  bytes,
16
17
  count,
17
18
  duration,
18
19
  fixed,
20
+ profileText,
19
21
  summary
20
22
  };