ssqch 0.10.1 → 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 (93) hide show
  1. package/bundled/completions/bash +61 -15
  2. package/bundled/completions/elvish +27 -12
  3. package/bundled/completions/fish +35 -23
  4. package/bundled/completions/powershell +29 -12
  5. package/bundled/completions/zsh +39 -19
  6. package/bundled/docs/agents.md +11 -0
  7. package/bundled/docs/comparing-builds.md +37 -5
  8. package/bundled/docs/configuring.md +30 -5
  9. package/bundled/docs/field-guide.md +1 -1
  10. package/bundled/docs/github-pages.md +1 -1
  11. package/bundled/docs/index.md +1 -1
  12. package/bundled/docs/known-gaps.md +1 -1
  13. package/bundled/docs/markdown.md +63 -5
  14. package/bundled/docs/multilingual.md +20 -3
  15. package/bundled/docs/nav.yml +1 -0
  16. package/bundled/docs/netlify.md +2 -2
  17. package/bundled/docs/plugins.md +4 -4
  18. package/bundled/docs/seo.md +39 -1
  19. package/bundled/docs/template-languages.md +6 -4
  20. package/bundled/docs/templates.md +3 -3
  21. package/bundled/docs/trailheads/from-eleventy.md +25 -13
  22. package/bundled/docs/trailheads/from-hugo.md +103 -0
  23. package/bundled/docs/trailheads/from-jekyll.md +49 -15
  24. package/bundled/docs/trailheads/from-mkdocs.md +54 -9
  25. package/bundled/docs/trailheads/from-zola.md +2 -2
  26. package/bundled/docs/trailheads.md +22 -5
  27. package/bundled/docs/where-values-come-from.md +1 -1
  28. package/bundled/mkdocs/404.jinja +6 -0
  29. package/bundled/ssqch.d.ts +71 -16
  30. package/lib/assets.js +10 -9
  31. package/lib/{chunk-MUYWL4ZX.js → chunk-2L3HR67O.js} +71 -18
  32. package/lib/{chunk-ERNVEZOK.js → chunk-2QTJTEBV.js} +1 -1
  33. package/lib/{chunk-CXRHH5P5.js → chunk-3HZZY3Y7.js} +5 -5
  34. package/lib/{chunk-G67W2FTJ.js → chunk-3K237XAX.js} +9 -8
  35. package/lib/{chunk-6RSZV5O2.js → chunk-443ZQLVX.js} +3 -3
  36. package/lib/{chunk-ZZBHBLDB.js → chunk-5ELAUHRL.js} +18 -16
  37. package/lib/{chunk-MDG5A4NI.js → chunk-A75EVUJX.js} +5 -5
  38. package/lib/{chunk-JFPLNHEQ.js → chunk-AIMEXBTK.js} +28 -5
  39. package/lib/{chunk-6OUT5VFK.js → chunk-B5E27PLU.js} +10 -39
  40. package/lib/{chunk-R2YGC3VE.js → chunk-CMJ7X5WW.js} +3 -2
  41. package/lib/{chunk-MDB3D3LP.js → chunk-ERAIEV3O.js} +2 -2
  42. package/lib/{chunk-DTSTCVRX.js → chunk-FCM3NYFR.js} +11 -8
  43. package/lib/{chunk-X7C6GFUM.js → chunk-GJNIQAIH.js} +8 -8
  44. package/lib/{chunk-FYRC2HBU.js → chunk-GLJQ4C76.js} +39 -18
  45. package/lib/{chunk-BXARVN5Z.js → chunk-GS5B3CBW.js} +1 -1
  46. package/lib/chunk-H5K2ZE7B.js +219 -0
  47. package/lib/{chunk-DNWA7WNO.js → chunk-HFSWUTXX.js} +1 -1
  48. package/lib/{chunk-7JGYYAKI.js → chunk-HWW5NCVJ.js} +1 -1
  49. package/lib/{chunk-BT3NVQOD.js → chunk-I3HYKEEW.js} +1 -1
  50. package/lib/{chunk-RFNLZM7W.js → chunk-IOBC665M.js} +1 -1
  51. package/lib/chunk-JC54PHIT.js +7992 -0
  52. package/lib/{chunk-3BQJY6GF.js → chunk-KCF2Z6N7.js} +1 -1
  53. package/lib/{chunk-HMVYNV6M.js → chunk-KZZS4W2V.js} +14 -12
  54. package/lib/{chunk-XR7GFL4B.js → chunk-LJOURBYT.js} +14 -12
  55. package/lib/chunk-OQGXZYZS.js +45 -0
  56. package/lib/chunk-OSBEH67S.js +6296 -0
  57. package/lib/{chunk-FYU22VDK.js → chunk-QJ5ZFTML.js} +14 -12
  58. package/lib/{chunk-LU73FTIR.js → chunk-QLUTNR37.js} +11 -10
  59. package/lib/{chunk-DUGGZ4EE.js → chunk-RBNPBTDP.js} +1 -1
  60. package/lib/{chunk-F65YUXZ7.js → chunk-RIAOXEXC.js} +10 -4
  61. package/lib/chunk-RVXGUMFI.js +21 -0
  62. package/lib/{chunk-FZGJUJAL.js → chunk-RYIWYWRQ.js} +3 -3
  63. package/lib/{chunk-LYPKL524.js → chunk-RZYAIX2R.js} +12 -10
  64. package/lib/{chunk-3NDFUMV2.js → chunk-V2FSMOFX.js} +3 -3
  65. package/lib/{chunk-26SHWRC6.js → chunk-X2GAVYV2.js} +524 -72
  66. package/lib/chunk-XS4EJSEK.js +279 -0
  67. package/lib/chunk-YCOTX2VM.js +37 -0
  68. package/lib/{chunk-P2TRR6XK.js → chunk-Z44IAMNG.js} +85 -16
  69. package/lib/chunk-Z5OP43HU.js +2945 -0
  70. package/lib/{chunk-3LODFCCH.js → chunk-ZINLHOX4.js} +2 -2
  71. package/lib/{chunk-HNG372DW.js → chunk-ZR3JYLFB.js} +814 -12347
  72. package/lib/cli.js +78 -37
  73. package/lib/elements.js +10 -9
  74. package/lib/image.js +11 -10
  75. package/lib/links.js +10 -9
  76. package/lib/minify.js +71 -12
  77. package/lib/redirects.js +10 -9
  78. package/lib/rss.js +13 -10
  79. package/lib/sass.js +13 -243
  80. package/lib/sitemap.js +18 -15
  81. package/lib/ssqch.js +6 -4
  82. package/package.json +1 -1
  83. package/types/index.d.ts +52 -11
  84. package/types/minify.d.ts +15 -3
  85. package/types/sass.d.ts +2 -0
  86. package/types/sitemap.d.ts +2 -2
  87. package/wasm/markdown.wasm +0 -0
  88. package/wasm/minify.wasm +0 -0
  89. package/wasm/sass.wasm +0 -0
  90. package/lib/chunk-II7ZRIAC.js +0 -1285
  91. package/lib/chunk-IOXCGMSF.js +0 -1539
  92. /package/lib/{chunk-JFPLNHEQ.js.LEGAL.txt → chunk-AIMEXBTK.js.LEGAL.txt} +0 -0
  93. /package/lib/{chunk-HNG372DW.js.LEGAL.txt → chunk-ZR3JYLFB.js.LEGAL.txt} +0 -0
