@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 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
@@ -0,0 +1,3 @@
1
+ @echo off
2
+
3
+ node "%~dp0\dev" %*
package/bin/run ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+
3
+ const oclif = require('@oclif/core')
4
+
5
+ require('@cenk1cenk2/oclif-common').setup()
6
+
7
+ oclif.run().then(oclif.flush).catch(oclif.Errors.handle)
package/bin/run.cmd CHANGED
File without changes
@@ -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(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
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 import_boilerplate_oclif = require("@cenk1cenk2/boilerplate-oclif");
42
+ var import_oclif_common = require("@cenk1cenk2/oclif-common");
36
43
 
37
44
  // src/constants/template.constants.ts
38
- var RequiredTemplateFiles = ["settings.json" /* SETTINGS */];
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 = [".md"];
43
- var OUTPUT_FILE_ACCEPTED_TYPES = [".pdf"];
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 _MDPrinter = class extends import_boilerplate_oclif.BaseCommand {
67
+ var MDPrinter = class extends import_oclif_common.Command {
47
68
  constructor() {
48
69
  super(...arguments);
49
- this.nunjucks = import_nunjucks.default.configure({
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
- const { args, flags: flags2 } = this.parse(_MDPrinter);
58
- this.tasks.options = { rendererSilent: true };
59
- const tasks = this.tasks.newListr([
83
+ this.tasks.add([
60
84
  {
61
- task: async (ctx2) => {
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 (!import_fs_extra.default.existsSync(file)) {
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
- 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);
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 (ctx2) => {
77
- const template = ctx2.graymatter?.data?.template ?? flags2.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
- ctx2.templates = new RegExp(/\.\.?\//).test(template) ? (0, import_path.join)(process.cwd(), template) : (0, import_path.join)(this.config.root, TEMPLATE_DIRECTORY, template);
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)(ctx2.templates, file);
82
- if (!import_fs_extra.default.existsSync(current)) {
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
- ["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 */)
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
- 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 */])) {
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
- ctx2.options.css = await import_fs_extra.default.readFile(paths["main.css" /* CSS */], "utf-8");
127
+ ctx.options.css = await this.fs.read(paths[TemplateFiles.CSS]);
101
128
  }
102
- if (import_fs_extra.default.existsSync(paths["header.html" /* HEADER */])) {
129
+ if (this.fs.exists(paths[TemplateFiles.HEADER])) {
103
130
  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");
131
+ ctx.options.pdf_options.headerTemplate = await this.fs.read(paths[TemplateFiles.HEADER]);
105
132
  }
106
- if (import_fs_extra.default.existsSync(paths["footer.html" /* FOOTER */])) {
133
+ if (this.fs.exists(paths[TemplateFiles.FOOTER])) {
107
134
  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");
135
+ ctx.options.pdf_options.footerTemplate = await this.fs.read(paths[TemplateFiles.FOOTER]);
109
136
  }
110
- if (import_fs_extra.default.existsSync(paths["template.html.j2" /* TEMPLATE */])) {
137
+ if (this.fs.exists(paths[TemplateFiles.TEMPLATE])) {
111
138
  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);
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 (ctx2) => {
120
- if (flags2.dev) {
121
- ctx2.options.devtools = true;
146
+ task: async (ctx) => {
147
+ if (this.flags.dev) {
148
+ ctx.options.devtools = true;
122
149
  }
123
- return this.runMd2Pdf(ctx2);
150
+ return this.runMd2Pdf(ctx);
124
151
  }
125
152
  }
126
153
  ]);
127
- const ctx = await tasks.run();
128
- if (flags2.watch) {
154
+ }
155
+ async shouldRunAfter(ctx) {
156
+ if (this.flags.watch) {
129
157
  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();
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)({ content: this.nunjucks.renderString(ctx.template, { ...ctx.graymatter?.data ?? {}, content: ctx.content }) }, ctx.options);
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)({ content: ctx.content }, ctx.options);
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 import_fs_extra.default.mkdirp((0, import_path.dirname)(output));
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 import_fs_extra.default.writeFile(output, pdf.content);
194
+ await this.fs.write(output, pdf.content);
156
195
  }
157
196
  }
158
197
  };
159
- var MDPrinter = _MDPrinter;
160
- MDPrinter.description = "Generates a PDF from the given markdown file with the selected HTML template.";
161
- MDPrinter.flags = {
162
- template: import_command.flags.string({
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: import_command.flags.string({
206
+ title: import_oclif_common.Flags.string({
168
207
  char: "T",
169
208
  description: "Overwrite document title."
170
209
  }),
171
- watch: import_command.flags.boolean({
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: import_command.flags.boolean({
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.args = [
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 = [".md"];
27
- var OUTPUT_FILE_ACCEPTED_TYPES = [".pdf"];
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,
@@ -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 = /* @__PURE__ */ ((TemplateFiles2) => {
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
- return TemplateFiles2;
38
- })(TemplateFiles || {});
39
- var RequiredTemplateFiles = ["settings.json" /* SETTINGS */];
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 = [".md"];
44
- var OUTPUT_FILE_ACCEPTED_TYPES = [".pdf"];
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 = /* @__PURE__ */ ((TemplateFiles2) => {
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
- return TemplateFiles2;
34
- })(TemplateFiles || {});
35
- var RequiredTemplateFiles = ["settings.json" /* SETTINGS */];
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 import_boilerplate_oclif = require("@cenk1cenk2/boilerplate-oclif");
26
- var not_found_hook_default = import_boilerplate_oclif.notFoundHook;
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/prerun.hook.ts
20
- var prerun_hook_exports = {};
21
- __export(prerun_hook_exports, {
22
- default: () => prerun_hook_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(prerun_hook_exports);
25
- var import_boilerplate_oclif = require("@cenk1cenk2/boilerplate-oclif");
26
- var prerun_hook_default = import_boilerplate_oclif.prerunHook;
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.0",
3
+ "version": "2.2.2",
4
4
  "description": "A markdown printer.",
5
5
  "main": "dist/index.js",
6
- "repository": "git@gitlab.kilic.dev:utils/md-printer.git",
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
- "start": "./bin/run.js",
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
- "lint": "prettier --write src/ --loglevel warn && eslint --ext .json,.ts,.js --fix src/",
20
- "lint:check": "eslint --ext .json,.ts,.js src/",
21
- "lint:staged": "lint-staged",
22
- "readme": "yarn oclif-dev readme",
23
- "oclif": "oclif",
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
- "bin/",
43
- "config/",
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": "./dist/hooks/init.hook",
55
- "command_not_found": "./dist/hooks/not-found.hook",
56
- "prerun": "./dist/hooks/prerun.hook"
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/boilerplate-oclif": "^1.10.6",
68
- "@oclif/command": "^1.8.16",
69
- "@oclif/config": "^1.18.3",
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
- "config": "^3.3.7",
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": "^4.0.5",
83
+ "listr2": "^5.0.5",
80
84
  "md-to-pdf": "^5.1.0",
81
85
  "nunjucks": "^3.2.3",
82
- "tsup": "^6.1.2",
83
- "yaml": "^2.1.1"
86
+ "tsup": "^6.3.0",
87
+ "yaml": "^2.1.3"
84
88
  },
85
89
  "devDependencies": {
86
- "@cenk1cenk2/cz-cc": "^1.5.3",
87
- "@cenk1cenk2/eslint-config": "^2.5.16",
88
- "@oclif/dev-cli": "^1.26.10",
89
- "@tailwindcss/forms": "^0.5.2",
90
- "@tailwindcss/typography": "^0.5.2",
91
- "@types/config": "^0.0.41",
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.0.0",
97
+ "@types/node": "^18.11.9",
94
98
  "@types/nunjucks": "^3.2.1",
95
- "eslint": "^8.18.0",
99
+ "eslint": "^8.26.0",
96
100
  "lint-staged": "^13.0.3",
97
- "postcss": "^8.4.14",
101
+ "oclif": "^3",
102
+ "postcss": "^8.4.18",
98
103
  "prettier": "^2.7.1",
99
- "simple-git-hooks": "^2.8.0",
104
+ "simple-git-hooks": "^2.8.1",
100
105
  "source-map-support": "^0.5.21",
101
- "tailwindcss": "^3.1.4",
106
+ "tailwindcss": "^3.2.1",
102
107
  "theme-colors": "^0.0.5",
103
- "typescript": "^4.7.4"
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.4 | MIT License | https://tailwindcss.com
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: var(--tw-prose-links);
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
- padding-top: 0.5714286em;
1003
- padding-right: 0.5714286em;
1004
- padding-bottom: 0.5714286em;
1005
- padding-left: 0.5714286em;
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 > :where(ul > li p):not(:where([class~="not-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 > :where(ul > li > *:first-child):not(:where([class~="not-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 > :where(ul > li > *:last-child):not(:where([class~="not-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 > :where(ol > li > *:first-child):not(:where([class~="not-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 > :where(ol > li > *:last-child):not(:where([class~="not-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:first-child):not(:where([class~="not-prose"] *)) {
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 > :where(:first-child):not(:where([class~="not-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 > :where(:last-child):not(:where([class~="not-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="p-0 m-0 font-bold">Rechnungsnummer</p>
14
- <p class="p-0 m-0 font-bold">{{ id }}</p>
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="p-0 my-2 font-semibold">{{ sender.name }}</p>
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="p-0 m-0 mb-2">{{ sender.phone }}</p>
27
+ <p class="m-0 my-2">{{ sender.phone }}</p>
25
28
  {% endif %}
26
- <p class="p-0 m-0">{{ sender.address }}</p>
27
- <p class="p-0 m-0">{{ sender.postcode }}</p>
28
- <p class="p-0 m-0">{{ sender.location }}</p>
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="p-0 my-2 font-semibold">{{ receiver.name }}</p>
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="p-0 m-0 mb-2">{{ receiver.phone }}</p>
46
+ <p class="m-0 my-2">{{ receiver.phone }}</p>
39
47
  {% endif %}
40
- <p class="p-0 m-0">{{ receiver.address }}</p>
41
- <p class="p-0 m-0">{{ receiver.postcode }}</p>
42
- <p class="p-0 m-0">{{ receiver.location }}</p>
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
- <h4>Dies ist eine Privatrechnung über eine nicht gewerbliche Tätigkeit. Umsatzsteuer wird daher nicht in Rechnung gestellt.</h4>
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
- <div class="flex flex-row items-center text-center">
121
- <div class="w-full">
122
- <p class="p-0 m-0">{{ location }}</p>
123
- <p class="p-0 m-0">{{ date }}</p>
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
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- require('@cenk1cenk2/boilerplate-oclif/bin/run')
4
-
5
- require('@oclif/command').run().catch(require('@oclif/errors/handle'))
@@ -1,2 +0,0 @@
1
- loglevel: LOG_LEVEL
2
- logcolor: LOG_COLOR
package/config/debug.yml DELETED
@@ -1 +0,0 @@
1
- loglevel: debug
@@ -1,6 +0,0 @@
1
- loglevel: module
2
- logcolor: true
3
- logcolorAll: true
4
- configDir: '.config/md-printer'
5
- localConfig: '.md-printer.local.yml'
6
- lock: '.md-printer.lock'
package/config/silent.yml DELETED
@@ -1 +0,0 @@
1
- loglevel: silent
@@ -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
- });