asnunes / notion-page-to-html

NodeJS tool to convert public Notion pages to HTML from page ID
MIT License
163 stars 45 forks source link

Subpages Support #35

Open asmodat opened 1 year ago

asmodat commented 1 year ago

Works well however does not support sub-pages, here is a demo code:

const NotionPageToHtml = require('notion-page-to-html');
const fs = require('fs');

async function getPage() {
  const { title, icon, cover, html } = await NotionPageToHtml.convert("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
  console.log(title);

  fs.writeFile("./out.html", html, function(err) {
    if(err) {
        return console.log(err);
    }
    console.log("The file was saved!");
  });
}

getPage();

Subpages would be much more useful, especially for generating static pages with github actions

kmlbgn commented 11 months ago

Bump. Would be super useful