Skip to content

Commit

Permalink
enable md to rst with embedded images
Browse files Browse the repository at this point in the history
  • Loading branch information
mmckerns committed Jan 13, 2023
1 parent 81f93b2 commit bcb896e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions version.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ def get_readme_as_rst(filepath):
README += line.replace('* ',' - ',1)
elif line.startswith('-'):
README += line.replace('-','=') + '\n'
elif line.startswith('!['): # image
alt,img = line.split('](',1)
img = img.replace('docs/source/','') # make is in docs
README += '.. image:: ' + img.replace(')','')
README += ' :alt: ' + alt.replace('![','') + '\n'
#elif ')[http' in line: # alt text link (`text <http://url>`_)
else:
README += line
skip = line.endswith(':\n')
Expand Down

0 comments on commit bcb896e

Please sign in to comment.