feat/export-service
main
Export Service:把笔记或未保存的 Markdown 文本导出为 HTML / PDF / DOCX 的完整链路——创建即返回 queued、后台 asyncio.Task 渲染、产物 24h 过期、轮询 GET /api/exports/{job_id} 下载。
queued
GET /api/exports/{job_id}
renderer="ast"
DocumentNode
DocumentExporter
HtmlExporter
PdfExporter
Drawing
DocxExporter
w:eastAsia=宋体
parser.py
compute_geometry
render.py
render_reportlab.py
StaticRenderer
renderer.py
app/contracts.py
app/routes.py
/api/exports*
tests/test_export.py
tests/test_plot.py
docs/development/Export开发说明.md
720 passed
git diff --check
暂不建议合并,当前仍有 1 个 P2 问题。
当前实现将“相邻采样值分别低于 ymin 和高于 ymax”直接判断为中间存在渐近线并断开曲线。
ymin
ymax
但正常的连续函数也可能在两个采样点之间快速穿过可见范围。例如:
domain: -1, 1 range: -1, 1 y = 1000*(x-0.0025)
实测该函数最终生成 0 个曲线段,整条本应穿过绘图区的直线完全消失。
建议:
No dependencies set.
The note is not visible to the blocked user.
概述
Export Service:把笔记或未保存的 Markdown 文本导出为 HTML / PDF / DOCX 的完整链路——创建即返回
queued、后台 asyncio.Task 渲染、产物 24h 过期、轮询GET /api/exports/{job_id}下载。范围(相对 main:28 文件 / +4836 行)
renderer="ast"→DocumentNode内部协议 +DocumentExporterProtocol。HtmlExporter:完整 HTML5 + function-plot 静态 SVG 内嵌。PdfExporter:reportlab,function-plot 内嵌矢量Drawing(与 SVG 同源共享几何),中文字体 STSong-Light,列表/表格/引用/行内语义。DocxExporter:python-docx,标题/列表/链接/表格,中文经w:eastAsia=宋体。parser.py)、共享几何compute_geometry(render.py)、reportlab 矢量后端(render_reportlab.py)、StaticRenderer内部契约(renderer.py)。app/contracts.py+app/routes.py的/api/exports*(创建/查询/下载/取消)。tests/test_export.py、tests/test_plot.py,docs/development/Export开发说明.md、接口契约 §10。审阅修复记录(多轮)
验证结果
720 passedgit diff --check:通过main:无合并冲突审阅结论
暂不建议合并,当前仍有 1 个 P2 问题。
P2:渐近线判断会误删正常的陡峭连续曲线
当前实现将“相邻采样值分别低于
ymin和高于ymax”直接判断为中间存在渐近线并断开曲线。但正常的连续函数也可能在两个采样点之间快速穿过可见范围。例如:
实测该函数最终生成 0 个曲线段,整条本应穿过绘图区的直线完全消失。
建议:
已确认内容
720 passedgit diff --check:通过main:无合并冲突Pull request closed