1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//! The contracts a card is made of: where its background comes from, how it is drawn, and where cards
//! come from.
use PathBuf;
use async_trait;
use RgbaImage;
use crateCard;
use crateRenderFailed;
/// Resolves to a local image file that gets embedded into the card.
///
/// Every driver returns the same thing, a path on disk, so a flat colour, an Unsplash photo and an
/// AI-generated PNG all travel through one code path.
/// Turns a composed SVG into a raster image.
///
/// The PHP contract takes the path of an SVG file and writes a PNG. The native renderer has no process
/// to hand a file to, so it takes the SVG text and returns the pixels.
/// Maps a collection of content (blog posts, tools, cities) to cards.
///
/// Implement one per kind of content and register it on the provider, or with [`crate::source`] from
/// another package. The generate command walks every source it is given.
///
/// PHP returns an iterable, which can be a generator. Here the source returns the cards it has, and
/// `async` so it can read them from the database.