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:
@@ -24,6 +24,7 @@ class ThesisConfig:
|
||||
)
|
||||
body_style: str = "Body Text Indent"
|
||||
level_offset: int = -1
|
||||
reference_style: str = "列出段落1"
|
||||
|
||||
def to_dict(self) -> dict:
|
||||
"""转成模板渲染用的扁平字典,排除 options 命名空间。"""
|
||||
@@ -64,4 +65,5 @@ def load_config(path: str | Path) -> ThesisConfig:
|
||||
),
|
||||
body_style=opts.get("body_style", "Body Text Indent"),
|
||||
level_offset=opts.get("level_offset", -1),
|
||||
reference_style=opts.get("reference_style", "列出段落1"),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user