Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin ideas #22

Closed
8 of 25 tasks
earlAchromatic opened this issue Mar 31, 2023 · 3 comments
Closed
8 of 25 tasks

Plugin ideas #22

earlAchromatic opened this issue Mar 31, 2023 · 3 comments
Labels
enhancement New feature or request plugins

Comments

@earlAchromatic
Copy link
Contributor

earlAchromatic commented Mar 31, 2023

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:

  • its possible templates should be a plugin instead of built in to core dunno
  • navigation - aggregate marked pages, slugs and urls for building nice nav components.
  • segmenter - just split content by horizontal rules into an array so your can do: cms.segment[0] in one component and cms.segments[1] in another.
  • Notion component mapper
  • images - pull all images in a page into a set structure, ability to perform some optimizations on them, caching, etc. aws hosted images from Notion expire after a couple of hours so aren't usable. You need to download the image from remote.
  • internal links
  • mermaid
  • pull out all seo/head/metadata properties and make that an SEO plugin
  • schema.org management
  • i18n (probably use something like https://github.com/franciscop/translate as it would let the end user decide on translation engine)
  • general purpose UI framework component mappings (MDX for notion). See vue-substrat-forms.ts for working example.
  • simple forms - we can SSR using vue behind the scenes but all that matters is static form html for netlify works.
  • NotionCMS lint. Set rules and warnings if your content contains certain patterns. eg I use (link) as a placeholder a lot but forget the link.
  • front matter parsing - https://github.com/natemoo-re/ultramatter
  • link preview builder- need to request and scrape title, metas etc server side.

Some import workflow improvements (see #30) :

  • Ghost to NotionCMS
  • MD local files to NotionCMS - using tryfabric/martian and NotionCMS cli.

Some loftier ones:

  • post recommendations. Analyzes and builds an array of recommendations for consumption on current page.
  • search - compile all pages into a graph and tokenize some keywords so that their index pops up and we provide a path to the page. For building a nice search component.
  • graphNav - build a content graph (similar to search) that can plug into a force-directed graph visualization and use that to filter pages and navigate the site. Futuristic navigation.
  • provide a serverless function + plugin that pushes form filled data back to a specific database in Notion.
  • Semver at time of writing and current semver. Avoid doc-rot by using ncms plugin that writes to a column in the notion db telling you which documentation needs updated.
  • a/b testing rig

Some plugin helpers we need to expose:

  • type safe property extractor
  • expose the tree crawler
@earlAchromatic earlAchromatic added plugins enhancement New feature or request labels Mar 31, 2023
@earlAchromatic
Copy link
Contributor Author

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

@earlAchromatic
Copy link
Contributor Author

earlAchromatic commented Apr 12, 2023

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:

  • linking
  • notionCMS linting
  • seo/head
  • basic images

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
Copy link
Contributor Author

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

@agency-kit agency-kit locked and limited conversation to collaborators Aug 7, 2023
@earlAchromatic earlAchromatic converted this issue into discussion #108 Aug 7, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
enhancement New feature or request plugins
Projects
None yet
Development

No branches or pull requests

1 participant