Skip to content
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

"backport" (some) distill features to html_document #1501

Open
maxheld83 opened this issue Dec 17, 2018 · 4 comments
Open

"backport" (some) distill features to html_document #1501

maxheld83 opened this issue Dec 17, 2018 · 4 comments
Labels
feature a feature request or enhancement theme: bootstrap related to bootstrap

Comments

@maxheld83
Copy link
Contributor

I'm a huge fan of the simple rmarkdown websites: no heavy dependencies, no JS weirdness, just plain bootstrap and html.

But I can't help admiring the advanced design of radix, especially the full-width plots and tables.

Radix is great, but it also comes with too much dependencies and too little bootstrappy-flexibility for my taste.

Would there be any interest from the rmarkdown developers to "backport"/"reverse-engineer" some of the radix features (full-width plots) using plain bootstrap?
If so, I'd look into this, but wanted to ask first what a useful angle to contribute might be.

@yihui
Copy link
Member

yihui commented Dec 17, 2018

If you are only looking for full-width elements, they can actually be quite simple with CSS, e.g. (note that this example requires Pandoc 2.x, which has been bundled in RStudio Preview)

---
title: "Full-width plots"
output: html_document
---

```{css, echo=FALSE}
.full-width img {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
}
```

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

::: full-width
```{r, fig.width=15}
par(mar = c(4.2, 4.2, .2, .2))
plot(cars)
```
:::

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

image

I have started to believe the CSS world for Markdown is often seriously bloated, and popular CSS frameworks are often like an overkill in my eyes... Next year I'll spend some time thinking about the possibility of a lightweight CSS framework for Markdown only.

@werkstattcodes

This comment has been minimized.

@maxheld83

This comment has been minimized.

@yihui

This comment has been minimized.

@cderv cderv added theme: bootstrap related to bootstrap Enhancement labels Nov 2, 2020
@cderv cderv added feature a feature request or enhancement and removed enhancement labels Apr 14, 2021
@cderv cderv changed the title "backport" (some) radix features to html_document "backport" (some) distill features to html_document Jan 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement theme: bootstrap related to bootstrap
Projects
Status: Backlog
Development

No branches or pull requests

4 participants