@@ -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. */
@@ -190,15 +208,15 @@ declare module "ssqch" {
190
208
  /** Shows up in error messages. */
191
209
  name?: string;
192
210
  /** Functions templates can call: `{{ slug(title) }}`. Async functions are awaited. */
193
- filters?: Record<string, (...args: any[]) => unknown>;
211
+ filters?: Record<string, (this: FilterContext | undefined, ...args: any[]) => unknown>;
194
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. */
195
213
  data?: Record<string, unknown>;
196
214
  /** Custom collections, from the pages in collections. */
197
215
  collections?: Record<string, (pages: Pages) => unknown>;
198
216
  /** Run on every output file. Return the content, changed or not. */
199
217
  transforms?: Record<string, (content: string, page: TransformPage) => MaybePromise<string>>;
200
- /** Template engines of your own, by file extension: a function, or an object with `render`. Return the rendered text. */
201
- 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 }>;
202
220
  /** Files or folders to copy: a path, or `{ from: to }`, or an array of them. */
203
221
  passthrough?: string | Record<string, string> | Array<string | Record<string, string>>;
204
222
  /** More paths for `ssqch serve` to watch. */
@@ -252,12 +270,22 @@ declare module "ssqch" {
252
270
  bundles?: boolean;
253
271
  /** Printing an undefined value (`{{ titel }}`) is an error, in every template language. Conditionals and defaults still work. Default `false`. */
254
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 };
255
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`). */
256
282
  lastModified?: "git" | "file" | false;
257
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`). */
258
284
  dateFallback?: "git" | "file";
