-
Notifications
You must be signed in to change notification settings - Fork 185
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
Adopting the pandoc-citeproc markdown citation format #2
Comments
@jgm (creator of |
Just found the following in the pandoc docs. Converted to markdown using this cool tool. Citations go inside square brackets and are separated by semicolons. Each citation must have a key, composed of '@' + the citation identifier from the database, and may optionally have a prefix, a locator, and a suffix. The citation key must begin with a letter, digit, or
A minus sign (
You can also write an in-text citation, as follows:
So I think this answers some of our questions about what is valid syntax. Next step will be to see if we can find the regexes to extract (and then replace in our case) the citations. |
One difficulty that we may face is that DOIs can include some prohibited characters, meaning that we can't use identical regex to pandoc-citeproc. |
To be clear: is your goal to allow authors to use |
Exactly, for two reasons:
However, given the weird characters that can be in DOIs and URLs, I'm not sure this will be possible? We could always require using tags for certain problematic IDs. |
Right. So is the first step using the DOI regex to replace all
Is it broken? |
As far as I can tell, the main problem with this whole thing is DOI can include semicolons, while Pandoc citations can't, for obvious reasons. |
@dhimmel thoughts on next steps or division of labor? |
I think the immediate priority is #1. You should go ahead and submit a PR that adds support for As far as this issue, I'm not sure what the best solution is. Here's what I'm thinking. If we're going to change our citation syntax, sooner is better. If you want to pursue this, the next step will be, precisely defining valid citations as a subset of valid pandoc-citeproc citations. We would need to build a regex to match:
In the case of DOIs or URLs that would be invalid pandoc-citeproc citations, these would have to use a tag. It would be helpful to scan all standard citations from the deep review and see what percent are invalid at the moment. URLs ending in We should make sure we think this revised format will be superior. It'll nice to align with pandoc-citeproc, but the semicolons will be mildly annoying. The more versatile reference, e.g. outside of brackets, would be a plus. |
Working on it. Logistical question: if I setup a separate Travis build on my fork to test the changes before creating a PR, then I also need to change things in |
@slochower I wouldn't change any Travis settings for your fork. Your pull request will get built... but not deployed so you won't actually see the PDF / HTML output. Instead you can run |
@tarleb this issue is one of the most important outstanding issues. In short, currently our citation syntax differs from the pandoc citation syntax. We're hoping to more closely adhere to the pandoc syntax, so we can rely more heavily on pandoc's citation features The only additional feature we add on top of pandoc is that raw citations (for example to a DOI like @tarleb, since you seem to know the pandoc codebase, perhaps you could help us with the following question:
The goal here is to extract the citation keys for further processing. We want to mirror the same process pandoc uses to extract these keys. |
My suggestion would be to go the other way: match on DOI URIs, |
Yes. One more thing I'd like to do is enable warnings if something like |
Currently we cite multiple documents like:
Prior to pandoc, this gets converted to:
Then post pandoc conversion, it will look like:
Note how we have to add semicolons to separate each reference. We figured this out at lierdakil/pandoc-crossref#110. It would be nice to align our format with the
pandoc-citeproc
format. This presumably would also allow us to make non-bracketed citations like:This would presumably render to
However, I haven't found the actual docs for the markdown citation formatting supported by
pandoc-citeproc
(docs). Tagging @lierdakil and @slochower in case they have any insights.The text was updated successfully, but these errors were encountered: