Render a notion page #385
-
Hi! Is there an easy way of rendering a notion page to html? I am able to load the page like this:
But is there any way to automatically convert it to html? |
Beta Was this translation helpful? Give feedback.
Answered by
mariosimao
Aug 9, 2024
Replies: 1 comment
-
Hi @jeff1985! The notion-sdk-php has a Markdown renderer. <?php
require "vendor/autoload.php";
use Notion\Blocks\Renderer\MarkdownRenderer;
use Notion\Notion;
$token = "secret_token";
$notion = Notion::create($token);
$pageId = "page_id";
$blocks = $notion->blocks()->findChildrenRecursive($pageId);
echo PHP_EOL;
echo MarkdownRenderer::render(...$blocks); The feature could mixed with a Markdown to HTML converter like CommonMark. For more info, see #197 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
mariosimao
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @jeff1985!
The notion-sdk-php has a Markdown renderer.
The feature could mixed with a Markdown to HTML converter like CommonMark.
For more info, see #197