259
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. */
260
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>;
261
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. */
262
290
  base?: string;
263
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. */
@@ -275,10 +303,19 @@ declare module "ssqch" {
275
303
 
276
304
  /** Returns its argument. It's there so the config reads as one, and for these types. */
277
305
  export function defineConfig<T extends Config | ((context: ConfigContext) => MaybePromise<Config>)>(config: T): T;
278
- /** Render Markdown with the site's `markdown` options (render hooks and containers are for templates). `inline` drops the `<p>` around a single paragraph. */
279
- 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;
280
308
  /** Read a JSON, YAML or TOML file (from the project root) into data: `readData("src/_data/sites/en.yml")`. */
281
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
+ }
282
319
  /** A file that `files()` found. */
283
320
  export interface FoundFile {
284
321
  /** From the project root, with `/`: `"images/albums/v1/20011222_08.JPG"`. */
@@ -310,6 +347,10 @@ declare module "ssqch" {
310
347
  separator?: string;
311
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. */
312
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;
313
354
  }
314
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. */
315
356
  export function slugify(text: string, options?: SlugifyOptions | string): string;
@@ -432,14 +473,26 @@ declare module "ssqch/minify" {
432
473
  removeComments?: boolean;
433
474
  /** Default `true`. */
434
475
  shortDoctype?: boolean;
435
- /** 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`. */
436
477
  shortenAttributes?: boolean;
437
478
  }
438
479
 
439
- /** Minifies HTML output, after the image transform, with ssqch's own minifier (Rust, as WebAssembly): it doesn't write html-minifier-terser's bytes. */
440
- 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;
441
492
  /** Minify one string of HTML, with the plugin's options. */
442
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;
443
496
  }
444
497
 
445
498
  declare module "ssqch/assets" {
@@ -480,8 +533,8 @@ declare module "ssqch/sitemap" {
480
533
  import type { BuiltinPlugin } from "ssqch";
481
534
 
482
535
  export interface SitemapPluginOptions {
483
- /** The site's address, like `"https://example.com"`. */
484
- 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;
485
538
  /** URL globs to leave out, like `["/tags/**"]`. Pages with `sitemap: false` and 404 pages are always left out. */
486
539
  exclude?: string[];
487
540
  /** Add `<lastmod>` from each page's date. Default `true`. */
@@ -540,6 +593,8 @@ declare module "ssqch/sass" {
540
593
  style?: "compressed" | "expanded";
541
594
  /** More folders `@use` and `@import` look in, relative to the project root. */
542
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;
543
598
  }
544
599
 
545
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,28 +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-DUGGZ4EE.js";
5
+ } from "./chunk-RBNPBTDP.js";
6
6
  import {
7
7
  BUILTINS,
8
8
  blake3Hex,
9
9
  rewriteHtml
10
- } from "./chunk-P2TRR6XK.js";
11
- import "./chunk-ERNVEZOK.js";
12
- import "./chunk-MDB3D3LP.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-BXARVN5Z.js";
15
- import "./chunk-IOXCGMSF.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-DNWA7WNO.js";
18
19
  import "./chunk-UU43WIZG.js";
19
- import "./chunk-RFNLZM7W.js";
20
+ import "./chunk-IOBC665M.js";
20
21
  import "./chunk-CMUWRPSQ.js";
21
22
  import {
22
23
  bail,
23
24
  displayPath,
24
25
  warn,
25
26
  warning
26
- } from "./chunk-JFPLNHEQ.js";
27
+ } from "./chunk-AIMEXBTK.js";
27
28
  import "./chunk-I3PS26CI.js";
28
29
 
29
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-X7C6GFUM.js";
5
+ } from "./chunk-GJNIQAIH.js";
6
6
  import {
7
7
  BUILTIN_FILTERS
8
- } from "./chunk-FYRC2HBU.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-6OUT5VFK.js";
13
+ agentsMd
14
+ } from "./chunk-B5E27PLU.js";
18
15
  import {
19
16
  configOptions
20
- } from "./chunk-P2TRR6XK.js";
21
- import "./chunk-ERNVEZOK.js";
22
- import "./chunk-MDB3D3LP.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-BXARVN5Z.js";
27
- import "./chunk-IOXCGMSF.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-DNWA7WNO.js";
32
34
  import "./chunk-UU43WIZG.js";
33
- import "./chunk-RFNLZM7W.js";
35
+ import "./chunk-IOBC665M.js";
34
36
  import "./chunk-CMUWRPSQ.js";
