@@ -55,10 +55,11 @@ class CompletedEntry(TypedDict, total=False):
5555
5656
5757class TemplateLoader :
58- """Loads YAML template files that control citation field collection .
58+ """Loads YAML template files that provide fallback BibTeX entry types .
5959
60- Templates define which bibliographic fields to collect and how
61- entries are typed (e.g. article, inproceedings).
60+ Templates are used when auto-detection cannot determine the entry type
61+ from metadata. They specify which entry_type (e.g. @article, @book)
62+ to use as a fallback and which fields are expected.
6263 """
6364
6465 def __init__ (self , templates_dir : Optional [str ] = None ):
@@ -84,7 +85,8 @@ def load_template(self, template_name: str) -> Dict[str, Any]:
8485
8586 Returns:
8687 A dictionary describing the template with keys ``name``,
87- ``entry_type``, and ``fields``.
88+ ``entry_type``, and ``fields``. The template provides a
89+ fallback entry type when auto-detection is inconclusive.
8890 """
8991 template_path = os .path .join (self .templates_dir , f"{ template_name } .yaml" )
9092
@@ -110,11 +112,11 @@ def _get_default_template(self) -> Dict[str, Any]:
110112 {'name' : 'title' , 'required' : True },
111113 {'name' : 'journal' , 'required' : True },
112114 {'name' : 'year' , 'required' : True },
113- {'name' : 'volume' , 'required' : False , 'source_priority' : [ 'crossref_api' , 'user_prompt' ] },
114- {'name' : 'number' , 'required' : False , 'source_priority' : [ 'crossref_api' , 'user_prompt' ] },
115- {'name' : 'pages' , 'required' : False , 'source_priority' : [ 'crossref_api' , 'google_scholar_scraper' ] },
116- {'name' : 'publisher' , 'required' : False , 'source_priority' : [ 'crossref_api' , 'user_prompt' ] },
117- {'name' : 'doi' , 'required' : False , 'source_priority' : [ 'crossref_api' ] },
115+ {'name' : 'volume' , 'required' : False },
116+ {'name' : 'number' , 'required' : False },
117+ {'name' : 'pages' , 'required' : False },
118+ {'name' : 'publisher' , 'required' : False },
119+ {'name' : 'doi' , 'required' : False },
118120 ]
119121 }
120122
0 commit comments