Skip to content

Instantly share code, notes, and snippets.

@paulsharpeY
paulsharpeY / count-and-sort.py
Created June 25, 2021 08:44
Create a bibliography from (R)markdown sorted by in-article citation frequency
#!/usr/bin/env python3
# Create a bibliography from (R)markdown sorted by in-article citation frequency
#
# usage: pandoc -s --bibliography=refs.bib --citeproc foo.Rmd bar.Rmd ... | count-and-sort.py > refs_by_citation_frequency.html
#
# Author: emilianoeheyns
# Details: https://forums.zotero.org/discussion/comment/385929#Comment_385929
import xml.etree.ElementTree as ET