素材对照
原能力
把关键说法连到原作品或活动资料,并标明需补证、审核或撤下的主张。(细化版 p.6–7)
首选项目
Taguette(BSD-3-Clause)。 Taguette
匹配范围
片段标注和 CMS 版本规范支持出处链。
源码
Taguette · class Highlight
taguette/database/models.py · 592–605 行。 在 GitHub 查看源码 · 许可证与声明
源码片段
class Highlight(Base):
__tablename__ = 'highlights'
__table_args__ = ({'sqlite_autoincrement': True},)
id = Column(Integer, primary_key=True)
document_id = Column(Integer, ForeignKey('documents.id',
ondelete='CASCADE'),
nullable=False, index=True)
document = relationship('Document', back_populates='highlights')
start_offset = Column(Integer, nullable=False)
end_offset = Column(Integer, nullable=False)
snippet = Column(Text, nullable=False)
tags = relationship('Tag', secondary='highlight_tags',
back_populates='highlights')
Wagtail · def save_revision(
wagtail/models/revisions.py · 384–397 行。 在 GitHub 查看源码 · 许可证与声明
源码片段
def save_revision(
self,
user=None,
approved_go_live_at=None,
changed=True,
log_action=False,
previous_revision=None,
clean=True,
overwrite_revision=None,
):
"""
Creates and saves a revision.
:param user: The user performing the action.
实现与验收要点
绑定主张与同版本原素材,补证与撤下的业务流程。