Sphinx Bibtex Domain

Introduction

A sphinx extension for a bibtex domain.

Adds an entry directive , with accompanying roles, which are used to generate indices for author’s institution’s, journal’s, publisher’s, series, and tag’s.

For an example of this domain in use, see my bibliography.

Installation

To install, run uv add --prerelease=allowed sphinx_bib_domain and sync (prerelease is needed for the dependency on `bibtexparser). Then, in your conf.py:

extensions =  ["sphinx_bib_domain"]

# To enable .bib file parsing:
source_suffix = {".bib": "bibtex"}
# To enable split domain-specific indices:
bib_domain_split_index = True

Split Domain Index Builder

By calling sphinx-build --builder bibhtml, the BibDomainHTMLBuilder will be called to run the build. With bib_domain_split_index = True in the conf.py file, all domain-specific indices (eg: this bib domain) will be built in a similar way to the standard split index of sphinx.

The Bibtex Entry Directive

This is the main piece of this package.

.. bibtex:entry:: a_key
   :title: An Example Entry
   :author: Bob
   :year: 2025
   :tags: example,bibtex
   :url: https://somewhere.com

This will be handled by the BibEntryDirective, producing a description of the entry in a similar format to how sphinx documents python code.

BibtexParser

The BibtexParser uses bibble to parse bibtex and rewrite it to rst, which is then parsed to produce output.

Repo And Issues

The repo can be found here.

If you find a bug, bug me, unsurprisingly, on the issue tracker.