Package: narkdown
Narkdown|English|한국어|A tool to use Notion as a Markdown editor.⚠️NOTE:Narkdown is dependent onnotion-py, theunofficialNotion API created byJamie Alexandre. It can not gurantee it will stay stable. If you need to use in production, I recommend waiting for their official release.Installationpipinstallnarkdown# pip3 install narkdownUsage⚠️NOTE:the latest version of narkdown requires Python 3.5 or greater.Quick StartCLIHow To Find Your Notion v2 Token - Red GregoryPythonexample.pypython3example.pyDatabase template page for testHere is andatabase template pagefor importing pages from the database. Move to that page, duplicate it, and test it.FeaturesImport page from Notion and save it to the desired path.Import database from Notion and save pages to the desired path.Useful for CMS(Contents Manage System) of static pages such as blog or docs page.Support import by status of content.Support filter contents.Importchild pagein Notion page recursively. And importlinked pageas a Notion page link.Support nested block. (e.g. bulleted, numbered, to-do, toggle)Support language selection of code block.Configuring NarkdownNarkdown provides some configuration for how to extract documents. You can configure Narkdown vianarkdown.config.json.Createnarkdown.config.jsonand runpython3 -m narkdownin that directory.// narkdown.config.json{"exportConfig":{"recursiveExport":true,"createPageDirectory":true,"addMetadata":true,"appendCreatedTime":true,"generateSlug":true},"databaseConfig":{"categoryColumnName":"Category","statusColumnName":"Status","currentStatus":"✅ Completed","nextStatus":"🖨 Published"}}NameDescriptionDefaultrecursiveExportWhether or not to recursively export child page.[true]createPageDirectoryWhether or not to create subdirectories with page titles for each page.[true]addMetadataWhether or not to add metadata to content.[false]appendCreatedTimeWhether or not to append created time to filename. ( The page must have a created time property.)[false]generateSlugWhether or not to generate and append slug to metatdata.[false]NameDescriptionDefaultcategoryColumnNameIn Notion database, content can be classified by category byselectproperty. When you create theselectproperty in the Notion database and pass the name of the column, folders are created by category.[""]statusColumnNameIn the Notion database, you can manage the status of content withSelectproperty. If you create aSelectproperty in the Notion database and pass the name of the column, you can import contents in a specific state or change the status of the content. (should be used with thecurrentStatusornextStatusoption.)[""]currentStatusImport only the content that corresponds tocurrentStatusvalue. (statusColumnNamemust be set.)[""]nextStatusChanges content status tonextStatusvalue after import. (statusColumnNamemust be set.)[""]Set env variable fortoken_v2Thetoken_v2of notion is a variable that should not be shared. You can use os environment variable for notion token.Narkdown use theNOTION_TOKENas an environment variable fortoken_v2. Setting this environment variable allow the CLI to omittoken_v2input.AdvancedNotion2GithubrecommendedGithub action to synchronize the content of the notion database with github.Supported BlocksBlock TypeSupportedNotesHeading 1✅ YesConverted to heading 2 in markdown.Heading 2✅ YesConverted to heading 3 in markdown.Heading 3✅ YesConverted to heading 4 in markdown.Text✅ YesDivider✅ YesDivider after the Heading 1 is not added.Callout✅ YesCallout block will be exported as quote block with emoji.Quote✅ YesBulleted list✅ YesSupport nested block.Numbered list✅ YesSupport nested block.To-do list✅ YesSupport nested block.Toggle list✅ YesSupport nested block.Code✅ YesSupport syntax highlighting.Image✅ YesUploaded image will be downloaded to local. Linked image will be linked not be downloaded.Web bookmark✅ YesSame as link text.Page✅ YesImport "Child page" in Notion page recursively. And import "Linked page" as a Notion page link.Table (aka database)✅ YesVideo❌ NoAudio❌ NoFile❌ NoEmbed other services❌ NoAdvanced❌ NoLayout in page❌ NoLicenseMIT ©younho9