|
|
@ -8,10 +8,13 @@ import re |
|
|
|
import os |
|
|
|
import sys |
|
|
|
|
|
|
|
NODE = '/home/dickreckard/.nvm/versions/node/v16.13.0/bin/node' |
|
|
|
PAGEDJSCLI = '/home/dickreckard/.nvm/versions/node/v16.13.0/bin/pagedjs-cli' |
|
|
|
localhost = '/var/www/html/atnofs/' |
|
|
|
localurl = 'http://localhost/atnofs/' |
|
|
|
# todo move this variable outta here.. |
|
|
|
|
|
|
|
NODE = '/home/friend/.nvm/versions/node/v16.13.0/bin/node' |
|
|
|
PAGEDJSCLI = '/home/friend/.nvm/versions/node/v16.13.0/bin/pagedjs-cli' |
|
|
|
|
|
|
|
localhost = '/var/www/html/pdfs/' |
|
|
|
localurl = 'http://localhost/pdfs/' |
|
|
|
|
|
|
|
outputname='atnofs-compiled.pdf' |
|
|
|
|
|
|
@ -88,15 +91,15 @@ for chapter in chapters: |
|
|
|
# end hack |
|
|
|
|
|
|
|
# this is the pagedjs client version making the pdf out of the localhost version of the html |
|
|
|
subprocess.run([NODE, PAGEDJSCLI, localpreview, '-o', pdffile]) |
|
|
|
subprocess.run([NODE, PAGEDJSCLI, localpreview, '-o', localhost+pdffile]) |
|
|
|
|
|
|
|
else: |
|
|
|
if('octomode.vvvvvvaria.org' in chapter): |
|
|
|
chapter=chapter.replace('://','://'+authu+':'+authp+'@') |
|
|
|
preview = chapter.replace('pad/','pagedjs.html') |
|
|
|
subprocess.run([NODE, PAGEDJSCLI, preview, '-o', pdffile]) |
|
|
|
subprocess.run([NODE, PAGEDJSCLI, preview, '-o', localhost+pdffile]) |
|
|
|
|
|
|
|
outputs.append(pdffile) |
|
|
|
outputs.append(localhost+pdffile) |
|
|
|
|
|
|
|
counter+=1 |
|
|
|
|
|
|
@ -108,5 +111,5 @@ if ooooo_insert: |
|
|
|
|
|
|
|
# compiling all the files in one big pdf! |
|
|
|
|
|
|
|
output = pypdftk.concat(outputs,out_file=outputname) |
|
|
|
output = pypdftk.concat(outputs,out_file=localhost+outputname) |
|
|
|
|
|
|
|