Skip to content

Commit

Permalink
0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
evgenyigumnov committed Apr 25, 2024
1 parent 331e8c7 commit 60a9582
Show file tree
Hide file tree
Showing 6 changed files with 214 additions and 215 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "metatron"
version = "0.2.1"
version = "0.3.0"
edition = "2021"

authors = ["Evgeny Igumnov <[email protected]>"]
Expand All @@ -19,8 +19,8 @@ description = "Metatron library"
anyhow = "1.0.75"
thiserror = "1.0.44"
#shiva = {path = "../shiva/lib"}
shiva = "0.2.3"
serde_yaml = "0.9.34"
shiva = "0.3.0"
kdl = "4.6.0"
serde_json = "1.0.115"
bytes = "1.5.0"

Expand Down
65 changes: 34 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
Cargo.toml
```toml
[dependencies]
metatron = "0.2.1"
metatron = "0.3.0"
```

```rust
Expand All @@ -35,36 +35,39 @@ fn main() {

## How it works

### report-template.yaml
```yaml
title:
- header: $P{company_name} Employee Report
level: 1
page_header:
- text: Confidential information
size: 7
column_header:
- name: Name
width: 30
- name: Age
width: 10
- name: Salary
width: 20
row:
- value: $F(name)
- value: $F(age)
- value: $F(salary)
column_footer:
- value: "Average:"
- value: $P{average_age}
- value: $P{average_salary}
page_footer:
- text: "Tel: +1 123 456 789"
size: 7
summary:
- paragraph:
- text: "Company address: $P{company_address}"
size: 10
### report-template.kdl
```kdl
template {
title {
header level=1 "$P{company_name} Employee Report"
}
page_header {
text size=7 "Confidential information"
}
column_header {
column name="Name" width=30
column name="Age" width=10
column name="Salary" width=20
}
row {
value "$F(name)"
value "$F(age)"
value "$F(salary)"
}
column_footer {
value "Average:"
value "$P{average_age}"
value "$P{average_salary}"
}
page_footer {
text size=7 "Tel: +1 123 456 789"
}
summary {
paragraph {
text size=10 "Company address: $P{company_address}"
}
}
}
```

### report-data.json
Expand Down
31 changes: 31 additions & 0 deletions data/report-template.kdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
template {
title {
header level=1 "$P{company_name} Employee Report"
}
page_header {
text size=7 "Confidential information\n\n"
}
column_header {
column name="Name" width=30
column name="Age" width=10
column name="Salary" width=20
}
row {
value "$F(name)"
value "$F(age)"
value "$F(salary)"
}
column_footer {
value "Average:"
value "$P{average_age}"
value "$P{average_salary}"
}
page_footer {
text size=7 "Tel: +1 123 456 789"
}
summary {
paragraph {
text size=10 "Company address: $P{company_address}"
}
}
}
28 changes: 0 additions & 28 deletions data/report-template.yaml

This file was deleted.

Binary file modified data/report.pdf
Binary file not shown.
Loading

0 comments on commit 60a9582

Please sign in to comment.