@liustack/markpress 0.3.0 → 0.3.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/dist/main.js +5 -3
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -569,7 +569,7 @@ const defaultStyles = {
|
|
|
569
569
|
// Links — WeChat blue
|
|
570
570
|
a: "color: #576b95; text-decoration: none;",
|
|
571
571
|
// Images
|
|
572
|
-
img: "max-width: 100%; height: auto; display: block; margin: 1.5em
|
|
572
|
+
img: "max-width: 100%; height: auto; display: block; margin: 0 auto 1.5em; border-radius: 10px;",
|
|
573
573
|
// Tables — minimalist: collapse borders, thin lines
|
|
574
574
|
table: `${F} width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: 16px; border-radius: 2px;`,
|
|
575
575
|
th: `${F} padding: 10px 12px; border-bottom: 1px solid #d2d2d7; font-weight: 600; text-align: left; color: #1d1d1f;`,
|
|
@@ -882,7 +882,9 @@ async function render$1(options) {
|
|
|
882
882
|
const html = String(file);
|
|
883
883
|
const outputPath = path.resolve(output);
|
|
884
884
|
fs.mkdirSync(path.dirname(outputPath), { recursive: true });
|
|
885
|
-
|
|
885
|
+
const fileHtml = `<meta charset="utf-8">
|
|
886
|
+
${html}`;
|
|
887
|
+
fs.writeFileSync(outputPath, fileHtml, "utf-8");
|
|
886
888
|
let copied = false;
|
|
887
889
|
if (options.copy) {
|
|
888
890
|
const { copyToClipboard } = await import("./clipboard-pLkenrrh.js");
|
|
@@ -1029,7 +1031,7 @@ function normalizeTarget(input) {
|
|
|
1029
1031
|
if (normalized === "x" || normalized === "twitter") return "x";
|
|
1030
1032
|
throw new Error(`Unsupported target: ${input}. Supported targets: wechat, x, twitter`);
|
|
1031
1033
|
}
|
|
1032
|
-
program.name("markpress").description("Convert Markdown into editor-ready HTML (WeChat MP or X Articles)").version("0.3.
|
|
1034
|
+
program.name("markpress").description("Convert Markdown into editor-ready HTML (WeChat MP or X Articles)").version("0.3.2").requiredOption("-i, --input <path>", "Input Markdown file path").requiredOption("-o, --output <path>", "Output HTML file path").option("-t, --target <target>", "Render target: wechat | x | twitter", "wechat").option("-c, --copy", "Copy rendered HTML to system clipboard").action(async (options) => {
|
|
1033
1035
|
try {
|
|
1034
1036
|
const target = normalizeTarget(options.target);
|
|
1035
1037
|
const renderer = target === "wechat" ? render$1 : render;
|
package/package.json
CHANGED