iamcco / markdown-preview.nvim

markdown preview plugin for (neo)vim
MIT License
6.69k stars 277 forks source link

Feature request: citations like pandoc --citeproc #353

Open postylem opened 3 years ago

postylem commented 3 years ago

This is a really great plugin. I love it.

I was hoping it would be able to replace my note-taking workflow which involves writing in pandoc markdown. When editing pandoc markdown files, it sure would be nice to have the ability to use citations from a biblatex file, so that when notes become papers it is easy to organize a bibliography.

Like say I'm editing my file myfile.md, which is

---
title: My Title
bibliography: myfile.bib
reference-section-title: References
---

# Heading
Take a look at this citation: @blachman86.

and that I have a file myfile.bib which is a biblatex file with an entry whose key is blachman68, then running pandoc like pandoc --citeproc log.md -o log.html I get an HTML file with citations, like this:

My Title

Take a look at this citation: Blachman (1968).

References

Blachman, N. 1968. “The Amount of Information That y Gives about x.” IEEE Transactions on Information Theory 14 (1): 27–31.

I wonder whether there is an easy way to integrate this into the plugin. Would it be possible to get it to behave like that?

postylem commented 3 years ago

I think this could be mostly achieved by simply using the markdown-it plugin markdown-it-citations. How easy is that? I don't understand how this project works, but it seems it should be pretty simple, right?

I've never programmed in js, so I don't think I could manage a PR without some help, but would that be basically as simple as adding some code like

import citations from 'markdown-it-citations' // import the plugin
// ...
// this.md
  .use(citations, {
  // citations options
  })

on to this.md in app/pages/index.jsx https://github.com/iamcco/markdown-preview.nvim/blob/e5bfe9b89dc9c2fbd24ed0f0596c85fd0568b143/app/pages/index.jsx#L176 ?

JPK85 commented 2 years ago

I'm just going to drop a bump-comment here xpressing my unwaivering support for this request - love the plugin, just wish it had this one particular feature to boot (although I would shyly add a minor extra wish toward pandoc-crossref).

serranomorante commented 1 year ago

This would be so amazing to have!