Skip to content

style_config

expand_field_spec

expand_field_spec(spec: str) -> List[str]

Split a required/suggested spec into concrete BibTeX field names.

Source code in ures/literature/citation/rules/style_config.py
 92
 93
 94
 95
 96
 97
 98
 99
100
def expand_field_spec(spec: str) -> List[str]:
    """Split a required/suggested spec into concrete BibTeX field names."""
    keys: List[str] = []
    for alternative in str(spec).split("|"):
        for part in alternative.split("+"):
            name = part.strip()
            if name and name not in keys:
                keys.append(name)
    return keys