Cell_list now appends links to cell readmes
This commit is contained in:
parent
9fcefb09c7
commit
c74b4d8ceb
|
@ -149,9 +149,24 @@ def AppendToReadme (celllistfile):
|
||||||
for i, l in enumerate(f):
|
for i, l in enumerate(f):
|
||||||
if i<5: old += l
|
if i<5: old += l
|
||||||
|
|
||||||
|
# get cell readme list
|
||||||
|
lscmd = 'ls -1a ' + str(celllistfile.parents[0])+"/cells/*/README.rst 2>/dev/null"
|
||||||
|
cellrdm = os.popen(lscmd).read().strip().split('\n')
|
||||||
|
cellrdm = [c.replace(str(celllistfile.parents[0])+'/','') for c in cellrdm]
|
||||||
|
|
||||||
with open(str(readmefile), "w+") as f:
|
with open(str(readmefile), "w+") as f:
|
||||||
f.write(old)
|
f.write(old)
|
||||||
tableinc = f'.. include:: {celllistfile.name}\n'
|
tableinc = f'.. include:: {celllistfile.name}\n'
|
||||||
|
|
||||||
|
if len(cellrdm):
|
||||||
|
f.write('\n\n\n')
|
||||||
|
f.write('Cell descriptions\n')
|
||||||
|
f.write('-----------------\n\n')
|
||||||
|
f.write('.. toctree::\n\n')
|
||||||
|
for c in cellrdm:
|
||||||
|
f.write(f' {c}\n')
|
||||||
|
f.write('\n\n\n')
|
||||||
|
|
||||||
if not tableinc in old:
|
if not tableinc in old:
|
||||||
f.write(tableinc)
|
f.write(tableinc)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue