@hawkeyexl/manni 2.2.0 → 2.3.1

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.
package/dist/docmeta.js CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  buildProgram
4
- } from "./chunk-2Q5JUEIO.js";
4
+ } from "./chunk-ESOEJTV2.js";
5
5
  import {
6
6
  runIfMain
7
- } from "./chunk-5O4FIGDJ.js";
7
+ } from "./chunk-HUHERW7E.js";
8
8
 
9
9
  // src/docmeta.ts
10
10
  runIfMain(import.meta.url, () => buildProgram().name("docmeta"));
package/dist/index.d.ts CHANGED
@@ -128,14 +128,6 @@ interface MetadataExtractor {
128
128
  name: string;
129
129
  /** Lowercase file extensions this extractor handles, incl. dot (e.g. ".md"). */
130
130
  extensions: string[];
131
- /**
132
- * Whether this extractor can *read* — false for a format that is registered
133
- * but not yet wired up. Every registered extractor sets it true today; it is
134
- * kept because it is a distinct capability from writability, which is the
135
- * presence of `apply`. A format can read without writing, and one being
136
- * added could be declared before it can do either.
137
- */
138
- implemented: boolean;
139
131
  /**
140
132
  * Extract metadata from raw file content.
141
133
  *
@@ -358,6 +350,16 @@ declare function selectCollections(collections: readonly CollectionConfig[], nam
358
350
  */
359
351
  declare function isMember(collection: CollectionConfig, relPath: string): boolean;
360
352
 
353
+ /** Vale's settings under `tools.vale`. */
354
+ interface ValeToolConfig {
355
+ /** Vale's config file, as written, relative to `manni.config.yaml`. */
356
+ config?: string;
357
+ }
358
+ /** The document's top-level `tools:`, one namespace per outside tool. */
359
+ interface ToolsConfig {
360
+ vale?: ValeToolConfig;
361
+ }
362
+
361
363
  interface ConfigFile {
362
364
  /** Absolute path to the file. */
363
365
  path: string;
@@ -387,6 +389,12 @@ interface ConfigFile {
387
389
  * document *is* the tool's section, so it carries no family-wide keys.
388
390
  */
389
391
  collections: CollectionConfig[];
392
+ /**
393
+ * The document's top-level `tools:` (proposal 0052), an outside tool's
394
+ * settings, parsed once here for the same reason as `collections`. `{}` when
395
+ * the key is absent, and always `{}` for a `legacy` file.
396
+ */
397
+ tools: ToolsConfig;
390
398
  /**
391
399
  * The document's top-level `encryptionKey:` (proposal 0045), validated
392
400
  * here. Absent when the key is, and always absent for a `legacy` file, for
@@ -2092,7 +2100,6 @@ interface SchemasInfo {
2092
2100
  formats: {
2093
2101
  name: string;
2094
2102
  extensions: string[];
2095
- implemented: boolean;
2096
2103
  /** Whether `manni meta fill` can write metadata back to this format. */
2097
2104
  writable: boolean;
2098
2105
  }[];
@@ -3422,15 +3429,13 @@ contents: string | Uint8Array): Promise<void>;
3422
3429
 
3423
3430
  /**
3424
3431
  * Extractor registry. Maps file extensions to extractors and resolves an
3425
- * extractor by name (for the `--as` override). Every registered extractor is
3426
- * implemented today; the `implemented` filters below are what would keep a
3427
- * declared-but-unwired format out of directory walks, so an unfinished format
3428
- * can be registered without becoming "supported".
3432
+ * extractor by name (for the `--as` override). A registered extractor reads
3433
+ * its format, so registration is what makes an extension supported.
3429
3434
  */
3430
3435
 
3431
- /** Resolve an implemented extractor for a file extension (incl. dot). */
3436
+ /** Resolve the extractor for a file extension (incl. dot). */
3432
3437
  declare function extractorForExtension(ext: string): MetadataExtractor | undefined;
3433
- /** Extensions handled by implemented extractors (used for directory walks). */
3438
+ /** Extensions handled by registered extractors (used for directory walks). */
3434
3439
  declare function supportedExtensions(): string[];
3435
3440
 
3436
3441
  type KeySource = "env" | "config" | "none";
@@ -4118,12 +4123,9 @@ declare function readSource(root: string, index: SourceIndex, range: SourceRange
4118
4123
  * `indexOf` for the delimiters, never a regex over the whole page, and is
4119
4124
  * handed the body only, so a `cite` inside frontmatter is never matched.
4120
4125
  *
4121
- * It does not read code. An opener inside a fenced block (``` or ~~~ in
4122
- * markdown and mdx, indented or not; `----` in asciidoc; an unclosed fence
4123
- * runs to the end, as a renderer reads it) or inside a backtick span (a run of
4124
- * backticks closed by a run of the same length on the same line) is skipped,
4125
- * so a page that documents the syntax carries no statements. html and xml
4126
- * have neither; a `<pre>` is not code to this scanner.
4126
+ * It does not read code. An opener inside a fenced block or a backtick span,
4127
+ * as `src/shared/code-regions.ts` finds them, is skipped, so a page that
4128
+ * documents the syntax carries no statements.
4127
4129
  *
4128
4130
  * Every form parses in both markdown and mdx. The first form is what
4129
4131
  * `formatStatement` writes: the html comment for markdown, the jsx comment
@@ -4146,9 +4148,10 @@ declare function detectEol(text: string): "\n" | "\r\n";
4146
4148
  /**
4147
4149
  * The paragraph starting at or after `offset` (skipping blank lines), as
4148
4150
  * `{ start, end, line }` file offsets and the file line it starts on. A fence
4149
- * opener ends the search with no paragraph.
4151
+ * opener ends the search with no paragraph. Given a `format`, a marker-only
4152
+ * line is skipped like a blank one before the paragraph, and ends it after.
4150
4153
  */
4151
- declare function paragraphAfter(content: string, offset: number): {
4154
+ declare function paragraphAfter(content: string, offset: number, format?: string): {
4152
4155
  start: number;
4153
4156
  end: number;
4154
4157
  line: number;
@@ -4201,8 +4204,10 @@ declare function insideFence(text: string, bodyOffset: number, line: number, for
4201
4204
  /**
4202
4205
  * The lines a marker anchors, as 1-based lines of `text`: the rest of its own
4203
4206
  * line when that carries text, else the paragraph or fenced block that
4204
- * follows. With `quote`, the next fenced block after it, wherever that is.
4205
- * Undefined when nothing follows to anchor.
4207
+ * follows. Marker-only lines below it are skipped, so markers stacked above
4208
+ * one paragraph all anchor it, and none is part of the pin. With `quote`, the
4209
+ * next fenced block after it, wherever that is. Undefined when nothing
4210
+ * follows to anchor.
4206
4211
  */
4207
4212
  declare function anchoredLines(text: string, after: number, format: string, quote?: boolean): {
4208
4213
  start: number;
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  reencryptMetadata,
6
6
  runKeyRotate,
7
7
  runKeySet
8
- } from "./chunk-6JWX6JM2.js";
8
+ } from "./chunk-CD3LHG26.js";
9
9
  import {
10
10
  BinMissing,
11
11
  COMMON_FORMATS,
@@ -127,7 +127,7 @@ import {
127
127
  valueOf,
128
128
  vendorFileName,
129
129
  writeFileAtomic
130
- } from "./chunk-5O4FIGDJ.js";
130
+ } from "./chunk-HUHERW7E.js";
131
131
 
132
132
  // src/key/index.ts
133
133
  var key_exports = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hawkeyexl/manni",
3
- "version": "2.2.0",
3
+ "version": "2.3.1",
4
4
  "description": "One command line for documentation that is meant to be checked. `manni meta` validates the presence and format of document metadata (Markdown frontmatter and more) against JSON Schema, built for CI. Formerly docmeta.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -85,6 +85,7 @@
85
85
  "ajv-formats": "^3.0.1",
86
86
  "commander": "^15.0.0",
87
87
  "fast-glob": "^3.3.2",
88
+ "github-slugger": "^2.0.0",
88
89
  "parse5": "^8.0.1",
89
90
  "picocolors": "^1.1.1",
90
91
  "picomatch": "^4.0.7",