Skip to content

Instantly share code, notes, and snippets.

@alanzchen
alanzchen / convert.py
Created September 1, 2021 23:03
Convert Word with Zotero citation to Markdown. Step 1: https://www.zotero.org/support/kb/moving_documents_between_word_processors Step 2: Convert the docx to Markdown via pandoc with "--wrap=none". Step 3: Use this script to process the markdown file.
#!/usr/bin/env python3
import sqlite3
import re
import json
import argparse
def convert(db, filename):
con = sqlite3.connect(db)
cur = con.cursor()
with open(filename, "r") as f: