-
Notifications
You must be signed in to change notification settings - Fork 1k
use litedown for rendering vignettes #6583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6583 +/- ##
==========================================
- Coverage 98.97% 98.97% -0.01%
==========================================
Files 87 87
Lines 16741 16739 -2
==========================================
- Hits 16569 16567 -2
Misses 172 172 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
This PR is on hold until current GH version of |
|
Earmark: after #6589, if {knitr} is not in |
|
NB: After #6618, we'll also want to check this issue whether it should be included, or left as a TODO: yihui/litedown#67 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NB: After #6618, we'll also want to check this issue whether it should be included, or left as a TODO: yihui/litedown#67
It's safe to use litedown:::.env$input with the current CRAN version of litedown. The next CRAN release should take place in a few weeks, and you'll be able to use litedown::get_context('input').
Co-authored-by: Yihui Xie <xie@yihui.name>
|
Sorry I meant to push a sub-branch to merge but instead forget to switch and pushed the commit directly. |
|
xfun is fixed on CRAN so we could proceed with this issue, isn't it? @ben-schwen |
Yes. Only blocker, I'm aware of now is that |
Since we register a method for knitr::knit_print, keep it mentioned in the DESCRIPTION.
As with knit_print, avoid printing x when !shouldPrint(x). Use the overloaded method in the vignettes instead of relying on the auto-printing detection in print.data.table.
|
This can be solved similarly to #6589, except that methods for library(data.table)
library(xfun)
x <- data.table(a = 1)
xfun::record('x[,a:=1]') |> print(browse = FALSE)
# x[,a:=1]
#
# #> a
# #> <num>
# #> 1: 1
#
.S3method(
'record_print', 'data.table',
\(x, ...) if (!shouldPrint(x)) character() else NextMethod()
)
xfun::record('x[,a:=1]') |> print(browse = FALSE)
# x[,a:=1]
#
xfun::record('x[,a:=1][]') |> print(browse = FALSE)
# x[,a:=1][]
#
# #> a
# #> <num>
# #> 1: 1
# Additionally, inline expressions of the form ...and with At some point we'll need to transition the translated vignettes too, right? |
aitap
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In datatable-intro.Rmd, by-group j-expressions that call print() render like:
DT[, print(.SD), by = ID]# a b c # <int> <int> <int> # 1: 1 7 13 # 2: 2 8 14 # 3: 3 9 15 # a b c # <int> <int> <int> # 1: 4 10 16 # 2: 5 11 17 # a b c # <int> <int> <int> # 1: 6 12 18
ID
I wonder where is the last ID coming from.
I couldn't make the
`some text `r expression(...)`` syntax work in Litedown and wrote a replacement function for datatable-intro.Rmd.
In datatable-reference-semantics.Rmd, the CSS class syntax #### {.bs-callout .bs-callout-info} does not work; it produces a level-4 heading titled {.bs-callout .bs-callout-info} instead.
|
NB: please |
|
Unfortunately, |
|
Per the {litedown} README, {litedown} itself is supposed to do the site rendering, right? Otherwise, we should ask the {pkgdown} maintainers to support {litedown} rendering; IINM, the issue is that {pkgdown} relies on {rmarkdown} to render: https://github.com/r-lib/pkgdown/blob/824ab4a4f20ecd895282b434d8652120e1f62ba4/R/build-article.R#L294 |
|
It does support basic website. pkgdown could support it anyway, but not sure if and how fast that will happen. |
|
comparing the results of html vignette generation with knitr and litedown on "data-table-joins.Rmd" : knitr/litedown diff screenshot section 7.2: litedown resulting file to follow the comments: My Windows environment : R version 4.0.2 (2020-06-22) -- "Taking Off Again" installation from CRAN source packages : ‘commonmark’, ‘xfun’, ‘litedown’ URL 'https://pbil.univ-lyon1.fr/CRAN/src/contrib/commonmark_2.0.0.tar.gz' |
This may be as well interesting for @yihui |
|
I have exchanged the knitr mock with an litedown mock, however, currently it only prints with the comment char via |
hi, @ben-schwen can you please attach the generated .html to follow evolution. Thanks. |
|
Some requirements when retrying with litedown : (1) Rstudio and knit button generates : (2) so needed to add a line knit: litedown:::knit in the source yaml document to be compatible with knit (3) the links to the translated vignettes FR RU .... are still missing in the HTML document due to line : (4) once html was generated, a new working directory is created each time in ./vignettes and remains empty needing its manual delete : (5) loaded document: |
ChristianWia
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my review completed.

Closes #6394
Towards #6584