-
Notifications
You must be signed in to change notification settings - Fork 4
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
Feature: clickable references to bibliography entry #3
Comments
Would really like to see this. I understand the difficulty when multiple citations are used. |
Thanks for the comment. Could you tell me a bit more about your use case and what you mean by "single citation"? |
Sure! I'm using this along with vitepress to create a nice github pages website for an ISA Reference (basically a language reference for a specific flavor of assembly). I have references to academic papers within the document, and want them to be familiar to users (so, IEEE style documentation). So, basically, if I write something like Here we reference the excellent work by John Doe [@doe-2024]. Which right now appears as
(In the default apa-csl, I think it appears like (Doe, J 2024) or something..) I would like to be able to have readers click the citation number to jump to the entry in the bibliography. So it would appear like
[1] Doe, John "An Excellent Title", 2024 This requires inserting an anchor before wherever the entry occurs in the bibliography. As for single citation, what I mean is when there is only one citation in the list (like in my example). That is opposed to the multiple citations form supported by this extension (which may be difficult to do, I'm not sure) |
Thanks for your detailed description. It could be that That being said, clickable references to sources and back, is an interesting feature regardless of chosen style. I'll look at this once I have some more time. |
Thanks! I was going to open a separate issue for that so as to not go off topic here, but I wanted to see if I could figure it out first. I'm guessing that the library citeproc is difficult to use, and this makes adding anchors and hyperrefs to the citations it returns non trivial? |
Indeed, we are just dumping the contents returned by its makeBibliography function. Unless there is a way to configure that function and supply it with custom IDs for anchoring, we need to build our own. This costs some time, but allows for customization. |
I have created a PR with the following (breaking) changes:
This will introduce a new major version. For multiple citation items, it will link to the first listed item. |
At a minimum, this requires wrapping citations in
<a>
tags in the renderer.Challenges
A solution needs to be designed for supporting multiple citation items in a single citation.
How much control does citeproc-js give us? Is this feasible while supporting every possible CSL style and locale?
It would be nice if the anchors could go both ways.
Future changes, out of scope for now
Support namespaces to make it possible to have links to multiple bibliographies per document.
This comes in handy when multiple MD-pages are rendered on the same HTML page (i.e. with SSG or paged media).
Note: multiple bibliographies are possible, see: #6 Not namespaced but order-based.
The text was updated successfully, but these errors were encountered: