Skip to content

Commit

Permalink
issue #357 typst notes (#359)
Browse files Browse the repository at this point in the history
* issue 357: typst notes

* test
  • Loading branch information
vincentarelbundock authored Oct 11, 2024
1 parent cf5f3bf commit 92ec2fd
Show file tree
Hide file tree
Showing 22 changed files with 37 additions and 20 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Package: tinytable
Type: Package
Title: Simple and Configurable Tables in 'HTML', 'LaTeX', 'Markdown', 'Word', 'PNG', 'PDF', and 'Typst' Formats
Description: Create highly customized tables with this simple and dependency-free package. Data frames can be converted to 'HTML', 'LaTeX', 'Markdown', 'Word', 'PNG', 'PDF', or 'Typst' tables. The user interface is minimalist and easy to learn. The syntax is concise. 'HTML' tables can be customized using the flexible 'Bootstrap' framework, and 'LaTeX' code with the 'tabularray' package.
Version: 0.5.0
Version: 0.5.0.1
Imports:
methods
Depends:
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# News

## Development

Bugs:

* Typst notes returned an error since the last release. Thanks to @DominikVogel for report #357.

## 0.5.0

New:
Expand Down
3 changes: 1 addition & 2 deletions inst/templates/typst.typ
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ block[ // start block

// tinytable cell content after


// tinytable footer before
// tinytable footer after

) // end table

Expand Down
2 changes: 1 addition & 1 deletion inst/tinytest/_tinysnapshot/group_tt-3level.typ
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ table.cell(stroke: (bottom: .05em + black), colspan: 2, align: center)[c],table.
[21.0], [6], [160], [110], [3.90],
[22.8], [4], [108], [ 93], [3.85],

// tinytable footer before
// tinytable footer after

) // end table

Expand Down
2 changes: 1 addition & 1 deletion inst/tinytest/_tinysnapshot/group_tt-issue258_01_typst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ table.cell(colspan: 5)[hello],
[4.6], [3.1], [1.5], [0.2], [setosa],
[5.0], [3.6], [1.4], [0.2], [setosa],
[5.4], [3.9], [1.7], [0.4], [setosa],
// tinytable footer before
// tinytable footer after
) // end table

]) // end align
Expand Down
2 changes: 1 addition & 1 deletion inst/tinytest/_tinysnapshot/group_tt-issue258_02_typst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ table.cell(colspan: 5)[world],
[4.6], [3.1], [1.5], [0.2], [setosa],
[5.0], [3.6], [1.4], [0.2], [setosa],
[5.4], [3.9], [1.7], [0.4], [setosa],
// tinytable footer before
// tinytable footer after
) // end table

]) // end align
Expand Down
2 changes: 1 addition & 1 deletion inst/tinytest/_tinysnapshot/tibble-typst_pillar_num.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ table.hline(y: 0, start: 0, end: 3, stroke: 0.1em + black),
[1000.], [1000. ], [1000.5],
[1100.], [1100. ], [1100.5],

// tinytable footer before
// tinytable footer after

) // end table

Expand Down
2 changes: 1 addition & 1 deletion inst/tinytest/_tinysnapshot/typst-complicated.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ table.hline(y: 0, start: 0, end: 5, stroke: 0.1em + black),
[22.8], [4], [108], [ 93], [3.85],
[21.4], [6], [258], [110], [3.08],

// tinytable footer before
// tinytable footer after

) // end table

Expand Down
2 changes: 1 addition & 1 deletion inst/tinytest/_tinysnapshot/typst-font_size.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ table.hline(y: 0, start: 0, end: 5, stroke: 0.1em + black),
[22.8], [4], [108], [ 93], [3.85],
[21.4], [6], [258], [110], [3.08],

// tinytable footer before
// tinytable footer after

) // end table

Expand Down
2 changes: 1 addition & 1 deletion inst/tinytest/_tinysnapshot/typst-formatting.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ table.hline(y: 0, start: 0, end: 4, stroke: 0.1em + black),
[201399], [201.4 ], [1970-08-21], [True ],
[100188], [ 0.13], [1970-07-18], [False],

// tinytable footer before
// tinytable footer after

) // end table

