-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix readme render #607
Fix readme render #607
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
import os | ||
import re | ||
import sys | ||
import codecs | ||
import subprocess as sp | ||
|
||
import ah_bootstrap | ||
|
@@ -84,9 +85,16 @@ def read_metadata(config_filename): | |
|
||
|
||
def read_readme(readme_filename): | ||
with open(readme_filename) as ff: | ||
with codecs.open(readme_filename, encoding='utf8') as ff: | ||
lines = ff.read().splitlines() | ||
|
||
# Skip lines that contain raw HTML markup | ||
lines = lines[:4] + lines[26:] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems a bit dangerous - what if someone else makes the README and doesn't realize they need to update this file? Maybe instead look for the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, you're absolutely right. We should do something smarter like that in the long term but for the sake of this bug fix I'm going to leave it alone. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also the point of the |
||
|
||
# Turn the header comment into a real header | ||
lines = lines[1:] | ||
lines[0:2] = [x.strip() for x in lines[0:2]] | ||
|
||
# Fix hyperlink targets so that the README displays properly on pypi | ||
label_re = re.compile(r'^\.\.\s+_(\w|-)+$') | ||
for i, line in enumerate(lines): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, this is diabolical (in a good way)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😈