-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Home
This is a place for users to share pandoc tips.
These extend the capabilities of pandoc:
- Pandoc Extras: tools built around pandoc
- User-contributed templates: other templates to build standalone output formats.
- Pandoc Filters: Pandoc provides an interface for users to write programs (known as filters) which act on the intermediate AST.
- Pandoc Boilerplates: readymade pandoc presentation style
- General:
- Examples:
- Compiling pandoc:
- Debug LaTeX output examples:
based on <src/Text/Pandoc/Error.hs>
3 : Failing because there were warnings
4 : Application error
5 : Error compiling template
6 : Option error
21 : Unknown input format
22 : Unknown output format
23 : Unsupported file extension
31 : EPUB subdirectory contains illegal characters
43 : Error producing PDF
47 : PDF program not found
61 : Could not fetch via HTTP
62 : Should never happen
63 : Some error
64 : Parse error
65 : Parsec error (?)
66 : Make pdf error
67 : Syntax map error
83 : Error running filter
91 : Loop encountered in expanding macro
92 : UTF-8 decoding error
93 : IPython notebook decoding error
97 : Could not find data file
99 : Resource not found
""" XXX DEX PPT Generator - 主入口文件 生成深色科技风格的XXX DEX产品演示PPT """
from fastapi import FastAPI, File, UploadFile, HTTPException from fastapi.responses import FileResponse from fastapi.middleware.cors import CORSMiddleware from src.ppt_generator import XXXDEXPPTGenerator import uvicorn import os import tempfile
app = FastAPI( title="XXX DEX PPT Generator", description="生成XXX DEX产品演示PPT的自动化工具", version="1.0.0" )
app.add_middleware( CORSMiddleware, allow_origins=[""], allow_credentials=True, allow_methods=[""], allow_headers=["*"], )
@app.post("/generate-ppt") async def generate_ppt(): """生成PPTX文件并返回下载链接""" try: generator = XXXDEXPPTGenerator()
# 创建临时文件
with tempfile.NamedTemporaryFile(suffix='.pptx', delete=False) as tmp_file:
tmp_path = tmp_file.name
# 生成PPT
generator.create_presentation(tmp_path)
return FileResponse(
tmp_path,
media_type="application/vnd.openxmlformats-officedocument.presentationml.presentation",
filename="XXX-DEX-产品演示.pptx"
)
except Exception as e:
raise HTTPException(status_code=500, detail=str(e))
@app.get("/health") async def health_check(): """健康检查接口""" return {"status": "healthy", "service": "XXX DEX PPT Generator"}
if name == "main": uvicorn.run(app, host="0.0.0.0", port=8000)