35
37
  import {
36
38
  OTHER_CONFIGS,
@@ -38,7 +40,7 @@ import {
38
40
  jsYaml,
39
41
  red,
40
42
  toJson
41
- } from "./chunk-JFPLNHEQ.js";
43
+ } from "./chunk-AIMEXBTK.js";
42
44
  import "./chunk-I3PS26CI.js";
43
45
 
44
46
  // src/commands/docs.ts
@@ -510,6 +512,27 @@ function guide(generator) {
510
512
  ${body.trim()}
511
513
  ` };
512
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
+ }
513
536
  var guideUrl = (file) => `${SITE_URL}/docs/trailheads/${file.replace(/\.md$/, "")}/`;
514
537
  function from(generator, json) {
515
538
  const known = generators();
@@ -551,6 +574,8 @@ ${rows(everyone)}`;
551
574
  The trailhead (${guideUrl(g.file)}):
552
575
 
553
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"\`.
554
579
  `;
555
580
  else if (g) out += `
556
581
  The trailhead: ${guideUrl(g.file)}
@@ -558,6 +583,17 @@ The trailhead: ${guideUrl(g.file)}
558
583
  else out += "\nThere's no trailhead for it yet; `ssqch docs trailheads` has the general route.\n";
559
584
  return out;
560
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
+ }
561
597
  function runDocs(grammar, command) {
562
598
  const fail = (message) => {
563
599
  process.stderr.write(`${red("error:")} ${message}
@@ -586,8 +622,25 @@ function runDocs(grammar, command) {
586
622
  const text = agentsMd();
587
623
  return out(json ? JSON.stringify({ query, found: true, agentsMd: text }, null, 2) + "\n" : text);
588
624
  }
589
- const a = answer(grammar, all, known, query);
590
- 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}`);
591
644
  const near = closestName(all, known, query);
592
645
  const next = near === void 0 ? nextStep(grammar, all, known, query) : void 0;
593
646
  if (json) {
@@ -8,7 +8,7 @@ import {
8
8
  } from "./chunk-CMUWRPSQ.js";
9
9
  import {
10
10
  bail
11
- } from "./chunk-JFPLNHEQ.js";
11
+ } from "./chunk-AIMEXBTK.js";
12
12
 
13
13
  // src/budgets.ts
14
14
  var BUDGETS = [
@@ -8,14 +8,14 @@ import {
8
8
  measure,
9
9
  overBudget,
10
10
  urlOf
11
- } from "./chunk-FZGJUJAL.js";
12
- import "./chunk-ERNVEZOK.js";
13
- import "./chunk-MDB3D3LP.js";
14
- import "./chunk-BXARVN5Z.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-JFPLNHEQ.js";
18
+ import "./chunk-AIMEXBTK.js";
19
19
  import "./chunk-I3PS26CI.js";
20
20
  export {
21
21
  buildFiles,
@@ -1,22 +1,23 @@
1
1
  import { createRequire as __ssqchCreateRequire } from "node:module";
2
2
  const require = __ssqchCreateRequire(import.meta.url);
3
- import "./chunk-P2TRR6XK.js";
4
- import "./chunk-ERNVEZOK.js";
5
- import "./chunk-MDB3D3LP.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-BXARVN5Z.js";
11
+ } from "./chunk-GS5B3CBW.js";
11
12
  import {
12
13
  slugWith
13
- } from "./chunk-IOXCGMSF.js";
14
+ } from "./chunk-JC54PHIT.js";
15
+ import "./chunk-HFSWUTXX.js";
14
16
  import "./chunk-FVZ5JBRI.js";
15
- import "./chunk-DNWA7WNO.js";
16
17
  import {
17
18
  FIELD_NOTES
18
19
  } from "./chunk-UU43WIZG.js";
19
- import "./chunk-RFNLZM7W.js";
20
+ import "./chunk-IOBC665M.js";
20
21
  import {
21
22
  serdeFloat
22
23
  } from "./chunk-CMUWRPSQ.js";
@@ -29,7 +30,7 @@ import {
29
30
  parseFrontMatter,
30
31
  realPath,
31
32
  slashes
32
- } from "./chunk-JFPLNHEQ.js";
33
+ } from "./chunk-AIMEXBTK.js";
33
34
  import "./chunk-I3PS26CI.js";
34
35
 
35
36
  // src/commands/new.ts
@@ -7,10 +7,10 @@ import {
7
7
  fixed,
8
8
  profileText,
9
9
  summary
10
- } from "./chunk-MDB3D3LP.js";
11
- import "./chunk-BXARVN5Z.js";
10
+ } from "./chunk-ERAIEV3O.js";
11
+ import "./chunk-GS5B3CBW.js";
12
12
  import "./chunk-UU43WIZG.js";
