Skip to content

Commit

Permalink
Fixed method name in usage examples.
Browse files Browse the repository at this point in the history
The relevant method on the `Parser` instance is called `format`, not `render` (though the latter might have been more consistent).
  • Loading branch information
homeworkprod committed Aug 26, 2014
1 parent f15399d commit d1b1b16
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/usage.rst
Expand Up @@ -64,7 +64,7 @@ The linker is a function that gets called to replace URLs with markup. It takes
return '<a href="%s">%s</a>' % (href, url)

parser = bbcode.Parser(linker=my_linker)
parser.render('www.apple.com') # returns <a href="http://www.apple.com">www.apple.com</a>
parser.format('www.apple.com') # returns <a href="http://www.apple.com">www.apple.com</a>

For an example of a linker that may want the render context, imagine a linker that routes all clicks through a local URL::

Expand All @@ -76,4 +76,4 @@ For an example of a linker that may want the render context, imagine a linker th
return '<a href="%s">%s</a>' % (redir_url, url)

parser = bbcode.Parser(linker=my_linker, linker_takes_context=True)
parser.render('www.apple.com', request=request)
parser.format('www.apple.com', request=request)

0 comments on commit d1b1b16

Please sign in to comment.