{"id":26650557,"url":"https://github.com/gaojiuli/tomd","last_synced_at":"2025-03-25T02:01:44.117Z","repository":{"id":41168807,"uuid":"92415908","full_name":"elliotgao2/tomd","owner":"elliotgao2","description":"Convert HTML to Markdown.","archived":false,"fork":false,"pushed_at":"2020-02-02T10:49:25.000Z","size":46,"stargazers_count":531,"open_issues_count":19,"forks_count":71,"subscribers_count":16,"default_branch":"master","last_synced_at":"2024-10-30T00:10:31.571Z","etag":null,"topics":["html","markdown","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elliotgao2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"custom":null}},"created_at":"2017-05-25T15:13:41.000Z","updated_at":"2024-09-03T04:33:46.000Z","dependencies_parsed_at":"2022-09-26T17:41:03.210Z","dependency_job_id":null,"html_url":"https://github.com/elliotgao2/tomd","commit_stats":null,"previous_names":["gaojiuli/tomd"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotgao2%2Ftomd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotgao2%2Ftomd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotgao2%2Ftomd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotgao2%2Ftomd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elliotgao2","download_url":"https://codeload.github.com/elliotgao2/tomd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245383037,"owners_count":20606265,"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":["html","markdown","python"],"created_at":"2025-03-25T02:01:42.098Z","updated_at":"2025-03-25T02:01:44.105Z","avatar_url":"https://github.com/elliotgao2.png","language":"Python","readme":"# tomd\n\n![[License](https://pypi.python.org/pypi/tomd/)](https://img.shields.io/pypi/l/tomd.svg)\n![[Pypi](https://pypi.python.org/pypi/tomd/)](https://img.shields.io/pypi/v/tomd.svg)\n![[Python](https://pypi.python.org/pypi/tomd/)](https://img.shields.io/pypi/pyversions/tomd.svg)\n\nWhen crawling online articles such as news, blogs, etc. I want to save them in markdown files but not databases.\nTomd has the ability of converting a HTML that converted from markdown. If a HTML can't be described by markdown, tomd can't convert it right.\nTomd is a python tool.\n\n\n## Road map\n\n- [x] Basic support\n- [ ] Full support(Nested list)\n- [ ] Command line tool\n\n## Installation\n\n`pip install tomd`\n\n## Getting Started\n\nInput\n\n```python\nimport tomd\n\ntomd.Tomd('\u003ch1\u003eh1\u003c/h1\u003e').markdown\n# or\ntomd.convert('\u003ch1\u003eh1\u003c/h1\u003e')\n```\n\nOutput\n\n```markdown\n# h1\n```\n\n## Usage\n\n```python\nfrom tomd import Tomd\n\n\nhtml=\"\"\"\n\u003ch1\u003eh1\u003c/h1\u003e\n\u003ch2\u003eh2\u003c/h2\u003e\n\u003ch3\u003eh3\u003c/h3\u003e\n\u003ch4\u003eh4\u003c/h4\u003e\n\u003ch5\u003eh5\u003c/h5\u003e\n\u003ch6\u003eh6\u003c/h6\u003e\n\u003cp\u003eparagraph\n\u003ca href=\"https://github.com\"\u003elink\u003c/a\u003e\n\u003cimg src=\"https://github.com\" class=\"dsad\"\u003eimg\u003c/img\u003e\n\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003e1\u003c/li\u003e\n\u003cli\u003e2\u003c/li\u003e\n\u003cli\u003e3\u003c/li\u003e\n\u003c/ul\u003e\n\u003col\u003e\n\u003cli\u003e1\u003c/li\u003e\n\u003cli\u003e2\u003c/li\u003e\n\u003cli\u003e3\u003c/li\u003e\n\u003c/ol\u003e\n\u003cblockquote\u003eblockquote\u003c/blockquote\u003e\n\u003cp\u003e\u003ccode\u003einline code\u003c/code\u003e\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003eblock code\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003e\n\u003cdel\u003edel\u003c/del\u003e\n\u003cb\u003ebold\u003c/b\u003e\n\u003ci\u003eitalic\u003c/i\u003e\n\u003cb\u003e\u003ci\u003ebold italic\u003c/i\u003e\u003c/b\u003e\n\u003c/p\u003e\n\n\u003chr/\u003e\n\n\u003ctable\u003e\n\u003cthead\u003e\n\u003ctr\u003e\n\u003cth\u003eth1\u003c/th\u003e\n\u003cth\u003eth2\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003ctd\u003etd\u003c/td\u003e\n\u003ctd\u003etd\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003etd\u003c/td\u003e\n\u003ctd\u003etd\u003c/td\u003e\n\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\n\"\"\"\n\n\nTomd(html).markdown\n```\n\n## Result\n\n```markdown\n# h1\n\n## h2\n\n### h3\n\n#### h4\n\n##### h5\n\n###### h6\n\nparagraph\n[link](https://github.com)\n![img](https://github.com)\n\n\n- 1\n- 2\n- 3\n\n1. 1\n1. 2\n1. 3\n\n\u003e blockquote\n\n`inline code`\n\n\nblock code\n\n\n~~del~~\n**bold**\n*italic*\n***bold italic***\n\n\n---\n\n\n|th1|th2\n|------\n|td|td\n|td|td\n\n```\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaojiuli%2Ftomd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgaojiuli%2Ftomd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaojiuli%2Ftomd/lists"}