Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jacobgardner/pdfreport-test
https://github.com/jacobgardner/pdfreport-test
Last synced: 11 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/jacobgardner/pdfreport-test
- Owner: jacobgardner
- Created: 2022-03-04T23:41:43.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-08-02T04:02:44.000Z (over 2 years ago)
- Last Synced: 2024-10-27T17:22:56.534Z (about 2 months ago)
- Language: Rust
- Size: 4.15 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PDF Report Generator
This project is organized into a few different pieces.
The root of the project is just the server and cli binary that utilizing the
underlying libraries. These, on their own, are pretty small and only exist (as
of this writing) as two files (`cli.rs` and `server.rs`)The libraries that drive pdf generation can be found in the `crates` directory
with the primary one being `pdf-render`.- prototype-implementation - This does not need to be reviewed. This will be
removed once SVG images are integrated into the PDF generation library.
- optional-merge-derive & merges - These two crates are complementary. They both
work to allow us to define a fully specified structure and apply a macros to
it to allow us to partially specify and merge partially specified structures.This is primarily (read: only) used to support stylesheets in the pdf generation.
i.e. You can specify a style structure:```rust
#[mergeable]
struct SomeStyles {
color: String,
backgroundColor: String,
size: Pt,
}
```
and it will generate a Mergeable and Unmergable version of that struct at:
`SomeStyles::Mergeable` and `SomeStyles::Unmergeable`Where we can do something like:
```rust
let a = SomeStyles::Mergeable {
color: Some("red"),
backgroundColor: Some("pink"),
..Default::default()
}
let b = SomeStyles::Mergeable {
backgroundColor: Some("blue"),
..Default::default()
}
let merged: SomeStyles::Unmergeable = a.merges(b);
```which results in a fully-defined merged struct.
- pdf-render - This is where the bulk of the work happens. Go to the `README.md`
in pdf-render for more details.