- 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-title
iscontainerTitle
in the template. - create a directory called
output
if it doesn't exist, or add a field calledoutput
toconfig.json
pointing 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:
relations
is removedcollections
is removed- if a
DOI
is present but starts withhttps://doi.org/
, that prefix is stripped links
is the subset ofattachments
that are links to URL pagesattachments
will have alllinks
removed- a field named
select
will be added which is an URL that directly links into your Zotero library creators
will be changed into a single field listing all creatorstags
will be changed into a single field listing all tags, sorted alphabeticallynotes
will 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