- Common Lisp 99.1%
- TeX 0.9%
Common Lisp bindings for btparse (1)
btparse is the underlying C library used by both bibtex and biber to parse .bib files, thus using it directly is the easiest way to get a compatible bib(la)tex parser. The aim of this library is to provide a convenient interface to take advantage of btparse from Common Lisp.
Compatibility
Tested against current versions of:
- SBCL
- ECL*
- CCL
- CLISP
*: ECL support is currently depending on a workaround for an issue with cffi (see here and here). All tests pass but there might be some unexpected behaviour hidden somewhere.
Dependencies
- System:
- btparse (usually distributed as part of perl::text::bibtex).
- Lisp:
API
Main entry point is process-file. The internal API follows what is documented
in btparse (1). Currently exposed functionality roughly corresponds to
bt_traverse (1) and bt_split_names (1).
Exported symbols
- cl-btparse
- custom API
process-file: call a function on all entries in a file.parse-entry: parse entry into alist.traverse-entry-fields: return alist of entry fields
- bt_input (1)
with-ast-from-string: wrapper aroundbt_parse_entry_string.with-ast-from-file: wrapper aroundbt_parse_file.
- bt_traverse (1)
entry-typeentry-key
- bt_split_names (1)
bt-name(struct type)split-name-listsplit-name
- bt_misc (1)
purify-stringchange-case
- custom API
- cl-btparse/biber: BibLaTex extension, aiming for biber compatibility
xname-p: check if a string is in biblatex extended name formatparse-xname: parse biblatex extended namebt-xname(struct type)
For documentation consult the man pages and docstrings.
TODO
- Handle parser/string options
- implement
bt_postprocessingAPI - implement
bt_format_namesAPI - implement
bt_macroAPI- the functions are implemented but don't jive with the way I integrated
bt_initializeandbt_cleanupinto the API.
- the functions are implemented but don't jive with the way I integrated
- error handling
License
GPLv3
Also if you don't support queer & trans folk or use LLMs please fuck off.