{"id":15454722,"url":"https://github.com/emoriarty/notion_to_md","last_synced_at":"2026-03-08T16:01:43.659Z","repository":{"id":43219369,"uuid":"442518092","full_name":"emoriarty/notion_to_md","owner":"emoriarty","description":"Notion Markdown Exporter in Ruby","archived":false,"fork":false,"pushed_at":"2025-04-19T21:24:33.000Z","size":226,"stargazers_count":16,"open_issues_count":1,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-20T00:59:10.741Z","etag":null,"topics":["markdown","notion","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/emoriarty.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-12-28T16:18:38.000Z","updated_at":"2025-04-19T21:24:26.000Z","dependencies_parsed_at":"2023-02-01T10:16:22.344Z","dependency_job_id":"90fce2b5-755f-4e49-8654-afcd93666c72","html_url":"https://github.com/emoriarty/notion_to_md","commit_stats":{"total_commits":79,"total_committers":4,"mean_commits":19.75,"dds":"0.49367088607594933","last_synced_commit":"c3e0976c195fb9d916b5093602ce351bcca30ceb"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emoriarty%2Fnotion_to_md","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emoriarty%2Fnotion_to_md/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emoriarty%2Fnotion_to_md/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emoriarty%2Fnotion_to_md/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emoriarty","download_url":"https://codeload.github.com/emoriarty/notion_to_md/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249834788,"owners_count":21331988,"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":["markdown","notion","ruby"],"created_at":"2024-10-01T22:05:03.181Z","updated_at":"2026-03-08T16:01:43.647Z","avatar_url":"https://github.com/emoriarty.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"https://ik.imagekit.io/gxidvqvc9/noiton_to_md_logo_white_bg_-OiZSEkqY.png?updatedAt=1756209770491\" width=\"150\"\u003e\n\n# notion_to_md\n\nA Ruby library to export [Notion](https://www.notion.so/) pages and databases to Markdown.\nThe output is fully compliant with the [GitHub Flavored Markdown specification](https://github.github.com/gfm/).\n\n[![Gem Version](https://badge.fury.io/rb/notion_to_md.svg)](https://badge.fury.io/rb/notion_to_md)\n[![CI](https://github.com/emoriarty/notion_to_md/actions/workflows/ci.yml/badge.svg)](https://github.com/emoriarty/notion_to_md/actions)\n\n\u003e [!NOTE]\n\u003e You are reading the documentation for the latest development branch.\n\u003e For the stable **v2.x.x** documentation, see [the v2.x.x branch](https://github.com/emoriarty/notion_to_md/tree/v2.x.x).\n\n## Installation\n\nInstall via RubyGems:\n\n```bash\ngem install notion_to_md\n```\n\nOr add it to your `Gemfile`:\n\n```ruby\ngem 'notion_to_md'\n```\n\n### Beta version\n\nLearn about the new changes in the following [post](https://enrq.me/dev/2025/09/09/jekyll-notion-notion-to-md-3-0-0-beta/).\n\nIf you want to try the **beta release**, install with the `--pre` flag:\n\n```bash\ngem install notion_to_md --pre\n```\n\nOr pin the beta in your Gemfile:\n\n```ruby\ngem \"notion_to_md\", \"3.0.0.beta2\"\n```\n\n⚠️ This version is under active development. For stable usage, prefer the latest `2.x.x` release.\n\n\n## Quick Start\n\n```ruby\n# Convert a Notion page to Markdown\nmd = NotionToMd.call(:page, id: 'b91d5...', token: ENV['NOTION_TOKEN'])\nFile.write(\"page.md\", md)\n```\n\n## Usage\n\nBefore using the gem, create a Notion integration and obtain a secret token.\nSee the [Notion Getting Started Guide](https://developers.notion.com/docs/getting-started) for details.\n\n### Pages\n\n```ruby\nmd = NotionToMd.call(:page, id: 'b91d5...', token: 'secret_...')\n# or equivalently\nmd = NotionToMd.convert(:page, id: 'b91d5...', token: 'secret_...')\n```\n\n`md` is a string containing the page content in Markdown format.\n\n### Databases\n\n```ruby\nmds = NotionToMd.call(:database, id: 'b91d5...')\n```\n\n`mds` is an array of strings, one per page.\n\n### Environment Variables\n\nIf your token is stored in `NOTION_TOKEN`, you don’t need to pass it explicitly:\n\n```bash\nexport NOTION_TOKEN=\u003csecret_...\u003e\n```\n\n```ruby\nmd = NotionToMd.call(:page, id: 'b91d5...')\n```\n\n## Supported Blocks\n\nEverything in Notion is a [block object](https://developers.notion.com/reference/block#block-object-keys).\n\n| Block type                        | Nested children supported? |\n|-----------------------------------|----------------------------|\n| paragraph                         | ✅ |\n| heading_1 / heading_2 / heading_3 | ❌ |\n| bulleted_list_item                | ✅ |\n| numbered_list_item                | ✅ |\n| to_do                             | ✅ |\n| image, file, pdf, video           | ❌ |\n| bookmark, embed, link_preview     | ❌ |\n| callout                           | ❌ |\n| quote                             | ❌ |\n| divider                           | ❌ |\n| table                             | ❌ |\n| code                              | ❌ |\n| equation                          | ❌ |\n\n## Front Matter\n\nBy default, front matter is **disabled**. Enable it with:\n\n```ruby\nNotionToMd.call(:page, id: 'b91d5...', frontmatter: true)\n```\n\n### Examples\n\n**Default properties:**\n\n```yml\n---\nid: e42383cd-4975-4897-b967-ce453760499f\ntitle: An amazing post\ncover: https://img.bank.sh/an_image.jpg\ncreated_time: 2022-01-23T12:31:00.000Z\nlast_edited_time: 2022-01-23T12:31:00.000Z\nicon: 💥\narchived: false\ncreated_by_id: db313571-0280-411f-a6de-70e826421d16\ncreated_by_object: user\nlast_edited_by_id: db313571-0280-411f-a6de-70e826421d16\nlast_edited_by_object: user\n---\n```\n\n**Custom properties:**\n\n```yml\n---\ntags: tag1, tag2, tag3\nmultiple_options: option1, option2\n---\n```\n\nCustom property names are [parameterized](https://api.rubyonrails.org/classes/ActiveSupport/Inflector.html#method-i-parameterize) and [underscored](https://api.rubyonrails.org/classes/ActiveSupport/Inflector.html#method-i-underscore).\n\nSupported property types:\n\n- `number`\n- `select`\n- `multi_select`\n- `date`\n- `people`\n- `files`\n- `checkbox`\n- `url`\n- `email`\n- `phone_number`\n- `rich_text` (plain text only)\n\n\u003e [!NOTE]\n\u003e Advanced types such as `formula`, `relation`, and `rollup` are **not supported**.\n\u003e See the [Notion property value docs](https://developers.notion.com/reference/property-value-object#all-property-values).\n\n## Development\n\nRun the test suite with:\n\n```bash\nrspec\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femoriarty%2Fnotion_to_md","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femoriarty%2Fnotion_to_md","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femoriarty%2Fnotion_to_md/lists"}