开发者

Any way of getting PyDoc into Jira Confluence

开发者 https://www.devze.com 2023-03-14 13:19 出处:网络
I\'m using PyDoc to generate documentation from my Python code and I\'m using Jira\'s Confluence plugin to manage documentation. Is there any way to generating PyDoc docume开发者_Python百科ntation and

I'm using PyDoc to generate documentation from my Python code and I'm using Jira's Confluence plugin to manage documentation. Is there any way to generating PyDoc docume开发者_Python百科ntation and putting it into Confluence?

Googling didn't yield too many results.

Thanks everyone


You can try something like this:

from pydoc import *
import io

d = HTMLDoc()
content = d.docmodule(sys.modules["mymodule"])

f = io.open('./out.html', 'w')
f.write(unicode(content))
f.close()

You now have an HTML file containing the pydoc info. The next trick is to get it into Confluence so that it looks nice. I have so far tried importing it into Microsoft Word as an .rtf, then cut-and-paste into Confluence.


pydoc generates one file format, html. So your challenge is getting an self contained HTML4 page into Confluence.

The Confluence wiki says you can use a HTML macro.

I imagine ideally you'd want to get pydoc to generate Confluence Markup, but you'd need a different tool for that.

0

精彩评论

暂无评论...
验证码 换一张
取 消