Asked by border control officers, taxi drivers, and friends…
[…] A wealthy businessman who was passing through Radin and took advantage of the opportunity to visit the Rabbi (Chofetz Chaim). He was astounded by the lack of furniture in Rabbi’s home.
Unable to contain himself, he asked, “Where is your furniture?”
Rabbi responded by asking him where was his furniture.
The man, a bit surprised by the question, explained that he was only passing through.
Rabbi smiled and explained that in this world, he too, was only passing through.1
Warren Buffet
???
litedown: https://github.com/yihui/litedown
litedown = min{
knitr + evaluate +
rmarkdown +
bookdown + blogdown + pagedown + xaringan + tufte + distill
} – Pandoc – Bootstrap – jQuery
– GitBook – Hugo – paged.js – remark.js – tufte.css – distill.js/.css – …
+ super lightweight vanilla js/css
Re-implementing 12 years of work from scratch, with fewer features and dependencies2
Easier to develop, install, and manage
Also easier to be embedded in other applications (e.g., WebAssembly)
Choosing a stable foundation to develop software on top of
e.g., base R, commonmark3
Reproducibility would be hard without stability
Almost “feature-complete” in my eyes after a few months’ work (not because I’m smart but limited scope and a decade’s thinking)
Users will surely request for more features, but litedown is unlikely to gain major new features (time is up, pencils down!)
Quick tests for my audience today:
How much fun you have missed without knowing HTML…
Pandoc, the swiss-army knife for converting documents from one format to another: https://pandoc.org (look at that impossible-to-read diagram on the homepage!)
A swiss-army knife?4 I think the Pandoc author is too modest!
litedown re-implemented some Pandoc Markdown features on top of commonmark, but it doesn’t aim at becoming a swiss-army knife (perhaps a laser gun instead?)
Let me show you the “big picture” (pun intended)
['markdown_githubreader', 'htmlwriter', 'markdown_githubreader->htmlwriter'].forEach(title => {
document.querySelectorAll('g > title').forEach(el => {
if (el.innerHTML === title)
el.nextElementSibling.setAttribute('fill', 'yellow');
});
});
Word and PowerPoint are just awkward implementations of HTML, CSS, and web browsers.
<- web browsers | MS Office ->
And you will also realize how awesome web browsers are…
(now cast the spell “go up”, “go down”, “dark mode”, “mirror my slides”, or “reset my slides”)
BTW, did you notice that this slide is actually editable?
# install from CRAN
install.packages('litedown')
# or install the dev version (recommended for now)
install.packages('litedown', repos = c('https://yihui.r-universe.dev', 'https://cloud.r-project.org'))
Core functions: litedown::mark()
to convert plain Markdown documents;
litedown::fuse()
to compile R Markdown documents
The live previewer: litedown::roam()
Markdown syntax
Code chunks and inline code
Extra features via CSS/JS
Literate programming (Knuth, 1984) = documentation language + computing language
A 10-second introduction of R Markdown:
Write _narratives_ in Markdown, and _computer code_ in backticks:
```{r}
mean(rnorm(100))
```
Write **more** code chunks and narratives.
I don’t have enough time showcase all possibilities of litedown, so let me highlight one tiny feature that I came up with when rethinking about literate programming.
---
title: A nice report
abstract: "In this report, we studied `{r, order = -1} nrow(x)` cars."
---
Filter cars with `mpg` above 20.
```{r, order = 1}
x = subset(mtcars, mpg > 20)
```
RIP, Fritz Leisch!
Different people are just trying to make the world better in different ways, and we learn from each other, so thank you, Fritz, and authors of Pandoc, jQuery, Bootstrap, Quarto, …
Special thanks to the great ninja, Jeroen Ooms, for the commonmark package!
Of course, since I’m here, big thanks to Ross Ihaka & Robert Gentleman!
Contact:
Github: https://github.com/yihui
Personal website: https://yihui.org