- make sure you have node installed
- run
npm install - install BBT in Zotero. Right-click a collection or library and select "Download Better BibTeX export", and choose the "CSL JSON" format.
- edit
config.json. Paste the URL from step 3 into the fieldcollection. Also paste the URL in your browser so you can see what the objects look like - edit
template.html. The template understands nunjucks syntax; the objects it inserts are in CSL-JSON format, the fields of which are documented here. Variables with dashes (-) are available in camelCase in the template, so a variable likecontainer-titleiscontainerTitlein the template. - create a directory called
outputif it doesn't exist, or add a field calledoutputtoconfig.jsonpointing to the output directory - run
npm start
You can see what data is available to the template by plugging the URL from step 3 into your browser. this script will make the following changes to what you see there:
relationsis removedcollectionsis removed- if a
DOIis present but starts withhttps://doi.org/, that prefix is stripped linksis the subset ofattachmentsthat are links to URL pagesattachmentswill have alllinksremoved- a field named
selectwill be added which is an URL that directly links into your Zotero library creatorswill be changed into a single field listing all creatorstagswill be changed into a single field listing all tags, sorted alphabeticallynoteswill be changed into a single field with all notes
Nunjucks will escape everything so that it is valid HTML; there is one special field called notes which is already valid HTML, so if you want this in the template, add it as {{ notes | safe }} so nunjucks doesn't escape it again