469,936 Members | 2,444 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,936 developers. It's quick & easy.

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

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
3 1157
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
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
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.

Similar topics

8 posts views Thread by Useko Netsumi | last post: by
23 posts views Thread by flab ba | last post: by
12 posts views Thread by Fredrik Olsson | last post: by
5 posts views Thread by Matias | last post: by
34 posts views Thread by emrahayanoglu | last post: by
1 post views Thread by LinkExchange.AB | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.