@cenk1cenk2/md-printer 2.2.0 → 2.2.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.
- package/README.md +76 -0
- package/bin/dev +20 -0
- package/bin/dev.cmd +3 -0
- package/bin/run +7 -0
- package/bin/run.cmd +0 -0
- package/dist/commands/index.js +105 -66
- package/dist/constants/file.constants.js +6 -2
- package/dist/constants/index.js +12 -6
- package/dist/constants/template.constants.js +6 -4
- package/dist/hooks/not-found.hook.js +2 -2
- package/dist/hooks/{prerun.hook.js → update-notifier.hook.js} +7 -7
- package/oclif.manifest.json +1 -0
- package/package.json +46 -40
- package/templates/privat-rechnung/main.css +246 -48
- package/templates/privat-rechnung/template.html.j2 +32 -22
- package/bin/run.js +0 -5
- package/config/custom-environment-variables.yml +0 -2
- package/config/debug.yml +0 -1
- package/config/default.yml +0 -6
- package/config/silent.yml +0 -1
- package/dist/hooks/init.hook.js +0 -35
- package/dist/templates/logo.template.js +0 -31
package/README.md
CHANGED
|
@@ -3,3 +3,79 @@
|
|
|
3
3
|
## Description
|
|
4
4
|
|
|
5
5
|
Prints a PDF file from a Markdown document with some themes for myself.
|
|
6
|
+
|
|
7
|
+
<!-- toc -->
|
|
8
|
+
|
|
9
|
+
- [md-printer](#md-printer)
|
|
10
|
+
- [Usage](#usage)
|
|
11
|
+
- [Commands](#commands)
|
|
12
|
+
<!-- tocstop -->
|
|
13
|
+
|
|
14
|
+
# Usage
|
|
15
|
+
|
|
16
|
+
<!-- usage -->
|
|
17
|
+
|
|
18
|
+
```sh-session
|
|
19
|
+
$ npm install -g @cenk1cenk2/md-printer
|
|
20
|
+
$ md-printer COMMAND
|
|
21
|
+
running command...
|
|
22
|
+
$ md-printer (--version)
|
|
23
|
+
@cenk1cenk2/md-printer/1.0.0 linux-x64 node-v16.18.0
|
|
24
|
+
$ md-printer --help [COMMAND]
|
|
25
|
+
USAGE
|
|
26
|
+
$ md-printer COMMAND
|
|
27
|
+
...
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
<!-- usagestop -->
|
|
31
|
+
|
|
32
|
+
# Commands
|
|
33
|
+
|
|
34
|
+
<!-- commands -->
|
|
35
|
+
|
|
36
|
+
- [`md-printer FILE [OUTPUT]`](#md-printer-file-output)
|
|
37
|
+
- [`md-printer help [COMMAND]`](#md-printer-help-command)
|
|
38
|
+
|
|
39
|
+
## `md-printer FILE [OUTPUT]`
|
|
40
|
+
|
|
41
|
+
Generates a PDF from the given markdown file with the selected HTML template.
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
USAGE
|
|
45
|
+
$ md-printer [FILE] [OUTPUT] [-t <value>] [-T <value>] [-w] [-d]
|
|
46
|
+
|
|
47
|
+
ARGUMENTS
|
|
48
|
+
FILE Markdown file to be processed.
|
|
49
|
+
OUTPUT Output file that will be generated. Overwrites the one define in front-matter.
|
|
50
|
+
|
|
51
|
+
FLAGS
|
|
52
|
+
-T, --title=<value> Overwrite document title.
|
|
53
|
+
-d, --dev Run with Chrome browser instead of publishing the file.
|
|
54
|
+
-t, --template=<value> [default: default] HTML template for the generated PDF file.
|
|
55
|
+
-w, --watch Watch the changes on the given file.
|
|
56
|
+
|
|
57
|
+
DESCRIPTION
|
|
58
|
+
Generates a PDF from the given markdown file with the selected HTML template.
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## `md-printer help [COMMAND]`
|
|
62
|
+
|
|
63
|
+
Display help for md-printer.
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
USAGE
|
|
67
|
+
$ md-printer help [COMMAND] [-n]
|
|
68
|
+
|
|
69
|
+
ARGUMENTS
|
|
70
|
+
COMMAND Command to show help for.
|
|
71
|
+
|
|
72
|
+
FLAGS
|
|
73
|
+
-n, --nested-commands Include all nested commands in the output.
|
|
74
|
+
|
|
75
|
+
DESCRIPTION
|
|
76
|
+
Display help for md-printer.
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.1.17/src/commands/help.ts)_
|
|
80
|
+
|
|
81
|
+
<!-- commandsstop -->
|
package/bin/dev
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const oclif = require('@oclif/core')
|
|
4
|
+
|
|
5
|
+
const path = require('path')
|
|
6
|
+
const project = path.join(__dirname, '..', 'tsconfig.json')
|
|
7
|
+
|
|
8
|
+
require('ts-node').register({ project })
|
|
9
|
+
require('tsconfig-paths').register({
|
|
10
|
+
baseUrl: path.dirname(project),
|
|
11
|
+
paths: require(project).compilerOptions.paths
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
// In dev mode, always show stack traces
|
|
15
|
+
oclif.settings.debug = true
|
|
16
|
+
|
|
17
|
+
require('@cenk1cenk2/oclif-common').setup()
|
|
18
|
+
|
|
19
|
+
// Start the CLI
|
|
20
|
+
oclif.run().then(oclif.flush).catch(oclif.Errors.handle)
|
package/bin/dev.cmd
ADDED
package/bin/run
ADDED
package/bin/run.cmd
CHANGED
|
File without changes
|
package/dist/commands/index.js
CHANGED
|
@@ -4,6 +4,8 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
9
|
var __export = (target, all) => {
|
|
8
10
|
for (var name in all)
|
|
9
11
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -16,8 +18,15 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
18
|
}
|
|
17
19
|
return to;
|
|
18
20
|
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
23
|
+
mod
|
|
24
|
+
));
|
|
20
25
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
26
|
+
var __publicField = (obj, key, value) => {
|
|
27
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
28
|
+
return value;
|
|
29
|
+
};
|
|
21
30
|
|
|
22
31
|
// src/commands/index.ts
|
|
23
32
|
var commands_exports = {};
|
|
@@ -25,110 +34,133 @@ __export(commands_exports, {
|
|
|
25
34
|
default: () => MDPrinter
|
|
26
35
|
});
|
|
27
36
|
module.exports = __toCommonJS(commands_exports);
|
|
28
|
-
var import_command = require("@oclif/command");
|
|
29
37
|
var import_chokidar = require("chokidar");
|
|
30
|
-
var import_fs_extra = __toESM(require("fs-extra"));
|
|
31
38
|
var import_gray_matter = require("gray-matter");
|
|
32
39
|
var import_md_to_pdf = __toESM(require("md-to-pdf"));
|
|
33
40
|
var import_nunjucks = __toESM(require("nunjucks"));
|
|
34
41
|
var import_path = require("path");
|
|
35
|
-
var
|
|
42
|
+
var import_oclif_common = require("@cenk1cenk2/oclif-common");
|
|
36
43
|
|
|
37
44
|
// src/constants/template.constants.ts
|
|
38
|
-
var
|
|
45
|
+
var TemplateFiles;
|
|
46
|
+
(function(TemplateFiles2) {
|
|
47
|
+
TemplateFiles2["FOOTER"] = "footer.html";
|
|
48
|
+
TemplateFiles2["HEADER"] = "header.html";
|
|
49
|
+
TemplateFiles2["TEMPLATE"] = "template.html.j2";
|
|
50
|
+
TemplateFiles2["CSS"] = "main.css";
|
|
51
|
+
TemplateFiles2["SETTINGS"] = "settings.json";
|
|
52
|
+
})(TemplateFiles || (TemplateFiles = {}));
|
|
53
|
+
var RequiredTemplateFiles = [
|
|
54
|
+
TemplateFiles.SETTINGS
|
|
55
|
+
];
|
|
39
56
|
var TEMPLATE_DIRECTORY = "templates";
|
|
40
57
|
|
|
41
58
|
// src/constants/file.constants.ts
|
|
42
|
-
var INPUT_FILE_ACCEPTED_TYPES = [
|
|
43
|
-
|
|
59
|
+
var INPUT_FILE_ACCEPTED_TYPES = [
|
|
60
|
+
".md"
|
|
61
|
+
];
|
|
62
|
+
var OUTPUT_FILE_ACCEPTED_TYPES = [
|
|
63
|
+
".pdf"
|
|
64
|
+
];
|
|
44
65
|
|
|
45
66
|
// src/commands/index.ts
|
|
46
|
-
var
|
|
67
|
+
var MDPrinter = class extends import_oclif_common.Command {
|
|
47
68
|
constructor() {
|
|
48
69
|
super(...arguments);
|
|
49
|
-
this
|
|
70
|
+
__publicField(this, "nunjucks", import_nunjucks.default.configure({
|
|
50
71
|
autoescape: false,
|
|
51
72
|
throwOnUndefined: true,
|
|
52
73
|
trimBlocks: true,
|
|
53
74
|
lstripBlocks: false
|
|
54
|
-
});
|
|
75
|
+
}));
|
|
76
|
+
}
|
|
77
|
+
async shouldRunBefore() {
|
|
78
|
+
this.tasks.options = {
|
|
79
|
+
rendererSilent: true
|
|
80
|
+
};
|
|
55
81
|
}
|
|
56
82
|
async run() {
|
|
57
|
-
|
|
58
|
-
this.tasks.options = { rendererSilent: true };
|
|
59
|
-
const tasks = this.tasks.newListr([
|
|
83
|
+
this.tasks.add([
|
|
60
84
|
{
|
|
61
|
-
task: async (
|
|
62
|
-
const file = (0, import_path.join)(process.cwd(), args.file);
|
|
85
|
+
task: async (ctx) => {
|
|
86
|
+
const file = (0, import_path.join)(process.cwd(), this.args.file);
|
|
63
87
|
if (!INPUT_FILE_ACCEPTED_TYPES.includes((0, import_path.extname)(file))) {
|
|
64
88
|
throw new Error(`Input file should be ending with the extension: ${INPUT_FILE_ACCEPTED_TYPES.join(", ")} -> current: ${(0, import_path.extname)(file)}`);
|
|
65
89
|
}
|
|
66
|
-
if (!
|
|
90
|
+
if (!this.fs.exists(file)) {
|
|
67
91
|
throw new Error(`File does not exists: ${file}`);
|
|
68
92
|
}
|
|
69
93
|
this.logger.debug("Loading file: %s", file);
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
94
|
+
ctx.file = file;
|
|
95
|
+
ctx.content = await this.fs.read(file);
|
|
96
|
+
ctx.graymatter = (0, import_gray_matter.read)(ctx.file);
|
|
73
97
|
}
|
|
74
98
|
},
|
|
75
99
|
{
|
|
76
|
-
task: async (
|
|
77
|
-
const template =
|
|
100
|
+
task: async (ctx) => {
|
|
101
|
+
const template = ctx.graymatter?.data?.template ?? this.flags.template;
|
|
78
102
|
this.logger.debug("Loading template: %s", template);
|
|
79
|
-
|
|
103
|
+
ctx.templates = new RegExp(/\.\.?\//).test(template) ? (0, import_path.join)(process.cwd(), template) : (0, import_path.join)(this.config.root, TEMPLATE_DIRECTORY, template);
|
|
80
104
|
await Promise.all(RequiredTemplateFiles.map(async (file) => {
|
|
81
|
-
const current = (0, import_path.join)(
|
|
82
|
-
if (!
|
|
105
|
+
const current = (0, import_path.join)(ctx.templates, file);
|
|
106
|
+
if (!this.fs.exists(current)) {
|
|
83
107
|
throw new Error(`Template does not exists: ${current}`);
|
|
84
108
|
}
|
|
85
109
|
}));
|
|
86
110
|
const paths = {
|
|
87
|
-
[
|
|
88
|
-
[
|
|
89
|
-
[
|
|
90
|
-
[
|
|
91
|
-
[
|
|
111
|
+
[TemplateFiles.SETTINGS]: (0, import_path.join)(ctx.templates, TemplateFiles.SETTINGS),
|
|
112
|
+
[TemplateFiles.CSS]: (0, import_path.join)(ctx.templates, TemplateFiles.CSS),
|
|
113
|
+
[TemplateFiles.HEADER]: (0, import_path.join)(ctx.templates, TemplateFiles.HEADER),
|
|
114
|
+
[TemplateFiles.FOOTER]: (0, import_path.join)(ctx.templates, TemplateFiles.FOOTER),
|
|
115
|
+
[TemplateFiles.TEMPLATE]: (0, import_path.join)(ctx.templates, TemplateFiles.TEMPLATE)
|
|
92
116
|
};
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
117
|
+
ctx.options = await this.cs.extend([
|
|
118
|
+
paths[TemplateFiles.SETTINGS],
|
|
119
|
+
{
|
|
120
|
+
pdf_options: {},
|
|
121
|
+
dest: this.args?.output ?? ctx.graymatter.data?.dest ?? `${(0, import_path.basename)(this.args.file, (0, import_path.extname)(this.args.file))}.pdf`,
|
|
122
|
+
document_title: ctx.graymatter.data?.document_title ?? this.flags.title ?? this.args.file
|
|
123
|
+
}
|
|
124
|
+
]);
|
|
125
|
+
if (this.fs.exists(paths[TemplateFiles.CSS])) {
|
|
99
126
|
this.logger.debug("CSS exists for template.");
|
|
100
|
-
|
|
127
|
+
ctx.options.css = await this.fs.read(paths[TemplateFiles.CSS]);
|
|
101
128
|
}
|
|
102
|
-
if (
|
|
129
|
+
if (this.fs.exists(paths[TemplateFiles.HEADER])) {
|
|
103
130
|
this.logger.debug("Header exists for template.");
|
|
104
|
-
|
|
131
|
+
ctx.options.pdf_options.headerTemplate = await this.fs.read(paths[TemplateFiles.HEADER]);
|
|
105
132
|
}
|
|
106
|
-
if (
|
|
133
|
+
if (this.fs.exists(paths[TemplateFiles.FOOTER])) {
|
|
107
134
|
this.logger.debug("Footer exists for template.");
|
|
108
|
-
|
|
135
|
+
ctx.options.pdf_options.footerTemplate = await this.fs.read(paths[TemplateFiles.FOOTER]);
|
|
109
136
|
}
|
|
110
|
-
if (
|
|
137
|
+
if (this.fs.exists(paths[TemplateFiles.TEMPLATE])) {
|
|
111
138
|
this.logger.debug("Design template exists for template.");
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
this.logger.debug("Frontmatter: %o",
|
|
139
|
+
ctx.template = await this.fs.read(paths[TemplateFiles.TEMPLATE]);
|
|
140
|
+
ctx.content = ctx.graymatter.content;
|
|
141
|
+
this.logger.debug("Frontmatter: %o", ctx.graymatter.data);
|
|
115
142
|
}
|
|
116
143
|
}
|
|
117
144
|
},
|
|
118
145
|
{
|
|
119
|
-
task: async (
|
|
120
|
-
if (
|
|
121
|
-
|
|
146
|
+
task: async (ctx) => {
|
|
147
|
+
if (this.flags.dev) {
|
|
148
|
+
ctx.options.devtools = true;
|
|
122
149
|
}
|
|
123
|
-
return this.runMd2Pdf(
|
|
150
|
+
return this.runMd2Pdf(ctx);
|
|
124
151
|
}
|
|
125
152
|
}
|
|
126
153
|
]);
|
|
127
|
-
|
|
128
|
-
|
|
154
|
+
}
|
|
155
|
+
async shouldRunAfter(ctx) {
|
|
156
|
+
if (this.flags.watch) {
|
|
129
157
|
this.logger.info("Running in watch mode.");
|
|
130
|
-
(0, import_chokidar.watch)([
|
|
131
|
-
|
|
158
|
+
(0, import_chokidar.watch)([
|
|
159
|
+
this.args.file,
|
|
160
|
+
(0, import_path.join)(ctx.templates, "**/*")
|
|
161
|
+
]).on("change", async () => {
|
|
162
|
+
await this.run();
|
|
163
|
+
await this.runTasks();
|
|
132
164
|
this.logger.info("Waiting for the next change.");
|
|
133
165
|
});
|
|
134
166
|
}
|
|
@@ -137,13 +169,20 @@ var _MDPrinter = class extends import_boilerplate_oclif.BaseCommand {
|
|
|
137
169
|
let pdf;
|
|
138
170
|
if (ctx.template) {
|
|
139
171
|
this.logger.debug("Rendering as template.");
|
|
140
|
-
pdf = await (0, import_md_to_pdf.default)({
|
|
172
|
+
pdf = await (0, import_md_to_pdf.default)({
|
|
173
|
+
content: this.nunjucks.renderString(ctx.template, {
|
|
174
|
+
...ctx.graymatter?.data ?? {},
|
|
175
|
+
content: ctx.content
|
|
176
|
+
})
|
|
177
|
+
}, ctx.options);
|
|
141
178
|
} else {
|
|
142
179
|
this.logger.debug("Rendering as plain file.");
|
|
143
|
-
pdf = await (0, import_md_to_pdf.default)({
|
|
180
|
+
pdf = await (0, import_md_to_pdf.default)({
|
|
181
|
+
content: ctx.content
|
|
182
|
+
}, ctx.options);
|
|
144
183
|
}
|
|
145
184
|
const output = pdf.filename;
|
|
146
|
-
await
|
|
185
|
+
await this.fs.mkdir((0, import_path.dirname)(output));
|
|
147
186
|
if (!output) {
|
|
148
187
|
throw new Error("Output should either be defined with the variable or front-matter.");
|
|
149
188
|
} else if (!OUTPUT_FILE_ACCEPTED_TYPES.includes((0, import_path.extname)(output))) {
|
|
@@ -152,32 +191,32 @@ var _MDPrinter = class extends import_boilerplate_oclif.BaseCommand {
|
|
|
152
191
|
this.logger.debug("Output file will be: %s", output);
|
|
153
192
|
if (pdf) {
|
|
154
193
|
this.logger.info("Writing file to output: %s", output);
|
|
155
|
-
await
|
|
194
|
+
await this.fs.write(output, pdf.content);
|
|
156
195
|
}
|
|
157
196
|
}
|
|
158
197
|
};
|
|
159
|
-
|
|
160
|
-
MDPrinter
|
|
161
|
-
MDPrinter
|
|
162
|
-
template:
|
|
198
|
+
__name(MDPrinter, "MDPrinter");
|
|
199
|
+
__publicField(MDPrinter, "description", "Generates a PDF from the given markdown file with the selected HTML template.");
|
|
200
|
+
__publicField(MDPrinter, "flags", {
|
|
201
|
+
template: import_oclif_common.Flags.string({
|
|
163
202
|
char: "t",
|
|
164
203
|
default: "default",
|
|
165
204
|
description: "HTML template for the generated PDF file."
|
|
166
205
|
}),
|
|
167
|
-
title:
|
|
206
|
+
title: import_oclif_common.Flags.string({
|
|
168
207
|
char: "T",
|
|
169
208
|
description: "Overwrite document title."
|
|
170
209
|
}),
|
|
171
|
-
watch:
|
|
210
|
+
watch: import_oclif_common.Flags.boolean({
|
|
172
211
|
char: "w",
|
|
173
212
|
description: "Watch the changes on the given file."
|
|
174
213
|
}),
|
|
175
|
-
dev:
|
|
214
|
+
dev: import_oclif_common.Flags.boolean({
|
|
176
215
|
char: "d",
|
|
177
216
|
description: "Run with Chrome browser instead of publishing the file."
|
|
178
217
|
})
|
|
179
|
-
};
|
|
180
|
-
MDPrinter
|
|
218
|
+
});
|
|
219
|
+
__publicField(MDPrinter, "args", [
|
|
181
220
|
{
|
|
182
221
|
name: "file",
|
|
183
222
|
description: "Markdown file to be processed.",
|
|
@@ -188,6 +227,6 @@ MDPrinter.args = [
|
|
|
188
227
|
description: "Output file that will be generated. Overwrites the one define in front-matter.",
|
|
189
228
|
required: false
|
|
190
229
|
}
|
|
191
|
-
];
|
|
230
|
+
]);
|
|
192
231
|
// Annotate the CommonJS export names for ESM import in node:
|
|
193
232
|
0 && (module.exports = {});
|
|
@@ -23,8 +23,12 @@ __export(file_constants_exports, {
|
|
|
23
23
|
OUTPUT_FILE_ACCEPTED_TYPES: () => OUTPUT_FILE_ACCEPTED_TYPES
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(file_constants_exports);
|
|
26
|
-
var INPUT_FILE_ACCEPTED_TYPES = [
|
|
27
|
-
|
|
26
|
+
var INPUT_FILE_ACCEPTED_TYPES = [
|
|
27
|
+
".md"
|
|
28
|
+
];
|
|
29
|
+
var OUTPUT_FILE_ACCEPTED_TYPES = [
|
|
30
|
+
".pdf"
|
|
31
|
+
];
|
|
28
32
|
// Annotate the CommonJS export names for ESM import in node:
|
|
29
33
|
0 && (module.exports = {
|
|
30
34
|
INPUT_FILE_ACCEPTED_TYPES,
|
package/dist/constants/index.js
CHANGED
|
@@ -28,20 +28,26 @@ __export(constants_exports, {
|
|
|
28
28
|
module.exports = __toCommonJS(constants_exports);
|
|
29
29
|
|
|
30
30
|
// src/constants/template.constants.ts
|
|
31
|
-
var TemplateFiles
|
|
31
|
+
var TemplateFiles;
|
|
32
|
+
(function(TemplateFiles2) {
|
|
32
33
|
TemplateFiles2["FOOTER"] = "footer.html";
|
|
33
34
|
TemplateFiles2["HEADER"] = "header.html";
|
|
34
35
|
TemplateFiles2["TEMPLATE"] = "template.html.j2";
|
|
35
36
|
TemplateFiles2["CSS"] = "main.css";
|
|
36
37
|
TemplateFiles2["SETTINGS"] = "settings.json";
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
})(TemplateFiles || (TemplateFiles = {}));
|
|
39
|
+
var RequiredTemplateFiles = [
|
|
40
|
+
TemplateFiles.SETTINGS
|
|
41
|
+
];
|
|
40
42
|
var TEMPLATE_DIRECTORY = "templates";
|
|
41
43
|
|
|
42
44
|
// src/constants/file.constants.ts
|
|
43
|
-
var INPUT_FILE_ACCEPTED_TYPES = [
|
|
44
|
-
|
|
45
|
+
var INPUT_FILE_ACCEPTED_TYPES = [
|
|
46
|
+
".md"
|
|
47
|
+
];
|
|
48
|
+
var OUTPUT_FILE_ACCEPTED_TYPES = [
|
|
49
|
+
".pdf"
|
|
50
|
+
];
|
|
45
51
|
// Annotate the CommonJS export names for ESM import in node:
|
|
46
52
|
0 && (module.exports = {
|
|
47
53
|
INPUT_FILE_ACCEPTED_TYPES,
|
|
@@ -24,15 +24,17 @@ __export(template_constants_exports, {
|
|
|
24
24
|
TemplateFiles: () => TemplateFiles
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(template_constants_exports);
|
|
27
|
-
var TemplateFiles
|
|
27
|
+
var TemplateFiles;
|
|
28
|
+
(function(TemplateFiles2) {
|
|
28
29
|
TemplateFiles2["FOOTER"] = "footer.html";
|
|
29
30
|
TemplateFiles2["HEADER"] = "header.html";
|
|
30
31
|
TemplateFiles2["TEMPLATE"] = "template.html.j2";
|
|
31
32
|
TemplateFiles2["CSS"] = "main.css";
|
|
32
33
|
TemplateFiles2["SETTINGS"] = "settings.json";
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
})(TemplateFiles || (TemplateFiles = {}));
|
|
35
|
+
var RequiredTemplateFiles = [
|
|
36
|
+
TemplateFiles.SETTINGS
|
|
37
|
+
];
|
|
36
38
|
var TEMPLATE_DIRECTORY = "templates";
|
|
37
39
|
// Annotate the CommonJS export names for ESM import in node:
|
|
38
40
|
0 && (module.exports = {
|
|
@@ -22,7 +22,7 @@ __export(not_found_hook_exports, {
|
|
|
22
22
|
default: () => not_found_hook_default
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(not_found_hook_exports);
|
|
25
|
-
var
|
|
26
|
-
var not_found_hook_default =
|
|
25
|
+
var import_oclif_common = require("@cenk1cenk2/oclif-common");
|
|
26
|
+
var not_found_hook_default = import_oclif_common.notFoundHook;
|
|
27
27
|
// Annotate the CommonJS export names for ESM import in node:
|
|
28
28
|
0 && (module.exports = {});
|
|
@@ -16,13 +16,13 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
};
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
18
|
|
|
19
|
-
// src/hooks/
|
|
20
|
-
var
|
|
21
|
-
__export(
|
|
22
|
-
default: () =>
|
|
19
|
+
// src/hooks/update-notifier.hook.ts
|
|
20
|
+
var update_notifier_hook_exports = {};
|
|
21
|
+
__export(update_notifier_hook_exports, {
|
|
22
|
+
default: () => update_notifier_hook_default
|
|
23
23
|
});
|
|
24
|
-
module.exports = __toCommonJS(
|
|
25
|
-
var
|
|
26
|
-
var
|
|
24
|
+
module.exports = __toCommonJS(update_notifier_hook_exports);
|
|
25
|
+
var import_oclif_common = require("@cenk1cenk2/oclif-common");
|
|
26
|
+
var update_notifier_hook_default = import_oclif_common.updateNotifierHook;
|
|
27
27
|
// Annotate the CommonJS export names for ESM import in node:
|
|
28
28
|
0 && (module.exports = {});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":"1.0.0","commands":{}}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cenk1cenk2/md-printer",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.2",
|
|
4
4
|
"description": "A markdown printer.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
|
-
"repository": "
|
|
6
|
+
"repository": "https://gitlab.kilic.dev/utils/md-printer",
|
|
7
7
|
"author": "Cenk Kilic",
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"bin": {
|
|
@@ -13,17 +13,16 @@
|
|
|
13
13
|
"access": "public"
|
|
14
14
|
},
|
|
15
15
|
"scripts": {
|
|
16
|
-
"
|
|
16
|
+
"dev": "./bin/dev",
|
|
17
|
+
"start": "./bin/run",
|
|
18
|
+
"prebuild": "yarn run manifest && yarn run docs:toc",
|
|
17
19
|
"build": "tsup-node",
|
|
18
20
|
"dev:start": "tsup-node --watch",
|
|
19
|
-
"
|
|
20
|
-
"lint
|
|
21
|
-
"lint:
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"oclif-dev": "node -r tsconfig-paths/register node_modules/@oclif/dev-cli/bin/run",
|
|
25
|
-
"test": "./bin/run.js ./test/test.md --debug",
|
|
26
|
-
"template:privat-rechnung": "cd ./templates/privat-rechnung && tailwindcss -w -c ./tailwind.config.js -i ./tailwind.css -o ./main.css"
|
|
21
|
+
"clean": "rimraf oclif.manifset.json",
|
|
22
|
+
"lint": "prettier --write src/ --loglevel warn && eslint --ext .ts,.js,.tsx,.jsx --fix src/",
|
|
23
|
+
"lint:check": "eslint --ext .ts,.js,.tsx,.jsx src/",
|
|
24
|
+
"manifest": "oclif manifest",
|
|
25
|
+
"docs:toc": "oclif readme"
|
|
27
26
|
},
|
|
28
27
|
"simple-git-hooks": {
|
|
29
28
|
"pre-commit": "yarn exec lint-staged",
|
|
@@ -39,22 +38,27 @@
|
|
|
39
38
|
]
|
|
40
39
|
},
|
|
41
40
|
"files": [
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"dist
|
|
41
|
+
"/config",
|
|
42
|
+
"/bin",
|
|
43
|
+
"/dist",
|
|
44
|
+
"/oclif.manifest.json",
|
|
45
45
|
"templates/"
|
|
46
46
|
],
|
|
47
47
|
"oclif": {
|
|
48
|
-
"commands": "./dist/commands",
|
|
49
48
|
"bin": "md-printer",
|
|
49
|
+
"dirname": "md-printer",
|
|
50
|
+
"commands": "./dist/commands",
|
|
51
|
+
"default": ".",
|
|
50
52
|
"plugins": [
|
|
51
53
|
"@oclif/plugin-help"
|
|
52
54
|
],
|
|
53
55
|
"hooks": {
|
|
54
|
-
"init":
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
"init": [
|
|
57
|
+
"./dist/hooks/update-notifier.hook"
|
|
58
|
+
],
|
|
59
|
+
"command_not_found": "./dist/hooks/not-found.hook"
|
|
60
|
+
},
|
|
61
|
+
"topicSeparator": ":"
|
|
58
62
|
},
|
|
59
63
|
"engines": {
|
|
60
64
|
"node": ">=16.0.0"
|
|
@@ -64,43 +68,45 @@
|
|
|
64
68
|
"cenk1cenk2"
|
|
65
69
|
],
|
|
66
70
|
"dependencies": {
|
|
67
|
-
"@cenk1cenk2/
|
|
68
|
-
"@oclif/
|
|
69
|
-
"@oclif/
|
|
70
|
-
"@oclif/errors": "^1.3.5",
|
|
71
|
-
"@oclif/plugin-help": "^5.1.12",
|
|
71
|
+
"@cenk1cenk2/oclif-common": "^3.9.0",
|
|
72
|
+
"@oclif/core": "^1",
|
|
73
|
+
"@oclif/plugin-help": "^5.1.17",
|
|
72
74
|
"chokidar": "^3.5.3",
|
|
73
|
-
"
|
|
75
|
+
"class-transformer": "^0.5.1",
|
|
76
|
+
"class-validator": "^0.13.2",
|
|
77
|
+
"config": "^3.3.8",
|
|
74
78
|
"enquirer": "^2.3.6",
|
|
75
79
|
"execa": "^5.1.1",
|
|
76
80
|
"fs-extra": "^10.1.0",
|
|
77
81
|
"globby": "^11.0.4",
|
|
78
82
|
"gray-matter": "^4.0.3",
|
|
79
|
-
"listr2": "^
|
|
83
|
+
"listr2": "^5.0.5",
|
|
80
84
|
"md-to-pdf": "^5.1.0",
|
|
81
85
|
"nunjucks": "^3.2.3",
|
|
82
|
-
"tsup": "^6.
|
|
83
|
-
"yaml": "^2.1.
|
|
86
|
+
"tsup": "^6.3.0",
|
|
87
|
+
"yaml": "^2.1.3"
|
|
84
88
|
},
|
|
85
89
|
"devDependencies": {
|
|
86
|
-
"@cenk1cenk2/cz-cc": "^1.5.
|
|
87
|
-
"@cenk1cenk2/eslint-config": "^2.5.
|
|
88
|
-
"@
|
|
89
|
-
"@tailwindcss/forms": "^0.5.
|
|
90
|
-
"@tailwindcss/typography": "^0.5.
|
|
91
|
-
"@types/config": "^
|
|
90
|
+
"@cenk1cenk2/cz-cc": "^1.5.4",
|
|
91
|
+
"@cenk1cenk2/eslint-config": "^2.5.34",
|
|
92
|
+
"@swc/core": "^1.3.11",
|
|
93
|
+
"@tailwindcss/forms": "^0.5.3",
|
|
94
|
+
"@tailwindcss/typography": "^0.5.7",
|
|
95
|
+
"@types/config": "^3.3.0",
|
|
92
96
|
"@types/fs-extra": "^9.0.13",
|
|
93
|
-
"@types/node": "^18.
|
|
97
|
+
"@types/node": "^18.11.9",
|
|
94
98
|
"@types/nunjucks": "^3.2.1",
|
|
95
|
-
"eslint": "^8.
|
|
99
|
+
"eslint": "^8.26.0",
|
|
96
100
|
"lint-staged": "^13.0.3",
|
|
97
|
-
"
|
|
101
|
+
"oclif": "^3",
|
|
102
|
+
"postcss": "^8.4.18",
|
|
98
103
|
"prettier": "^2.7.1",
|
|
99
|
-
"simple-git-hooks": "^2.8.
|
|
104
|
+
"simple-git-hooks": "^2.8.1",
|
|
100
105
|
"source-map-support": "^0.5.21",
|
|
101
|
-
"tailwindcss": "^3.1
|
|
106
|
+
"tailwindcss": "^3.2.1",
|
|
102
107
|
"theme-colors": "^0.0.5",
|
|
103
|
-
"
|
|
108
|
+
"ts-node": "^10.9.1",
|
|
109
|
+
"typescript": "^4.8.4"
|
|
104
110
|
},
|
|
105
111
|
"config": {
|
|
106
112
|
"commitizen": {
|
|
@@ -7,7 +7,7 @@ html {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
/*
|
|
10
|
-
! tailwindcss v3.1
|
|
10
|
+
! tailwindcss v3.2.1 | MIT License | https://tailwindcss.com
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
/*
|
|
@@ -363,13 +363,6 @@ input::-moz-placeholder, textarea::-moz-placeholder {
|
|
|
363
363
|
/* 2 */
|
|
364
364
|
}
|
|
365
365
|
|
|
366
|
-
input:-ms-input-placeholder, textarea:-ms-input-placeholder {
|
|
367
|
-
opacity: 1;
|
|
368
|
-
/* 1 */
|
|
369
|
-
color: #9ca3af;
|
|
370
|
-
/* 2 */
|
|
371
|
-
}
|
|
372
|
-
|
|
373
366
|
input::placeholder,
|
|
374
367
|
textarea::placeholder {
|
|
375
368
|
opacity: 1;
|
|
@@ -425,6 +418,12 @@ video {
|
|
|
425
418
|
height: auto;
|
|
426
419
|
}
|
|
427
420
|
|
|
421
|
+
/* Make elements with the HTML hidden attribute stay hidden by default */
|
|
422
|
+
|
|
423
|
+
[hidden] {
|
|
424
|
+
display: none;
|
|
425
|
+
}
|
|
426
|
+
|
|
428
427
|
[type='text'],[type='email'],[type='url'],[type='password'],[type='number'],[type='date'],[type='datetime-local'],[type='month'],[type='search'],[type='tel'],[type='time'],[type='week'],[multiple],textarea,select {
|
|
429
428
|
-webkit-appearance: none;
|
|
430
429
|
-moz-appearance: none;
|
|
@@ -460,11 +459,6 @@ input::-moz-placeholder, textarea::-moz-placeholder {
|
|
|
460
459
|
opacity: 1;
|
|
461
460
|
}
|
|
462
461
|
|
|
463
|
-
input:-ms-input-placeholder, textarea:-ms-input-placeholder {
|
|
464
|
-
color: #6b7280;
|
|
465
|
-
opacity: 1;
|
|
466
|
-
}
|
|
467
|
-
|
|
468
462
|
input::placeholder,textarea::placeholder {
|
|
469
463
|
color: #6b7280;
|
|
470
464
|
opacity: 1;
|
|
@@ -490,7 +484,6 @@ select {
|
|
|
490
484
|
background-size: 1.5em 1.5em;
|
|
491
485
|
padding-right: 2.5rem;
|
|
492
486
|
-webkit-print-color-adjust: exact;
|
|
493
|
-
color-adjust: exact;
|
|
494
487
|
print-color-adjust: exact;
|
|
495
488
|
}
|
|
496
489
|
|
|
@@ -501,7 +494,6 @@ select {
|
|
|
501
494
|
background-size: initial;
|
|
502
495
|
padding-right: 0.75rem;
|
|
503
496
|
-webkit-print-color-adjust: unset;
|
|
504
|
-
color-adjust: unset;
|
|
505
497
|
print-color-adjust: unset;
|
|
506
498
|
}
|
|
507
499
|
|
|
@@ -511,14 +503,12 @@ select {
|
|
|
511
503
|
appearance: none;
|
|
512
504
|
padding: 0;
|
|
513
505
|
-webkit-print-color-adjust: exact;
|
|
514
|
-
color-adjust: exact;
|
|
515
506
|
print-color-adjust: exact;
|
|
516
507
|
display: inline-block;
|
|
517
508
|
vertical-align: middle;
|
|
518
509
|
background-origin: border-box;
|
|
519
510
|
-webkit-user-select: none;
|
|
520
511
|
-moz-user-select: none;
|
|
521
|
-
-ms-user-select: none;
|
|
522
512
|
user-select: none;
|
|
523
513
|
flex-shrink: 0;
|
|
524
514
|
height: 1rem;
|
|
@@ -765,8 +755,22 @@ select {
|
|
|
765
755
|
font-weight: 600;
|
|
766
756
|
}
|
|
767
757
|
|
|
758
|
+
.prose :where(a strong):not(:where([class~="not-prose"] *)) {
|
|
759
|
+
color: inherit;
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
.prose :where(blockquote strong):not(:where([class~="not-prose"] *)) {
|
|
763
|
+
color: inherit;
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
.prose :where(thead th strong):not(:where([class~="not-prose"] *)) {
|
|
767
|
+
color: inherit;
|
|
768
|
+
}
|
|
769
|
+
|
|
768
770
|
.prose :where(ol):not(:where([class~="not-prose"] *)) {
|
|
769
771
|
list-style-type: decimal;
|
|
772
|
+
margin-top: 1.25em;
|
|
773
|
+
margin-bottom: 1.25em;
|
|
770
774
|
padding-left: 1.625em;
|
|
771
775
|
}
|
|
772
776
|
|
|
@@ -808,6 +812,8 @@ select {
|
|
|
808
812
|
|
|
809
813
|
.prose :where(ul):not(:where([class~="not-prose"] *)) {
|
|
810
814
|
list-style-type: disc;
|
|
815
|
+
margin-top: 1.25em;
|
|
816
|
+
margin-bottom: 1.25em;
|
|
811
817
|
padding-left: 1.625em;
|
|
812
818
|
}
|
|
813
819
|
|
|
@@ -858,6 +864,7 @@ select {
|
|
|
858
864
|
|
|
859
865
|
.prose :where(h1 strong):not(:where([class~="not-prose"] *)) {
|
|
860
866
|
font-weight: 900;
|
|
867
|
+
color: inherit;
|
|
861
868
|
}
|
|
862
869
|
|
|
863
870
|
.prose :where(h2):not(:where([class~="not-prose"] *)) {
|
|
@@ -871,6 +878,7 @@ select {
|
|
|
871
878
|
|
|
872
879
|
.prose :where(h2 strong):not(:where([class~="not-prose"] *)) {
|
|
873
880
|
font-weight: 800;
|
|
881
|
+
color: inherit;
|
|
874
882
|
}
|
|
875
883
|
|
|
876
884
|
.prose :where(h3):not(:where([class~="not-prose"] *)) {
|
|
@@ -884,6 +892,7 @@ select {
|
|
|
884
892
|
|
|
885
893
|
.prose :where(h3 strong):not(:where([class~="not-prose"] *)) {
|
|
886
894
|
font-weight: 700;
|
|
895
|
+
color: inherit;
|
|
887
896
|
}
|
|
888
897
|
|
|
889
898
|
.prose :where(h4):not(:where([class~="not-prose"] *)) {
|
|
@@ -896,6 +905,12 @@ select {
|
|
|
896
905
|
|
|
897
906
|
.prose :where(h4 strong):not(:where([class~="not-prose"] *)) {
|
|
898
907
|
font-weight: 700;
|
|
908
|
+
color: inherit;
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
.prose :where(img):not(:where([class~="not-prose"] *)) {
|
|
912
|
+
margin-top: 2em;
|
|
913
|
+
margin-bottom: 2em;
|
|
899
914
|
}
|
|
900
915
|
|
|
901
916
|
.prose :where(figure > *):not(:where([class~="not-prose"] *)) {
|
|
@@ -925,7 +940,33 @@ select {
|
|
|
925
940
|
}
|
|
926
941
|
|
|
927
942
|
.prose :where(a code):not(:where([class~="not-prose"] *)) {
|
|
928
|
-
color:
|
|
943
|
+
color: inherit;
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
.prose :where(h1 code):not(:where([class~="not-prose"] *)) {
|
|
947
|
+
color: inherit;
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
.prose :where(h2 code):not(:where([class~="not-prose"] *)) {
|
|
951
|
+
color: inherit;
|
|
952
|
+
font-size: 0.875em;
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
.prose :where(h3 code):not(:where([class~="not-prose"] *)) {
|
|
956
|
+
color: inherit;
|
|
957
|
+
font-size: 0.9em;
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
.prose :where(h4 code):not(:where([class~="not-prose"] *)) {
|
|
961
|
+
color: inherit;
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
.prose :where(blockquote code):not(:where([class~="not-prose"] *)) {
|
|
965
|
+
color: inherit;
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
.prose :where(thead th code):not(:where([class~="not-prose"] *)) {
|
|
969
|
+
color: inherit;
|
|
929
970
|
}
|
|
930
971
|
|
|
931
972
|
.prose :where(pre):not(:where([class~="not-prose"] *)) {
|
|
@@ -999,10 +1040,15 @@ select {
|
|
|
999
1040
|
|
|
1000
1041
|
.prose :where(tbody td):not(:where([class~="not-prose"] *)) {
|
|
1001
1042
|
vertical-align: baseline;
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
.prose :where(tfoot):not(:where([class~="not-prose"] *)) {
|
|
1046
|
+
border-top-width: 1px;
|
|
1047
|
+
border-top-color: var(--tw-prose-th-borders);
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
.prose :where(tfoot td):not(:where([class~="not-prose"] *)) {
|
|
1051
|
+
vertical-align: top;
|
|
1006
1052
|
}
|
|
1007
1053
|
|
|
1008
1054
|
.prose {
|
|
@@ -1047,11 +1093,6 @@ select {
|
|
|
1047
1093
|
margin-bottom: 1.25em;
|
|
1048
1094
|
}
|
|
1049
1095
|
|
|
1050
|
-
.prose :where(img):not(:where([class~="not-prose"] *)) {
|
|
1051
|
-
margin-top: 2em;
|
|
1052
|
-
margin-bottom: 2em;
|
|
1053
|
-
}
|
|
1054
|
-
|
|
1055
1096
|
.prose :where(video):not(:where([class~="not-prose"] *)) {
|
|
1056
1097
|
margin-top: 2em;
|
|
1057
1098
|
margin-bottom: 2em;
|
|
@@ -1062,14 +1103,6 @@ select {
|
|
|
1062
1103
|
margin-bottom: 2em;
|
|
1063
1104
|
}
|
|
1064
1105
|
|
|
1065
|
-
.prose :where(h2 code):not(:where([class~="not-prose"] *)) {
|
|
1066
|
-
font-size: 0.875em;
|
|
1067
|
-
}
|
|
1068
|
-
|
|
1069
|
-
.prose :where(h3 code):not(:where([class~="not-prose"] *)) {
|
|
1070
|
-
font-size: 0.9em;
|
|
1071
|
-
}
|
|
1072
|
-
|
|
1073
1106
|
.prose :where(li):not(:where([class~="not-prose"] *)) {
|
|
1074
1107
|
margin-top: 0.5em;
|
|
1075
1108
|
margin-bottom: 0.5em;
|
|
@@ -1083,24 +1116,24 @@ select {
|
|
|
1083
1116
|
padding-left: 0.375em;
|
|
1084
1117
|
}
|
|
1085
1118
|
|
|
1086
|
-
.prose
|
|
1119
|
+
.prose :where(.prose > ul > li p):not(:where([class~="not-prose"] *)) {
|
|
1087
1120
|
margin-top: 0.75em;
|
|
1088
1121
|
margin-bottom: 0.75em;
|
|
1089
1122
|
}
|
|
1090
1123
|
|
|
1091
|
-
.prose
|
|
1124
|
+
.prose :where(.prose > ul > li > *:first-child):not(:where([class~="not-prose"] *)) {
|
|
1092
1125
|
margin-top: 1.25em;
|
|
1093
1126
|
}
|
|
1094
1127
|
|
|
1095
|
-
.prose
|
|
1128
|
+
.prose :where(.prose > ul > li > *:last-child):not(:where([class~="not-prose"] *)) {
|
|
1096
1129
|
margin-bottom: 1.25em;
|
|
1097
1130
|
}
|
|
1098
1131
|
|
|
1099
|
-
.prose
|
|
1132
|
+
.prose :where(.prose > ol > li > *:first-child):not(:where([class~="not-prose"] *)) {
|
|
1100
1133
|
margin-top: 1.25em;
|
|
1101
1134
|
}
|
|
1102
1135
|
|
|
1103
|
-
.prose
|
|
1136
|
+
.prose :where(.prose > ol > li > *:last-child):not(:where([class~="not-prose"] *)) {
|
|
1104
1137
|
margin-bottom: 1.25em;
|
|
1105
1138
|
}
|
|
1106
1139
|
|
|
@@ -1133,19 +1166,171 @@ select {
|
|
|
1133
1166
|
padding-right: 0;
|
|
1134
1167
|
}
|
|
1135
1168
|
|
|
1136
|
-
.prose :where(tbody td
|
|
1169
|
+
.prose :where(tbody td, tfoot td):not(:where([class~="not-prose"] *)) {
|
|
1170
|
+
padding-top: 0.5714286em;
|
|
1171
|
+
padding-right: 0.5714286em;
|
|
1172
|
+
padding-bottom: 0.5714286em;
|
|
1173
|
+
padding-left: 0.5714286em;
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
.prose :where(tbody td:first-child, tfoot td:first-child):not(:where([class~="not-prose"] *)) {
|
|
1137
1177
|
padding-left: 0;
|
|
1138
1178
|
}
|
|
1139
1179
|
|
|
1140
|
-
.prose :where(tbody td:last-child):not(:where([class~="not-prose"] *)) {
|
|
1180
|
+
.prose :where(tbody td:last-child, tfoot td:last-child):not(:where([class~="not-prose"] *)) {
|
|
1141
1181
|
padding-right: 0;
|
|
1142
1182
|
}
|
|
1143
1183
|
|
|
1144
|
-
.prose
|
|
1184
|
+
.prose :where(.prose > :first-child):not(:where([class~="not-prose"] *)) {
|
|
1185
|
+
margin-top: 0;
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
.prose :where(.prose > :last-child):not(:where([class~="not-prose"] *)) {
|
|
1189
|
+
margin-bottom: 0;
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
.prose-sm :where(.prose > ul > li p):not(:where([class~="not-prose"] *)) {
|
|
1193
|
+
margin-top: 0.5714286em;
|
|
1194
|
+
margin-bottom: 0.5714286em;
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
.prose-sm :where(.prose > ul > li > *:first-child):not(:where([class~="not-prose"] *)) {
|
|
1198
|
+
margin-top: 1.1428571em;
|
|
1199
|
+
}
|
|
1200
|
+
|
|
1201
|
+
.prose-sm :where(.prose > ul > li > *:last-child):not(:where([class~="not-prose"] *)) {
|
|
1202
|
+
margin-bottom: 1.1428571em;
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1205
|
+
.prose-sm :where(.prose > ol > li > *:first-child):not(:where([class~="not-prose"] *)) {
|
|
1206
|
+
margin-top: 1.1428571em;
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
.prose-sm :where(.prose > ol > li > *:last-child):not(:where([class~="not-prose"] *)) {
|
|
1210
|
+
margin-bottom: 1.1428571em;
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
.prose-sm :where(.prose > :first-child):not(:where([class~="not-prose"] *)) {
|
|
1214
|
+
margin-top: 0;
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
.prose-sm :where(.prose > :last-child):not(:where([class~="not-prose"] *)) {
|
|
1218
|
+
margin-bottom: 0;
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
.prose-base :where(.prose > ul > li p):not(:where([class~="not-prose"] *)) {
|
|
1222
|
+
margin-top: 0.75em;
|
|
1223
|
+
margin-bottom: 0.75em;
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
.prose-base :where(.prose > ul > li > *:first-child):not(:where([class~="not-prose"] *)) {
|
|
1227
|
+
margin-top: 1.25em;
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
.prose-base :where(.prose > ul > li > *:last-child):not(:where([class~="not-prose"] *)) {
|
|
1231
|
+
margin-bottom: 1.25em;
|
|
1232
|
+
}
|
|
1233
|
+
|
|
1234
|
+
.prose-base :where(.prose > ol > li > *:first-child):not(:where([class~="not-prose"] *)) {
|
|
1235
|
+
margin-top: 1.25em;
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
.prose-base :where(.prose > ol > li > *:last-child):not(:where([class~="not-prose"] *)) {
|
|
1239
|
+
margin-bottom: 1.25em;
|
|
1240
|
+
}
|
|
1241
|
+
|
|
1242
|
+
.prose-base :where(.prose > :first-child):not(:where([class~="not-prose"] *)) {
|
|
1243
|
+
margin-top: 0;
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
.prose-base :where(.prose > :last-child):not(:where([class~="not-prose"] *)) {
|
|
1247
|
+
margin-bottom: 0;
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
.prose-lg :where(.prose > ul > li p):not(:where([class~="not-prose"] *)) {
|
|
1251
|
+
margin-top: 0.8888889em;
|
|
1252
|
+
margin-bottom: 0.8888889em;
|
|
1253
|
+
}
|
|
1254
|
+
|
|
1255
|
+
.prose-lg :where(.prose > ul > li > *:first-child):not(:where([class~="not-prose"] *)) {
|
|
1256
|
+
margin-top: 1.3333333em;
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
.prose-lg :where(.prose > ul > li > *:last-child):not(:where([class~="not-prose"] *)) {
|
|
1260
|
+
margin-bottom: 1.3333333em;
|
|
1261
|
+
}
|
|
1262
|
+
|
|
1263
|
+
.prose-lg :where(.prose > ol > li > *:first-child):not(:where([class~="not-prose"] *)) {
|
|
1264
|
+
margin-top: 1.3333333em;
|
|
1265
|
+
}
|
|
1266
|
+
|
|
1267
|
+
.prose-lg :where(.prose > ol > li > *:last-child):not(:where([class~="not-prose"] *)) {
|
|
1268
|
+
margin-bottom: 1.3333333em;
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
.prose-lg :where(.prose > :first-child):not(:where([class~="not-prose"] *)) {
|
|
1272
|
+
margin-top: 0;
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1275
|
+
.prose-lg :where(.prose > :last-child):not(:where([class~="not-prose"] *)) {
|
|
1276
|
+
margin-bottom: 0;
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1279
|
+
.prose-xl :where(.prose > ul > li p):not(:where([class~="not-prose"] *)) {
|
|
1280
|
+
margin-top: 0.8em;
|
|
1281
|
+
margin-bottom: 0.8em;
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1284
|
+
.prose-xl :where(.prose > ul > li > *:first-child):not(:where([class~="not-prose"] *)) {
|
|
1285
|
+
margin-top: 1.2em;
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1288
|
+
.prose-xl :where(.prose > ul > li > *:last-child):not(:where([class~="not-prose"] *)) {
|
|
1289
|
+
margin-bottom: 1.2em;
|
|
1290
|
+
}
|
|
1291
|
+
|
|
1292
|
+
.prose-xl :where(.prose > ol > li > *:first-child):not(:where([class~="not-prose"] *)) {
|
|
1293
|
+
margin-top: 1.2em;
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
.prose-xl :where(.prose > ol > li > *:last-child):not(:where([class~="not-prose"] *)) {
|
|
1297
|
+
margin-bottom: 1.2em;
|
|
1298
|
+
}
|
|
1299
|
+
|
|
1300
|
+
.prose-xl :where(.prose > :first-child):not(:where([class~="not-prose"] *)) {
|
|
1145
1301
|
margin-top: 0;
|
|
1146
1302
|
}
|
|
1147
1303
|
|
|
1148
|
-
.prose
|
|
1304
|
+
.prose-xl :where(.prose > :last-child):not(:where([class~="not-prose"] *)) {
|
|
1305
|
+
margin-bottom: 0;
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1308
|
+
.prose-2xl :where(.prose > ul > li p):not(:where([class~="not-prose"] *)) {
|
|
1309
|
+
margin-top: 0.8333333em;
|
|
1310
|
+
margin-bottom: 0.8333333em;
|
|
1311
|
+
}
|
|
1312
|
+
|
|
1313
|
+
.prose-2xl :where(.prose > ul > li > *:first-child):not(:where([class~="not-prose"] *)) {
|
|
1314
|
+
margin-top: 1.3333333em;
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1317
|
+
.prose-2xl :where(.prose > ul > li > *:last-child):not(:where([class~="not-prose"] *)) {
|
|
1318
|
+
margin-bottom: 1.3333333em;
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1321
|
+
.prose-2xl :where(.prose > ol > li > *:first-child):not(:where([class~="not-prose"] *)) {
|
|
1322
|
+
margin-top: 1.3333333em;
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1325
|
+
.prose-2xl :where(.prose > ol > li > *:last-child):not(:where([class~="not-prose"] *)) {
|
|
1326
|
+
margin-bottom: 1.3333333em;
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
.prose-2xl :where(.prose > :first-child):not(:where([class~="not-prose"] *)) {
|
|
1330
|
+
margin-top: 0;
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1333
|
+
.prose-2xl :where(.prose > :last-child):not(:where([class~="not-prose"] *)) {
|
|
1149
1334
|
margin-bottom: 0;
|
|
1150
1335
|
}
|
|
1151
1336
|
|
|
@@ -1158,14 +1343,31 @@ select {
|
|
|
1158
1343
|
margin-bottom: 0.5rem;
|
|
1159
1344
|
}
|
|
1160
1345
|
|
|
1346
|
+
.my-4 {
|
|
1347
|
+
margin-top: 1rem;
|
|
1348
|
+
margin-bottom: 1rem;
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1161
1351
|
.mb-2 {
|
|
1162
1352
|
margin-bottom: 0.5rem;
|
|
1163
1353
|
}
|
|
1164
1354
|
|
|
1355
|
+
.mt-4 {
|
|
1356
|
+
margin-top: 1rem;
|
|
1357
|
+
}
|
|
1358
|
+
|
|
1165
1359
|
.mt-0 {
|
|
1166
1360
|
margin-top: 0px;
|
|
1167
1361
|
}
|
|
1168
1362
|
|
|
1363
|
+
.\!mt-0 {
|
|
1364
|
+
margin-top: 0px !important;
|
|
1365
|
+
}
|
|
1366
|
+
|
|
1367
|
+
.\!mb-2 {
|
|
1368
|
+
margin-bottom: 0.5rem !important;
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1169
1371
|
.flex {
|
|
1170
1372
|
display: flex;
|
|
1171
1373
|
}
|
|
@@ -1256,10 +1458,6 @@ select {
|
|
|
1256
1458
|
background-color: rgb(243 244 246 / var(--tw-bg-opacity)) !important;
|
|
1257
1459
|
}
|
|
1258
1460
|
|
|
1259
|
-
.p-0 {
|
|
1260
|
-
padding: 0px;
|
|
1261
|
-
}
|
|
1262
|
-
|
|
1263
1461
|
.p-20 {
|
|
1264
1462
|
padding: 5rem;
|
|
1265
1463
|
}
|
|
@@ -8,24 +8,29 @@
|
|
|
8
8
|
</head>
|
|
9
9
|
<body>
|
|
10
10
|
<div class="max-w-full leading-tight prose">
|
|
11
|
-
<h1 class="mb-2 text-center">Privatrechnung</h1>
|
|
11
|
+
<h1 class="mb-2 text-center border-b-2">Privatrechnung</h1>
|
|
12
12
|
<div class="text-center">
|
|
13
|
-
<p class="
|
|
14
|
-
<p class="
|
|
13
|
+
<p class="m-0 font-bold">Rechnungsnummer</p>
|
|
14
|
+
<p class="m-0 font-bold">{{ id }}</p>
|
|
15
15
|
</div>
|
|
16
|
-
<div class="grid grid-cols-2">
|
|
16
|
+
<div class="grid grid-cols-2" style="margin-bottom: 1em !important;">
|
|
17
17
|
<div class="grid-cols-1">
|
|
18
18
|
<div>
|
|
19
19
|
<h4 class="">Absender</h4>
|
|
20
20
|
</div>
|
|
21
21
|
<div>
|
|
22
|
-
<p class="
|
|
22
|
+
<p class="my-2 font-semibold">{{ sender.name }}</p>
|
|
23
|
+
{% if sender.email %}
|
|
24
|
+
<p class="m-0 my-2">{{ sender.email }}</p>
|
|
25
|
+
{% endif %}
|
|
23
26
|
{% if sender.phone %}
|
|
24
|
-
<p class="
|
|
27
|
+
<p class="m-0 my-2">{{ sender.phone }}</p>
|
|
25
28
|
{% endif %}
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
<div class="mt-4">
|
|
30
|
+
<p class="m-0">{{ sender.address }}</p>
|
|
31
|
+
<p class="m-0">{{ sender.postcode }}</p>
|
|
32
|
+
<p class="m-0">{{ sender.location }}</p>
|
|
33
|
+
</div>
|
|
29
34
|
</div>
|
|
30
35
|
</div>
|
|
31
36
|
<div class="grid-cols-1 text-right">
|
|
@@ -33,18 +38,23 @@
|
|
|
33
38
|
<h4 class="">Empfänger</h4>
|
|
34
39
|
</div>
|
|
35
40
|
<div class="leading-tight">
|
|
36
|
-
<p class="
|
|
41
|
+
<p class="my-2 font-semibold">{{ receiver.name }}</p>
|
|
42
|
+
{% if receiver.email %}
|
|
43
|
+
<p class="m-0 my-2">{{ receiver.email }}</p>
|
|
44
|
+
{% endif %}
|
|
37
45
|
{% if receiver.phone %}
|
|
38
|
-
<p class="
|
|
46
|
+
<p class="m-0 my-2">{{ receiver.phone }}</p>
|
|
39
47
|
{% endif %}
|
|
40
|
-
<
|
|
41
|
-
|
|
42
|
-
|
|
48
|
+
<div class="mt-4">
|
|
49
|
+
<p class="m-0">{{ receiver.address }}</p>
|
|
50
|
+
<p class="m-0">{{ receiver.postcode }}</p>
|
|
51
|
+
<p class="m-0">{{ receiver.location }}</p>
|
|
52
|
+
</div>
|
|
43
53
|
</div>
|
|
44
54
|
</div>
|
|
45
55
|
</div>
|
|
46
|
-
<div>
|
|
47
|
-
<
|
|
56
|
+
<div class="border-t-2">
|
|
57
|
+
<p class="font-bold">Dies ist eine Privatrechnung über eine nicht gewerbliche Tätigkeit. Umsatzsteuer wird daher nicht in Rechnung gestellt.</p>
|
|
48
58
|
<table class="w-full rounded-lg border-gray-200 table-fixed">
|
|
49
59
|
<thead class="border-b-2 border-primary-500">
|
|
50
60
|
<tr class="bg-gray-200">
|
|
@@ -115,14 +125,14 @@
|
|
|
115
125
|
</tfoot>
|
|
116
126
|
</table>
|
|
117
127
|
</div>
|
|
118
|
-
<hr />
|
|
128
|
+
<hr class="border-t-2 !mt-0 !mb-2" style="margin-top: 0 !important; margin-bottom: 1.5em !important;" />
|
|
119
129
|
<div class="grid grid-cols-2 font-semibold">
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
</div>
|
|
130
|
+
<div class="flex flex-row items-center text-center">
|
|
131
|
+
<div class="w-full">
|
|
132
|
+
<p class="my-4">{{ location }}</p>
|
|
133
|
+
<p class="my-4">{{ date }}</p>
|
|
125
134
|
</div>
|
|
135
|
+
</div>
|
|
126
136
|
<div class="p-20 text-center rounded-lg border-2 border-gray-200">Unterschrift</div>
|
|
127
137
|
</div>
|
|
128
138
|
</div>
|
package/bin/run.js
DELETED
package/config/debug.yml
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
loglevel: debug
|
package/config/default.yml
DELETED
package/config/silent.yml
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
loglevel: silent
|
package/dist/hooks/init.hook.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
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,31 +0,0 @@
|
|
|
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/templates/logo.template.ts
|
|
20
|
-
var logo_template_exports = {};
|
|
21
|
-
__export(logo_template_exports, {
|
|
22
|
-
logo: () => logo
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(logo_template_exports);
|
|
25
|
-
function logo(version) {
|
|
26
|
-
return `md-printer v${version}`;
|
|
27
|
-
}
|
|
28
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
29
|
-
0 && (module.exports = {
|
|
30
|
-
logo
|
|
31
|
-
});
|