docgen-tool 6.4.3 → 6.4.4
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/app/pdf/pdf-generator/pdf-page/pdf-html-block/custom-renderers/custom-renderers.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { parse } from 'node-html-parser';
|
|
2
3
|
import { View, Text, Image } from '@react-pdf/renderer';
|
|
3
|
-
import * as cheerio from 'cheerio';
|
|
4
4
|
|
|
5
5
|
declare const __BASE_PATH__: string;
|
|
6
6
|
|
|
@@ -28,10 +28,11 @@ export const customRenderers = () => ({
|
|
|
28
28
|
},
|
|
29
29
|
pre: (payload) => {
|
|
30
30
|
const { element, style } = payload;
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
|
|
31
|
+
const root = parse(element.innerHTML ?? '');
|
|
32
|
+
const codeElement = root.querySelector('code');
|
|
33
|
+
const text = codeElement
|
|
34
|
+
? codeElement.textContent
|
|
35
|
+
: (root.textContent ?? '');
|
|
35
36
|
|
|
36
37
|
// Preserve indentation and multiple spaces with Non-Breaking Spaces
|
|
37
38
|
// to ensure react-pdf doesn't collapse them
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
--color-button-border: 2px solid rgb(46, 113, 225);
|
|
33
33
|
--color-button-border-inverted: 2px solid rgb(46, 113, 225);
|
|
34
34
|
--color-button-background: rgb(46, 113, 225);
|
|
35
|
-
--color-button-background-hover:
|
|
35
|
+
--color-button-background-hover: rgb(22, 71, 193);
|
|
36
36
|
--color-button-background-inverted: #fff;
|
|
37
37
|
--color-button-text: #fff;
|
|
38
38
|
--color-button-text-inverted: rgb(46, 113, 225);
|
|
@@ -31,7 +31,7 @@ export const ColorTextLinkVisited = "#808080";
|
|
|
31
31
|
export const ColorButtonBorder = "2px solid rgb(46, 113, 225)";
|
|
32
32
|
export const ColorButtonBorderInverted = "2px solid rgb(46, 113, 225)";
|
|
33
33
|
export const ColorButtonBackground = "rgb(46, 113, 225)";
|
|
34
|
-
export const ColorButtonBackgroundHover = "
|
|
34
|
+
export const ColorButtonBackgroundHover = "rgb(22, 71, 193)";
|
|
35
35
|
export const ColorButtonBackgroundInverted = "#fff";
|
|
36
36
|
export const ColorButtonText = "#fff";
|
|
37
37
|
export const ColorButtonTextInverted = "rgb(46, 113, 225)";
|
package/dist/cli/cli.js
CHANGED
|
@@ -387,7 +387,7 @@ const scaffold = async (command) => {
|
|
|
387
387
|
console.log(pico.green("Creating scaffold template directory"));
|
|
388
388
|
await copyDirectory(inputDir, outputDir, verbose);
|
|
389
389
|
};
|
|
390
|
-
program.version("6.4.
|
|
390
|
+
program.version("6.4.4").usage("[command] [--option]");
|
|
391
391
|
program.command("scaffold").usage("[--option]").description("create a template input directory").option("-o, --output [path]", "path to the output directory (default: ./)", "./").option("-v, --verbose", "show verbose output including detailed errors").action((command) => {
|
|
392
392
|
scaffold(command);
|
|
393
393
|
});
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "docgen-tool",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "6.4.
|
|
4
|
+
"version": "6.4.4",
|
|
5
5
|
"description": "A tool for creating HTML and PDF documentation",
|
|
6
|
+
"packageManager": "pnpm@10.28.0",
|
|
6
7
|
"bin": "./dist/cli/cli.js",
|
|
7
8
|
"files": [
|
|
8
9
|
"dist/*"
|
|
@@ -11,21 +12,21 @@
|
|
|
11
12
|
"check:types": "tsc --noEmit",
|
|
12
13
|
"bundle:cli": "vite build --config ./vite.bundle.cli.config.ts && chmod +x dist/cli/cli.js",
|
|
13
14
|
"bundle:app": "rimraf dist/app dist/template && ncp src/app dist/app && ncp src/template dist/template",
|
|
14
|
-
"bundle": "
|
|
15
|
+
"bundle": "pnpm bundle:cli && pnpm bundle:app",
|
|
15
16
|
"dev:docs": "tsx src/cli/cli.ts dev -i src/docs -o ./docs",
|
|
16
17
|
"build:docs": "tsx src/cli/cli.ts build -i src/docs -o ./docs",
|
|
17
|
-
"preview:docs": "
|
|
18
|
-
"build:docs:gh": "tsx src/cli/cli.ts build -i src/docs -o ./docs &&
|
|
18
|
+
"preview:docs": "pnpx serve -s ./docs",
|
|
19
|
+
"build:docs:gh": "tsx src/cli/cli.ts build -i src/docs -o ./docs && pnpm copy:gh:files",
|
|
19
20
|
"copy:gh:files": "node deploy/before-deploy-website.js",
|
|
20
|
-
"preview:style:variables": "rimraf src/app/styles/style-variables &&
|
|
21
|
-
"test": "
|
|
21
|
+
"preview:style:variables": "rimraf src/app/styles/style-variables && pnpx style-dictionary build --config src/app/styles/config.json && pnpm formatting:fix",
|
|
22
|
+
"test": "pnpm formatting:check",
|
|
22
23
|
"test:run": "tsx src/cli/cli.ts build -i src/__test__/test-run -o src/__test__/test-run-output",
|
|
23
24
|
"test:scaffold": "tsx src/cli/cli.ts scaffold -o src/__test__/test-run-output",
|
|
24
25
|
"test:prod:run": "./dist/cli/cli.js build -i src/__test__/test-run -o ../source/__test__/test-run-output",
|
|
25
|
-
"formatting:check": "prettier --check '
|
|
26
|
-
"formatting:fix": "prettier --write '
|
|
27
|
-
"lint:check": "oxlint
|
|
28
|
-
"lint:fix": "oxlint --fix
|
|
26
|
+
"formatting:check": "prettier --check '*/**/*.{ts,js,tsx,jsx,json,css}'",
|
|
27
|
+
"formatting:fix": "prettier --write '*/**/*.{ts,js,tsx,jsx,json,css}'",
|
|
28
|
+
"lint:check": "oxlint",
|
|
29
|
+
"lint:fix": "oxlint --fix",
|
|
29
30
|
"test:publish": "sh ./src/__test__/test-publish/test-publish.sh",
|
|
30
31
|
"prepare": "husky"
|
|
31
32
|
},
|
|
@@ -39,7 +40,6 @@
|
|
|
39
40
|
"@react-pdf/renderer": "^4.3.2",
|
|
40
41
|
"@tanstack/react-router": "^1.150.0",
|
|
41
42
|
"@vitejs/plugin-react": "5.1.2",
|
|
42
|
-
"cheerio": "^1.1.2",
|
|
43
43
|
"classnames": "^2.5.1",
|
|
44
44
|
"commander": "^14.0.2",
|
|
45
45
|
"dotenv": "^17.2.3",
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
"husky": "^9.1.7",
|
|
48
48
|
"lint-staged": "^16.2.7",
|
|
49
49
|
"marked": "^17.0.1",
|
|
50
|
+
"node-html-parser": "^7.0.2",
|
|
50
51
|
"picocolors": "^1.1.1",
|
|
51
52
|
"react": "^19.2.3",
|
|
52
53
|
"react-dom": "^19.2.3",
|