Skip to content

Changed docstring to fix formatting problem #133

Open
wants to merge 2 commits into from

2 participants

@hlainchb

Need to leave the very first line of the docstring blank to allow the markdown to render correctly whenever docstrings have multiple lines with examples. A few functions have this issue. If this is acceptable, I can go around and fix the rest of them up.

I considered changing makedoc.py to add the extra line but that wouldn't fix the inconsistency within within python with the help() variant, so decided it was better to just make the source docstrings consistent.

@webpy
webpy commented Jan 30, 2012
@hlainchb

I just checked out the latest trunk and ran makedoc. The resulting HTML generated for websafe examples looks like this:

<blockquote>
  <blockquote>
    <blockquote>
      <p>websafe("&lt;'&amp;\">")
      u'&lt;&#39;&amp;&quot;&gt;'
      websafe(None)
      u''
      websafe(u'\u203d')
      u'\u203d'
      websafe('\xe2\x80\xbd')
      u'\u203d'</p>
    </blockquote>
  </blockquote>
</blockquote></div></p>
</div>

This happens when functions are commented like this:

def websafe(val):
    r"""Converts `val` so that it is safe for use in Unicode HTML.

        >>> websafe("<'&\">")
        u'&lt;&#39;&amp;&quot;&gt;'
        >>> websafe(None)
        u''
        >>> websafe(u'\u203d')
        u'\u203d'
        >>> websafe('\xe2\x80\xbd')
        u'\u203d'
    """

instead of this:

def websafe(val):
    r"""
    Converts `val` so that it is safe for use in Unicode HTML.

        >>> websafe("<'&\">")
        u'&lt;&#39;&amp;&quot;&gt;'
        >>> websafe(None)
        u''
        >>> websafe(u'\u203d')
        u'\u203d'
        >>> websafe('\xe2\x80\xbd')
        u'\u203d'
    """

Happy to help out. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.