{"id":13817176,"url":"https://github.com/ff6347/to-markdown-cli","last_synced_at":"2025-04-09T16:05:28.483Z","repository":{"id":37560769,"uuid":"87284060","full_name":"ff6347/to-markdown-cli","owner":"ff6347","description":"a command line tool for turning html to markdown","archived":false,"fork":false,"pushed_at":"2025-04-07T17:32:29.000Z","size":1813,"stargazers_count":33,"open_issues_count":4,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-09T16:05:23.067Z","etag":null,"topics":["cli","converter","html","markdown"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/to-markdown-cli","language":"TypeScript","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/ff6347.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}},"created_at":"2017-04-05T08:13:59.000Z","updated_at":"2025-01-21T22:27:52.000Z","dependencies_parsed_at":"2023-10-14T22:03:11.653Z","dependency_job_id":"80238aa5-b108-4eed-99e9-edb7f25a8733","html_url":"https://github.com/ff6347/to-markdown-cli","commit_stats":{"total_commits":396,"total_committers":11,"mean_commits":36.0,"dds":0.4494949494949495,"last_synced_commit":"e8642568191df5e5ea862975083bc3847ea9ebc4"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ff6347%2Fto-markdown-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ff6347%2Fto-markdown-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ff6347%2Fto-markdown-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ff6347%2Fto-markdown-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ff6347","download_url":"https://codeload.github.com/ff6347/to-markdown-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248065288,"owners_count":21041871,"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":["cli","converter","html","markdown"],"created_at":"2024-08-04T06:00:36.052Z","updated_at":"2025-04-09T16:05:28.458Z","avatar_url":"https://github.com/ff6347.png","language":"TypeScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# to-markdown-cli\n\n[![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg)](#contributors) ![Node CI](https://github.com/ff6347/to-markdown-cli/workflows/Node%20CI/badge.svg) ![npm](https://img.shields.io/npm/v/to-markdown-cli?color=green) ![GitHub last commit](https://img.shields.io/github/last-commit/ff6347/to-markdown-cli)\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fff6347%2Fto-markdown-cli.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fff6347%2Fto-markdown-cli?ref=badge_shield)\n\n## Installation\n\n    npm install -g to-markdown-cli\n\n## Usage\n\n```plain\nUsage: html2md [options]\n\nOptions:\n  -V, --version          output the version number\n  -i, --input \u003cinput\u003e    path to the input file (if input is stdin) it will be ignored\n  -o, --output \u003coutput\u003e  path to the output file\n  -c, --clipboard        use only the clipboard for input and output\n  -g, --gfm              use GitHub Flavored Markdown\n  -h, --help             output usage information\n\n     _   _   _   _   _   _   _\n    / \\ / \\ / \\ / \\ / \\ / \\ / \\\n   ( h | t | m | l | 2 | m | d )\n    \\_/ \\_/ \\_/ \\_/ \\_/ \\_/ \\_/\n\n    html2md turns html into markdown\n\n    - if no input file is given it ueses the clipboard content\n    - if no output file is given it logs the result to stdout\n    - if there is input from stdin clipboard will be ignored for inputs\n\n    Examples:\n        $ html2md -i ./foo.html # output to stdout\n        $ html2md -i ./foo.html -o out.md # output to out.md\n        $ html2md -o out.md # clipboard to out.md\n        $ html2md -c # clipboard to clipboard\n        $ html2md # clipboard to stdout\n        $ html2md -g # clipboard to stdout using GitHub flavored markdown\n        $ echo \"\u003ch1\u003efoo\u003c/h1\u003e\" | html2md # will output to stdout\n\n    Acknowledgments:\n        Build on these great modules:\n        - https://github.com/domchristie/turndown\n        - https://github.com/sindresorhus/clipboardy\n        - https://github.com/tj/commander.js\n```\n\n## Troubleshooting\n\nThe following error indicates that `$DISPLAY` is not set to a valid display: `Error: Both xsel and fallback failed`\n\n**html2md** relies on a valid `$DISPLAY` because it uses clipboard via **xsel**.\nIn some environments (for example, **tmux**) you may need to run the command as follows:\n\n```plain\nDISPLAY=:0 html2md ...  # or whatever your display id is.\n```\n\nFully headless systems may not be able to use **html2md**.\n\n## Contributors\n\nThanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"http://roose.kz\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/277651?v=4?s=128\" width=\"128px;\" alt=\"roose\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eroose\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/ff6347/to-markdown-cli/commits?author=roose\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://fabianmoronzirfas.me\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/315106?v=4?s=128\" width=\"128px;\" alt=\"Fabian Morón Zirfas\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eFabian Morón Zirfas\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/ff6347/to-markdown-cli/commits?author=fabianmoronzirfas\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/cayhorstmann\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/432187?v=4?s=128\" width=\"128px;\" alt=\"cayhorstmann\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003ecayhorstmann\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/ff6347/to-markdown-cli/issues?q=author%3Acayhorstmann\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/akomakom\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/12100822?v=4?s=128\" width=\"128px;\" alt=\"akomakom\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eakomakom\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/ff6347/to-markdown-cli/commits?author=akomakom\" title=\"Documentation\"\u003e📖\u003c/a\u003e \u003ca href=\"https://github.com/ff6347/to-markdown-cli/issues?q=author%3Aakomakom\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/thenbe\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/33713262?v=4?s=128\" width=\"128px;\" alt=\"thenbe\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003ethenbe\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#ideas-thenbe\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!\n\n## Test\n\n```bash\nnpm run test\n```\n\n\n## Acknowledgements\n\nBuild on these great modules:\n\n- [domchristie/turndown: An HTML to Markdown converter written in JavaScript](https://github.com/domchristie/turndown)\n- [sindresorhus/clipboardy: Access the system clipboard (copy/paste)](https://github.com/sindresorhus/clipboardy)\n- [tj/commander.js: node.js command-line interfaces made easy](https://github.com/tj/commander.js)\n\n## Related Projects\n\n- suntong/html2md: HTML to Markdown converter https://github.com/suntong/html2md\n- JohannesKaufmann/html-to-markdown: ⚙️ Convert HTML to Markdown. Even works with entire websites and can be extended through rules. https://github.com/JohannesKaufmann/html-to-markdown\n- thebigbone/markhtml: a fast CLI tool for converting markdown to html https://github.com/thebigbone/markhtml\n- letmutex/htmd: A turndown.js inspired HTML to Markdown converter for Rust https://github.com/letmutex/htmd\n- romansky/dom-to-semantic-markdown: DOM to Semantic-Markdown for use in LLMs https://github.com/romansky/dom-to-semantic-markdown","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fff6347%2Fto-markdown-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fff6347%2Fto-markdown-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fff6347%2Fto-markdown-cli/lists"}