@cenk1cenk2/md-printer 2.1.2 → 2.2.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.
- package/dist/commands/index.js +186 -98
- package/dist/constants/file.constants.js +32 -5
- package/dist/constants/index.js +51 -17
- package/dist/constants/template.constants.js +42 -11
- package/dist/hooks/init.hook.js +35 -5
- package/dist/hooks/not-found.hook.js +28 -4
- package/dist/hooks/prerun.hook.js +28 -4
- package/dist/interfaces/commands/index.interface.js +17 -2
- package/dist/interfaces/commands/index.js +16 -16
- package/dist/templates/logo.template.js +29 -5
- package/package.json +24 -22
- package/templates/privat-rechnung/footer.html +26 -0
- package/templates/privat-rechnung/header.html +16 -0
- package/templates/privat-rechnung/main.css +1330 -0
- package/templates/privat-rechnung/settings.json +9 -0
- package/templates/privat-rechnung/tailwind.config.js +74 -0
- package/templates/privat-rechnung/tailwind.css +13 -0
- package/templates/privat-rechnung/template.html.j2 +130 -0
package/dist/commands/index.js
CHANGED
|
@@ -1,105 +1,193 @@
|
|
|
1
|
-
|
|
2
|
-
var
|
|
3
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
4
10
|
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
+
|
|
22
|
+
// src/commands/index.ts
|
|
23
|
+
var commands_exports = {};
|
|
24
|
+
__export(commands_exports, {
|
|
25
|
+
default: () => MDPrinter
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(commands_exports);
|
|
28
|
+
var import_command = require("@oclif/command");
|
|
29
|
+
var import_chokidar = require("chokidar");
|
|
30
|
+
var import_fs_extra = __toESM(require("fs-extra"));
|
|
31
|
+
var import_gray_matter = require("gray-matter");
|
|
32
|
+
var import_md_to_pdf = __toESM(require("md-to-pdf"));
|
|
33
|
+
var import_nunjucks = __toESM(require("nunjucks"));
|
|
34
|
+
var import_path = require("path");
|
|
35
|
+
var import_boilerplate_oclif = require("@cenk1cenk2/boilerplate-oclif");
|
|
36
|
+
|
|
37
|
+
// src/constants/template.constants.ts
|
|
38
|
+
var RequiredTemplateFiles = ["settings.json" /* SETTINGS */];
|
|
39
|
+
var TEMPLATE_DIRECTORY = "templates";
|
|
40
|
+
|
|
41
|
+
// src/constants/file.constants.ts
|
|
42
|
+
var INPUT_FILE_ACCEPTED_TYPES = [".md"];
|
|
43
|
+
var OUTPUT_FILE_ACCEPTED_TYPES = [".pdf"];
|
|
44
|
+
|
|
45
|
+
// src/commands/index.ts
|
|
46
|
+
var _MDPrinter = class extends import_boilerplate_oclif.BaseCommand {
|
|
47
|
+
constructor() {
|
|
48
|
+
super(...arguments);
|
|
49
|
+
this.nunjucks = import_nunjucks.default.configure({
|
|
50
|
+
autoescape: false,
|
|
51
|
+
throwOnUndefined: true,
|
|
52
|
+
trimBlocks: true,
|
|
53
|
+
lstripBlocks: false
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
async run() {
|
|
57
|
+
const { args, flags: flags2 } = this.parse(_MDPrinter);
|
|
58
|
+
this.tasks.options = { rendererSilent: true };
|
|
59
|
+
const tasks = this.tasks.newListr([
|
|
60
|
+
{
|
|
61
|
+
task: async (ctx2) => {
|
|
62
|
+
const file = (0, import_path.join)(process.cwd(), args.file);
|
|
63
|
+
if (!INPUT_FILE_ACCEPTED_TYPES.includes((0, import_path.extname)(file))) {
|
|
64
|
+
throw new Error(`Input file should be ending with the extension: ${INPUT_FILE_ACCEPTED_TYPES.join(", ")} -> current: ${(0, import_path.extname)(file)}`);
|
|
65
|
+
}
|
|
66
|
+
if (!import_fs_extra.default.existsSync(file)) {
|
|
67
|
+
throw new Error(`File does not exists: ${file}`);
|
|
68
|
+
}
|
|
69
|
+
this.logger.debug("Loading file: %s", file);
|
|
70
|
+
ctx2.file = file;
|
|
71
|
+
ctx2.content = await import_fs_extra.default.readFile(file, "utf-8");
|
|
72
|
+
ctx2.graymatter = (0, import_gray_matter.read)(ctx2.file);
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
task: async (ctx2) => {
|
|
77
|
+
const template = ctx2.graymatter?.data?.template ?? flags2.template;
|
|
78
|
+
this.logger.debug("Loading template: %s", template);
|
|
79
|
+
ctx2.templates = new RegExp(/\.\.?\//).test(template) ? (0, import_path.join)(process.cwd(), template) : (0, import_path.join)(this.config.root, TEMPLATE_DIRECTORY, template);
|
|
80
|
+
await Promise.all(RequiredTemplateFiles.map(async (file) => {
|
|
81
|
+
const current = (0, import_path.join)(ctx2.templates, file);
|
|
82
|
+
if (!import_fs_extra.default.existsSync(current)) {
|
|
83
|
+
throw new Error(`Template does not exists: ${current}`);
|
|
77
84
|
}
|
|
78
|
-
|
|
85
|
+
}));
|
|
86
|
+
const paths = {
|
|
87
|
+
["settings.json" /* SETTINGS */]: (0, import_path.join)(ctx2.templates, "settings.json" /* SETTINGS */),
|
|
88
|
+
["main.css" /* CSS */]: (0, import_path.join)(ctx2.templates, "main.css" /* CSS */),
|
|
89
|
+
["header.html" /* HEADER */]: (0, import_path.join)(ctx2.templates, "header.html" /* HEADER */),
|
|
90
|
+
["footer.html" /* FOOTER */]: (0, import_path.join)(ctx2.templates, "footer.html" /* FOOTER */),
|
|
91
|
+
["template.html.j2" /* TEMPLATE */]: (0, import_path.join)(ctx2.templates, "template.html.j2" /* TEMPLATE */)
|
|
92
|
+
};
|
|
93
|
+
ctx2.options = (0, import_boilerplate_oclif.deepMergeWithArrayOverwrite)(await import_fs_extra.default.readJSON(paths["settings.json" /* SETTINGS */]), {
|
|
94
|
+
pdf_options: {},
|
|
95
|
+
dest: args?.output ?? ctx2.graymatter.data?.dest ?? `${(0, import_path.basename)(args.file, (0, import_path.extname)(args.file))}.pdf`,
|
|
96
|
+
document_title: ctx2.graymatter.data?.document_title ?? flags2.title ?? args.file
|
|
97
|
+
});
|
|
98
|
+
if (import_fs_extra.default.existsSync(paths["main.css" /* CSS */])) {
|
|
99
|
+
this.logger.debug("CSS exists for template.");
|
|
100
|
+
ctx2.options.css = await import_fs_extra.default.readFile(paths["main.css" /* CSS */], "utf-8");
|
|
101
|
+
}
|
|
102
|
+
if (import_fs_extra.default.existsSync(paths["header.html" /* HEADER */])) {
|
|
103
|
+
this.logger.debug("Header exists for template.");
|
|
104
|
+
ctx2.options.pdf_options.headerTemplate = await import_fs_extra.default.readFile(paths["header.html" /* HEADER */], "utf-8");
|
|
105
|
+
}
|
|
106
|
+
if (import_fs_extra.default.existsSync(paths["footer.html" /* FOOTER */])) {
|
|
107
|
+
this.logger.debug("Footer exists for template.");
|
|
108
|
+
ctx2.options.pdf_options.footerTemplate = await import_fs_extra.default.readFile(paths["footer.html" /* FOOTER */], "utf-8");
|
|
109
|
+
}
|
|
110
|
+
if (import_fs_extra.default.existsSync(paths["template.html.j2" /* TEMPLATE */])) {
|
|
111
|
+
this.logger.debug("Design template exists for template.");
|
|
112
|
+
ctx2.template = await import_fs_extra.default.readFile(paths["template.html.j2" /* TEMPLATE */], "utf-8");
|
|
113
|
+
ctx2.content = ctx2.graymatter.content;
|
|
114
|
+
this.logger.debug("Frontmatter: %o", ctx2.graymatter.data);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
task: async (ctx2) => {
|
|
120
|
+
if (flags2.dev) {
|
|
121
|
+
ctx2.options.devtools = true;
|
|
122
|
+
}
|
|
123
|
+
return this.runMd2Pdf(ctx2);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
]);
|
|
127
|
+
const ctx = await tasks.run();
|
|
128
|
+
if (flags2.watch) {
|
|
129
|
+
this.logger.info("Running in watch mode.");
|
|
130
|
+
(0, import_chokidar.watch)([args.file, (0, import_path.join)(ctx.templates, "**/*")]).on("change", async () => {
|
|
131
|
+
await tasks.run();
|
|
132
|
+
this.logger.info("Waiting for the next change.");
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
async runMd2Pdf(ctx) {
|
|
137
|
+
let pdf;
|
|
138
|
+
if (ctx.template) {
|
|
139
|
+
this.logger.debug("Rendering as template.");
|
|
140
|
+
pdf = await (0, import_md_to_pdf.default)({ content: this.nunjucks.renderString(ctx.template, { ...ctx.graymatter?.data ?? {}, content: ctx.content }) }, ctx.options);
|
|
141
|
+
} else {
|
|
142
|
+
this.logger.debug("Rendering as plain file.");
|
|
143
|
+
pdf = await (0, import_md_to_pdf.default)({ content: ctx.content }, ctx.options);
|
|
144
|
+
}
|
|
145
|
+
const output = pdf.filename;
|
|
146
|
+
await import_fs_extra.default.mkdirp((0, import_path.dirname)(output));
|
|
147
|
+
if (!output) {
|
|
148
|
+
throw new Error("Output should either be defined with the variable or front-matter.");
|
|
149
|
+
} else if (!OUTPUT_FILE_ACCEPTED_TYPES.includes((0, import_path.extname)(output))) {
|
|
150
|
+
throw new Error(`Output file should be ending with the extension: ${OUTPUT_FILE_ACCEPTED_TYPES.join(", ")} -> current: ${(0, import_path.extname)(output)}`);
|
|
79
151
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
152
|
+
this.logger.debug("Output file will be: %s", output);
|
|
153
|
+
if (pdf) {
|
|
154
|
+
this.logger.info("Writing file to output: %s", output);
|
|
155
|
+
await import_fs_extra.default.writeFile(output, pdf.content);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
var MDPrinter = _MDPrinter;
|
|
160
|
+
MDPrinter.description = "Generates a PDF from the given markdown file with the selected HTML template.";
|
|
83
161
|
MDPrinter.flags = {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
162
|
+
template: import_command.flags.string({
|
|
163
|
+
char: "t",
|
|
164
|
+
default: "default",
|
|
165
|
+
description: "HTML template for the generated PDF file."
|
|
166
|
+
}),
|
|
167
|
+
title: import_command.flags.string({
|
|
168
|
+
char: "T",
|
|
169
|
+
description: "Overwrite document title."
|
|
170
|
+
}),
|
|
171
|
+
watch: import_command.flags.boolean({
|
|
172
|
+
char: "w",
|
|
173
|
+
description: "Watch the changes on the given file."
|
|
174
|
+
}),
|
|
175
|
+
dev: import_command.flags.boolean({
|
|
176
|
+
char: "d",
|
|
177
|
+
description: "Run with Chrome browser instead of publishing the file."
|
|
178
|
+
})
|
|
93
179
|
};
|
|
94
180
|
MDPrinter.args = [
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
181
|
+
{
|
|
182
|
+
name: "file",
|
|
183
|
+
description: "Markdown file to be processed.",
|
|
184
|
+
required: true
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
name: "output",
|
|
188
|
+
description: "Output file that will be generated. Overwrites the one define in front-matter.",
|
|
189
|
+
required: false
|
|
190
|
+
}
|
|
105
191
|
];
|
|
192
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
193
|
+
0 && (module.exports = {});
|
|
@@ -1,5 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/constants/file.constants.ts
|
|
20
|
+
var file_constants_exports = {};
|
|
21
|
+
__export(file_constants_exports, {
|
|
22
|
+
INPUT_FILE_ACCEPTED_TYPES: () => INPUT_FILE_ACCEPTED_TYPES,
|
|
23
|
+
OUTPUT_FILE_ACCEPTED_TYPES: () => OUTPUT_FILE_ACCEPTED_TYPES
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(file_constants_exports);
|
|
26
|
+
var INPUT_FILE_ACCEPTED_TYPES = [".md"];
|
|
27
|
+
var OUTPUT_FILE_ACCEPTED_TYPES = [".pdf"];
|
|
28
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
29
|
+
0 && (module.exports = {
|
|
30
|
+
INPUT_FILE_ACCEPTED_TYPES,
|
|
31
|
+
OUTPUT_FILE_ACCEPTED_TYPES
|
|
32
|
+
});
|
package/dist/constants/index.js
CHANGED
|
@@ -1,18 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
15
8
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/constants/index.ts
|
|
20
|
+
var constants_exports = {};
|
|
21
|
+
__export(constants_exports, {
|
|
22
|
+
INPUT_FILE_ACCEPTED_TYPES: () => INPUT_FILE_ACCEPTED_TYPES,
|
|
23
|
+
OUTPUT_FILE_ACCEPTED_TYPES: () => OUTPUT_FILE_ACCEPTED_TYPES,
|
|
24
|
+
RequiredTemplateFiles: () => RequiredTemplateFiles,
|
|
25
|
+
TEMPLATE_DIRECTORY: () => TEMPLATE_DIRECTORY,
|
|
26
|
+
TemplateFiles: () => TemplateFiles
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(constants_exports);
|
|
29
|
+
|
|
30
|
+
// src/constants/template.constants.ts
|
|
31
|
+
var TemplateFiles = /* @__PURE__ */ ((TemplateFiles2) => {
|
|
32
|
+
TemplateFiles2["FOOTER"] = "footer.html";
|
|
33
|
+
TemplateFiles2["HEADER"] = "header.html";
|
|
34
|
+
TemplateFiles2["TEMPLATE"] = "template.html.j2";
|
|
35
|
+
TemplateFiles2["CSS"] = "main.css";
|
|
36
|
+
TemplateFiles2["SETTINGS"] = "settings.json";
|
|
37
|
+
return TemplateFiles2;
|
|
38
|
+
})(TemplateFiles || {});
|
|
39
|
+
var RequiredTemplateFiles = ["settings.json" /* SETTINGS */];
|
|
40
|
+
var TEMPLATE_DIRECTORY = "templates";
|
|
41
|
+
|
|
42
|
+
// src/constants/file.constants.ts
|
|
43
|
+
var INPUT_FILE_ACCEPTED_TYPES = [".md"];
|
|
44
|
+
var OUTPUT_FILE_ACCEPTED_TYPES = [".pdf"];
|
|
45
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
46
|
+
0 && (module.exports = {
|
|
47
|
+
INPUT_FILE_ACCEPTED_TYPES,
|
|
48
|
+
OUTPUT_FILE_ACCEPTED_TYPES,
|
|
49
|
+
RequiredTemplateFiles,
|
|
50
|
+
TEMPLATE_DIRECTORY,
|
|
51
|
+
TemplateFiles
|
|
52
|
+
});
|
|
@@ -1,11 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var
|
|
5
|
-
(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/constants/template.constants.ts
|
|
20
|
+
var template_constants_exports = {};
|
|
21
|
+
__export(template_constants_exports, {
|
|
22
|
+
RequiredTemplateFiles: () => RequiredTemplateFiles,
|
|
23
|
+
TEMPLATE_DIRECTORY: () => TEMPLATE_DIRECTORY,
|
|
24
|
+
TemplateFiles: () => TemplateFiles
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(template_constants_exports);
|
|
27
|
+
var TemplateFiles = /* @__PURE__ */ ((TemplateFiles2) => {
|
|
28
|
+
TemplateFiles2["FOOTER"] = "footer.html";
|
|
29
|
+
TemplateFiles2["HEADER"] = "header.html";
|
|
30
|
+
TemplateFiles2["TEMPLATE"] = "template.html.j2";
|
|
31
|
+
TemplateFiles2["CSS"] = "main.css";
|
|
32
|
+
TemplateFiles2["SETTINGS"] = "settings.json";
|
|
33
|
+
return TemplateFiles2;
|
|
34
|
+
})(TemplateFiles || {});
|
|
35
|
+
var RequiredTemplateFiles = ["settings.json" /* SETTINGS */];
|
|
36
|
+
var TEMPLATE_DIRECTORY = "templates";
|
|
37
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
38
|
+
0 && (module.exports = {
|
|
39
|
+
RequiredTemplateFiles,
|
|
40
|
+
TEMPLATE_DIRECTORY,
|
|
41
|
+
TemplateFiles
|
|
42
|
+
});
|
package/dist/hooks/init.hook.js
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/hooks/init.hook.ts
|
|
20
|
+
var init_hook_exports = {};
|
|
21
|
+
__export(init_hook_exports, {
|
|
22
|
+
default: () => init_hook_default
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(init_hook_exports);
|
|
25
|
+
|
|
26
|
+
// src/templates/logo.template.ts
|
|
27
|
+
function logo(version) {
|
|
28
|
+
return `md-printer v${version}`;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// src/hooks/init.hook.ts
|
|
32
|
+
var import_boilerplate_oclif = require("@cenk1cenk2/boilerplate-oclif");
|
|
33
|
+
var init_hook_default = (0, import_boilerplate_oclif.generateInitHook)({ logo });
|
|
34
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
35
|
+
0 && (module.exports = {});
|
|
@@ -1,4 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/hooks/not-found.hook.ts
|
|
20
|
+
var not_found_hook_exports = {};
|
|
21
|
+
__export(not_found_hook_exports, {
|
|
22
|
+
default: () => not_found_hook_default
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(not_found_hook_exports);
|
|
25
|
+
var import_boilerplate_oclif = require("@cenk1cenk2/boilerplate-oclif");
|
|
26
|
+
var not_found_hook_default = import_boilerplate_oclif.notFoundHook;
|
|
27
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
28
|
+
0 && (module.exports = {});
|
|
@@ -1,4 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/hooks/prerun.hook.ts
|
|
20
|
+
var prerun_hook_exports = {};
|
|
21
|
+
__export(prerun_hook_exports, {
|
|
22
|
+
default: () => prerun_hook_default
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(prerun_hook_exports);
|
|
25
|
+
var import_boilerplate_oclif = require("@cenk1cenk2/boilerplate-oclif");
|
|
26
|
+
var prerun_hook_default = import_boilerplate_oclif.prerunHook;
|
|
27
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
28
|
+
0 && (module.exports = {});
|
|
@@ -1,2 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
|
|
15
|
+
// src/interfaces/commands/index.interface.ts
|
|
16
|
+
var index_interface_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(index_interface_exports);
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
15
12
|
};
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
|
|
15
|
+
// src/interfaces/commands/index.ts
|
|
16
|
+
var commands_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(commands_exports);
|