File tree Expand file tree Collapse file tree
examples/custom_locations Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
2- "version" : " 0.2.0" ,
3- "configurations" : [
4- {
5- "name" : " Debug Examples" ,
6- "type" : " debugpy" ,
7- "request" : " launch" ,
8- "module" : " pdfbaker" ,
9- "args" : [" bake" , " examples/examples.yaml" ],
10- "console" : " integratedTerminal"
11- },
12- {
13- "name" : " Debug Tests" ,
14- "type" : " debugpy" ,
15- "request" : " launch" ,
16- "module" : " pytest" ,
17- "args" : [" -v" , " tests" ],
18- "console" : " integratedTerminal"
19- }
20- ]
21- }
22-
2+ "version" : " 0.2.0" ,
3+ "configurations" : [
4+ {
5+ "name" : " Debug Examples" ,
6+ "type" : " debugpy" ,
7+ "request" : " launch" ,
8+ "module" : " pdfbaker" ,
9+ "args" : [" bake" , " examples/examples.yaml" ],
10+ "console" : " integratedTerminal"
11+ },
12+ {
13+ "name" : " Debug Tests" ,
14+ "type" : " debugpy" ,
15+ "request" : " launch" ,
16+ "module" : " pytest" ,
17+ "args" : [" -v" , " tests" ],
18+ "console" : " integratedTerminal"
19+ }
20+ ]
21+ }
Original file line number Diff line number Diff line change 11{
2- "version" : " 2.0.0" ,
3- "tasks" : [
4- {
5- "label" : " Bake" ,
6- "type" : " shell" ,
7- "command" : " python -m pdfbaker bake ${input:configPath}" ,
8- "group" : " build" ,
9- "presentation" : {
10- "reveal" : " always" ,
11- "panel" : " new"
12- }
13- },
14- {
15- "label" : " Run Tests" ,
16- "type" : " shell" ,
17- "command" : " pytest -v tests" ,
18- "group" : " test" ,
19- "presentation" : {
20- "reveal" : " always" ,
21- "panel" : " new"
22- }
23- },
24- {
25- "label" : " Run Coverage" ,
26- "type" : " shell" ,
27- "command" : " pytest --cov=pdfbaker --cov-report=html" ,
28- "group" : " test" ,
29- "presentation" : {
30- "reveal" : " always" ,
31- "panel" : " new"
32- }
33- },
34- {
35- "label" : " View Coverage" ,
36- "type" : " shell" ,
37- "command" : " python -c \" import webbrowser; webbrowser.open('htmlcov/index.html')\" " ,
38- "presentation" : {
39- "reveal" : " never" ,
40- "panel" : " new"
41- }
42- }
43- ],
44- "inputs" : [
45- {
46- "id" : " configPath" ,
47- "type" : " promptString" ,
48- "description" : " Path to main YAML config file" ,
49- "default" : " examples/examples.yaml"
50- }
51- ]
2+ "version" : " 2.0.0" ,
3+ "tasks" : [
4+ {
5+ "label" : " Bake" ,
6+ "type" : " shell" ,
7+ "command" : " python -m pdfbaker bake ${input:configPath}" ,
8+ "group" : " build" ,
9+ "presentation" : {
10+ "reveal" : " always" ,
11+ "panel" : " new"
12+ }
13+ },
14+ {
15+ "label" : " Run Tests" ,
16+ "type" : " shell" ,
17+ "command" : " pytest -v tests" ,
18+ "group" : " test" ,
19+ "presentation" : {
20+ "reveal" : " always" ,
21+ "panel" : " new"
22+ }
23+ },
24+ {
25+ "label" : " Run Coverage" ,
26+ "type" : " shell" ,
27+ "command" : " pytest --cov=pdfbaker --cov-report=html" ,
28+ "group" : " test" ,
29+ "presentation" : {
30+ "reveal" : " always" ,
31+ "panel" : " new"
32+ }
33+ },
34+ {
35+ "label" : " View Coverage" ,
36+ "type" : " shell" ,
37+ "command" : " python -c \" import webbrowser; webbrowser.open('htmlcov/index.html')\" " ,
38+ "presentation" : {
39+ "reveal" : " never" ,
40+ "panel" : " new"
41+ }
42+ }
43+ ],
44+ "inputs" : [
45+ {
46+ "id" : " configPath" ,
47+ "type" : " promptString" ,
48+ "description" : " Path to main YAML config file" ,
49+ "default" : " examples/examples.yaml"
50+ }
51+ ]
5252}
Original file line number Diff line number Diff line change 11title : " Custom Location Example"
22description : " This page uses custom directory structure"
3- template : " ../other_templates/custom_page.svg.j2"
3+ template : " ../other_templates/custom_page.svg.j2"
Original file line number Diff line number Diff line change 22<svg width =" 210mm" height =" 297mm" viewBox =" 0 0 210 297" version =" 1.1" >
33 <text x =" 105" y =" 50" text-anchor =" middle" font-size =" 20" >{{ title }}</text >
44 <text x =" 105" y =" 80" text-anchor =" middle" font-size =" 14" >{{ description }}</text >
5- </svg >
5+ </svg >
Original file line number Diff line number Diff line change 66 # Path notation - uses custom location
77 - " ../other_pages/custom_page.yaml"
88# Custom images directory name and location
9- images_dir : " ../your_images"
9+ images_dir : " ../your_images"
Original file line number Diff line number Diff line change 11title : " Content Page"
2- description : " This document is located in a nested directory structure, demonstrating how pdfbaker can handle documents located anywhere in your filesystem."
2+ description :
3+ " This document is located in a nested directory structure, demonstrating how pdfbaker
4+ can handle documents located anywhere in your filesystem."
Original file line number Diff line number Diff line change 11title : " Custom Locations Example"
22subtitle : " Mixing conventional and custom locations"
33template : " templates/intro.svg.j2"
4- # Uses conventional location (templates/intro.svg.j2)
4+ # Uses conventional location (templates/intro.svg.j2)
Original file line number Diff line number Diff line change 11title : " Standard Location Example"
22subtitle : " This page uses conventional directory structure"
3- template : " standard_page.svg.j2"
3+ template : " standard_page.svg.j2"
Original file line number Diff line number Diff line change 22<svg width =" 210mm" height =" 297mm" viewBox =" 0 0 210 297" version =" 1.1" >
33 <text x =" 105" y =" 50" text-anchor =" middle" font-size =" 20" >{{ title }}</text >
44 <text x =" 105" y =" 80" text-anchor =" middle" font-size =" 14" >{{ subtitle }}</text >
5- </svg >
5+ </svg >
Original file line number Diff line number Diff line change 1919__all__ = ["PDFBakerPage" ]
2020
2121
22+ # pylint: disable=too-few-public-methods
2223class PDFBakerPage :
2324 """A single page of a document."""
2425
2526 class Configuration (PDFBakerConfiguration ):
2627 """PDFBakerPage configuration."""
28+
2729 def __init__ (
28- self ,
29- base_config : dict [str , Any ],
30- config : Path ,
31- page : "PDFBakerPage" ,
32- ) -> None :
30+ self ,
31+ base_config : dict [str , Any ],
32+ config : Path ,
33+ page : "PDFBakerPage" ,
34+ ) -> None :
3335 """Initialize page configuration (needs a template)."""
3436 self .page = page
3537 # FIXME: config is usually pages/mypage.yaml
You can’t perform that action at this time.
0 commit comments