agency-kit / notion-cms

Add super powers to Notion by making it your full-fledged headless CMS.
https://www.agencykit.so/notion-cms/guide/
MIT License
38 stars 2 forks source link

Plugin ideas #22

Closed earlAchromatic closed 1 year ago

earlAchromatic commented 1 year ago

A plugin exist to extend NotionCMS in some way. There are currently only two hooks where the plugins run but long term I think we should provide hooks at these points: post-db-call, pre-parse, post-parse, final.

Right now pre and post parsing just give you access to the blocks or html for an individual entry so we should add a hook post-db-call (working title) for pre processing the tree-level pre-content calls (in fact pre-content might be a good name) and a final or post-content hook for any final tree-level transforms. This opens up many more possibilities for what a plugin can do.

The main idea of plugins is that the core database that comes with NotionCMS is as minimal as possible. Whenever you add a plugin you can add data properties that you expect to see for each entry.

As such plugins should come with necessary template or schema for the notion database so that they are easy for users to consume. NotionCMS should provide plugin types and the plugin itself should update type expectations for the tree structure should it modify the tree in any way.

Here's the list of planned plugins:

Some import workflow improvements (see #30) :

Some loftier ones:

Some plugin helpers we need to expose:

earlAchromatic commented 1 year ago

pre-tree and post-tree hooks added in #25

earlAchromatic commented 1 year ago

Thinking about adding a set of core plugins to this repo for easier maintenance. Core plugins should be the ones that you won't want to use NotionCMS without 9/10 times.

Here are the ones I'm thinking:

For instance, if you have images in your Notion content at all you will want to cache them. Just makes sense to keep these plugins closer to core, everything else is extra and promotes community plugins.

earlAchromatic commented 1 year ago

Here's one: tabs with code in different languages or examples. Could be done using a callout containing several codeblocks in different langs, the lang will be rendered as the tab title.

screencast 2023-08-07 17-17-05