By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,742 Members | 1,327 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,742 IT Pros & Developers. It's quick & easy.

Code documentation tool similar to what Ruby (on Rails?) uses

P: n/a
Hi,

I wonder if there is a tool for generation Python API documentation
that can include source code into HTML output. Example:
http://api.rubyonrails.com/ I really like the possibility to click on
"show source" link and read the source of the method!

AFAIK it is not possible with Epydoc and Pydoc.. but maybe other tools?

Thanks!
--
Ksenia
Jul 19 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
What about doing it yourself?
import inspect, os
print "<pre>%s</pre>" % inspect.getsource(os.makedirs)

<pre>def makedirs(name, mode=0777):
"""makedirs(path [, mode=0777])

Super-mkdir; create a leaf directory and all intermediate ones.
Works like mkdir, except that any intermediate path segment (not
just the rightmost) will be created if it does not exist. This is
recursive.

"""
head, tail = path.split(name)
if not tail:
head, tail = path.split(head)
if head and tail and not path.exists(head):
makedirs(head, mode)
if tail == curdir: # xxx/newdir/. exists if
xxx/newdir exists
return
mkdir(name, mode)
</pre>

Michele Simionato

Jul 19 '05 #2

P: n/a
12 Jun 2005 08:12:14 -0700, Michele Simionato <mi***************@gmail.com>:
What about doing it yourself?
import inspect, os
print "<pre>%s</pre>" % inspect.getsource(os.makedirs)


That's easy, thanks! I guess I'll submit a patch for Epydoc with the
functionality I've mentioned :)
--
Ksenia
Jul 19 '05 #3

P: n/a
Ksenia Marasanova responsded to Michele Simionato
>>> print "<pre>%s</pre>" % inspect.getsource(os.makedirs)


That's easy, thanks! I guess I'll submit a patch for Epydoc with the
functionality I've mentioned :)


Before doing that, add a "cgi.escape()" to the text. Otherwise
embedded [<>&] characters will be interpreted as HTML.

Andrew
da***@dalkescientific.com

Jul 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.