Importantus / notion-to-hayagriva

A simple CLI to convert literature entries from Notion to the Hayagriva YAML file format.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Notion to Hayagriva

A simple CLI to convert literature entries from Notion to the Hayagriva YAML file format for bibliographies. The tool automates the conversion process, saving time for users.

Learn more about the Hayagriva YAML file format at their documentation.
This project is inspired by notion-scholar, but works the other way round.

Installation

Notion-to-Hayagriva requires Node.js to be installed on your machine.

Download the repository and install the dependencies using the following commands:

npm init using Importantus/notion-to-hayagriva notion-to-hayagriva
cd notion-to-hayagriva
npm install

Setting up

1. Creation of a notion database

You can either duplicate the page template using the link below, or create a new database with the properties listed in requirements.

Template

Link to the template

Requirements

If you you want to use different property names, you need to change the values Array in index.js.

The properties necessary to import publications in a database are the following:

Property Name Property Type
Title Title
Key Text
Type Select
Autoren Relation
Datum Date
URL URL
Abrufdatum Date
DOI Text
ISBN Text
ISSN Text
Verlag Text
Organsiation Text
Ort Text
Issue Number
Volume Number
Parent Relation

No space or special sign should be in the names of the properties.

2. Creation of an integration

Create an integration for the notion-scholar database. The integration needs to target the workplace containing the publication database.

Option needed:

  • Internal Integration
  • Read content

Copy the Internal Integration Token for the step 4.

3. Share the database with the Integration

Go to your database in notion => Click on ... (top right) => + Add connections => Select the integration that you just created.

Copy the link of the database (simply the URL on a browser, on the application => Click on ... => Copy Link) for the step 4.

It is the database page and not the dashboard page that needs to be integrated.

4. Set the token and database_id in .env

Add an .env file in the root directory with the following content:

NOTION_TOKEN=your_token
NOTION_DB_ID=your_database_id

Usage

After installation and setting up, you can use the tool to convert the entries in the database to the Hayagriva YAML file format.

node index.js

The output will be a file named hayagriva.yml in the root directory.

About

A simple CLI to convert literature entries from Notion to the Hayagriva YAML file format.


Languages

Language:JavaScript 100.0%