Skip to content

Instantly share code, notes, and snippets.

@erikrose
Created July 18, 2011 23:55
Show Gist options
  • Save erikrose/1090980 to your computer and use it in GitHub Desktop.
Save erikrose/1090980 to your computer and use it in GitHub Desktop.
Regex to turn Sphinx method and class refs into normal reST, for PyPI display
"""This is how I include a dumbed-down copy of the ordinarily Sphinxified version history in my PyPI README.rst in django-tidings."""
re.sub(r':[a-zA-Z]+:`[0-9a-zA-Z~_\.]+\.([^`]+)`',
r'``\1``',
open('docs/changes.rst').read())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment