shyamd / mkdocs-bibtex

A MkDocs plugin for citation management using bibtex
Other
75 stars 21 forks source link

[feat]: Support for global bibliographies #270

Open thdhondt opened 1 week ago

thdhondt commented 1 week ago

Hello @shyamd!

One feature that would be very useful for my work would be a global and latex-like bibliography. While thinking about this feature, I noted the following:

I gave this project a try and ended up doing a pretty extensive rewrite of the plugin ... I tried to fix the first issue by pre-parsing the files of the documentation in the on_file mkdocs callback. The second issue is handled by introducing different citation formats (footnote, inline, link). The last issue is fixed by having global or per-page bibliography indexes depending on the setting chosen by the user.

I have also changed some of the configuration options of the plugin. The default behavior results in the same output as today:

plugins:
  - bibtex:
      bib_file: "refs.bib"
      cite_format: "footnote"
      bib_type: "per_page"

A global bibliography would be configured this way:

plugins:
  - bibtex:
      bib_file: "refs.bib"
      cite_format: "link"
      bib_type: "global"
      global_bib_ref: "\bibliography.md"

Even though there are quite a lot of changes that should still be made before this can be merged, it is in a mostly functional state. I was curious if you would be interested in taking over some of these changes in the official plugin.

I have not yet updated any of the tests, documentation, etc.