feat: 实现 Markdown 渲染核心

This commit is contained in:
SkyJourney
2026-07-25 18:39:43 +08:00
parent ec48bce0a6
commit 7224dfdf60
11 changed files with 1550 additions and 11 deletions
+1
View File
@@ -11,6 +11,7 @@
},
"dependencies": {
"@md-to-pdf/core": "0.1.0",
"@md-to-pdf/renderer": "0.1.0",
"fastify": "^5.6.2"
},
"devDependencies": {
+10 -3
View File
@@ -4,6 +4,7 @@ import {
defaultExportConfig,
supportedPaperFormats
} from "@md-to-pdf/core";
import { RENDERER_VERSION } from "@md-to-pdf/renderer";
const port = Number.parseInt(process.env.PORT ?? "3001", 10);
const host = process.env.HOST ?? "0.0.0.0";
@@ -15,14 +16,20 @@ const app = Fastify({
app.get("/api/health", async () => ({
status: "ok",
service: "md-to-pdf",
configVersion: EXPORT_CONFIG_VERSION
configVersion: EXPORT_CONFIG_VERSION,
rendererVersion: RENDERER_VERSION
}));
app.get("/api/capabilities", async () => ({
defaultExportConfig,
supportedPaperFormats,
implemented: ["project-skeleton", "export-config", "theme-manifest"],
planned: ["markdown-render", "html-preview", "pdf-export"]
implemented: [
"project-skeleton",
"export-config",
"theme-manifest",
"markdown-render"
],
planned: ["html-preview", "pdf-export"]
}));
async function start() {