Lambda-based API to convert Notion API Blocks and RichText to markdown and back
Main page. Sends the readme content as an HTML response.
Parses Markdown content into Notion Blocks.
Request Body:
markdown
: (string) Any Markdown or GFM contentoptions
: (object) Any additional option
Response:
Returns a JSON object of Notion Blocks.
Parses Markdown content into Notion Rich Text.
Request Body:
markdown
: (string) Any Markdown or GFM contentoptions
: (object) Any additional option
Response:
Returns a JSON object of Notion Rich Text.
Converts list of Notion Blocks to Markdown string.
Request Body:
blocks
: (array) List of notion blockstotalPage
: (number) Retrieve block children request number, page_size Maximum = totalPage * 100mdBlocks
: (array) Defines max depth of nestingpageIdentifier
: (string) Identifier for the pagenestingLevel
: (number) Defines max depth of nesting
Response:
Returns a JSON object containing a markdown string with child pages separated.
You can test the API using the following curl commands:
# api/md/to-notion-blocks
curl -X POST -H "Content-Type: application/json" -d "$(cat ./src/tests/md.test.json)" http://localhost:3000/api/md/to-notion-blocks
# md/to-notion-rich-text
curl -X POST -H "Content-Type: application/json" -d "$(cat ./src/tests/md.test.json)" http://localhost:3000/api/md/to-notion-rich-text
# notion/to-md
curl -X POST -H "Content-Type: application/json" -d "$(cat ./src/tests/notion.test.json)" http://localhost:3000/api/notion/to-md
Clone repo
git clone https://github.com/eonian-core/notion-md-translator.git
Install dependencies
cd notion-md-translator
yarn
Build and start server
yarn dev
build
- Build projectstart
- Start server
To run tests, run the following command
# Unit tests on mocks
yarn test
# E2E tests with real requests
yarn test:e2e
To deploy, you need install flyctl and login using fly auth login
To deploy this project run
yarn deploy
- Run
fly status
- show the status of the application instances. - Run
fly apps open
- open your browser and direct it to your app.
Eonian internal project. We trying to be as transparent as possible with our users, as part of this practice we publishing this project. You can also use it for own development. Any contributions and suggestions are welcome!
Contributions are always welcome!
Create new issues or contact us in Discord for any questions!