ssqch 0.6.0 → 0.6.2

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 (2) hide show
  1. package/package.json +5 -5
  2. package/types/index.d.ts +11 -2
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ssqch",
3
3
  "description": "SiteSquatch, a fast static site generator configured with JavaScript",
4
- "version": "0.6.0",
4
+ "version": "0.6.2",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/reverentgeek/sitesquatch#readme",
7
7
  "repository": {
@@ -74,9 +74,9 @@
74
74
  "node": ">=18"
75
75
  },
76
76
  "optionalDependencies": {
77
- "@ssqch/darwin-arm64": "0.6.0",
78
- "@ssqch/darwin-x64": "0.6.0",
79
- "@ssqch/linux-x64": "0.6.0",
80
- "@ssqch/win32-x64": "0.6.0"
77
+ "@ssqch/darwin-arm64": "0.6.2",
78
+ "@ssqch/darwin-x64": "0.6.2",
79
+ "@ssqch/linux-x64": "0.6.2",
80
+ "@ssqch/win32-x64": "0.6.2"
81
81
  }
82
82
  }
package/types/index.d.ts CHANGED
@@ -41,6 +41,15 @@ export interface Heading {
41
41
  text: string;
42
42
  }
43
43
 
44
+ /** What a token is: its `hl-*` class without the prefix. */
45
+ export type TokenKind = "comment" | "keyword" | "operator" | "string" | "regexp" | "escape" | "number" | "constant" | "builtin" | "property" | "attribute" | "function" | "type" | "parameter" | "tag" | "heading" | "strong" | "emphasis" | "link" | "inserted" | "deleted";
46
+
47
+ /** A piece of highlighted code. Without a `kind` (or as a string), it's plain text. */
48
+ export type Token = [text: string, kind?: TokenKind | null] | { text: string; kind?: TokenKind | null } | string;
49
+
50
+ /** A site's language for `markdown.highlight.languages`: a function that cuts the code into tokens whose text adds up to the code, another language's name (`"chordpro"`, an alias), or the path of a `.sublime-syntax` grammar from the project root. */
51
+ export type Highlighter = ((code: string, lang: string) => Token[]) | string;
52
+
44
53
  /** How Markdown renders. */
45
54
  export interface MarkdownOptions {
46
55
  /** Automatic heading `id`s: `"github"` (the default), `"blackfriday"` (Hugo's older style: `a-b` for `A -- B`), or `false` for none. A `{#id}` on the heading always wins. */
@@ -63,8 +72,8 @@ export interface MarkdownOptions {
63
72
  smartPunctuation?: boolean;
64
73
  /** Lines indented four spaces are code blocks. `false` renders them as ordinary Markdown (HTML indented inside Markdown, say); fences are still code. Default `true`. */
65
74
  indentedCode?: boolean;
66
- /** 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`. Default `false`. */
67
- highlight?: boolean | { css?: string | false };
75
+ /** 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`. */
76
+ highlight?: boolean | { css?: string | false; languages?: Record<string, Highlighter> };
68
77
  }
69
78
 
70
79
  /** What a collection function gets. */