Skip to content

Commit

Permalink
fixing width
Browse files Browse the repository at this point in the history
  • Loading branch information
kartikeya committed Sep 19, 2023
1 parent bac9567 commit 6174853
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions R/Renderer.R
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ Renderer <- R6::R6Class( # nolint: object_name_linter.
ft <- flextable::fontsize(ft, size = 8, part = 'body')
ft <- flextable::bg(x = ft,bg = 'lightgrey')
ft <- flextable::border_outer(ft)
if(flextable_dim(ft)$widths > 10) {
ft <- width(ft, width = 10)
}
ft
}"
} else {
Expand Down Expand Up @@ -137,21 +140,22 @@ Renderer <- R6::R6Class( # nolint: object_name_linter.
params <- lapply(params, function(l) if (is.character(l)) shQuote(l) else l)
block_content <- block$get_content()
if(report_type == "powerpoint_presentation") {
block_content_lst <- split_text_into_blocks(block_content, 10)
block_content_lst <- split_text_into_blocks(block_content, 30)
paste(
unlist(
lapply(seq_along(block_content_lst), function(b) {
browser()
sprintf(
"\n```{r, echo=FALSE}\ncode_block(data.frame(\n'%s'))\n```\n",
block_content_lst[[b]]
"### \n\n```{r, echo=FALSE}\ncode_block(data.frame(\n%s))\n```\n",
shQuote(block_content_lst[[b]])
)
})
),
collapse = "\n\n"
)
} else {
sprintf(
"\n```{r, %s}\n%s\n```\n",
"### \n\n```{r, %s}\n%s\n```\n",
paste(names(params), params, sep = "=", collapse = ", "),
block_content
)
Expand Down

0 comments on commit 6174853

Please sign in to comment.