Spaces:
Running
Running
| import { compileLaTeX } from "./dist/latex-compiler.js"; | |
| import fs from "fs/promises"; | |
| import path from "path"; | |
| async function test() { | |
| const baseDir = path.join(process.cwd(), "temp_projects", "test_mcp_1"); | |
| await fs.mkdir(baseDir, { recursive: true }); | |
| await fs.writeFile(path.join(baseDir, "main.tex"), ` | |
| \\documentclass{article} | |
| \\begin{document} | |
| Hello MCP Server! This is an automated LaTeX test compiled using XeLaTeX. | |
| \\end{document} | |
| `); | |
| console.log("Compiling LaTeX to PDF..."); | |
| const res = await compileLaTeX(baseDir); | |
| console.log(res); | |
| } | |
| test(); | |