Skip to content

Commit

Permalink
Support EM and gate da
Browse files Browse the repository at this point in the history
  • Loading branch information
arjunsuresh committed Sep 17, 2024
1 parent 8f74655 commit 4b48a5a
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 7 deletions.
21 changes: 17 additions & 4 deletions script/make-go-pdf/_cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,28 @@ input_mapping:
skip_pdf: CM_SKIP_PDF_MAKE
uid: 43bdc18426524e54
variations:
go-em:
env:
CM_GO_COVER_NAME: ''
deps:
- tags: make,pdf,from-html,_go-em
skip_if_env:
CM_SKIP_PDF_MAKE:
- yes
go-da:
env:
CM_GO_COVER_NAME: ''
deps:
- tags: make,pdf,from-html,_go-da
skip_if_env:
CM_SKIP_PDF_MAKE:
- yes

go-cse:
env: {}
vol1: {}
go-cse,vol1:
env:
CM_GO_HTML_NAME: filter1_volume1.html
CM_GO_PDF_NAME: filter1_volume1.pdf
CM_GO_COVER_NAME: vol1-cover.pdf
deps:
- tags: make,pdf,from-html,_go-cse,_vol1
Expand All @@ -30,8 +45,6 @@ variations:
vol2: {}
go-cse,vol2:
env:
CM_GO_HTML_NAME: filter1_volume2.html
CM_GO_PDF_NAME: filter1_volume2.pdf
CM_GO_COVER_NAME: vol2-cover.pdf
deps:
- tags: make,pdf,from-html,_go-cse,_vol2
Expand Down
26 changes: 24 additions & 2 deletions script/make-pdf-from-html/_cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,26 @@ deps:
- tags: get,wkhtmltopdf,_with-qt
uid: 403a21dfa7bc434a
variations:
go-da:
group: branch
env:
CM_GO_PDF_BRANCH: da
CM_GO_PDF_TITLE: 'GATEOverflow for GATE DA'
CM_GO_HTML_FOLDER_NAME: gate_overflow_for_gate_cse
CM_GO_PDF_JS_DELAY: 3880000
CM_GO_PDF_SCALE: '1.0'
CM_GO_HTML_FILE_NAME: book_gate_da.html
CM_GO_PDF_NAME: da.pdf
go-em:
group: branch
env:
CM_GO_PDF_BRANCH: cse
CM_GO_PDF_TITLE: 'GATEOverflow for GATECSE'
CM_GO_HTML_FOLDER_NAME: gate_overflow_for_gate_cse
CM_GO_PDF_JS_DELAY: 388000
CM_GO_PDF_SCALE: '0.7'
CM_GO_HTML_FILE_NAME: book_gate_em.html
CM_GO_PDF_NAME: em.pdf
go-cse:
group: branch
default: true
Expand All @@ -24,13 +44,15 @@ variations:
group: volume
go-cse,vol1:
default_env:
CM_GO_PDF_JS_DELAY: 488000
CM_GO_PDF_JS_DELAY: 488000
CM_GO_HTML_FILE_NAME: book_filter1_volume1.html
CM_GO_PDF_SCALE: '0.7'
CM_GO_PDF_NAME: filter1_volume1.pdf
go-cse,vol2:
default_env:
CM_GO_PDF_JS_DELAY: 8880000
CM_GO_PDF_JS_DELAY: 4880000
CM_GO_HTML_FILE_NAME: book_filter1_volume2.html
CM_GO_PDF_SCALE: '1.0'
CM_GO_PDF_NAME: filter1_volume2.pdf


2 changes: 1 addition & 1 deletion script/make-pdf-from-html/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def preprocess(i):
env['CM_ROOT_PATH'] = os.path.join(os.path.expanduser("~"), "go_books")
env['CM_PDF_PATH'] = os.path.join(env['CM_ROOT_PATH'], "pdfs")

cmd = f"""wkhtmltopdf --javascript-delay {env['CM_GO_PDF_JS_DELAY']} -T 20mm -B 20mm --header-spacing 6 --title '{env['CM_GO_PDF_TITLE']}' --no-stop-slow-scripts --load-error-handling ignore --enable-local-file-access toc {os.path.join(env['CM_ROOT_PATH'], env['CM_GO_HTML_FOLDER_NAME'], env['CM_GO_HTML_FILE_NAME'])} --enable-toc-back-links --zoom 1.0 {os.path.join(env['CM_PDF_PATH'],env['CM_GO_PDF_NAME'])} """
cmd = f"""wkhtmltopdf --javascript-delay {env['CM_GO_PDF_JS_DELAY']} -T 20mm -B 20mm --header-spacing 6 --title '{env['CM_GO_PDF_TITLE']}' --no-stop-slow-scripts --load-error-handling ignore --enable-local-file-access toc {os.path.join(env['CM_ROOT_PATH'], env['CM_GO_HTML_FOLDER_NAME'], env['CM_GO_HTML_FILE_NAME'])} --enable-toc-back-links --zoom {env['CM_GO_PDF_SCALE']} {os.path.join(env['CM_PDF_PATH'],env['CM_GO_PDF_NAME'])} """

env['CM_RUN_CMD'] = cmd

Expand Down

0 comments on commit 4b48a5a

Please sign in to comment.