UNPKG

@jmuchovej/paperpile-notion

Version:
30 lines (29 loc) 1.54 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.BibTeXToNotion = void 0; const notion_cms_1 = require("../notion-cms"); const BibTeXToNotion = (appConfig, bib) => { const ID = (0, notion_cms_1.makeRichText)(bib.id); const Title = (0, notion_cms_1.makeTitle)(bib.title); const Status = (0, notion_cms_1.makeSelect)(bib.status) ?? (0, notion_cms_1.makeSelect)("❓ Unknown"); const Authors = appConfig.hasAuthorDB ? (0, notion_cms_1.makeRelation)(bib.authors) : (0, notion_cms_1.makeMultiSelect)(bib.authors); const Topics = (0, notion_cms_1.makeMultiSelect)(bib.topics); const Fields = (0, notion_cms_1.makeMultiSelect)(bib.fields); const Methods = (0, notion_cms_1.makeMultiSelect)(bib.methods); const Folders = (0, notion_cms_1.makeMultiSelect)(bib.folders); const Keywords = (0, notion_cms_1.makeMultiSelect)(bib.keywords); const Venue = (0, notion_cms_1.makeSelect)(bib["container-title"]); const URL = (0, notion_cms_1.makeURL)(bib.url); let Entry = { ID, Title, Status }; Entry = Authors ? { ...Entry, Authors } : Entry; Entry = Topics ? { ...Entry, Topics } : Entry; Entry = Fields ? { ...Entry, Fields } : Entry; Entry = Methods ? { ...Entry, Methods } : Entry; Entry = Keywords ? { ...Entry, Keywords } : Entry; Entry = Folders ? { ...Entry, Folders } : Entry; Entry = Venue ? { ...Entry, Venue } : Entry; Entry = URL ? { ...Entry, URL } : Entry; return Entry; }; exports.BibTeXToNotion = BibTeXToNotion;