Generate an HTML page based on a Notion document

Overview

Notion Generator

Generate an HTML page based on a Notion document! Still a bit of a work in progress, but I am about to actually use it for some actual content so maybe it's ready enough for you too!

License

This project is licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in flood by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Comments
  • Programmatically getting notion to render the HTML/Markdown

    Programmatically getting notion to render the HTML/Markdown

    Hey! Please disregard this if you already know, but just in case: you can get Notion to give you Markdown or HTML for a notion page by using the endpoints the webapp talks to. It's a fairly involved process and needs three requests for each page:

    curl 'https://www.notion.so/api/v3/enqueueTask' -X POST -H 'Content-Type: application/json' -H 'Cookie: token_v2={{secret}};' --data-raw '{"task":{"eventName":"exportBlock","request":{"block":{"id":"{{id}}"},"recursive":false,"exportOptions":{"exportType":"html","timeZone":"Asia/Kolkata","locale":"en"}}}}'
    #=> task id
    
    curl 'https://www.notion.so/api/v3/getTasks' -X POST -H 'Content-Type: application/json' -H 'Cookie: token_v2={{secret}};' --data-raw '{"taskIds":["{{task id}}"]}'
    # => s3 url
    
    # curl/wget the s3 url
    

    The output HTML is pretty much as it looks on notion minus the JS. Of course, this isn't supposed to be their "official" API, and they might deprecate it or lock it down any moment.

    opened by shrik450 3
  • Drop `NOTION-HACK` for toml

    Drop `NOTION-HACK` for toml

    TOML support is now officially part of Notion, it's not the greatest language and it's made by someone awful but hooray less hacks. Maybe one day Rust adopts KDL ❤️

    opened by Mathspy 0
  • Add special highlighting captures for turbofishies

    Add special highlighting captures for turbofishies

    This by coincidence also solves a weird edge case where <Option<()>>::map would cause an https://github.com/operator selector to start and never end

    opened by Mathspy 0
  • Add rough support for page mentions

    Add rough support for page mentions

    I am not fully sure if this is adequate or not, I will have to make a few tests especially with pages that the integration doesn't have access to but for now I think this unblocks me for the day

    I really had to use a feature I didn't add support to in the first, huh? :'>

    opened by Mathspy 0
  • Add support for TOML by using out-of-band info

    Add support for TOML by using out-of-band info

    TOML is fairly essential for describing Rust related configuration and when a website doesn't have highlighting it feels like not enough effort was put into it. We can't let ourselves be that! And I am not going to sit tight until Notion adds support for TOML so I am taking matters into my own hand by adding support for TOML using a special marker that is unlikely to appear in that specific format anywhere else

    opened by Mathspy 0
  • Improve composability of highlight classes

    Improve composability of highlight classes

    Instead of the class type-builtin we will add the two classes type and builtin because this gives us MUCH more composability If we want to target only types that are builtin we can do .type.builtin, if we want only types that aren't builtin we can do .type:not(.builtin)

    opened by Mathspy 0
  • Should we just link to Katex from a CDN?

    Should we just link to Katex from a CDN?

    Currently we link to katex in a styles/katex.css directory, this means after someone the HTML they will need to be careful how they put it around. It'd probably be better to just link to a CDN but there are privacy concerns related to that

    opened by Mathspy 0
Releases(v0.1.3)
  • v0.1.3(Nov 29, 2021)

    What's Changed

    • Fix rendering of divider (should be hr instead of br) by @Mathspy in https://github.com/Mathspy/notion-generator/pull/7
    • Add the block id as an id attribute to all rendered blocks by @Mathspy in https://github.com/Mathspy/notion-generator/pull/8
    • Implement Default for Color and Annotations by @Mathspy in https://github.com/Mathspy/notion-generator/pull/9

    Full Changelog: https://github.com/Mathspy/notion-generator/compare/v0.1.2...v0.1.3

    Source code(tar.gz)
    Source code(zip)
    notion-generator(16.86 MB)
  • v0.1.2(Nov 26, 2021)

    What's Changed

    • Add output option to allow choosing output dir by @Mathspy in https://github.com/Mathspy/notion-generator/pull/4
    • Fix project name in README CLA by @shrik450 in https://github.com/Mathspy/notion-generator/pull/5
    • Create media directory if it doesn't exist by @Mathspy in https://github.com/Mathspy/notion-generator/pull/6

    New Contributors

    • @shrik450 made their first contribution in https://github.com/Mathspy/notion-generator/pull/5

    Full Changelog: https://github.com/Mathspy/notion-generator/compare/v0.1.1...v0.1.2

    Source code(tar.gz)
    Source code(zip)
    notion-generator(16.86 MB)
  • v0.1.1(Nov 24, 2021)

    What's Changed

    • Switch from OpenSSL to rustls-native-certs by @Mathspy in https://github.com/Mathspy/notion-generator/pull/2
    • Build GitHub release binary with cross by @Mathspy in https://github.com/Mathspy/notion-generator/pull/3

    New Contributors

    • @Mathspy made their first contribution in https://github.com/Mathspy/notion-generator/pull/2

    Full Changelog: https://github.com/Mathspy/notion-generator/compare/v0.1.0...v0.1.1

    Source code(tar.gz)
    Source code(zip)
    notion-generator(16.83 MB)
  • v0.1.0(Nov 22, 2021)

