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

Implementation of Aside Tags in html_document2 #1069

Open
GitHunter0 opened this issue Jan 29, 2021 · 5 comments
Open

Implementation of Aside Tags in html_document2 #1069

GitHunter0 opened this issue Jan 29, 2021 · 5 comments
Labels
feature a feature request or enhancement

Comments

@GitHunter0
Copy link

GitHunter0 commented Jan 29, 2021

Hi folks,

I know it is implemented in tufte_handout2 but is it possible to also implement aside tags in html_document2, pdf_document2 and word_document2 ?

If not, is there a current hacky way to do that?

It is a really useful feature and I think it would be amazing to have this available in as many formats as possible.

Thanks a lot

@cderv
Copy link
Collaborator

cderv commented Jan 29, 2021

Currently this feature is available in distill, and also in tufte

You have bookdown::tufte_html2 format you can use to have cross reference and numbering in tufte format.

Using the same with base_format argument (documented here, you may be able to have the same with distill.

Did you try already to use something like this

---
title: test
output: 
  bookdown::html_document2: 
    base_format: distill::distill_article
--- 

# A header

Some content in the test

<aside>
This content will appear in the gutter of the article.
</aside>

This should get you the format of distill but having access to some of the bookdown features.

Would it work for you need ?

@GitHunter0
Copy link
Author

@cderv , This is great man, cool to know we can do that.

The downside is that the features numbered sections and float toc are lost in this format.

Any way to circumvent that?

@cderv
Copy link
Collaborator

cderv commented Feb 1, 2021

Unfortunately, not all features of all formats are duplicated in each format. That is what make each format interesting.

Currently distill does not support number_sections (rstudio/distill#56) and already offers a floating toc, but not the same as in html_document because it is not the same template and CSS.

tufte supports numbered sections (number_sections: true) and has a TOC (toc: true) but from its own template too.

Each format is a template HTML with JS and CSS dependencies to implement some features (like floating toc, aside divs, ...), so if nothing suits you it would require adding custom template with CSS and JS to have a specific format.

bookdown::html_document2 is based on rmarkdown::html_document so supporting aside environment would need to be added in this format but for now that is not the plan as distill as this feature.

I'll leave this open as a feature request for now.

@GitHunter0
Copy link
Author

Cool, got it, thank you very much for the info and feedback, @cderv

@cderv cderv added feature a feature request or enhancement and removed enhancement labels Mar 15, 2021
@cderv
Copy link
Collaborator

cderv commented Mar 31, 2021

Related to #1054

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
Projects
None yet
Development

No branches or pull requests

2 participants