{"id":15292088,"url":"https://github.com/thibaudcolas/draftjs_exporter_markdown","last_synced_at":"2025-08-11T05:11:28.697Z","repository":{"id":39954499,"uuid":"123190078","full_name":"thibaudcolas/draftjs_exporter_markdown","owner":"thibaudcolas","description":"Library to convert rich text from Draft.js raw ContentState to Markdown","archived":false,"fork":false,"pushed_at":"2025-03-07T13:48:58.000Z","size":783,"stargazers_count":3,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-02T04:36:39.332Z","etag":null,"topics":["draft-js","draftjs-exporter","draftjs-utils","exporter","python"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/draftjs-exporter-markdown/","language":"Python","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/thibaudcolas.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-02-27T21:21:08.000Z","updated_at":"2025-03-07T13:49:02.000Z","dependencies_parsed_at":"2023-12-06T17:27:43.060Z","dependency_job_id":"f075d73f-15de-4328-9d8a-60a3b4240fb9","html_url":"https://github.com/thibaudcolas/draftjs_exporter_markdown","commit_stats":{"total_commits":260,"total_committers":4,"mean_commits":65.0,"dds":0.5461538461538462,"last_synced_commit":"878dba1b9ed3bad3d50cba4c4639fb6c7f596c6f"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/thibaudcolas/draftjs_exporter_markdown","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thibaudcolas%2Fdraftjs_exporter_markdown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thibaudcolas%2Fdraftjs_exporter_markdown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thibaudcolas%2Fdraftjs_exporter_markdown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thibaudcolas%2Fdraftjs_exporter_markdown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thibaudcolas","download_url":"https://codeload.github.com/thibaudcolas/draftjs_exporter_markdown/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thibaudcolas%2Fdraftjs_exporter_markdown/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269832909,"owners_count":24482334,"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","status":"online","status_checked_at":"2025-08-11T02:00:10.019Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["draft-js","draftjs-exporter","draftjs-utils","exporter","python"],"created_at":"2024-09-30T16:16:27.945Z","updated_at":"2025-08-11T05:11:28.675Z","avatar_url":"https://github.com/thibaudcolas.png","language":"Python","readme":"# Draft.js exporter 🐍 - Markdown edition\n\n\u003e Library to convert rich text from Draft.js raw ContentState to Markdown, based on [Draft.js exporter](https://github.com/springload/draftjs_exporter).\n\u003e\n\u003e 🚧 This is an experimental exporter with limited Markdown support – please use with caution.\n\n## Usage\n\nThis package is a Markdown export configuration for the [Draft.js exporter](https://github.com/springload/draftjs_exporter). Specifically, it provides:\n\n- A Markdown-friendly exporter engine, with fallbacks to HTML tags.\n- Configuration for basic Markdown formatting.\n\nFirst, install the package:\n\n```sh\npip install draftjs_exporter_markdown\n```\n\nThen, to convert Draft.js content to Markdown:\n\nAnd in Python:\n\n```py\nfrom draftjs_exporter.html import HTML\nfrom draftjs_exporter_markdown import BLOCK_MAP, ENGINE, ENTITY_DECORATORS, STYLE_MAP\n\n# Initialise the exporter.\nexporter = HTML({\n    # Those configurations are overridable like for draftjs_exporter.\n    'block_map': BLOCK_MAP,\n    'style_map': STYLE_MAP,\n    'entity_decorators': ENTITY_DECORATORS,\n    'engine': ENGINE,\n})\n\nmarkdown = exporter.render({\n    'entityMap': {},\n    'blocks': [{\n        'key': '6mgfh',\n        'text': 'Hello, world!',\n        'type': 'unstyled',\n        'depth': 0,\n        'inlineStyleRanges': [],\n        'entityRanges': []\n    }]\n})\n\nprint(markdown)\n```\n\nYou can also run an example by downloading this repository and then using `python example.py`.\n\n### Configuration\n\nPlease refer to the [Draft.js exporter configuration documentation](https://github.com/springload/draftjs_exporter#configuration).\n\n### Supported Markdown formatting\n\nThe built-in configuration provides support for:\n\n- Inline styles: bold, italic, strikethrough, code\n- Blocks: paragraphs, heading levels, bullet and number lists, code blocks, blockquote\n- Images, links, and horizontal rules\n\nContrary to the main Draft.js exporter,\n\n- Nested / overlapping styles aren't supported.\n- None of the content is escaped (HTML escaping is unnecessary for Markdown, and there is no Markdown escaping).\n\n## Development\n\n\u003e Requirements: `virtualenv`, `pyenv`, `twine`\n\n```sh\ngit clone git@github.com:thibaudcolas/draftjs_exporter_markdown.git\ncd draftjs_exporter_markdown/\n\n# Install dependencies\nnvm install\nnpm install\n# For tests and development in watch mode.\nnpm install -g nodemon\n\n# Install the Python environment.\nvirtualenv .venv\nsource ./.venv/bin/activate\nmake init\n\n# Install required Python versions\npyenv install --skip-existing 3.6.3\n# Make required Python versions available globally.\npyenv global system 3.6.3\n\n# Run the built-in example.\nmake dev\n```\n\n### Releases\n\nUse `make release`, which uses [standard-version](https://github.com/conventional-changelog/standard-version) to generate the CHANGELOG and decide on the version bump based on the commits since the last release.\n\n## Credits\n\nView the full list of [contributors](https://github.com/thibaudcolas/draftjs_exporter_markdown/graphs/contributors). [MIT](LICENSE) licensed.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthibaudcolas%2Fdraftjs_exporter_markdown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthibaudcolas%2Fdraftjs_exporter_markdown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthibaudcolas%2Fdraftjs_exporter_markdown/lists"}