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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

emoji in Rmarkdown #171

Closed
nancym opened this Issue Aug 1, 2017 · 5 comments

Comments

Projects
None yet
3 participants
@nancym
Copy link

nancym commented Aug 1, 2017

If I put this in config.toml:

enableEmoji = true

An emoji like :smile: in a markdown file will be rendered as 馃槃 in the HTML output. Is there anything I can put in _output.yml to get emoji to work in an Rmarkdown file, e.g. something like this:

blogdown::html_page:
  md_extensions: +emoji

Thanks!

@yihui

This comment has been minimized.

Copy link
Member

yihui commented Aug 1, 2017

No, not to my knowledge. However, if you are okay with Blackfriday's Markdown, you will be able to render R Markdown to Markdown instead of HTML after I implement #165. Then emoji will work.

@yihui yihui added this to the v0.1 milestone Aug 10, 2017

@yihui

This comment has been minimized.

Copy link
Member

yihui commented Aug 10, 2017

#165 has been implemented. Please see the documentation about .Rmarkdown files at https://bookdown.org/yihui/blogdown/output-format.html

@yihui yihui closed this Aug 10, 2017

@ProQuestionAsker

This comment has been minimized.

Copy link
Collaborator

ProQuestionAsker commented Nov 16, 2017

Just for clarification, does this mean that emojis can't be rendered in either .Rmd or .Rmarkdown files if the output is like this?

output:
    blogdown::html_page:
        toc:true

And the workaround is to render the output like this

output:
    md_document:
        toc:true

Or to write in a .md document instead of .Rmd or .Rmarkdown?

@yihui

This comment has been minimized.

Copy link
Member

yihui commented Nov 16, 2017

@ProQuestionAsker The life cycles of .Rmd vs .Rmarkdown:

  • .Rmd -> knitr -> .md (intermediate) -> pandoc -> .html
  • .Rmarkdown -> knitr -> .markdown -> Hugo/Blackfriday -> .html

Emoji is a Markdown extension only in Blackfriday. Pandoc does not support it. As a result, you must use .Rmarkdown if you must have emojis.

For TOC in .Rmarkdown, you have to use the Hugo variable .TableOfContents: https://bookdown.org/yihui/blogdown/templates.html#how-to

This won't work in blogdown:

output:
    md_document:
        toc:true

blogdown only supports the output format blogdown::html_page. All other output formats are ignored.

@ProQuestionAsker

This comment has been minimized.

Copy link
Collaborator

ProQuestionAsker commented Nov 16, 2017

Ah, that makes sense. Thank you!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment