Skip to content

Commit aeee114

Browse files
committed
docs: improve configuration reference, add section on custom locations
1 parent f8dc25c commit aeee114

1 file changed

Lines changed: 31 additions & 4 deletions

File tree

docs/configuration.md

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@ project/
88
├── kiwipycon.yaml # Main configuration
99
├── material_specs/ # A document
1010
│ ├── config.yaml # Document configuration
11-
│ ├── images/ # Images
12-
│ ├── pages/ # Page configurations
13-
│ └── templates/ # SVG templates
11+
│ ├── images/ # The document's images
12+
│ ├── pages/ # The document's pages
13+
│ │ ├── cover.yaml # Page configuration
14+
│ │ └── main.yaml # Page configuration
15+
│ └── templates/ # The document's templates
16+
│ └── page.svg.j2 # A template
1417
└── prospectus/ # Another document
1518
├── config.yaml
1619
├── images/
@@ -68,7 +71,7 @@ theme:
6871
normal: "12pt"
6972
small: "10pt"
7073

71-
compress_pdf: false
74+
compress_pdf: true
7275
svg2pdf_backend: inkscape
7376

7477
# Custom settings available to all documents:
@@ -256,3 +259,27 @@ def process_document(document: Document) -> None:
256259

257260
See [the custom_processing example](../examples/custom_processing) for an implementation
258261
that insert the latest XKCD comic into your PDF.
262+
263+
### Custom Locations
264+
265+
The above `directories` settings work out of the box, and expect your files to follow a
266+
simple naming convention.
267+
268+
- You may not like these locations
269+
- You may already have images sitting elsewhere and want to avoid multiple copies
270+
- You want to create a document PDF in a webserver directory for people to download
271+
272+
You can customize all directories / file locations, even on a per-document basis:
273+
274+
```yaml
275+
# Document configuration
276+
filename: Monthly Report
277+
directories:
278+
- images: "../../images"
279+
- dist: "/var/www/documents"
280+
pages:
281+
- main
282+
```
283+
284+
See [the custom_locations example](../examples/custom_locations) for an implementation
285+
that goes off the default path.

0 commit comments

Comments
 (0)