{
  "markdown": "# cite2fn\n\nA Claude Code plugin that converts hyperlinked citations, parenthetical references, and inline author-date mentions in Word documents into properly formatted Bluebook footnotes or endnotes.\n\n## The problem\n\nLegal academics and law review authors frequently draft in Google Docs or Word using hyperlinks, author-date parentheticals, and references sections. Journals and publishers require Bluebook citation format with footnotes. Converting a 40-page paper by hand means hours of tedious, error-prone work: looking up each source, formatting it, inserting footnotes, cleaning up the body text, and tracking repeated citations for *supra* and *Id.*\n\n## How it works\n\nDrop a .docx file into Claude Code, and the plugin handles the full conversion:\n\n1. **Scans** the document for every citation — hyperlinks, parentheticals like `(Smith 2023)`, inline references like `Bisbee et al. (2023) found...`, and existing footnotes with bare URLs\n2. **Fetches metadata** from source URLs (title, authors, journal, year) so citations can be formatted correctly\n3. **Resolves internal references** by matching anchor links and parentheticals to a References/Bibliography section\n4. **Formats** each citation in Bluebook 21st edition style\n5. **Inserts** footnotes (or endnotes) into the document\n6. **Cleans up** the body text — removes redundant years, parentheticals, and hyperlink formatting while preserving author names that serve a grammatical role in the sentence\n7. **Applies short forms** — *Id.* for consecutive citations to the same source, *supra* for non-consecutive repeats\n8. **Flags uncertainties** with Word comments so you know exactly what to double-check\n\nThe original file is never modified. You always get a new `_converted.docx`.\n\n## Example use cases\n\n**Law review article drafted in Google Docs.** The author used hyperlinks throughout — clicking \"Sunstein (2024)\" jumps to an entry in the References section, and some citations link directly to SSRN or journal pages. The plugin detects all of these, pulls metadata from the URLs, matches internal anchors to reference entries, and produces a document with Bluebook footnotes ready for editorial review.\n\n**Empirical legal studies paper.** The draft is full of parenthetical citations like `(Angelino et al., 2017)` and inline references like `DellaVigna and Gentzkow (2019) show that...`. There is no References section and no hyperlinks — just plain text. The plugin detects the author-date patterns, flags citations it can't find a source for, and converts the ones it can into properly formatted footnotes.\n\n**Conference paper being adapted for a law journal.** The document has 25+ hyperlinks to arXiv, ACM Digital Library, and IEEE, with some sources cited multiple times. The plugin fetches metadata from each URL, formats the first citation in full Bluebook style, and automatically applies *supra* short forms for repeated sources — turning `Hullman (2025)` into `Hullman, *supra* note 3` on subsequent appearances.\n\n**Existing footnotes that need cleanup.** A draft already has footnotes, but they contain bare URLs or incomplete citations rather than Bluebook formatting. The plugin detects these, fetches metadata from the URLs, and replaces the footnote content with proper Bluebook text.\n\n## Key features\n\n- Detects 5 citation patterns: external hyperlinks, internal anchor links, parentheticals, inline author-date, and existing footnotes\n- Handles split hyperlinks from Google Docs exports (where a single citation spans multiple XML elements)\n- Fetches bibliographic metadata from academic sources (arXiv, SSRN, DOI, ACM DL, and more)\n- Extracts metadata from PDF sources when `pymupdf` is installed\n- Renders proper Bluebook formatting in footnotes — italic titles and small caps journal names\n- Supports both footnotes and endnotes with arabic numeral numbering\n- Preserves author names that are grammatically part of a sentence\n- Tracks repeated sources for *Id.* and *supra* short forms\n- Adds Word comments to flag anything that needs manual attention\n- Removes the References section after its content has been moved to footnotes\n- Interactive review — Claude shows you every citation before modifying the document\n\n## Setup\n\nRequires Python 3.11+.\n\n### As a Claude Code plugin (recommended)\n\nAdd the marketplace and install the plugin:\n\n```\n/plugin marketplace add anitasrinivasan/cite2fn\n/plugin install cite2fn@cite2fn\n```\n\nThen install the Python dependencies (one time):\n\n```bash\npip install python-docx lxml httpx beautifulsoup4\n```\n\nFor PDF metadata extraction (optional):\n\n```bash\npip install pymupdf\n```\n\n### Manual install\n\n```bash\ngit clone https://github.com/anitasrinivasan/cite2fn.git\ncd cite2fn\npip install -e .\n```\n\n## Usage\n\n### As a Claude Code plugin (recommended)\n\nDrop your .docx into the conversation and ask Claude to convert citations to Bluebook footnotes — or invoke the skill directly with `/cite2fn:convert`. Claude walks through the full workflow interactively, flagging uncertain citations and asking for your input before making changes.\n\n### As a CLI\n\nThe library exposes four commands via `python -m cite2fn.cli`:\n\n**Detect citations:**\n```bash\npython -m cite2fn.cli detect paper.docx\n```\n\n**Parse references section:**\n```bash\npython -m cite2fn.cli parse-references paper.docx\n```\n\n**Fetch URL metadata:**\n```bash\npython -m cite2fn.cli fetch-urls urls.json\n```\n\n**Assemble the final document:**\n```bash\npython -m cite2fn.cli assemble paper.docx citations.json -o paper_converted.docx\n```\n\nOptions: `--endnotes` for endnotes instead of footnotes, `--keep-references` to preserve the References section.\n\n## Limitations\n\n- Every output needs human review — Bluebook formatting is not guaranteed to be correct\n- Does not handle documents already in Bluebook footnote style\n- Editorial judgment is still required for whether author names should remain in the body text\n\n## Dependencies\n\n- `python-docx` — reading/writing .docx\n- `lxml` — XML manipulation for footnotes and document internals\n- `httpx` — fetching URLs for metadata\n- `beautifulsoup4` — parsing fetched HTML for metadata extraction\n- `pymupdf` (optional) — PDF metadata extraction for sources that link to PDFs\n",
  "bytes": 6203,
  "sha": "9b2cce4028c44a96f129aa412e301b128ebbd5f7e57e83f680c1d136e79155dd",
  "repo_slug": "anitasrinivasan/cite2fn",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_anitasrinivasan_cite2fn_cite2fn_a2c45e5f/readme"
}