NOTE: This is not an official Paperpile product.
This is a TypeScript CLI to sync your articles from Paperpile to a Notion database. Optionally, you may sync an authors database as well.
NOTE: This will only be maintained as long as Paperpile doesn't develop their own integration with Notion. They have expressed interest, here.
🚧 Overall, this is project is still a work in progress. This shouldn't be used as production-ready software, so there may be failing edge-cases that haven't been considered/tested. Please feel free to open an issue reporting any bugs/edge-cases you may encounter.
While this project is at v1.x.x
, this should not be considered
production-ready. It follows semantic versioning, and the migration to
TypeScript, obviously, breaks compatability with the Python implementation.
Prior to using paperpile-notion
, you'll need to setup a few things:
- Gather a BibTeX export (either manually exported from Paperpile or via their "Workflows & Integrations").
- A configuration file, similar to what you'll find in
docs/paperpile-notion.config.js
. - Your
Article
database UUID, which you can copy directly from your browser. (It's that 32-character long hexadecimal string – that looks likenotion.so/1234567890abcdef1234567890abcdef
.) - (Optional) Your
Author
database URL, copied in a similar manner as above. - Your Notion Integration Token. Follow
along these steps outlined by Notion. Copy the
Integration Token that starts with
secret_
, you'll need this later.
- Use the template laid out in Sync your Paperpile to Notion
- Create a new repository secret named
NOTION_INTEGRATION_TOKEN
by following this article. - Edit the
paperpile-notion.config.js
file you see in the repository root.
- Globally install
@jmuchovej/paperpile-notion
. (You should globally install so that you can access the CLI as a program.) You do not needsudo
access to correctly install this program.$ npm install -g @jmuchovej/paperpile-notion
- Ensure that your Notion Integration Token is added to your environment. I
recommend using a tool like
direnv
ordotenv
. (paperpile-notion
is purpose-built to run as a GitHub Workflow, so this method will receive little support.) - Run the sequence of commands that will perform your desired sync state. (To learn more, check out the commands detailed below.)
paperpile-notion articles:clean BIBTEXPATH
paperpile-notion articles:sync BIBTEXPATH
paperpile-notion articles:sync-diff BIBTEXPATH
paperpile-notion authors:clean BIBTEXPATH
paperpile-notion authors:sync BIBTEXPATH
paperpile-notion authors:sync-diff BIBTEXPATH
Cleans up your Articles Database.
USAGE
$ paperpile-notion articles:clean [BIBTEXPATH] -t <value> [-c <value>] [-h]
FLAGS
-c, --config=<value> Path to your config file, if not in /Users/jmuchovej/.config/paperpile-notion/config.js.
-h, --help Show CLI help.
-t, --token=<value> (required) Your Notion Integration's Token.
DESCRIPTION
Cleans up your Articles Database.
1. Removes dangling articles without authors.
EXAMPLES
$ paperpile-notion articles:clean /path/to/references.bib
$ paperpile-notion articles:clean /path/to/references.bib -c /path/to/paperpile-notion.config.js
See code: dist/commands/articles/clean.ts
Syncs your Articles Database with the local BibTeX file.
USAGE
$ paperpile-notion articles:sync [BIBTEXPATH] -t <value> [-c <value>] [-h]
FLAGS
-c, --config=<value> Path to your config file, if not in /Users/jmuchovej/.config/paperpile-notion/config.js.
-h, --help Show CLI help.
-t, --token=<value> (required) Your Notion Integration's Token.
DESCRIPTION
Syncs your Articles Database with the local BibTeX file.
Strictly creates or updates articles based on the ID assigned by Paperpile.
EXAMPLES
$ paperpile-notion articles:sync /path/to/references.bib
$ paperpile-notion articles:sync /path/to/references.bib -c /path/to/paperpile-notion.config.js
See code: dist/commands/articles/sync.ts
describe the command here
USAGE
$ paperpile-notion articles:sync-diff [BIBTEXPATH] -t <value> [-c <value>] [-h]
FLAGS
-c, --config=<value> Path to your config file, if not in /Users/jmuchovej/.config/paperpile-notion/config.js.
-h, --help Show CLI help.
-t, --token=<value> (required) Your Notion Integration's Token.
DESCRIPTION
describe the command here
EXAMPLES
$ paperpile-notion articles:sync-diff /path/to/references.bib
$ paperpile-notion articles:sync-diff /path/to/references.bib -c /path/to/paperpile-notion.config.js
See code: dist/commands/articles/sync-diff.ts
Cleans up your Authors Database.
USAGE
$ paperpile-notion authors:clean [BIBTEXPATH] -t <value> [-c <value>] [-h]
FLAGS
-c, --config=<value> Path to your config file, if not in /Users/jmuchovej/.config/paperpile-notion/config.js.
-h, --help Show CLI help.
-t, --token=<value> (required) Your Notion Integration's Token.
DESCRIPTION
Cleans up your Authors Database.
1. Removes dangling authors with no articles.
2. Attempts to clean up and merge authors and aliases.
EXAMPLES
$ paperpile-notion authors:clean /path/to/references.bib
$ paperpile-notion authors:clean /path/to/references.bib -c /path/to/paperpile-notion.config.js
See code: dist/commands/authors/clean.ts
Syncs your Authors Database with the local BibTeX file.
USAGE
$ paperpile-notion authors:sync [BIBTEXPATH] -t <value> [-c <value>] [-h]
FLAGS
-c, --config=<value> Path to your config file, if not in /Users/jmuchovej/.config/paperpile-notion/config.js.
-h, --help Show CLI help.
-t, --token=<value> (required) Your Notion Integration's Token.
DESCRIPTION
Syncs your Authors Database with the local BibTeX file.
Authors will be created if not present (or if they don't match a manually entered alias). Otherwise, Authors will have
their name stripped of whitespace and articles consolidation based on matching Aliases.
EXAMPLES
$ paperpile-notion authors:sync /path/to/references.bib
$ paperpile-notion authors:sync /path/to/references.bib -c /path/to/paperpile-notion.config.js
See code: dist/commands/authors/sync.ts
describe the command here
USAGE
$ paperpile-notion authors:sync-diff [BIBTEXPATH] -t <value> [-c <value>] [-h]
FLAGS
-c, --config=<value> Path to your config file, if not in /Users/jmuchovej/.config/paperpile-notion/config.js.
-h, --help Show CLI help.
-t, --token=<value> (required) Your Notion Integration's Token.
DESCRIPTION
describe the command here
EXAMPLES
$ paperpile-notion authors:sync-diff /path/to/references.bib
$ paperpile-notion authors:sync-diff /path/to/references.bib -c /path/to/paperpile-notion.config.js
See code: dist/commands/authors/sync-diff.ts