Expand Down
2 changes: 1 addition & 1 deletion inst/tinytest/_tinysnapshot/typst-grid.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ block[ // start block
[22.8], [4], [108], [ 93], [3.85],
[21.4], [6], [258], [110], [3.08],

// tinytable footer before
// tinytable footer after

) // end table

Expand Down
2 changes: 1 addition & 1 deletion inst/tinytest/_tinysnapshot/typst-group_rows.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ table.cell(colspan: 8)[They love tofu],
[14.3], [8], [360.0], [245], [3.21], [3.570], [15.84], [0],
[24.4], [4], [146.7], [ 62], [3.69], [3.190], [20.00], [1],
[22.8], [4], [140.8], [ 95], [3.92], [3.150], [22.90], [1],
// tinytable footer before
// tinytable footer after
) // end table

]) // end align
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ table.cell(colspan: 5)[Brie],
[24.4], [4], [146.7], [ 62], [3.69],
[22.8], [4], [140.8], [ 95], [3.92],
[19.2], [6], [167.6], [123], [3.92],
// tinytable footer before
// tinytable footer after
) // end table

]) // end align
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ table.cell(colspan: 8)[They love tofu],
[14.3], [8], [360.0], [245], [3.21], [3.570], [15.84], [0],
[24.4], [4], [146.7], [ 62], [3.69], [3.190], [20.00], [1],
[22.8], [4], [140.8], [ 95], [3.92], [3.150], [22.90], [1],
// tinytable footer before
// tinytable footer after
) // end table

]) // end align
Expand Down
2 changes: 1 addition & 1 deletion inst/tinytest/_tinysnapshot/typst-italic_markdown.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ table.hline(y: 0, start: 0, end: 1, stroke: 0.1em + black),
// tinytable cell content after
[This is _italic_ text.],

// tinytable footer before
// tinytable footer after

) // end table

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ table.hline(y: 0, start: 0, end: 2, stroke: 0.1em + black),
[ 1], [-],
[ 2], [ 5],

// tinytable footer before
// tinytable footer after

) // end table

Expand Down
2 changes: 1 addition & 1 deletion inst/tinytest/_tinysnapshot/typst-more_formatting.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ table.hline(y: 0, start: 0, end: 3, stroke: 0.1em + black),
[Food: Tofu], [ 0.146], [29M],
[Food: Beans], [ 0.003], [94K],

// tinytable footer before
// tinytable footer after

) // end table

Expand Down
2 changes: 1 addition & 1 deletion inst/tinytest/_tinysnapshot/typst-no_headers.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ table.hline(y: 1, start: 0, end: 5, stroke: 0.1em + black),
[22.8], [4], [108], [ 93], [3.85],
[21.4], [6], [258], [110], [3.08],

// tinytable footer before
// tinytable footer after

) // end table

Expand Down
2 changes: 1 addition & 1 deletion inst/tinytest/_tinysnapshot/typst-significant_cell.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ table.hline(y: 0, start: 0, end: 1, stroke: 0.1em + black),
[0.00012],
[12],

// tinytable footer before
// tinytable footer after

) // end table

Expand Down
2 changes: 1 addition & 1 deletion inst/tinytest/_tinysnapshot/typst-striped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ table.hline(y: 0, start: 0, end: 5, stroke: 0.1em + black),
[22.8], [4], [108], [ 93], [3.85],
[21.4], [6], [258], [110], [3.08],

// tinytable footer before
// tinytable footer after

) // end table

Expand Down
5 changes: 5 additions & 0 deletions inst/tinytest/test-typst.R
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ expect_snapshot_print(tab, label = "typst-issue323_group_tt_style_tt")



# Issue #357
tab <- tt(head(iris), notes = "blah") |> save_tt("typst")
expect_true(grepl('blah', tab))


options(tinytable_print_output = NULL)


7 changes: 7 additions & 0 deletions sandbox/typst.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,10 @@ tt(head(iris)) |> group_tt(i = list("hello" = 1))
# issue #259 02
tt(head(iris)) |> group_tt(i = list("hello" = 2, "world" = 2))
```


```{r}
# issue #357
tt(head(iris), notes = "blah")
```

0 comments on commit 92ec2fd

Please sign in to comment.