Closed earlAchromatic closed 1 year ago
pre-tree
and post-tree
hooks added in #25
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.
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.
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 factpre-content
might be a good name) and afinal
orpost-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:
vue-substrat-forms.ts
for working example.Some import workflow improvements (see #30) :
Some loftier ones:
Some plugin helpers we need to expose: