@dkothule/md2pdf 1.0.4 → 1.0.5
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 +11 -4
- package/install-system-deps.sh +56 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -54,18 +54,22 @@ npm i -g @dkothule/md2pdf
|
|
|
54
54
|
2) Install runtime dependencies (system packages + `pandocfilters`):
|
|
55
55
|
|
|
56
56
|
```bash
|
|
57
|
-
md2pdf-install-system-deps
|
|
57
|
+
md2pdf-install-system-deps --yes
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
If you prefer an interactive confirmation prompt, run:
|
|
61
61
|
|
|
62
62
|
```bash
|
|
63
|
-
md2pdf-install-system-deps
|
|
63
|
+
md2pdf-install-system-deps
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
-
3) Verify:
|
|
66
|
+
3) Verify runtime tools + CLI:
|
|
67
67
|
|
|
68
68
|
```bash
|
|
69
|
+
pandoc --version | head -n 1
|
|
70
|
+
xelatex --version | head -n 1
|
|
71
|
+
rsvg-convert --version
|
|
72
|
+
python3 -c "import pandocfilters; print('pandocfilters ok')"
|
|
69
73
|
md2pdf --version
|
|
70
74
|
md2pdf --help
|
|
71
75
|
```
|
|
@@ -218,6 +222,9 @@ md2pdf ./tests/samples/mermaid-all-diagram-types.md --keep-mermaid-assets
|
|
|
218
222
|
- Flowchart/graph labels missing in PDF: keep `MERMAID_AUTO_PDF_FALLBACK=true`.
|
|
219
223
|
- Diagram taking a full page: keep `MERMAID_PDF_FIT=true`.
|
|
220
224
|
- PDF engine missing: install `xelatex` or set `PDF_ENGINE`.
|
|
225
|
+
- On macOS, if `xelatex` is still missing after `md2pdf-install-system-deps`:
|
|
226
|
+
- Add TeX to PATH: `echo 'export PATH="/Library/TeX/texbin:$PATH"' >> ~/.zshrc && source ~/.zshrc`
|
|
227
|
+
- If binary is still missing: `sudo /Library/TeX/texbin/tlmgr install collection-xetex`
|
|
221
228
|
|
|
222
229
|
## Keywords
|
|
223
230
|
|
package/install-system-deps.sh
CHANGED
|
@@ -98,6 +98,61 @@ install_python_dependency() {
|
|
|
98
98
|
exit 1
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
+
ensure_tex_path_macos() {
|
|
102
|
+
local tex_bin="/Library/TeX/texbin"
|
|
103
|
+
if [[ ! -d "$tex_bin" ]]; then
|
|
104
|
+
return
|
|
105
|
+
fi
|
|
106
|
+
|
|
107
|
+
case ":$PATH:" in
|
|
108
|
+
*":$tex_bin:"*)
|
|
109
|
+
;;
|
|
110
|
+
*)
|
|
111
|
+
export PATH="$tex_bin:$PATH"
|
|
112
|
+
;;
|
|
113
|
+
esac
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
ensure_xelatex_macos() {
|
|
117
|
+
ensure_tex_path_macos
|
|
118
|
+
if command -v xelatex >/dev/null 2>&1; then
|
|
119
|
+
return
|
|
120
|
+
fi
|
|
121
|
+
|
|
122
|
+
echo "Installing BasicTeX for xelatex..."
|
|
123
|
+
brew install --cask basictex
|
|
124
|
+
ensure_tex_path_macos
|
|
125
|
+
|
|
126
|
+
if command -v xelatex >/dev/null 2>&1; then
|
|
127
|
+
return
|
|
128
|
+
fi
|
|
129
|
+
|
|
130
|
+
local tlmgr_bin="/Library/TeX/texbin/tlmgr"
|
|
131
|
+
if [[ -x "$tlmgr_bin" ]]; then
|
|
132
|
+
if [[ -t 0 ]]; then
|
|
133
|
+
echo "BasicTeX installed but xelatex is still missing. Installing TeX collection-xetex..."
|
|
134
|
+
sudo "$tlmgr_bin" install collection-xetex || true
|
|
135
|
+
ensure_tex_path_macos
|
|
136
|
+
else
|
|
137
|
+
echo "BasicTeX installed but xelatex is still missing."
|
|
138
|
+
echo "Run this command to install it:"
|
|
139
|
+
echo " sudo $tlmgr_bin install collection-xetex"
|
|
140
|
+
fi
|
|
141
|
+
fi
|
|
142
|
+
|
|
143
|
+
if command -v xelatex >/dev/null 2>&1; then
|
|
144
|
+
return
|
|
145
|
+
fi
|
|
146
|
+
|
|
147
|
+
echo "Error: xelatex is still not available." >&2
|
|
148
|
+
echo "If /Library/TeX/texbin/xelatex exists, add TeX to PATH and restart your shell:" >&2
|
|
149
|
+
echo " echo 'export PATH=\"/Library/TeX/texbin:\$PATH\"' >> ~/.zshrc" >&2
|
|
150
|
+
echo " source ~/.zshrc" >&2
|
|
151
|
+
echo "If xelatex binary is missing, install it with:" >&2
|
|
152
|
+
echo " sudo /Library/TeX/texbin/tlmgr install collection-xetex" >&2
|
|
153
|
+
exit 1
|
|
154
|
+
}
|
|
155
|
+
|
|
101
156
|
install_macos() {
|
|
102
157
|
if ! command -v brew >/dev/null 2>&1; then
|
|
103
158
|
echo "Homebrew is required on macOS. Install from https://brew.sh and retry."
|
|
@@ -111,11 +166,7 @@ install_macos() {
|
|
|
111
166
|
brew install node
|
|
112
167
|
fi
|
|
113
168
|
|
|
114
|
-
|
|
115
|
-
echo "Installing BasicTeX for xelatex..."
|
|
116
|
-
brew install --cask basictex
|
|
117
|
-
echo "BasicTeX installed. You may need to restart your shell before retrying."
|
|
118
|
-
fi
|
|
169
|
+
ensure_xelatex_macos
|
|
119
170
|
}
|
|
120
171
|
|
|
121
172
|
install_debian_ubuntu() {
|