Giter Club home page Giter Club logo

svelte-notion's Introduction

Svelte Notion

An unofficial Notion API tool set for Svelte & Sapper

This package uses https://github.com/splitbee/notion-api-worker to generate the API. You can host this yourself, but OOTB it uses https://notion-api.splitbee.io/

This package is very experimental and subject to change. Check out a working page here: https://www.scotttolinski.com/notion

How To Use

npm install @leveluptuts/svelte-notion


<script context="module">
  import { Notion, fetchNotion } from "@leveluptuts/svelte-notion";

  export async function preload() {
    const pageId = `3e03212e646e41caaa560408162dee99`;
    const blocks = await fetchNotion({ id: pageId, context: this });
    return { blocks };
  }
</script>

<script>
  export let blocks;
</script>

<Notion {blocks} />

What's supported currently

(shout-out to splitbee for this dope table. I borrowed from his React Notion repo)

We happily accept pull requests to add support for the missing blocks. I'll be adding as many as I can asap.

Block Type Supported Notes
Text ✅ Yes
Heading ✅ Yes
Image ❌ Missing
Image Caption ❌ Missing
Bulleted List ❌ Missing
Numbered List ❌ Missing
Quote ❌ Missing
Callout ❌ Missing
Column ❌ Missing
iframe ❌ Missing
Video ❌ Missing Only embedded videos
Divider ❌ Missing
Link ❌ Missing
Code ✅ Yes
Web Bookmark ❌ Missing
Databases ❌ Missing
Checkbox ❌ Missing
Toggle List ❌ Missing
Table Of Contents ❌ Missing

How To Host Your Own API

Coming Soon

FAQ

Is this practical?

Maybe? I could be much more very soon.

I thought Notion didn't have an API?

It don't. Don't hold your breath on this working for ever. See the Splitbee package for more info. The intention would be to migrate this to the official API once it's released.

Credits

Heavily inspired by https://github.com/splitbee/react-notion

svelte-notion's People

Contributors

stolinski avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.