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

Feature request: custom syntax highlighting themes #942

Open
3 tasks done
jefelino opened this issue Sep 4, 2020 · 2 comments
Open
3 tasks done

Feature request: custom syntax highlighting themes #942

jefelino opened this issue Sep 4, 2020 · 2 comments
Labels
feature a feature request or enhancement

Comments

@jefelino
Copy link

jefelino commented Sep 4, 2020

Since version 2.0, pandoc has supported custom syntax highlighting themes, provided in a .theme file which is passed as an argument to --highlight-style (see https://pandoc.org/MANUAL.html#syntax-highlighting). But if I try to provide a custom theme file using the highlight field in my _output.yml file, bookdown halts with this error message:

Error in match.arg(highlight, highlighters()) : 
  'arg' should be one of “default”, “tango”, “pygments”, “kate”, “monochrome”, “espresso”, “zenburn”, “haddock”, “breezedark”
Calls: <Anonymous> ... get_base_format -> do.call -> <Anonymous> -> match.arg
Execution halted

Exited with status 1.

It would be better to allow parameters that include a .theme extension to go through to pandoc.


By filing an issue to this repo, I promise that

  • I have fully read the issue guide at https://yihui.org/issue/.
  • I have provided the necessary information about my issue.
    • If I'm asking a question, I have already asked it on Stack Overflow or RStudio Community, waited for at least 24 hours, and included a link to my question there.
    • If I'm filing a bug report, I have included a minimal, self-contained, and reproducible example, and have also included xfun::session_info('bookdown'). I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version: remotes::install_github('rstudio/bookdown').
    • If I have posted the same issue elsewhere, I have also mentioned it in this issue.
  • I have learned the Github Markdown syntax, and formatted my issue correctly.

I understand that my issue may be closed if I don't fulfill my promises.

@cderv
Copy link
Collaborator

cderv commented Sep 5, 2020

Is this a question specific to bookdown or related to Rmarkdown ?

I believe you can do that in rmarkdown for html_document but only if you use a custom template too (by setting template argument). I think this is by design as the defaut rmarkdown template works well with provided theme.

Anyway, we need more information I think:

  • Which format are you using ?
  • Can you share what you set in _output.yml ?

Thank you !

@cderv
Copy link
Collaborator

cderv commented Mar 30, 2021

This is a limitation of rmarkdown for now. It should be done there first rstudio/rmarkdown#2035

@cderv cderv added the feature a feature request or enhancement label Mar 30, 2021
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