将structuredText转换为XML Atom 1.0
rst2atom的Python项目详细描述
Author: | Marco Giusti |
---|---|
Contact: | marco.giusti@gmail.com |
Date: | 2010-03-08 |
要求
rst2atom使用gdata python client library和pygments。 虽然gdata库是必需的,pygments它不是,而是 建议正确分析sourcecode指令。
用法
rst2atom扩展了标准的html编写器。照常写文件 别忘了添加书目元素,如作者、日期和 类别(尚未实现)。
这里是典型的hello world示例:
Hello world =========== asdfasdfadf .. sourcecode:: python def print_(obj): print obj asdasdf
$ rst2atom test.rst test.xml $ curl -d @test.xml --digest -u <YOUR_USERNAME_HERE> -H \ "Content-Type: application/atom+xml;type=entry" -v \ http://www.livejournal.com/interface/atom/post
字段
rst2atom假设feed只有一个条目,可能是 行为在未来可能会改变,但就是这样,它设置了 字段而不是提要的字段。
目前,以下指令被理解为 rst2atom:
- author
- 此字段设置条目author if是docinfo的子项。如果它 是authors添加参与者的子级。
- contact
- 如果节点 父级是author,否则,如果至少给定一个参与者, 设置电子邮件。
- date
- 设置updated属性。
- copyright
- 设置rights属性。