AminSallah / Flow.Launcher.Plugin.Notion

Quick capture plugin for search, create, edit, and delete Notion pages.
MIT License
9 stars 0 forks source link
dotnet flowlauncher flowlauncher-plugin notion notion-api notion-plugin

Flow launcher Plugin Notion

FreePalestine

Features

Commands

Installation Process

  1. Plugin Installation:

    • Start by installing the plugin. In flow launcher query paste

      pm install notion by Amin Salah
  2. Plugin Activation:

    • Trigger the plugin using the action keyword c.
    • Click to open the settings panel.

      No API Image

Configuration Steps

Configuration Steps

  1. Navigate to Settings:

    • Within the settings, navigate to Plugins > Notion.
  2. Integration Token Setup:

    • Paste your Internal Integration Token.
    • Create a new token if necessary.

      Note:

      • Ensure that the Internal Integration Token Content Capabilities include Read, Update, and Insert content.

        Token Capabilities Image

      • Share at least one database with the token.

        • To share a database, go to the Database page and select your integration name.

        Full Database Sharing Image

  3. Database Query:

    • Trigger the plugin again after setting the Internal Integration Token.
    • Wait while the plugin queries the databases.
  4. Testing Databases:

    • Test the databases using the command c @.

      Choose Relation Database Image

    • Confirm that your databases shared with the token are visible.

  5. Select Relation Database:

    • Navigate to Settings > Plugins > Notion.
    • Choose your relation database and wait the success message.

    Choose Relation Database Image

  6. Finally, restart Flow Launcher.

  7. After Flow Launcher opens, if the search cache is provided properly (require internet connection), you will see all shared pages with your token. The create mode is only allowed when there is no match with the query and shared pages.

    In case of any error Relod Plugins data or Restart flow lunacher with good internet connection to build a cache.

Note:

To enhance the visual appeal and facilitate the display of SVG icons in Flow Launcher, I recommend installing the SVG Explorer Extension for SVG preview. You can find the extension here.

Demos

Create a new database item with relation.

Plugin demo

Search, Open and Edit existing page.

Edit page

Append blocks for an existing page or a new page.

Append Block

Delete and Complete existing page (Plugin comes with two custom payload (delete and complete)).

Custom payload

Command Reference

Context menu of pages

Under construction

How to escape plugin keywords?

To escape any keyword simply add backslah before it \

Supported keywords:

  1. @
  2. !
  3. #
  4. [
  5. Custom Filter titles
  6. Dates by choosing cancel after they are recognized or backslah.

Unsupported Keywords:

  1. *
  2. ^
  3. $

Key Modifiers and Shortcuts

Under construction

Custom Payload

Description

:memo: Utilizing custom payloads allows you to:

  • Query specific filters such as (All uncompleted tasks and overdue).
  • Edit specific tasks based on payload from the context menu (Shift + Enter), for example, change state to complete and set complete date to now.

Note: The plugin comes with two payloads:

  1. Complete Payload needs to be configured to match your database property names.
  2. Delete Payload does not need configuration.

How to Add a New Custom Payload as a filter

Add a New Custom Filter

  1. Navigate to Settings > Plugins > Notion > Custom Payload.

  2. Click the Add Button.

  3. Set a title (required) and subtitle (optional) for the filter.

    Titles cannot be duplicated.

  4. Keep the type as a filter.

  5. Choose the database to query (required).

  6. Select the cache type based on your needs.

    • Disabled: Pages will not be cached, and search will be in real-time.
    • BuildAndWait: Initiates API call when the flow becomes visible, and if the filter is triggered while the API has not responded yet, it will wait for the response.
    • BuildWithoutWaiting: Similar to the previous option, but if the filter is triggered and the API has not responded yet, it will display old cached pages until new data is received.
    • BuildWithTimeout: Like the previous option, with the added feature of setting a timeout for the API. If the API exceeds the specified timeout, it will display old cache.
  7. Create a new payload JSON (if left empty, the entire database will be queried) or use this filter.

    For more information about how you can create more advanced filters, navigate to notion.

    {
    "and": [
    {
    "property": "Due",
    "date": {
    "on_or_before": "{{current date}}"
    }
    },
    {
    "or": [
    {
    "property": "Status",
    "status": {
    "equals": "🍡"
    }
    },
    {
    "property": "Status",
    "status": {
    "equals": "πŸ”„"
    }
    }
    ]
    }
    ]
    }
    • This filter represents this on the Notion UI

    Advanced Notion Filter

  8. Click the Add button and trigger the plugin; you should see the advanced filter or search for it by title.

How to Add a New Custom Payload as a property

JSON Variables as current date

Right now, the plugin only supports converting to dates.

UNDER CONSTRUCTION

Known Issues

  1. You can't change the database after selecting the multi-select option. If so, the plugin will neglect the specified page title, and you'll need to start typing it again from the beginning.

Thank You! β˜•οΈ

If you're enjoying the Notion Plugin, your support would mean a lot. It helps keep the plugin updated and allows for further development. You can buy me a coffee at Ko-fi or contribute through PayPal.

Please also help spread the word by sharing about the Flow launcher Notion Plugin on Twitter, Reddit, or any other social media platform you regularly use.

Licence

The source code for this plugin is licensed under MIT.