Skip to content

Commit b26c7d0

Browse files
committed
TL: added image support for documentation website
1 parent e836332 commit b26c7d0

File tree

5 files changed

+21
-0
lines changed

5 files changed

+21
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,9 @@ Education and Research](https://www.bmbf.de/bmbf/en/home/home_node.html)
108108
(BMBF) grant 16HPC047. The project also received help from the
109109
[Helmholtz Platform for Research Software Engineering - Preparatory
110110
Study (HiRSE_PS)](https://www.helmholtz-hirse.de/).
111+
112+
<p align="center">
113+
<img src="./docs/img/EuroHPC.jpg" height="105"/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
114+
<img src="./docs/img/LogoTime-X.png" height="105" /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
115+
<img src="./docs/img/BMBF_gefoerdert_2017_en.jpg" height="105" />
116+
</p>

docs/convert_markdown.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import glob
1010
import json
1111
import m2r2
12+
import shutil
1213
import numpy as np
1314

1415
mdFiles = [
@@ -20,6 +21,10 @@
2021

2122
docSources = 'docs/source'
2223

24+
# Move already images in the future build directory
25+
os.makedirs('docs/build/html/_images/', exist_ok=True)
26+
shutil.copytree('docs/img', 'docs/build/html/_images/docs/img', dirs_exist_ok=True)
27+
2328
counter = np.array(0)
2429

2530
with open('docs/emojis.json') as f:
@@ -64,6 +69,15 @@ def completeRefLinks(rst, baseName):
6469
def addOrphanTag(rst):
6570
return '\n:orphan:\n'+rst
6671

72+
def setImgPath(rst):
73+
i = 0
74+
while i != -1:
75+
i = rst.find('<img src=".', i)
76+
if i != -1:
77+
rst = rst[:i+11]+'/_images'+rst[i+11:]
78+
i += 16
79+
return rst
80+
6781
def convert(md, orphan=False, sectionRefs=True):
6882
baseName = os.path.splitext(md)[0]
6983
rst = m2r2.parse_from_file(md, parse_relative_links=True)
@@ -73,6 +87,7 @@ def convert(md, orphan=False, sectionRefs=True):
7387
rst = completeRefLinks(rst, baseName)
7488
if orphan:
7589
rst = addOrphanTag(rst)
90+
rst = setImgPath(rst)
7691
with open(f'{docSources}/{baseName}.rst', 'w') as f:
7792
f.write(rst)
7893
print(f'Converted {md} to {docSources}/{baseName}.rst')
55.9 KB
Loading

docs/img/EuroHPC.jpg

37.4 KB
Loading

docs/img/LogoTime-X.png

29.2 KB
Loading

0 commit comments

Comments
 (0)