Skip to content

Commit

Permalink
handle raw and relative image paths
Browse files Browse the repository at this point in the history
  • Loading branch information
mmckerns committed Jan 14, 2023
1 parent 09007c3 commit d67d381
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion version.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ def get_readme_as_rst(filepath):
README += line.replace('-','=') + '\n'
elif line.startswith('!['): # image
alt,img = line.split('](',1)
img = img.split('docs/source/',1)[-1] # make is in docs
if img.startswith('docs'): # relative path
img = img.split('docs/source/',1)[-1] # make is in docs
README += '.. image:: ' + img.replace(')','')
README += ' :alt: ' + alt.replace('![','') + '\n'
#elif ')[http' in line: # alt text link (`text <http://url>`_)
Expand Down

0 comments on commit d67d381

Please sign in to comment.