Skip to content
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

Notion Publisher #221

Open
brittonhayes opened this issue Jul 25, 2024 · 3 comments · May be fixed by #223
Open

Notion Publisher #221

brittonhayes opened this issue Jul 25, 2024 · 3 comments · May be fixed by #223
Milestone

Comments

@brittonhayes
Copy link

brittonhayes commented Jul 25, 2024

Description

Hello! Love the project 😊 I'd like to see support for creating Notion pages with the report content rendered by Fabric. I'd be more than happy to take a pass at helping create this if it sounds interesting!

Use Case

The use case for this is the aggregation of vulnerability and security posture reporting into a flexible knowledge management tool. I'd like to be able to have a report get generated and uploaded to Notion, enabling back linking between Reports and other security knowledge such as case manager entries, tasks, projects, ATT&CK techniques etc.

Requirements

  • The ability to specify Notion as an output via a flag or config
  • The ability to pass Notion API credentials securely either via Env Var or file path
  • Conversion of Markdown document to Notion blocks (this could be out of scope and something I could create as an external pkg for your project to consume if helpful)
  • The creation of a Notion page in a database

Additional Information

@traut
Copy link
Member

traut commented Jul 30, 2024

@brittonhayes thank you for the issue and the kind words! I've been planning on making one for Notion delivery, so I'm glad to see some interest!

The ability to specify Notion as an output via a flag or config

In the latest release (v0.4.2, the docs came online just now!) we added a concept of publishers, configured through publish blocks. The idea is to support multiple delivery destination for the created documents. Publishers implement API integration and are responsible for API-specific formatting of the content.

We're still developing the idea. For now we have only one publisher implemented -- local_file (code), but we have GitHub gist planned already. I would love to have a publisher for Notion as well.

The ability to pass Notion API credentials securely either via Env Var or file path

Environment variables are already supported.

Conversion of Markdown document to Notion blocks (this could be out of scope and something I could create as an external pkg for your project to consume if helpful)

This can happen in the publisher. The easiest is to contribute a new notion plugin with notion_page (?) publisher inside to this repository -- we'll take care of the maintenance and the releases. Alternatively, you can create a separate repository for the plugin. It will be a bit of a learning experience for us, since we don't host plugins outside this repo just yet :)

@brittonhayes
Copy link
Author

Love this idea!! Sounds like we're on the same page. I'll plan on taking a pass at building out a Notion publisher plugin in the fabric repository looking at the local file one as reference.

I don't feel the need to own the publisher plugin in my own repositories, happy to have it live in fabric so you can do whatever with it ☺️

Since a Notion publisher sounds like a welcome addition, I've gone ahead and built out the first piece of our puzzle here which is a Markdown AST -> Notion blocks converter. This will handle parsing the markdown, converting markdown components into their corresponding block types, chunking long documents into multiple blocks to support Notion's API limits (and allowing people to upload really big reports if they choose), etc etc.

Currently it supports headers, lists, paragraphs, and links. Once it's got support for things like codeblocks and text formatting I'll transition over to building out the publisher.

No idea how to do that at the moment but we can figure that out together 😂 Not too worried about it.

@traut
Copy link
Member

traut commented Jul 30, 2024

that's a great first iteration! With #159 we're planning on supporting a richer data structure (we're looking at the Goldmark AST types right now) in the future, so the publishers / formatters would need to be upgraded support it. But we're not there yet, so relying on Markdown is the way to go.

@traut traut added this to the v0.5 milestone Jul 30, 2024
@traut traut added publisher and removed plugins labels Jul 30, 2024
@brittonhayes brittonhayes changed the title Notion Destination Notion Publisher Jul 31, 2024
@britton-from-notion britton-from-notion linked a pull request Aug 2, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants