md-pdf-studio 1.1.0 β†’ 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Van Nguyen
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,208 +1,214 @@
1
- # πŸ“„ convert-md-to-pdf
2
-
3
- > A powerful CLI tool and **Browser Extension (Manifest V3)** to convert Markdown (`.md`) files, raw text, or web pages into beautifully styled, high-quality PDF & static HTML documents. Built with support for **Cover Pages**, **Dotted Leader Line Table of Contents (TOC)**, **Mermaid.js diagrams**, **LaTeX Math**, **GitHub Callout Alerts**, **Custom CSS Injection**, **7 Preset Themes**, and **Open-Source Font Selection**.
4
-
5
- [![Chrome Web Store](https://img.shields.io/badge/Chrome_Web_Store-Install_Extension-4285F4?logo=googlechrome&logoColor=white)](https://chromewebstore.google.com/detail/markdown-to-pdf-converter/djikikejkmkklfeklfmddaadilhahamj)
6
- [![Chrome Web Store users](https://img.shields.io/chrome-web-store/users/djikikejkmkklfeklfmddaadilhahamj?label=Chrome%20users)](https://chromewebstore.google.com/detail/markdown-to-pdf-converter/djikikejkmkklfeklfmddaadilhahamj)
7
- [![npm version](https://img.shields.io/npm/v/md-pdf-studio?color=blue)](https://www.npmjs.com/package/md-pdf-studio)
8
- [![npm downloads](https://img.shields.io/npm/d18m/md-pdf-studio)](https://www.npmjs.com/package/md-pdf-studio)
9
- ![Browser Extension](https://img.shields.io/badge/Extension-Manifest_V3-green)
10
- ![License](https://img.shields.io/badge/license-MIT-green)
11
-
12
- ---
13
-
14
- ## ✨ Features
15
-
16
- - 🧩 **Browser Extension (Manifest V3)**:
17
- - Drag & drop single or **multiple `.md` files** directly into the popup.
18
- - Auto-saved draft text in popup & conversion history list with 1-click re-open.
19
- - Convert active web page or GitHub raw Markdown files with 1 click.
20
- - Context menu integration: Right-click selected Markdown text or any page -> "Convert to PDF".
21
- - Full-page Print Preview with live theme switching, Font Selector, Auto TOC, Custom CSS, and native PDF/HTML export.
22
- - πŸ“‘ **Auto Cover Page Generator**: Generate elegant document report cover pages via YAML Front Matter (`cover: true`) or `--cover` flag.
23
- - πŸ“Œ **Dotted Leader Line Table of Contents (TOC)**: Auto-generates publication-grade TOC with dotted leader lines (`...`) and clickable anchor links (`--toc`).
24
- - 🎨 **7 Preset Themes**: `modern` (default), `dark`, `academic`, `github`, `ebook`, `cyberpunk`, and `minimal`.
25
- - πŸ”€ **Open-Source Font Selector**: 100% free under SIL OFL / Apache 2.0 (`Inter`, `Roboto`, `Lora`, `Merriweather`, `JetBrains Mono`, `Fira Code`).
26
- - ⚑ **Live Watch Mode & HTML Export**: Real-time auto-recompilation on file changes (`-w, --watch`) and direct static HTML export (`-f, --format html`).
27
- - πŸš€ **CLI & Batch Conversion**: Convert single files or batch process directories with wildcard patterns.
28
- - 🎨 **Custom CSS Injection**: Inject custom branding CSS stylesheets (`-c, --css custom.css`).
29
- - πŸ“Š **Mermaid Diagrams**: Sequence diagrams (with auto note wrapping), flowcharts, class diagrams, and gantt charts.
30
- - πŸ“ **LaTeX Math Support**: Mathematical equations rendered with KaTeX.
31
- - πŸ’‘ **GitHub Callout Box Alerts**: Support for `> [!NOTE]`, `> [!TIP]`, `> [!WARNING]`, `> [!IMPORTANT]`, and `> [!CAUTION]`.
32
- - πŸ’» **ASCII UI Mockups**: Styled dark-theme boxes for terminal output & ASCII wireframe mockups.
33
-
34
- ---
35
-
36
- ## 🌐 Extension Installation & Usage
37
-
38
- ### πŸ›’ Direct Install from Chrome Web Store (Recommended)
39
- You can install the official published extension directly with 1-click:
40
- πŸ‘‰ **[Install Markdown to PDF Converter on Chrome Web Store](https://chromewebstore.google.com/detail/markdown-to-pdf-converter/djikikejkmkklfeklfmddaadilhahamj)**
41
-
42
- ### πŸ› οΈ Developer Unpacked Installation (Local Build):
43
- 1. Clone or download this repository:
44
- ```bash
45
- git clone https://github.com/vannt-dev/convert-md-to-pdf.git
46
- ```
47
- 2. Open your browser and navigate to `chrome://extensions` (or `edge://extensions`).
48
- 3. Enable **Developer mode** (toggle in the top-right corner).
49
- 4. Click **Load unpacked** (TαΊ£i tiện Γ­ch Δ‘Γ£ giαΊ£i nΓ©n).
50
- 5. Select the **`extension`** directory inside this repository (or load `dist/extension-latest.zip`).
51
- 6. The **Markdown to PDF Converter** icon will appear in your browser toolbar!
52
-
53
- ---
54
-
55
- ## πŸ’» CLI Installation & Usage
56
-
57
- ### Global Installation via npm / npx
58
- The CLI is published on npm as [`md-pdf-studio`](https://www.npmjs.com/package/md-pdf-studio):
59
- ```bash
60
- npm install -g md-pdf-studio
61
- ```
62
- or run directly with `npx`:
63
- ```bash
64
- npx md-pdf-studio input.md
65
- ```
66
- A global install provides the `md-pdf-studio` command and the `md2pdf` and `convert-md-to-pdf` aliases.
67
- PDF output uses a locally installed Google Chrome, Microsoft Edge or Chromium.
68
-
69
- > The npm package named `convert-md-to-pdf` is an unrelated project; install `md-pdf-studio` for this tool.
70
-
71
- ### CLI Examples:
72
- ```bash
73
- # Convert a Markdown file with Cover Page, Auto TOC & Cyberpunk Theme
74
- npx md-pdf-studio input.md --cover --toc -t cyberpunk --font "Fira Code" -o output.pdf
75
-
76
- # Watch file and auto-recompile on save
77
- npx md-pdf-studio input.md -w -f html
78
-
79
- # Batch convert multiple files to an output directory
80
- npx md-pdf-studio file1.md file2.md -o output_dir/
81
-
82
- # Convert entire directory of .md files
83
- npx md-pdf-studio ./docs/ -o ./dist/
84
- ```
85
-
86
- ---
87
-
88
- ## πŸ› οΈ CLI Options
89
-
90
- | Flag | Alias | Description | Default |
91
- | :--- | :--- | :--- | :--- |
92
- | `-o, --output <path>`| | Output PDF/HTML file path or target directory | Auto-derived |
93
- | `-f, --format <format>`| | Output format: `pdf`, `html` | `pdf` |
94
- | `-w, --watch` | | Live watch input file and auto-recompile on change | `false` |
95
- | `-t, --theme <theme>` | | Theme: `modern`, `dark`, `academic`, `github`, `ebook`, `cyberpunk`, `minimal` | `modern` |
96
- | `--font <font>` | | Font family: `Inter`, `Roboto`, `Lora`, `Merriweather`, `JetBrains Mono`, `Fira Code` | `Inter` |
97
- | `--cover` | | Auto-generate document report Cover Page | `false` |
98
- | `--toc` | | Auto-generate Table of Contents with Dotted Leader Lines | `false` |
99
- | `-p, --page-size <size>`| | Paper size: `A4`, `Letter`, `A3`, `Legal` | `A4` |
100
- | `-l, --landscape` | | Use landscape page orientation | `false` |
101
- | `-m, --margin <margin>`| | Custom page margin (e.g. `14mm 12mm 16mm 12mm`) | `14mm 12mm 16mm 12mm` |
102
- | `-c, --css <path>` | | Custom CSS stylesheet file path to inject | |
103
- | `-k, --keep-html` | | Keep temporary HTML file after conversion | `false` |
104
- | `--no-mermaid` | | Disable Mermaid diagram rendering | `false` |
105
- | `--no-katex` | | Disable KaTeX math formula rendering | `false` |
106
-
107
- ---
108
-
109
- ## πŸ“„ Front Matter Options
110
-
111
- You can specify conversion settings directly inside your `.md` files using YAML Front Matter:
112
-
113
- ```yaml
114
- ---
115
- title: "Quarterly Financial Report"
116
- subtitle: "Q3 Fiscal Summary"
117
- author: "Engineering Team"
118
- date: "2026-08-11"
119
- cover: true
120
- toc: true
121
- theme: github
122
- font: Inter
123
- pageSize: A4
124
- landscape: false
125
- ---
126
- # Document Executive Summary
127
- ...
128
- ```
129
-
130
- ---
131
-
132
- ## 🌿 Git Flow & Automated Release Workflow
133
-
134
- This project follows standard **Git Flow** branching and automated release publishing:
135
-
136
- ### πŸ”€ Branching Strategy
137
- - **`main`**: Production-ready branch. Stores stable releases. Merging code into `main` automatically triggers a GitHub Release.
138
- - **`develop`**: Active development branch. Daily commits, feature additions, and refactoring take place here.
139
-
140
- ### πŸš€ Automated Release Pipeline
141
- Whenever code is merged from `develop` into `main` (or a version tag `v*` is pushed), GitHub Actions ([`.github/workflows/release.yml`](.github/workflows/release.yml)) automatically:
142
- 1. Runs full unit test suite (`npm test`).
143
- 2. Bundles cross-platform extension zip artifacts (`dist/extension-vX.Y.Z.zip`).
144
- 3. Auto-generates release notes from commit history.
145
- 4. Publishes a new official **[GitHub Release](https://github.com/vannt-dev/convert-md-to-pdf/releases)** with downloadable ZIP binaries attached!
146
-
147
- ### πŸ’‘ 1-Click CLI Release Command
148
- You can also bump version and trigger a release with a single CLI command:
149
- ```bash
150
- npm run release <version|patch|minor|major>
151
- # Example: npm run release 1.2.0
152
- ```
153
-
154
- Please review our [Git Commit & Push Workflow Guide (GIT_WORKFLOW.md)](GIT_WORKFLOW.md) for conventional commit guidelines and pre-commit checks.
155
-
156
- ---
157
-
158
- ## πŸ“ Project Architecture
159
-
160
- ```
161
- convert-md-to-pdf/
162
- β”œβ”€β”€ bin/
163
- β”‚ └── cli.js # CLI executable with watch & format options
164
- β”œβ”€β”€ src/
165
- β”‚ β”œβ”€β”€ core/ # Shared modular conversion engine
166
- β”‚ β”‚ β”œβ”€β”€ themes/ # Modular Theme CSS collection
167
- β”‚ β”‚ β”‚ β”œβ”€β”€ index.js # Theme registry & font override builder
168
- β”‚ β”‚ β”‚ β”œβ”€β”€ cover.js # Cover page CSS
169
- β”‚ β”‚ β”‚ β”œβ”€β”€ modern.js # Modern blue theme
170
- β”‚ β”‚ β”‚ β”œβ”€β”€ dark.js # Dark slate theme
171
- β”‚ β”‚ β”‚ β”œβ”€β”€ academic.js # Academic serif theme
172
- β”‚ β”‚ β”‚ β”œβ”€β”€ github.js # GitHub light theme
173
- β”‚ β”‚ β”‚ β”œβ”€β”€ ebook.js # E-Book paper theme
174
- β”‚ β”‚ β”‚ β”œβ”€β”€ cyberpunk.js # Cyberpunk neon dark theme
175
- β”‚ β”‚ β”‚ └── minimal.js # Minimal monochrome theme
176
- β”‚ β”‚ β”œβ”€β”€ frontmatter.js # YAML front matter parser
177
- β”‚ β”‚ β”œβ”€β”€ cover.js # Cover page generator
178
- β”‚ β”‚ β”œβ”€β”€ toc.js # Dotted leader line TOC generator
179
- β”‚ β”‚ β”œβ”€β”€ sanitizer.js # HTML sanitizer & escaping
180
- β”‚ β”‚ β”œβ”€β”€ utils.js # Preprocessors & helper re-exports
181
- β”‚ β”‚ β”œβ”€β”€ parser.js # Pipeline parser (Markdown -> HTML)
182
- β”‚ β”‚ β”œβ”€β”€ templates.js # HTML document template builder
183
- β”‚ β”‚ └── index.js # Main library API entrypoint
184
- β”‚ └── browser/ # Headless browser rendering engine
185
- β”‚ └── renderer.js # Puppeteer Chrome/Edge launcher & PDF worker pool
186
- β”œβ”€β”€ extension/ # Browser Extension (Manifest V3)
187
- β”‚ β”œβ”€β”€ manifest.json
188
- β”‚ β”œβ”€β”€ background/ # Service worker & context menus
189
- β”‚ β”œβ”€β”€ content/ # Content script for raw MD pages
190
- β”‚ β”œβ”€β”€ popup/ # Extension Popup UI (Batch file, Paste, Page, History)
191
- β”‚ β”œβ”€β”€ preview/ # Print Preview & PDF/HTML export page
192
- β”‚ β”œβ”€β”€ lib/ # Vendor libraries (marked, mermaid, katex)
193
- β”‚ └── icons/ # Extension icons (16, 48, 128)
194
- β”œβ”€β”€ tests/ # Standalone test suite (7/7 PASS)
195
- β”‚ └── index.test.js
196
- β”œβ”€β”€ dist/ # Built Chrome Extension zip artifacts
197
- β”œβ”€β”€ examples/ # Usage examples & custom CSS templates
198
- β”œβ”€β”€ package.json
199
- β”œβ”€β”€ README.md
200
- β”œβ”€β”€ PRIVACY_POLICY.md
201
- └── GIT_WORKFLOW.md
202
- ```
203
-
204
- ---
205
-
206
- ## πŸ“ License
207
-
208
- Distributed under the MIT License. See [LICENSE](LICENSE) for details.
1
+ # πŸ“„ convert-md-to-pdf
2
+
3
+ > A powerful CLI tool and **Browser Extension (Manifest V3)** to convert Markdown (`.md`) files, raw text, or web pages into beautifully styled, high-quality PDF & static HTML documents. Built with support for **Cover Pages**, **Dotted Leader Line Table of Contents (TOC)**, **Mermaid.js diagrams**, **LaTeX Math**, **GitHub Callout Alerts**, **Custom CSS Injection**, **7 Preset Themes**, and **Open-Source Font Selection**.
4
+
5
+ [![Chrome Web Store](https://img.shields.io/badge/Chrome_Web_Store-Install_Extension-4285F4?logo=googlechrome&logoColor=white)](https://chromewebstore.google.com/detail/markdown-to-pdf-converter/djikikejkmkklfeklfmddaadilhahamj)
6
+ [![Chrome Web Store users](https://img.shields.io/chrome-web-store/users/djikikejkmkklfeklfmddaadilhahamj?label=Chrome%20users)](https://chromewebstore.google.com/detail/markdown-to-pdf-converter/djikikejkmkklfeklfmddaadilhahamj)
7
+ [![npm version](https://img.shields.io/npm/v/md-pdf-studio?color=blue)](https://www.npmjs.com/package/md-pdf-studio)
8
+ [![npm downloads](https://img.shields.io/npm/d18m/md-pdf-studio)](https://www.npmjs.com/package/md-pdf-studio)
9
+ ![Browser Extension](https://img.shields.io/badge/Extension-Manifest_V3-green)
10
+ ![License](https://img.shields.io/badge/license-MIT-green)
11
+
12
+ ---
13
+
14
+ ## ✨ Features
15
+
16
+ - 🧩 **Browser Extension (Manifest V3)**:
17
+ - Drag & drop single or **multiple `.md` files** directly into the popup.
18
+ - Auto-saved draft text in popup & conversion history list with 1-click re-open.
19
+ - Convert active web page or GitHub raw Markdown files with 1 click.
20
+ - Context menu integration: Right-click selected Markdown text or any page -> "Convert to PDF".
21
+ - Full-page Print Preview with live theme switching, Font Selector, Auto TOC, Custom CSS, and native PDF/HTML export.
22
+ - πŸ“‘ **Auto Cover Page Generator**: Generate elegant document report cover pages via YAML Front Matter (`cover: true`) or `--cover` flag.
23
+ - πŸ“Œ **Dotted Leader Line Table of Contents (TOC)**: Auto-generates publication-grade TOC with dotted leader lines (`...`) and clickable anchor links (`--toc`).
24
+ - 🎨 **7 Preset Themes**: `modern` (default), `dark`, `academic`, `github`, `ebook`, `cyberpunk`, and `minimal`.
25
+ - πŸ”€ **Open-Source Font Selector**: 100% free under SIL OFL / Apache 2.0 (`Inter`, `Roboto`, `Lora`, `Merriweather`, `JetBrains Mono`, `Fira Code`).
26
+ - ⚑ **Live Watch Mode & HTML Export**: Real-time auto-recompilation on file changes (`-w, --watch`) and direct static HTML export (`-f, --format html`).
27
+ - πŸš€ **CLI & Batch Conversion**: Convert single files or batch process directories with wildcard patterns.
28
+ - 🎨 **Custom CSS Injection**: Inject custom branding CSS stylesheets (`-c, --css custom.css`).
29
+ - πŸ“Š **Mermaid Diagrams**: Sequence diagrams (with auto note wrapping), flowcharts, class diagrams, and gantt charts.
30
+ - 🌈 **Syntax Highlighting**: Fenced code blocks that name a language (` ```js `, ` ```python `, ` ```diff `, …) are coloured at build time with highlight.js β€” no CDN, so it also works offline and in static HTML export. Colours follow the theme's code block background. Works in the CLI and in the extension preview.
31
+ - πŸ“ **LaTeX Math Support**: Mathematical equations rendered with KaTeX.
32
+ - πŸ’‘ **GitHub Callout Box Alerts**: Support for `> [!NOTE]`, `> [!TIP]`, `> [!WARNING]`, `> [!IMPORTANT]`, and `> [!CAUTION]`.
33
+ - πŸ’» **ASCII UI Mockups**: Styled dark-theme boxes for terminal output & ASCII wireframe mockups.
34
+
35
+ ---
36
+
37
+ ## 🌐 Extension Installation & Usage
38
+
39
+ ### πŸ›’ Direct Install from Chrome Web Store (Recommended)
40
+ You can install the official published extension directly with 1-click:
41
+ πŸ‘‰ **[Install Markdown to PDF Converter on Chrome Web Store](https://chromewebstore.google.com/detail/markdown-to-pdf-converter/djikikejkmkklfeklfmddaadilhahamj)**
42
+
43
+ ### πŸ› οΈ Developer Unpacked Installation (Local Build):
44
+ 1. Clone or download this repository:
45
+ ```bash
46
+ git clone https://github.com/vannt-dev/convert-md-to-pdf.git
47
+ ```
48
+ 2. Open your browser and navigate to `chrome://extensions` (or `edge://extensions`).
49
+ 3. Enable **Developer mode** (toggle in the top-right corner).
50
+ 4. Click **Load unpacked** (TαΊ£i tiện Γ­ch Δ‘Γ£ giαΊ£i nΓ©n).
51
+ 5. Select the **`extension`** directory inside this repository (or load `dist/extension-latest.zip`).
52
+ 6. The **Markdown to PDF Converter** icon will appear in your browser toolbar!
53
+
54
+ ---
55
+
56
+ ## πŸ’» CLI Installation & Usage
57
+
58
+ ### Global Installation via npm / npx
59
+ The CLI is published on npm as [`md-pdf-studio`](https://www.npmjs.com/package/md-pdf-studio):
60
+ ```bash
61
+ npm install -g md-pdf-studio
62
+ ```
63
+ or run directly with `npx`:
64
+ ```bash
65
+ npx md-pdf-studio input.md
66
+ ```
67
+ A global install provides the `md-pdf-studio` command and the `md2pdf` and `convert-md-to-pdf` aliases.
68
+ PDF output uses a locally installed Google Chrome, Microsoft Edge or Chromium.
69
+
70
+ > The npm package named `convert-md-to-pdf` is an unrelated project; install `md-pdf-studio` for this tool.
71
+
72
+ ### CLI Examples:
73
+ ```bash
74
+ # Convert a Markdown file with Cover Page, Auto TOC & Cyberpunk Theme
75
+ npx md-pdf-studio input.md --cover --toc -t cyberpunk --font "Fira Code" -o output.pdf
76
+
77
+ # Watch file and auto-recompile on save
78
+ npx md-pdf-studio input.md -w -f html
79
+
80
+ # Batch convert multiple files to an output directory
81
+ npx md-pdf-studio file1.md file2.md -o output_dir/
82
+
83
+ # Convert entire directory of .md files
84
+ npx md-pdf-studio ./docs/ -o ./dist/
85
+ ```
86
+
87
+ ---
88
+
89
+ ## πŸ› οΈ CLI Options
90
+
91
+ | Flag | Alias | Description | Default |
92
+ | :--- | :--- | :--- | :--- |
93
+ | `-o, --output <path>`| | Output PDF/HTML file path or target directory | Auto-derived |
94
+ | `-f, --format <format>`| | Output format: `pdf`, `html` | `pdf` |
95
+ | `-w, --watch` | | Live watch input file and auto-recompile on change | `false` |
96
+ | `-t, --theme <theme>` | | Theme: `modern`, `dark`, `academic`, `github`, `ebook`, `cyberpunk`, `minimal` | `modern` |
97
+ | `--font <font>` | | Font family: `Inter`, `Roboto`, `Lora`, `Merriweather`, `JetBrains Mono`, `Fira Code` | `Inter` |
98
+ | `--cover` | | Auto-generate document report Cover Page | `false` |
99
+ | `--toc` | | Auto-generate Table of Contents with Dotted Leader Lines | `false` |
100
+ | `-p, --page-size <size>`| | Paper size: `A4`, `Letter`, `A3`, `Legal` | `A4` |
101
+ | `-l, --landscape` | | Use landscape page orientation | `false` |
102
+ | `-m, --margin <margin>`| | Custom page margin (e.g. `14mm 12mm 16mm 12mm`) | `14mm 12mm 16mm 12mm` |
103
+ | `-c, --css <path>` | | Custom CSS stylesheet file path to inject | |
104
+ | `-k, --keep-html` | | Keep temporary HTML file after conversion | `false` |
105
+ | `--no-mermaid` | | Disable Mermaid diagram rendering | `false` |
106
+ | `--no-katex` | | Disable KaTeX math formula rendering | `false` |
107
+ | `--no-highlight` | | Disable syntax highlighting of code blocks | `false` |
108
+
109
+ ---
110
+
111
+ ## πŸ“„ Front Matter Options
112
+
113
+ You can specify conversion settings directly inside your `.md` files using YAML Front Matter:
114
+
115
+ ```yaml
116
+ ---
117
+ title: "Quarterly Financial Report"
118
+ subtitle: "Q3 Fiscal Summary"
119
+ author: "Engineering Team"
120
+ date: "2026-08-11"
121
+ cover: true
122
+ toc: true
123
+ theme: github
124
+ font: Inter
125
+ pageSize: A4
126
+ landscape: false
127
+ highlight: true
128
+ ---
129
+ # Document Executive Summary
130
+ ...
131
+ ```
132
+
133
+ ---
134
+
135
+ ## 🌿 Git Flow & Automated Release Workflow
136
+
137
+ This project follows standard **Git Flow** branching and automated release publishing:
138
+
139
+ ### πŸ”€ Branching Strategy
140
+ - **`main`**: Production-ready branch. Stores stable releases. Pushing a version tag `v*` from `main` triggers a release.
141
+ - **`develop`**: Active development branch. Daily commits, feature additions, and refactoring take place here.
142
+
143
+ ### πŸš€ Automated Release Pipeline
144
+ Whenever a version tag `v*` is pushed, GitHub Actions ([`.github/workflows/release.yml`](.github/workflows/release.yml)) builds from that tag and automatically:
145
+ 1. Checks that the tag matches the version in `package.json` and `extension/manifest.json`, then runs the full unit test suite (`npm test`).
146
+ 2. Bundles cross-platform extension zip artifacts (`dist/extension-vX.Y.Z.zip`).
147
+ 3. Auto-generates release notes from commit history.
148
+ 4. Publishes a new official **[GitHub Release](https://github.com/vannt-dev/convert-md-to-pdf/releases)** with downloadable ZIP binaries attached!
149
+ 5. Publishes [`md-pdf-studio`](https://www.npmjs.com/package/md-pdf-studio) to npm with provenance, through npm trusted publishing (no token secret). A version already on npm is skipped.
150
+
151
+ To release an existing tag again (for example after a failed run), run the workflow manually with `tag_name`.
152
+
153
+ ### πŸ’‘ 1-Click CLI Release Command
154
+ You can also bump version and trigger a release with a single CLI command:
155
+ ```bash
156
+ npm run release <version|patch|minor|major>
157
+ # Example: npm run release 1.2.0
158
+ ```
159
+
160
+ Please review our [Git Commit & Push Workflow Guide (GIT_WORKFLOW.md)](GIT_WORKFLOW.md) for conventional commit guidelines and pre-commit checks.
161
+
162
+ ---
163
+
164
+ ## πŸ“ Project Architecture
165
+
166
+ ```
167
+ convert-md-to-pdf/
168
+ β”œβ”€β”€ bin/
169
+ β”‚ └── cli.js # CLI executable with watch & format options
170
+ β”œβ”€β”€ src/
171
+ β”‚ β”œβ”€β”€ core/ # Shared modular conversion engine
172
+ β”‚ β”‚ β”œβ”€β”€ themes/ # Modular Theme CSS collection
173
+ β”‚ β”‚ β”‚ β”œβ”€β”€ index.js # Theme registry & font override builder
174
+ β”‚ β”‚ β”‚ β”œβ”€β”€ cover.js # Cover page CSS
175
+ β”‚ β”‚ β”‚ β”œβ”€β”€ modern.js # Modern blue theme
176
+ β”‚ β”‚ β”‚ β”œβ”€β”€ dark.js # Dark slate theme
177
+ β”‚ β”‚ β”‚ β”œβ”€β”€ academic.js # Academic serif theme
178
+ β”‚ β”‚ β”‚ β”œβ”€β”€ github.js # GitHub light theme
179
+ β”‚ β”‚ β”‚ β”œβ”€β”€ ebook.js # E-Book paper theme
180
+ β”‚ β”‚ β”‚ β”œβ”€β”€ cyberpunk.js # Cyberpunk neon dark theme
181
+ β”‚ β”‚ β”‚ └── minimal.js # Minimal monochrome theme
182
+ β”‚ β”‚ β”œβ”€β”€ frontmatter.js # YAML front matter parser
183
+ β”‚ β”‚ β”œβ”€β”€ cover.js # Cover page generator
184
+ β”‚ β”‚ β”œβ”€β”€ toc.js # Dotted leader line TOC generator
185
+ β”‚ β”‚ β”œβ”€β”€ sanitizer.js # HTML sanitizer & escaping
186
+ β”‚ β”‚ β”œβ”€β”€ utils.js # Preprocessors & helper re-exports
187
+ β”‚ β”‚ β”œβ”€β”€ parser.js # Pipeline parser (Markdown -> HTML)
188
+ β”‚ β”‚ β”œβ”€β”€ templates.js # HTML document template builder
189
+ β”‚ β”‚ └── index.js # Main library API entrypoint
190
+ β”‚ └── browser/ # Headless browser rendering engine
191
+ β”‚ └── renderer.js # Puppeteer Chrome/Edge launcher & PDF worker pool
192
+ β”œβ”€β”€ extension/ # Browser Extension (Manifest V3)
193
+ β”‚ β”œβ”€β”€ manifest.json
194
+ β”‚ β”œβ”€β”€ background/ # Service worker & context menus
195
+ β”‚ β”œβ”€β”€ content/ # Content script for raw MD pages
196
+ β”‚ β”œβ”€β”€ popup/ # Extension Popup UI (Batch file, Paste, Page, History)
197
+ β”‚ β”œβ”€β”€ preview/ # Print Preview & PDF/HTML export page
198
+ β”‚ β”œβ”€β”€ lib/ # Vendor libraries (marked, mermaid, katex)
199
+ β”‚ └── icons/ # Extension icons (16, 48, 128)
200
+ β”œβ”€β”€ tests/ # Standalone test suite (7/7 PASS)
201
+ β”‚ └── index.test.js
202
+ β”œβ”€β”€ dist/ # Built Chrome Extension zip artifacts
203
+ β”œβ”€β”€ examples/ # Usage examples & custom CSS templates
204
+ β”œβ”€β”€ package.json
205
+ β”œβ”€β”€ README.md
206
+ β”œβ”€β”€ PRIVACY_POLICY.md
207
+ └── GIT_WORKFLOW.md
208
+ ```
209
+
210
+ ---
211
+
212
+ ## πŸ“ License
213
+
214
+ Distributed under the MIT License. See [LICENSE](LICENSE) for details.