marksites 0.2.2 → 0.2.3

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.
@@ -7,7 +7,7 @@ import { atomicWriteFile } from "../utils/files.js";
7
7
  import { BUILD_MANIFEST, assertNoOutputCollisions, loadManifest, writeManifest, } from "./manifest.js";
8
8
  import { buildBreadcrumbs, buildFileTree } from "./navigation.js";
9
9
  import { DEFAULT_OUTPUT_DIRECTORY, findMarkdownFiles, firstExistingPath, pathExists, toLegacyMetadataPaths, } from "./paths.js";
10
- import { OUTPUT_COMPATIBILITY_VERSION, contentHash, renderFingerprint, rewriteMarkdownLinks, } from "./rendering.js";
10
+ import { GENERATOR_VERSION, OUTPUT_COMPATIBILITY_VERSION, contentHash, renderFingerprint, rewriteMarkdownLinks, } from "./rendering.js";
11
11
  import { prepareImageAssets } from "./assets.js";
12
12
  async function migrateLegacyMetadata(files, output) {
13
13
  let moved = 0;
@@ -204,6 +204,7 @@ export async function convertDirectoryDetailed(input, outputArgument, options =
204
204
  const fingerprint = renderFingerprint();
205
205
  const full = !previous ||
206
206
  loaded.warning !== undefined ||
207
+ previous.generator.version !== GENERATOR_VERSION ||
207
208
  previous.generator.outputCompatibilityVersion !==
208
209
  OUTPUT_COMPATIBILITY_VERSION ||
209
210
  previous.generator.renderFingerprint !== fingerprint ||
@@ -215,7 +216,7 @@ export async function convertDirectoryDetailed(input, outputArgument, options =
215
216
  schemaVersion: 1,
216
217
  generator: {
217
218
  name: "marksites",
218
- version: "0.2.0",
219
+ version: GENERATOR_VERSION,
219
220
  outputCompatibilityVersion: OUTPUT_COMPATIBILITY_VERSION,
220
221
  renderFingerprint: fingerprint,
221
222
  },
@@ -1,4 +1,5 @@
1
1
  import type { Token } from "marked";
2
+ export declare const GENERATOR_VERSION: string;
2
3
  export declare const OUTPUT_COMPATIBILITY_VERSION = 7;
3
4
  export declare function contentHash(value: string | Buffer): string;
4
5
  export declare function rewriteMarkdownLinks(token: Token): void;
@@ -1,6 +1,9 @@
1
1
  import { createHash } from "node:crypto";
2
+ import { readFileSync } from "node:fs";
2
3
  import { emptyAnnotationDocument } from "../annotations/model.js";
3
4
  import { renderMarkdown } from "../markdown-to-html.js";
5
+ const packageMetadata = JSON.parse(readFileSync(new URL("../../package.json", import.meta.url), "utf8"));
6
+ export const GENERATOR_VERSION = packageMetadata.version;
4
7
  export const OUTPUT_COMPATIBILITY_VERSION = 7;
5
8
  export function contentHash(value) {
6
9
  return `sha256:${createHash("sha256").update(value).digest("hex")}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "marksites",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "Convert Markdown into standalone GitHub-styled HTML.",
5
5
  "type": "module",
6
6
  "exports": {