Owner
I love orange. Also coding. AND TESTING :heart: Oh and writing! Oh I also don't like writing bios...
null
Like jq, but for HTML. Uses CSS selectors to extract bits content from HTML files.

Like jq, but for HTML. Uses CSS selectors to extract bits content from HTML files. Mozilla's MDN has a good reference for CSS selector syntax.

Michael Maclean 6.3k Jan 3, 2023
A simple to use rust package to generate or parse Twitter snowflake IDs,generate time sortable 64 bits unique ids for distributed systems

A simple to use rust package to generate or parse Twitter snowflake IDs,generate time sortable 64 bits unique ids for distributed systems (inspired from twitter snowflake)

houseme 5 Oct 6, 2022
A shared document application akin to Google Docs. Example usage of wasm-peers library.

Live Document Proof of concept application showcasing the usability of wasm-peers crate for easy and costless peer-2-peer WebRTC communication. It's a

null 6 Sep 19, 2022
A fetcher hook for the Plato document reader that syncs an e-reader with an OPDS catalogue.

plato-opds A fetcher hook for the Plato document reader that syncs an e-reader with an OPDS catalogue. Motivation I wanted to be able to sync my e-rea

null 11 Nov 8, 2023
Generate commit messages using GPT3 based on your changes and commit history.

Commit Generate commit messages using GPT-3 based on your changes and commit history. Install You need Rust and Cargo installed on your machine. See t

Brian Le 40 Jan 3, 2023
A simple script (in Rust lang) to create HTML from SVD

A simple script to create HTML from an SVD file This is a simple script written in Rust language to create a single HTML file from an SVD file. It's r

Björn Quentin 14 Aug 22, 2022
Generate short, memorable phrases for throw-away names.

Generates three-word phrases of the form intensifier-adjective-noun, just like GitHub default repo names.

null 6 Dec 25, 2021
Generate a THIRDPARTY file with all licenses in a cargo project.

cargo-bundle-licenses Bundle all third-party licenses into a single file. NOTE This tools is not a lawyer and no guarantee of correctness can be made

Seth 58 Jan 7, 2023
Generate alerts for when metrics/recordings become absent

prometheus-absent-data-alert-rule-generator prometheus-absent-data-alert-rule-generator is a tool to generate alerts for missing data in time-series t

Stile Education 5 Sep 9, 2022
Used to generate and compare bounded timestamps.

ClockBound Summary: ClockBound allows you to generate and compare bounded timestamps that include accumulated error as reported from the local chronyd

Amazon Web Services 149 Nov 28, 2022
A set of bison skeleton files that can be used to generate a Bison grammar that is written in Rust.

rust-bison-skeleton A set of bison skeleton files that can be used to generate a Bison grammar that is written in Rust. Technically it's more like a B

Ilya Bylich 12 Dec 14, 2022
Rust macro that uses GPT3 codex to generate code at compiletime

gpt3_macro Rust macro that uses GPT3 codex to generate code at compiletime. Just describe what you want the function to do and (optionally) define a f

Maximilian von Gaisberg 59 Dec 18, 2022
Generate bindings to use Rust code in Qt and QML

Rust Qt Binding Generator This code generator gets you started quickly to use Rust code from Qt and QML. In other words, it helps to create a Qt based

KDE GitHub Mirror 768 Dec 24, 2022
Generate enum from a trait, with converters between them

Derive macro for Rust that turns traits into enums, providing tools for calling funtions over channels

Vitaly Shukela 16 Nov 3, 2022
Generate Rust register maps (`struct`s) from SVD files

svd2rust Generate Rust register maps (structs) from SVD files This project is developed and maintained by the Tools team. Documentation API Minimum Su

Rust Embedded 518 Dec 30, 2022
📝 Generate your README.md from Rust doc comments

cargo-onedoc ?? Generate README.md from doc comments. Only write your documentation once! This crate provides a Cargo subcommand that can generate Mar

Ross MacArthur 2 Dec 14, 2022
Rust library to generate word cloud images from text and images !

wordcloud-rs A Rust library to generate word-clouds from text and images! Example Code use std::collections::HashMap; use std::fs; use lazy_static::la

Teo Orthlieb 2 Dec 8, 2022
"Philips Ambilight for desktops". A tool to generate color palettes from your desktop wallpaper and send them to Home Assistant.

Desktop Dye DesktopDye is an open source project written in Rust that allows users to have their lights paired with Home Assistant adjust to the most

Jeroen Meijer (Jay) 7 Feb 22, 2023
Proc. macro to generate C-like `enum` tags.

Continuous Integration Documentation Crates.io #[derive(EnumTag)] This crate provides a proc. macro to derive the EnumTag trait for the given Rust enu

Robin Freyler 5 Mar 27, 2023