Use PDF screenshots for the manual.
[dcpomatic.git] / doc / manual / Makefile
1 # DCP-o-matic manual makefile
2
3 all:    html pdf
4
5 DIAGRAMS := file-structure.svg 3d-left-right.svg 3d-top-bottom.svg timecode.svg pipeline1.svg pipeline2.svg \
6             pipeline3.svg pipeline4.svg burn-in.svg discrete.svg dcp-copy.svg dcp-refer.svg reels-by-video.svg \
7             crypt.svg
8
9 SCREENSHOTS := file-new.pdf new-film.pdf video-select-content-file.pdf \
10                still-select-content-file.pdf examine-content.pdf timing-tab.pdf \
11                calculate-audio-gain.pdf add-file.pdf dcp-tab.pdf colour-conversion.pdf \
12                prefs-email.pdf prefs-kdm-email.pdf prefs-general.pdf prefs-tms.pdf prefs-cover-sheet.pdf \
13                prefs-advanced.pdf prefs-defaults.pdf prefs-servers.pdf prefs-keys.pdf \
14                prefs-notifications.pdf timeline1.pdf timed-text-tab.pdf \
15                making-dcp.pdf filters.pdf video-tab.pdf audio-tab.pdf \
16                audio-plot.pdf audio-map-eg1.pdf audio-map-eg2.pdf audio-map-eg3.pdf kdm.pdf \
17                kdm-creator.pdf export.pdf
18
19 XML := dcpomatic.xml
20
21 #
22 # For the HTML: convert PDF screenshots to PNG and copy into html/screenshots, scaling some.
23 #
24 html/screenshots/%.png: screenshots/%.pdf
25         mkdir -p html/screenshots
26         pdftoppm $< $(basename $@) -png -f 1 -singlefile -rx 80 -ry 80
27
28
29 # For LaTeX/PDF: crop some of the PDF screenshots; use others as-is
30 screenshots/%.pdf: raw-screenshots/%.pdf
31         cp $< $@
32
33 screenshots/prefs-general.pdf: raw-screenshots/prefs-general.pdf
34         python3 pdf_crop_by.py $< $@ 0 400 0 0
35
36 screenshots/prefs-defaults.pdf: raw-screenshots/prefs-defaults.pdf
37         python3 pdf_crop_by.py $< $@ 0 400 0 0
38
39 screenshots/prefs-servers.pdf: raw-screenshots/prefs-servers.pdf
40         python3 pdf_crop_by.py $< $@ 0 700 0 0
41
42 screenshots/prefs-keys.pdf: raw-screenshots/prefs-keys.pdf
43         python3 pdf_crop_by.py $< $@ 0 600 0 0
44
45 screenshots/prefs-tms.pdf: raw-screenshots/prefs-tms.pdf
46         python3 pdf_crop_by.py $< $@ 0 600 0 0
47
48 screenshots/prefs-email.pdf: raw-screenshots/prefs-email.pdf
49         python3 pdf_crop_by.py $< $@ 0 700 0 0
50
51 screenshots/prefs-cover-sheet.pdf: raw-screenshots/prefs-cover-sheet.pdf
52         python3 pdf_crop_by.py $< $@ 0 600 0 0
53
54 screenshots/examine-content.pdf: raw-screenshots/examine-content.pdf
55         python3 pdf_crop_by.py $< $@ 460 270 200 580
56
57 screenshots/audio-tab.pdf: raw-screenshots/audio-tab.pdf
58         python3 pdf_crop_by.py $< $@ 0 0 1230 380
59
60 screenshots/timing-tab.pdf: raw-screenshots/timing-tab.pdf
61         python3 pdf_crop_by.py $< $@ 0 0 1230 380
62
63 screenshots/timed-text-tab.pdf: raw-screenshots/timed-text-tab.pdf
64         python3 pdf_crop_by.py $< $@ 0 200 1230 380
65
66 screenshots/video-tab.pdf: raw-screenshots/video-tab.pdf
67         python3 pdf_crop_by.py $< $@ 0 0 1230 295
68
69 screenshots/add-file.pdf: raw-screenshots/add-file.pdf
70         python3 pdf_crop_by.py $< $@ 0 600 1210 0
71
72 screenshots/making-dcp.pdf: raw-screenshots/making-dcp.pdf
73         python3 pdf_crop_by.py $< $@ 470 190 300 700
74
75 screenshots/audio-map-eg1.pdf: raw-screenshots/audio-map-eg1.pdf
76         python3 pdf_crop_by.py $< $@ 10 195 1350 630
77
78 screenshots/audio-map-eg2.pdf: raw-screenshots/audio-map-eg2.pdf
79         python3 pdf_crop_by.py $< $@ 10 195 1350 630
80
81 screenshots/audio-map-eg3.pdf: raw-screenshots/audio-map-eg3.pdf
82         python3 pdf_crop_by.py $< $@ 10 75 1350 630
83
84 screenshots/dcp-tab.pdf: raw-screenshots/dcp-tab.pdf
85         python3 pdf_crop_by.py $< $@ 0 200 1230 30
86
87
88 # For HTML: convert diagrams from SVG to PNG
89 diagrams/%.png: diagrams/%.svg
90         inkscape $< --export-type=png --export-filename=$@ --export-area-drawing
91
92 # For LaTeX/PDF: convert diagrams from SVG to PDF
93 diagrams/%.pdf: diagrams/%.svg
94         inkscape $< --export-type=pdf --export-filename=$@ --export-area-drawing
95
96 config.xml:     ../../src/lib/config.cc config.py
97         python3 config.py ../../src/lib/config.cc > config.xml
98
99 #
100 # HTML
101 #
102
103 html:   $(XML) config.xml dcpomatic-html.xsl extensions-html.ent dcpomatic.css dcpomatic_create.xml dcpomatic_cli.xml dcpomatic_kdm_cli.xml \
104         $(subst .pdf,.png,$(addprefix html/screenshots/,$(SCREENSHOTS))) \
105         $(subst .svg,.png,$(addprefix diagrams/,$(DIAGRAMS))) \
106
107 #       The DocBook needs to know what file extensions to look for
108 #       for screenshots and diagrams; use the correct file to tell it.
109         cp extensions-html.ent extensions.ent
110
111 #       DocBoox -> html
112         xmlto html -m dcpomatic-html.xsl dcpomatic.xml --skip-validation -o html
113
114 #       Copy graphics and CSS in
115         mkdir -p html/diagrams
116         cp diagrams/*.png html/diagrams
117         cp dcpomatic.css html
118
119 #
120 # PDF
121 #
122
123 pdf:    $(XML) config.xml dcpomatic-pdf.xsl extensions-pdf.ent dcpomatic_create.xml dcpomatic_cli.xml dcpomatic_kdm_cli.xml \
124         $(addprefix screenshots/,$(SCREENSHOTS)) \
125         $(subst .svg,.pdf,$(addprefix diagrams/,$(DIAGRAMS)))
126
127 #       The DocBook needs to know what file extensions to look for
128 #       for screenshots and diagrams; use the correct file to tell it.
129         cp extensions-pdf.ent extensions.ent
130
131         mkdir -p pdf
132
133         dblatex -p dcpomatic-pdf.xsl -s dcpomatic.sty -r pptex.py -T native dcpomatic.xml -t pdf -o pdf/dcpomatic.pdf
134
135
136 #
137 # LaTeX (handy for debugging)
138 #
139
140 tex:    $(XML) config.xml dcpomatic-pdf.xsl extensions-pdf.ent
141
142 #       The DocBook needs to know what file extensions to look for
143 #       for screenshots and diagrams; use the correct file to tell it.
144         cp extensions-pdf.ent extensions.ent
145
146         mkdir -p tex
147
148 #       -P <foo> removes the revhistory table
149         dblatex -P doc.collab.show=0 -P latex.output.revhistory=0 -p dcpomatic-pdf.xsl -s dcpomatic.sty -r pptex.py -T native dcpomatic.xml -t tex -o tex/dcpomatic.tex
150
151
152 clean:; rm -rf html pdf diagrams/*.pdf diagrams/*.png graphics/*.png *.aux dcpomatic.cb dcpomatic.cb2 dcpomatic.glo dcpomatic.idx dcpomatic.ilg
153         rm -rf dcpomatic.ind dcpomatic.lof dcpomatic.log dcpomatic.tex dcpomatic.toc extensions.ent dcpomatic.out