From 602c3ecc176d248fcd1a7852880b1c45b5e3870f Mon Sep 17 00:00:00 2001 From: Miguel de Benito Delgado Date: Thu, 4 Apr 2024 06:39:09 +0200 Subject: [PATCH] Cache pandoc-citekey (#239) --- src/mkdocs_bibtex/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mkdocs_bibtex/utils.py b/src/mkdocs_bibtex/utils.py index 2476af4..446a54b 100644 --- a/src/mkdocs_bibtex/utils.py +++ b/src/mkdocs_bibtex/utils.py @@ -3,6 +3,7 @@ import requests import tempfile from collections import OrderedDict +from functools import lru_cache from itertools import groupby from pathlib import Path @@ -100,6 +101,7 @@ def _convert_pandoc_new(bibtex_string, csl_path): return citation.strip() +@lru_cache(maxsize=1024) def _convert_pandoc_citekey(bibtex_string, csl_path, fullcite): """ Uses pandoc to convert a markdown citation key reference