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

Support downlit for syntax highlighting #535

Open
4 of 5 tasks
petrbouchal opened this issue Dec 16, 2020 · 3 comments
Open
4 of 5 tasks

Support downlit for syntax highlighting #535

petrbouchal opened this issue Dec 16, 2020 · 3 comments
Assignees
Labels
feature a feature request or enhancement

Comments

@petrbouchal
Copy link

With the recent developments in blogdown, one area where a difference remains between {hugodown} and {distill} on one side and {blogdown} on the other is syntax highlighting.

The approach taken by {distill} and {hugodown} via {downlit} seems to me quite effective - in terms of ease of setup as well as output (esp. linking and better sensitivity to R-specific syntax). A useful way of implementing presumably would be to allow opting in or out (depending on what a safe default is) to accommodate those using other syntax highlighting tools.

I haven't seen this discussed anywhere with respect to {blogdown}, so: would a {downlit} integration in {blogdown} be feasible and is it perhaps being considered? (I noticed syntax highlighting mentioned briefly under the v0.21 wishlist but no followup there.)

Checklist

When filing a feature request, please check the boxes below to confirm that you have provided us with the information we need. Have you:

  • searched for an existing feature request to avoid creating duplicate requests? If you find an existing feature request, please give it a thumbs-up reaction, as we'll use these reactions to help prioritize the implementation of these features in the future.

  • provided a clear and concise description of the problem this proposed feature would address? For example, I struggle to do [...] with blogdown.

  • provided a clear and concise description of what you want to happen?

  • provided a clear and concise description of alternative solutions or workarounds you've considered?

  • added any other context or screenshots about your feature request?

@petrbouchal petrbouchal added the feature a feature request or enhancement label Dec 16, 2020
@petrbouchal petrbouchal changed the title Support downlit Support downlit for syntax highlighting Dec 16, 2020
@yihui
Copy link
Member

yihui commented Dec 18, 2020

This might become possible after the upstream support rstudio/rmarkdown#1941 (I haven't looked at the PR yet, so I'm not totally sure).

@cderv
Copy link
Collaborator

cderv commented Dec 18, 2020

I'll take it into account.

blogdown support would require more work because of the different formats .Rmd and .Rmarkdown but I see how we could do. Not sure the rmarkdown PR alone would be enough but I'll check it.

@cderv cderv self-assigned this Dec 18, 2020
@wjakethompson
Copy link

+1 for downlit support in blogdown. This would be especially helpful when writing about packages that have custom print methods. For example, see here, where color palettes have a special print method that display the color with the hex code. But when used in blogdown, the custom printing breaks (see here).

Maybe r-lib/pkgdown#1556 is helpful, which solved this issue in pkgdown?

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

4 participants