Browse Source

hide folders

master
dickreckard 1 year ago
parent
commit
842fc81f54
  1. 14
      pdf-compile.py

14
pdf-compile.py

@ -33,7 +33,7 @@ ooooo_graphs="https://pad.constantvzw.org/p/atnofs-insert"
indexmd = requests.get('https://pad.vvvvvvaria.org/atnofs-index.md/export/txt').text
# download the index of all contributions
with open('index.md','w') as file:
with open(localhost+'index.md','w') as file:
file.write(indexmd)
basecssget = requests.get(BASECSS).text
@ -42,7 +42,7 @@ with open(localhost+'base.css','w') as file:
# download the base css style
with open('index.md') as file:
with open(localhost+'index.md') as file:
for line in file:
# searches for the chapter links
@ -84,8 +84,8 @@ if ooooo_insert:
for chapter in chapters:
name=str(counter).zfill(2)+'-'+chapter.split('/')[-3]
if not os.path.exists(localhost+name):
os.makedirs(localhost+name)
if not os.path.exists(localhost+'.'+name):
os.makedirs(localhost+'.'+name)
pdffile=name+'.pdf'
if len(sys.argv)<2 or sys.argv[1]=='nonlocal':
@ -97,12 +97,12 @@ for chapter in chapters:
preview = requests.get(chapter.replace('pad/','preview.html'))
style = requests.get(chapter.replace('pad/','stylesheet.css'))
stylefile=localhost+name+'/stylesheet.css'
stylefile=localhost+'.'+name+'/stylesheet.css'
with open(stylefile, 'w') as file:
file.write(style.text)
previewfile=localhost+name+'/preview.html'
localpreview=localurl+name+'/preview.html'
previewfile=localhost+'.'+name+'/preview.html'
localpreview=localurl+'.'+name+'/preview.html'
with open(previewfile, 'w') as file:
file.write(preview.text)

Loading…
Cancel
Save