Giter Site home page Giter Site logo

notionsharp's Introduction

NotionSharp - Notion API client for C#

Notion is an app to write things. It has the most simple "wysiwyg" editor i have ever seen. Add photo, video, tables and more in one drag/drop or one click. For devs it features code blocks with highlightning.
The app works both offline and online, is multi user and historize all your changes making it easy to revert them.
The app is also available in the Microsoft Store for Windows and on mobile phones to peacefully write your contents offline.

This is an unofficial Notion APIv3 library and website template. You can, for example, get notion pages as a RSS feed. You can also use it as a simple CMS (Content Management System).

NuGet
Nuget

publish to nuget

notion-img

Use Cases

Spawn a Website displaying the pages built with Notion in a few seconds. See below 'kubernetes'.

Get a RSS representation of all root pages of the main space.
This also transforms notion data to HTML:

    var rssFeed = await session.GetSyndicationFeed();

Get a RSS representation from the sub-pages of a page:

    var space = userContent.RecordMap.Space.First().Value;
    var firstPage = userContent.RecordMap.Block[space.Pages[0]];
    var subPages = firstPage.Content;

    var feedPublicBlog = await session.GetSyndicationFeed(subPages);
    feedPublicBlog.Title = new TextSyndicationContent(firstPage.Title);

Spawn a website displaying Notion pages in a few minutes

Setup your Notion pages and get your credentials

Create some content

Create a page at the root of Notion.so (the root page), then add subpages to this page with a title and an icon.
For each subpage, check "shared". Don't check "Shared" on the root page. Only shared pages will be displayed by our example, so you can prepare private pages in advance without publishing them.

When you encounter CmsPageTitle below in this setup, replace it with the exact title of your root page.

Documentation

Sponsors

Big Thanks to those sponsors for supporting this project and keeping it free.

Alt

notionsharp's People

Contributors

softlion avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

notionsharp's Issues

Define a strategy to migrate to the official notion API

Define a strategy to migrate to the official notion API:

  • keeping the unofficial API functional
  • retaining most functionalities
  • avoid duplicating existing codes.
  • take the fastest and simplest path

Authentication can't be done in code. It only relies on a bearer token - an Authorize header transmitted with each request. Get a token using your notion account.

Path 1: TDD

Operation 1 - Create unit tests

  • to get a specific root page given its name
  • to get all blocks of a page, including all it's children pages, using pagination where necessary
  • to process all blocks into html, using most of the existing code

Recreate a new block model if necessary.
In a new specific nuget.

Bonus:

  • use a // pipeline (or reactivex) for ultra fast block to html transcoding

After op1 is finished, the API surface should be at least the same as the "old" nuget.

Operation 2 - Upgrade the blazor templates

  • Use the new nuget from op1
  • Simplify the authentication option model (use only the bearer token)
  • publish changes

Bonus:

  • add notion's data change detection (and trigger UI update)

Creating Pages and Documentation

Hi creators,

Is Creating pages available in the API? I haven't found any information in the code neither in the docs. Do you also provide some kind of extended documentation for the API?

Regards

License file missing?

Hi! just a quick note, but the NuGet package mentions that this library is under the MIT license but there's no license file in the repository!

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.