restructured text in python

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • bdsatish

    restructured text in python

    Hi all,

    I have a python prog:


    #!/usr/bin/env
    """
    Author: BDS
    Version: 1.0
    """

    def Hello():
    """ Prints a Hello World to the screen"""
    print "Hello, World"

    if __name__ == "__main__":
    Hello()

    I want to use ReSt (reStructuredTe xt) in my docstrings or comments.
    Any example of how to do it, w.r.t. above code ? Also how to invoke
    rst on the Python code to do the processing ?

    I know how to write in RST but I want to know how to process the
    resulting Python code
  • Jeroen Ruigrok van der Werven

    #2
    Re: restructured text in python

    -On [20080424 13:16], bdsatish (bdsatish@gmail .com) wrote:
    >#!/usr/bin/env
    #!/usr/bin/env what? I guess you meant #!/usr/bin/env python
    >"""
    >Author: BDS
    >Version: 1.0
    >"""
    >
    >def Hello():
    """ Prints a Hello World to the screen"""
    print "Hello, World"
    >
    >I want to use ReSt (reStructuredTe xt) in my docstrings or comments.
    >Any example of how to do it, w.r.t. above code ? Also how to invoke
    >rst on the Python code to do the processing ?
    Just run epydoc (easy_install epydoc) on your code, for example, and observe
    the resulting output.

    Once you see the output it's quite easy, since you already know reSt, how to
    change your docstrings to use appropriate formatting for what you need.

    --
    Jeroen Ruigrok van der Werven <asmodai(-at-)in-nomine.org/ asmodai
    イェルーン ラウフロッ ク ヴァン デル ウェルヴェ ン
    http://www.in-nomine.org/ | http://www.rangaku.org/ | GPG: 2EAC625B
    Give me the strength to be who I was, and forgive me for who I am...

    Comment

    Working...