plan: 听后复述/读后复述 sections with (待登记) placeholders; render pending cells as boxes
This commit is contained in:
@@ -90,6 +90,7 @@ tr:last-child td{border-bottom:none}
|
||||
.logdate:hover{color:#cBE6ff;border-bottom-style:solid;text-decoration:none}
|
||||
.md hr{border:0;border-top:1px solid #232b38;margin:18px 0}
|
||||
.md blockquote{border-left:3px solid #2f5f96;margin:10px 0;padding:2px 14px;color:#b9c3d3}
|
||||
.md p.pending{border:1px dashed #3f5a7d;border-radius:8px;padding:10px 14px;color:#7f8aa0;background:#141821;margin:8px 0}
|
||||
"""
|
||||
|
||||
# 页头/页脚:banner 结构(参考 FRA 模板)
|
||||
@@ -153,12 +154,14 @@ def esc(v) -> str:
|
||||
|
||||
|
||||
def render_md(text: str) -> str:
|
||||
"""Markdown → HTML。有 markdown 库就用,没有则降级为 <pre>。"""
|
||||
"""Markdown → HTML。有 markdown 库就用,没有则降级为 <pre>。
|
||||
未录入的格子(内容为 (待登记))渲染成可见的虚框。"""
|
||||
try:
|
||||
import markdown as _md
|
||||
return _md.markdown(text, extensions=["tables", "fenced_code"])
|
||||
out = _md.markdown(text, extensions=["tables", "fenced_code"])
|
||||
except ImportError:
|
||||
return "<pre>" + _html.escape(text) + "</pre>"
|
||||
out = "<pre>" + _html.escape(text) + "</pre>"
|
||||
return out.replace("<p>(待登记)</p>", '<p class="pending">(待登记)</p>')
|
||||
|
||||
|
||||
def session_body(s: dict, files: list[tuple[str, str]]) -> str:
|
||||
|
||||
Reference in New Issue
Block a user