nathaneastwood / knitrhooks

Extend {knitr} with hooks
MIT License
33 stars 2 forks source link

output_max_height width incorrect for bookdown #10

Closed nathaneastwood closed 6 years ago

nathaneastwood commented 6 years ago

For bookdown the width of a code block should be 770px not the 910px it currently is. We can check the document type using rmarkdown::metadata. For a normal Rmd document, this will return something like

$ouput
[1] "html_document"

but for a bookdown project, it will return something similar to

$title
[1] “A Minimal Book Example”
$author
[1] “Yihui Xie”
$date
[1] “r Sys.Date()”
$site
[1] “bookdown::bookdown_site”
$documentclass
[1] “book”
$link-citations
[1] TRUE
$description
[1] “This is a minimal example of using the bookdown package to write a book. The output format for this example is bookdown::gitbook.”

So we can target output for Rmd documents and documentclass or site for bookdown.

nathaneastwood commented 6 years ago

This is now fixed in 0996563.