@kobekeye/mdf 1.1.0 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
name: Publish to npm
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [created]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
publish:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
id-token: write
|
|
14
|
+
|
|
15
|
+
steps:
|
|
16
|
+
- name: Checkout repository
|
|
17
|
+
uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Setup Node.js
|
|
20
|
+
uses: actions/setup-node@v4
|
|
21
|
+
with:
|
|
22
|
+
node-version: '20.x'
|
|
23
|
+
registry-url: 'https://registry.npmjs.org'
|
|
24
|
+
|
|
25
|
+
- name: Install dependencies
|
|
26
|
+
run: npm ci
|
|
27
|
+
|
|
28
|
+
- name: Publish package
|
|
29
|
+
run: npm publish --provenance --access public
|
package/README.md
CHANGED
|
@@ -18,6 +18,7 @@ Welcome to mdf! Please note that this project is currently in the MVP (Minimum V
|
|
|
18
18
|
|
|
19
19
|
## Installation
|
|
20
20
|
### Windows
|
|
21
|
+
If one hasn't install nodejs, click [here](https://nodejs.org) to install. After installing nodejs, type
|
|
21
22
|
```bash
|
|
22
23
|
npm install -g @kobekeye/mdf
|
|
23
24
|
```
|
|
@@ -40,12 +41,23 @@ npm install -g @kobekeye/mdf
|
|
|
40
41
|
mdf input.md # outputs input.pdf
|
|
41
42
|
mdf input.md output.pdf # custom output name
|
|
42
43
|
```
|
|
44
|
+
To watch the output pdf file, use
|
|
45
|
+
```bash
|
|
46
|
+
mdf input.md -w # outputs input.pdf and watches for changes
|
|
47
|
+
mdf input.md output.pdf -w # custom output name and watches for changes
|
|
48
|
+
```
|
|
43
49
|
Or, if you want to try without installation,
|
|
44
50
|
```bash
|
|
45
|
-
npx @kobekeye/mdf input.md
|
|
46
|
-
npx @kobekeye/mdf input.md output.pdf
|
|
51
|
+
npx @kobekeye/mdf input.md # outputs input.pdf
|
|
52
|
+
npx @kobekeye/mdf input.md output.pdf # custom output name
|
|
53
|
+
npx @kobekeye/mdf input.md -w # outputs input.pdf and watches for changes
|
|
54
|
+
npx @kobekeye/mdf input.md output.pdf -w # custom output name and watches for changes
|
|
47
55
|
```
|
|
48
|
-
|
|
56
|
+
## Update
|
|
57
|
+
```bash
|
|
58
|
+
npm update -g @kobekeye/mdf
|
|
59
|
+
```
|
|
60
|
+
If you only use `npx` to run mdf, you don't need to update.
|
|
49
61
|
## Syntax Guide
|
|
50
62
|
|
|
51
63
|
### Table of Contents
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kobekeye/mdf",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "Convert Markdown to beautiful PDFs — free, open-source, and zero-config.",
|
|
5
|
-
"main": "
|
|
5
|
+
"main": "src/cli.js",
|
|
6
6
|
"bin": {
|
|
7
|
-
"mdf": "
|
|
7
|
+
"mdf": "src/cli.js"
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
10
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
@@ -149,9 +149,10 @@ function processTOC(html) {
|
|
|
149
149
|
return html.replace(TOC_MARKER, toc);
|
|
150
150
|
}
|
|
151
151
|
// CSS file paths
|
|
152
|
-
const
|
|
153
|
-
const
|
|
154
|
-
const
|
|
152
|
+
const root = path.join(__dirname, '..');
|
|
153
|
+
const themePath = path.join(root, 'themes', 'default.css');
|
|
154
|
+
const hljsCssPath = path.join(root, 'node_modules', 'highlight.js', 'styles', 'github-dark.css');
|
|
155
|
+
const texmathCssPath = path.join(root, 'node_modules', 'markdown-it-texmath', 'css', 'texmath.css');
|
|
155
156
|
// KaTeX CSS is referenced as a local file:// URL so its bundled fonts resolve correctly
|
|
156
157
|
const katexCssUrl = `file://${path.join(__dirname, 'node_modules', 'katex', 'dist', 'katex.min.css')}`;
|
|
157
158
|
// CSS cache: read once, avoid I/O on every render
|
/package/{index.js → src/cli.js}
RENAMED
|
File without changes
|