用于注释gthnk日志文本文件的python标记扩展名
mdx-journal的Python项目详细描述
使用gthnk日志注释格式扩展python标记。安装此扩展后,所有的日期戳和时间戳都将呈现为标题。
安装
pip install mdx-journal
示例
首先,让我们看看没有这个自定义标记的日记条目。
>>> from markdown import markdown >>> text = "2013-12-16\n\n1620\n\nThis is the first entry\n1621\n\nAnd this is the second entry" >>> markdown(text) u'<p>2013-12-16</p>\n<p>1620</p>\n<p>This is the first entry\n1621</p>\n<p>And this is the second entry</p>'
现在让我们看看应用了日志标记的日志条目。您将看到日期和时间现在包装在标题标记中。
>>> markdown(text, extensions=["journal"]) u'<p><h3>2013-12-16</h3></p>\n<p><h4>1620</h4></p>\n<p>This is the first entry\n<h4>1621</h4></p>\n<p>And this is the second entry</p>'
许可证
麻省理工学院执照。