feat(transit): 添加参考文献解析功能并修复段落编号继承问题

新增了参考文献处理模块,支持按照 GB 7714 《文后参考文献著录规则》顺序编码制
解析和格式化参考文献。同时修复了段落替换过程中自动编号丢失的问题。

- 新增 transit/references.py 模块,提供参考文献解析和格式化功能
- 在 body.py 的 replace_placeholder 函数中实现段落编号属性的正确继承
- 修改 transit/__init__.py 导入新的参考文献处理函数
- 更新 transit/config.py 添加参考文献样式配置项
- 修改 transit/renderer.py 集成参考文献处理流程
This commit is contained in:
zzy
2026-05-08 22:14:51 +08:00
parent c29a3e6af0
commit 74d28ea2d8
5 changed files with 149 additions and 4 deletions

View File

@@ -4,6 +4,7 @@ from .parser import parse_markdown
from .body import body_to_paragraphs, replace_placeholder
from .renderer import generate_thesis
from .config import load_config, ThesisConfig
from .references import references_to_paragraphs, format_gb7714
__all__ = [
"parse_markdown",
@@ -12,4 +13,6 @@ __all__ = [
"generate_thesis",
"load_config",
"ThesisConfig",
"references_to_paragraphs",
"format_gb7714",
]