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

dt-code not highlighting OCaml code #129

Open
Isweet opened this issue Sep 10, 2020 · 0 comments
Open

dt-code not highlighting OCaml code #129

Isweet opened this issue Sep 10, 2020 · 0 comments

Comments

@Isweet
Copy link

Isweet commented Sep 10, 2020

Hey,

I'm just playing around with Distill for the first time. I use OCaml quite a bit and figured I would try out a code block. Here's the source:

<!doctype html>
<meta charset="utf-8">
<script src="https://distill.pub/template.v1.js"></script>

<script type="text/front-matter">
  title: "Article Title"
  description: "Description of the post"
  authors:
  - Chris Olah: http://colah.github.io
  - Shan Carter: http://shancarter.com
  affiliations:
  - Google Brain: http://g.co/brain
  - Google Brain: http://g.co/brain
</script>

<dt-article>
  <h1>Hello World</h1>
  <h2>A description of the article</h2>
  <dt-byline></dt-byline>
  <p>This is the first paragraph of the article.</p>
  <p>We can also cite <dt-cite key="gregor2015draw"></dt-cite> external publications.</p>

  <dt-code block language="ocaml">
    42
  </dt-code>
</dt-article>

<dt-appendix>
</dt-appendix>

<script type="text/bibliography">
  @article{gregor2015draw,
    title={DRAW: A recurrent neural network for image generation},
    author={Gregor, Karol and Danihelka, Ivo and Graves, Alex and Rezende, Danilo Jimenez and Wierstra, Daan},
    journal={arXivreprint arXiv:1502.04623},
    year={2015},
    url={https://arxiv.org/pdf/1502.04623.pdf}
  }
</script>

This is is exactly the example from the Distill guide except that I have added:

  <dt-code block language="ocaml">
    42
  </dt-code>

inside the <dt-article>. I dug around the repo here and found https://github.com/distillpub/template/blob/b854bd0124911e1be4744e472b67832e3251b96c/src/transforms/code.js which appears to use Prism under the hood. My understanding is that Prism supports OCaml. I expected the rendering to look like:

Screen Shot 2020-09-09 at 8 31 15 PM

but instead I am getting:

Screen Shot 2020-09-09 at 8 31 41 PM

Please let me know if you need more information, or if this is a Prism issue and I should open an issue there instead.

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

1 participant