Juris-M / citeproc-js-docs

Documentation for citeproc-js
13 stars 14 forks source link

Hyperlinking text in a CSL-specified bibliography #15

Closed dhimmel closed 6 years ago

dhimmel commented 6 years ago

Greetings, I recently created my own CSL specification for a custom bibliography format in https://github.com/greenelab/manubot-rootstock/pull/68. I was not able to exactly achieve the "ideal" bibliographic format I had wanted (as per https://github.com/greenelab/manubot-rootstock/issues/53). One of the main issues is that I was unable to figure out how to hyperlink text in a CSL specification.

For example, I would like to hyperlink title so it links to URL. One may also want to hyperlink DOI so it points to https://doi.org/{DOI}. Is this a supported feature of either CSL or CSL-M? Hyperlinks will be important for bibliographies of the future.

By example, I was able to specify a bibliography that looks like:

Randomization Techniques for Graphs Sami Hanhijärvi, Gemma C. Garriga, Kai Puolamäki Proceedings of the 2009 SIAM International Conference on Data Mining (2009-04-30) https://doi.org/10.1137/1.9781611972795.67

But I want it to instead be like:

Randomization Techniques for Graphs Sami Hanhijärvi, Gemma C. Garriga, Kai Puolamäki Proceedings of the 2009 SIAM International Conference on Data Mining (2009-04-30)

Sorry if this is the wrong place to post this... just let me know the right place if possible.

fbennett commented 6 years ago

If Manubot runs citeproc-js in a custom environment, this is possible. It is not documented, but if I recall correctly the hooks for it are in the source file formats.js.

The best way to illustrate the necessary coding patterns will be a test fixture. I'll take a look later and see if I have one on file.

fbennett commented 6 years ago

(Oh - and it's not possible to produce links with CSL style code alone. You need to hack the processor directly.)

dhimmel commented 6 years ago

If Manubot runs citeproc-js in a custom environment, this is possible.

Ah, Manubot runs pandoc-citeproc in a custom (conda) environment.

it's not possible to produce links with CSL style code alone. You need to hack the processor directly

So it sounds like we'd lose the portability of CSL style code alone if we "hacked the processor". That's too bad.

Is the CSL stype specification set in stone, or is there somewhere I could request adding hyperlinkability.

fbennett commented 6 years ago

Hacking the processor in this case would not impede style portability; you just wouldn't get links in other environments.

I missed that you're using pandoc. This repo is for the citeproc-js docs. You'll need to speak with the pandoc maintainers. Re CSL you can reach everyone via the xbiblio-devel mailing list.