def get_changelog(self, repo, commit):
item = nodes.list_item()
item.append(self._make_message_node(commit.message, commit.hexsha))
item.append(nodes.inline(text=six.text_type(' by ')))
item.append(nodes.emphasis(text=six.text_type(commit.author.name)))
item.append(nodes.inline(text=six.text_type(' at ')))
commit_date = datetime.fromtimestamp(commit.authored_date)
item.append(nodes.emphasis(text=six.text_type(commit_date)))
if OPTION_WITH_REF_URL in self.options:
ref_url = repo.get_commit_url(commit.hexsha)
ref = nodes.reference('', commit.hexsha, refuri=ref_url)
item.append(nodes.paragraph('', '', ref))
if OPTION_INCLUDE_DIFF in self.options:
diff = repo.get_diff(commit.hexsha)
item.append(self._make_diff_node(diff, commit.hexsha))
return item
评论列表
文章目录