{"id":13770626,"url":"https://github.com/asnunes/notion-page-to-html","last_synced_at":"2025-04-05T13:08:41.610Z","repository":{"id":37095706,"uuid":"281968406","full_name":"asnunes/notion-page-to-html","owner":"asnunes","description":"NodeJS tool to convert public Notion pages to HTML from page ID","archived":false,"fork":false,"pushed_at":"2023-01-06T12:35:18.000Z","size":841,"stargazers_count":167,"open_issues_count":12,"forks_count":47,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-29T12:06:05.654Z","etag":null,"topics":["equation","html","html5","notion-pages"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/asnunes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-23T14:06:05.000Z","updated_at":"2024-12-17T18:06:24.000Z","dependencies_parsed_at":"2023-02-06T02:30:27.230Z","dependency_job_id":null,"html_url":"https://github.com/asnunes/notion-page-to-html","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asnunes%2Fnotion-page-to-html","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asnunes%2Fnotion-page-to-html/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asnunes%2Fnotion-page-to-html/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asnunes%2Fnotion-page-to-html/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/asnunes","download_url":"https://codeload.github.com/asnunes/notion-page-to-html/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247339158,"owners_count":20923014,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["equation","html","html5","notion-pages"],"created_at":"2024-08-03T17:00:39.974Z","updated_at":"2025-04-05T13:08:41.586Z","avatar_url":"https://github.com/asnunes.png","language":"TypeScript","funding_links":[],"categories":["TypeScript","APIs"],"sub_categories":[],"readme":"![Cover image](docs/cover.png)\n\n# Notion Page To HTML\n\nNodeJS tool to convert public notion pages to HTML.\n\nAlso available as public API:\n\n[https://notion-page-to-html-api.vercel.app/](https://notion-page-to-html-api.vercel.app/)\n\n## Supported features\n\nMost of the native Notion blocks are currently supported:\n\n- Headings\n- Text With Decorations\n- Quote\n- Image\n- YouTube Videos\n- Code\n- Math Equations\n- To-do\n- Checkbox\n- Bulleted Lists\n- Numbered Lists\n- Toggle Lists\n- Divider\n- Callout\n- Nested blocks\n\nEmbeds and tables are not supported yet.\n\n## Why notion-page-to-html?\n\nIt's perfect as content manager system\n\n- This tool can get any public page from Notion and convert it to html. This is perfect\n  for the ones who want to use Notion as CMS. Once it gets page content from Notion, it becomes completely independent (images are converted to base64 so you do not have to call Notion again to get content). You can convert a page and then make it private again.\n\nIt's fully customizable\n\n- You can choose how you want to get page content. Do you want title, cover, and icon in html body? You can do that! Do you want they apart of html so you can choose where place it? You have it. Do want html without style? Without Equation and Code Highlighting scripts? Do you want body content only? You have those options too.\n\n## Basic Usage\n\nInstall it in a NodeJS project using npm\n\n```bash\nnpm install notion-page-to-html\n```\n\nThen, just import it and paste a public Notion page url\n\n```jsx\nconst NotionPageToHtml = require('notion-page-to-html');\n\n// using async/await\nasync function getPage() {\n  const { title, icon, cover, html } = await NotionPageToHtml.convert(\"https://www.notion.so/asnunes/Simple-Page-Text-4d64bbc0634d4758befa85c5a3a6c22f\");\n  console.log(title, icon, cover, html);\n}\n\ngetPage();\n```\n\n`cover` is a base64 string from original page cover image. `icon` can be an emoji or base64 image based on original page icon. `html` is a full html document by default. It has style, body, MathJax and PrismJS CDN scripts by default. You can pass some options to handle html content.\n\n```jsx\nNotionPageToHtml.convert(\n  'https://www.notion.so/asnunes/Simple-Page-Text-4d64bbc0634d4758befa85c5a3a6c22f',\n  options,\n);\n```\n\n`options` is an object with the following keys\n\n| Key                     | Default value | If true                                                |\n| ----------------------- | ------------- | ------------------------------------------------------ |\n| `excludeCSS`            | false         | returns html without style tag                         |\n| `excludeMetadata`       | false         | returns html without metatags                          |\n| `excludeScripts`        | false         | returns html without script tags                       |\n| `excludeHeaderFromBody` | false         | returns html without title, cover and icon inside body |\n| `excludeTitleFromHead`  | false         | returns html without title tag in head                 |\n| `bodyContentOnly`       | false         | returns html body tag content only                     |\n\n---\n\n## Development and testing\n\n1. Clone this application\n\n2. Make sure you have node v14 or higher and then install all dependencies\n\n````\nnpm i\n````\nRunning tests:\n\n````\nnpm test\n````\n\nInstalling locally in another project:\n````\nnpm run build\nnpm pack\n````\nInside your project:\n````\nnpm i /path/to/tar/gz\n````\n\nDocker approach for testing\n\n1. Make sure you have Docker and Docker Compose installed and then run:\n````\nmake test\n````\n\n## Contributing\n\nWe love your feedback! Feel free to:\n\n- Report a bug\n- Discuss the current state of the code\n- Submit a fix\n- Propose new features\n- Become a maintainer\n\nJust create a GitHub issue or a PR ;)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasnunes%2Fnotion-page-to-html","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasnunes%2Fnotion-page-to-html","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasnunes%2Fnotion-page-to-html/lists"}