Replies: 1 comment 4 replies
-
I had a random idea to use citeproc-js from a component to render citations on the page, together with a custom theme/stylesheet that would print the page (directly from the browser) in a format acceptable for submission to a journal. Would a component avoid "plunking a lot of js into the markdown" - ie be a way to reuse javascript logic to correctly format? |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm loving using using this for making interactive tutorials for teaching, but the lack of support for pandoc-style citatons+bibtex was a bit of a pain point at first. Simply running pandoc on the file doesn't work for two big reasons:
I have dealt with this myself by writing a short/hacky R script (below) that uses pandoc to process the MD file w/the citations in it and spits out a commonmark-formatted file that has the citations formatted as HTML in the text and then copies over the yaml header from the original file and prepends it to the output:
Right now I have this automated using
chokidar
(in a script calledcitewatch.sh
to watch the raw source directory):And I modified the
npm run dev
command inpackage.json
to start both this script and the preview server at the same time usingconcurrently
:This all works pretty well, but it would be nice to have it work more seamlessly in framework if possible, particularly so that the processing of the citations could happen somewhere along the buildchain from
docs
directory rather than doing what I have done, which is writing the processed file intodocs
to trigger the dev server to run/reload.I know there is a pandoc plugin for node (https://github.com/eshinn/node-pandoc) but it is a big aged at this point, and the pandoc citation solutions for markdown-it are also somewhat limited. I looked at
citation-js
but it involved plunking a lot of js into the markdown and also live-rendering citations, which I didn't need.In any event, having this be part of the package for framework would, I think, really increase its uptake w/academic types and make it a nice alternative to quarto for making slick, data-driven interactives.
Beta Was this translation helpful? Give feedback.
All reactions