Git Product home page Git Product logo

Comments (5)

jjallaire avatar jjallaire commented on June 25, 2024 1

Going to close this and create a new issue covering adding more Prism languages.

from distill.

epspi avatar epspi commented on June 25, 2024

Source

https://github.com/rstudio/radix/blob/27b482a21b6cba1c21752abdcd6b55ff5e083218/inst/rmarkdown/templates/radix_article/resources/distill.html#L575

image

Details

The pre element within the d-code block tag is missing for the sql chunk but present for the chunks that render correctly. A child of pre that's supposed to contain the code (code id="code-container") is actually there but

  1. it has nothing in it and
  2. it doesn't carry a language class

image

Results for R

<pre>
    <code id="code-container" class="language-clike">
        data <span class="token operator">&lt;</span>
        <span class="token operator">-</span> iris
    </code>
</pre>

Results for Sql

<code id="code-container"></code>

from distill.

jjallaire avatar jjallaire commented on June 25, 2024

Fixed via rstudio/radix@868669f

Our only option here was to map languages not supported directly by Prism to "clike"

from distill.

dakvid avatar dakvid commented on June 25, 2024

I'm a little confused, apologies if I'm misunderstanding something at some point. :-)

Prism.js supports 152 languages, including R and SQL: https://prismjs.com/#languages-list

However, looking at the source of template/src/components/d-code.js from distill, they only explicitly import python, clike, lua, bash, go, markdown and julia. So this could be fixed "properly" by importing more languages - but is this something that radix could override, or would it need a pull request to distill?

from distill.

jjallaire avatar jjallaire commented on June 25, 2024

We'd have to remove the embedded Prism from Distill then replace it with another implementation. So far we've taken the approach not to fork/edit Distill but it may be that we'll ultimately need to.

from distill.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.