You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixed: reading a file written by export with full=True (--full on the command line) no longer fails. A full export records each attachment as a plain relative path (Bdsk-File-1 = {GrondPRA2009a.pdf}) rather than a base64 binary plist, and every Library load and every CLI command on such a file previously crashed with a bare Error: Invalid file when decoding that value. A bdsk-file-N value that is not a base64 binary plist is now read as a path-only attachment: it appears in Entry.files like any other, round-trips back to the same plain path, and is upgraded to a full base64 attachment (with a fresh bookmark) if renamed or replaced through the Library methods. [[#65], [#68]]
Changed: Entry.add_url/Entry.replace_url (and thus Library.add_url/Library.replace_url and the add_url/replace_url CLI commands) now percent-encode their input before storing it, exactly as BibDesk does: every character outside the URL-allowed set is UTF-8 percent-encoded, so a bdsk-url-N value is ASCII by construction (matching BibDesk's own absoluteString serialization), while an already-encoded URL passes through unchanged (% is left alone, so no double encoding). A raw non-ASCII URL previously stored verbatim could silently disappear when BibDesk reloaded the file. add_url("https://example.com/münchen") now stores https://example.com/m%C3%BCnchen; replace_url encodes only its new_url, matching old_url literally against the stored URLs. import applies the same normalization to incoming bdsk-url-N fields. [[#64], [#67]]
Added: a new standard check audit, url_encoding, reporting every URL-type value that holds raw non-ASCII characters: any field whose name contains url (the class exempt from TeX encoding, e.g. the url field) plus the bdsk-url-N links. Such characters break a LaTeX export that typesets the value inside \url{...} (whose verbatim catcodes bypass inputenc, printing garbled glyphs) and are what BibDesk drops when reloading a bdsk-url-N. The message shows the percent-encoded form so the fix is copy-pasteable (Key2020: url contains non-ASCII characters: 'https://example.com/münchen' (use 'https://example.com/m%C3%BCnchen')). Stored url field values are never rewritten automatically (that would break byte-exact round-tripping and diverge from BibDesk, which keeps them verbatim); the audit is the nudge instead. The audit name url_encoding also appears in the --json output. [[#64], [#67]]
Added: a .bib file that is not a BibDesk database -- no BibDesk header, no group @comment blocks, no bdsk-* fields; e.g., a file written by export -- is now recognized as plain BibTeX on load, and save preserves that format: no header is synthesized, no date fields are created, comments, @preamble blocks, and @string definitions are kept in place, and every stored field of every entry is written -- unmodified entries in their stored field order, so a file created by export round-trips byte-identically, and modified entries in BibDesk's field order, in the export layout. All commands that modify the .bib file (set_field, delete, rekey, set_string, import, ...) thus work on exported files without converting them. The plain-format options -- value encoding (Unicode or TeX-encoded), @string expansion, and preprint export form -- are read from the marker line that every export now writes as its first block (%% Created by BibDeskParser (unicode, preprints as unpublished).), or, for a marker-less file, detected from the file's content; Library.export gained a marker parameter (CLI: --marker/--no-marker, default on) controlling the marker line, which is never written when the output includes bdsk-* fields. A mutation that introduces database-only state -- creating or assigning a static group, attaching a file, or adding a URL -- converts the library to the BibDesk database format instead, with a new FormatConversionWarning (re-exported from the top-level package) naming the trigger. [[#62], [#63]]
Added: export --update FILE KEY... (with the keys optional), via a new update= parameter of Library.export, refreshes a previously exported file from the library, which is only read: every key in FILE that the library knows -- or, with KEYs given, exactly those keys, appended if not yet present -- is replaced by a fresh export, the @string block is regenerated as the sorted union of the old block and the definitions the rewritten entries need (with the library's current value for every macro the library defines, which is how corrected journal abbreviations propagate, and the file's own value for a macro only it defines), and everything else -- entries the library does not know, comments, @preamble blocks, unused definitions -- is kept; nothing is ever removed, and entries written by an update never include bdsk-* fields. The --unicode/--expand-strings/--preprint options default to the target file's own recorded or detected options; an explicit flag overrides them and is recorded in the rewritten marker, so it is sticky for subsequent updates. The target must already exist (use --outfile to create a new export) and be plain BibTeX; a BibDesk database is refused. [[#62], [#63]]
Changed: export now defaults to the minimal field selection -- the fields parameter of Library.export defaults to "minimal" instead of "full" -- and the CLI flag pair --minimal/--no-minimal is renamed to --minimal/--full. To adapt, pass --full (Python: fields="full") for the previous behavior. In particular, export KEY | import other.bib --stdin as a library-to-library transfer now moves a minimal skeleton unless --full is passed, and the export-to-edit --stdin round-trip must be spelled export KEY --full --preprint stored | edit KEY --stdin, since a field missing from the text piped into edit --stdin is deleted from the entry. [[#62], [#63]]
Changed: the command-line tool now reports warnings raised while a command runs (a group/file/URL command converting a plain BibTeX file, the macOS-bookmark fallback of add_file, a duplicate-citation-key warning on load) as the same clean Warning: lines on stderr it uses for save-time warnings, instead of letting them surface through Python's location-prefixed warning display. [[#62], [#63]]
Changed: a newly constructed Entry no longer carries date-added/date-modified; the fields are stamped when the entry is added to a Library in the BibDesk database format, so that adding entries to a plain BibTeX file (directly, or via import/add) never plants date bookkeeping there. A date-added already stored on an entry (e.g. preserved by import) is kept as before, and Entry.date_added/Entry.date_modified are None for a detached entry. [[#62], [#63]]