13
- import "./chunk-JFPLNHEQ.js";
13
+ import "./chunk-AIMEXBTK.js";
14
14
  import "./chunk-I3PS26CI.js";
15
15
  export {
16
16
  bytes,
@@ -2,36 +2,38 @@ import { createRequire as __ssqchCreateRequire } from "node:module";
2
2
  const require = __ssqchCreateRequire(import.meta.url);
3
3
  import {
4
4
  isAsset
5
- } from "./chunk-3BQJY6GF.js";
5
+ } from "./chunk-KCF2Z6N7.js";
6
6
  import {
7
7
  build
8
- } from "./chunk-HNG372DW.js";
9
- import "./chunk-7JGYYAKI.js";
10
- import "./chunk-FYRC2HBU.js";
11
- import "./chunk-FZGJUJAL.js";
8
+ } from "./chunk-ZR3JYLFB.js";
9
+ import "./chunk-OSBEH67S.js";
10
+ import "./chunk-HWW5NCVJ.js";
11
+ import "./chunk-GLJQ4C76.js";
12
+ import "./chunk-RYIWYWRQ.js";
13
+ import {
14
+ fileHash
15
+ } from "./chunk-I3HYKEEW.js";
12
16
  import {
13
17
  filesRead
14
18
  } from "./chunk-3NYSSA2C.js";
15
- import {
16
- fileHash
17
- } from "./chunk-BT3NVQOD.js";
18
- import "./chunk-P2TRR6XK.js";
19
- import "./chunk-ERNVEZOK.js";
19
+ import "./chunk-Z44IAMNG.js";
20
+ import "./chunk-2QTJTEBV.js";
20
21
  import {
21
22
  summary
22
- } from "./chunk-MDB3D3LP.js";
23
+ } from "./chunk-ERAIEV3O.js";
23
24
  import "./chunk-AD3HAW3W.js";
25
+ import "./chunk-YCOTX2VM.js";
24
26
  import {
25
27
  dirsOf
26
- } from "./chunk-BXARVN5Z.js";
27
- import "./chunk-IOXCGMSF.js";
28
+ } from "./chunk-GS5B3CBW.js";
29
+ import "./chunk-JC54PHIT.js";
30
+ import "./chunk-HFSWUTXX.js";
28
31
  import "./chunk-FVZ5JBRI.js";
29
- import "./chunk-DNWA7WNO.js";
30
32
  import "./chunk-UU43WIZG.js";
31
33
  import {
32
34
  describeThrown,
33
35
  loadedFiles
34
- } from "./chunk-RFNLZM7W.js";
36
+ } from "./chunk-IOBC665M.js";
35
37
  import "./chunk-CMUWRPSQ.js";
36
38
  import {
37
39
  BuildError,
@@ -47,7 +49,7 @@ import {
47
49
  red,
48
50
  relative,
49
51
  slashes
50
- } from "./chunk-JFPLNHEQ.js";
52
+ } from "./chunk-AIMEXBTK.js";
51
53
  import "./chunk-I3PS26CI.js";
52
54
 
53
55
  // src/serve/build-process.ts
@@ -6,18 +6,18 @@ import {
6
6
  fingerprint,
7
7
  isAsset,
8
8
  sameStamps
9
- } from "./chunk-3BQJY6GF.js";
9
+ } from "./chunk-KCF2Z6N7.js";
10
10
  import {
11
11
  commandLine
12
- } from "./chunk-7JGYYAKI.js";
12
+ } from "./chunk-HWW5NCVJ.js";
13
13
  import {
14
14
  Builder,
15
15
  stopBuilders
16
- } from "./chunk-BT3NVQOD.js";
16
+ } from "./chunk-I3HYKEEW.js";
17
17
  import {
18
18
  CONFIG_FILES,
19
19
  dirsOf
20
- } from "./chunk-BXARVN5Z.js";
20
+ } from "./chunk-GS5B3CBW.js";
21
21
  import {
22
22
  closestPath
23
23
  } from "./chunk-FVZ5JBRI.js";
@@ -39,7 +39,7 @@ import {
39
39
  walkFiles,
40
40
  warn,
41
41
  warning
42
- } from "./chunk-JFPLNHEQ.js";
42
+ } from "./chunk-AIMEXBTK.js";
43
43
  import "./chunk-I3PS26CI.js";
44
44
 
45
45
  // src/serve/server.ts