Skip to content

Commit

Permalink
Precompute bibtex string for BibliographyData (#238)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdbenito authored Apr 4, 2024
1 parent 8fce5ca commit e1b4c54
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/mkdocs_bibtex/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ def on_config(self, config):
refs.update(bibdata.entries)

self.bib_data = BibliographyData(entries=refs)
self.bib_data_bibtex = self.bib_data.to_string("bibtex")

# Set CSL from either url or path (or empty)
is_url = validators.url(self.config["csl_file"])
Expand Down Expand Up @@ -130,7 +131,7 @@ def on_page_markdown(self, markdown, page, config, files):
citation_quads,
markdown,
self.csl_file,
self.bib_data.to_string("bibtex"),
self.bib_data_bibtex,
)
else:
markdown = insert_citation_keys(citation_quads, markdown)
Expand Down

0 comments on commit e1b4c54

Please sign in to comment.