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

Provide downlit format wrapper for html or md documents #124

Closed
gadenbuie opened this issue Dec 2, 2021 · 2 comments
Closed

Provide downlit format wrapper for html or md documents #124

gadenbuie opened this issue Dec 2, 2021 · 2 comments

Comments

@gadenbuie
Copy link
Contributor

Currently, since downlit is intended to be used by other packages, it's difficult to apply downlit in situations where the user has less control over the output format (e.g. blogdown, learnr, etc.).

downlit could provide two functions, downlit_html() and downlit_md() that are rmarkdown output formats with a downlit post-processor.

For example, for a standard HTML document with custom options

---
output: 
  html_document:
    toc: true
    df_print: tibble
---

a user could ask for downlit to automatically post-process the output by using a downlit::downlit_html parent output format:

---
output:
  downlit::downlit_html:
    html_document:
      toc: true
      df_print: tibble
---
@cderv
Copy link
Contributor

cderv commented Dec 6, 2021

@gadenbuie original plan was to bring support into html_document directly rstudio/rmarkdown#1881.

There is a proposal rstudio/rmarkdown#1941 which still await some review and probably updates with newer downlit. (We plan to work on rmarkdown this month). There was an issue with bookdown however regarding how the processing is done using xml2.

For now, only distill has integrated support for highlighting using a knitr hook.

Having a wrapper format is another interesting option - offering integration is usual format seems best however. What do you think ?

@cderv
Copy link
Contributor

cderv commented Jan 14, 2022

@gadenbuie Support has been added in html_document() in rstudio/rmarkdown#1941 using highlight_downlit: TRUE in YAML.

For github_document() or md_document, this is a bit different as highlighting won't be useful. I have opened rstudio/rmarkdown#2284 to track and discuss.

@hadley hadley closed this as completed Jun 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants