{"id":13681849,"url":"https://github.com/breakdance/breakdance-mercury","last_synced_at":"2025-04-21T15:31:35.333Z","repository":{"id":143869753,"uuid":"100088675","full_name":"breakdance/breakdance-mercury","owner":"breakdance","description":"Breakdance plugin for mercury, the spiritual successor to readability.com. Mercury removes ads and distractions from HTML before passing it to breakdance, resulting in cleaner, more readable markdown.","archived":false,"fork":false,"pushed_at":"2017-08-12T04:25:49.000Z","size":14,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-16T04:24:12.170Z","etag":null,"topics":["breakdance","breakdanceplugin","convert","converter","html","html-to-markdown","markdown","mercury","plain-text","readability","text"],"latest_commit_sha":null,"homepage":"http://breakdance.io","language":"JavaScript","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/breakdance.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/contributing.md","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":"2017-08-12T04:20:25.000Z","updated_at":"2023-04-06T16:19:01.000Z","dependencies_parsed_at":"2023-09-05T08:46:53.798Z","dependency_job_id":null,"html_url":"https://github.com/breakdance/breakdance-mercury","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/breakdance%2Fbreakdance-mercury","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/breakdance%2Fbreakdance-mercury/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/breakdance%2Fbreakdance-mercury/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/breakdance%2Fbreakdance-mercury/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/breakdance","download_url":"https://codeload.github.com/breakdance/breakdance-mercury/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250080674,"owners_count":21371547,"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":["breakdance","breakdanceplugin","convert","converter","html","html-to-markdown","markdown","mercury","plain-text","readability","text"],"created_at":"2024-08-02T13:01:36.862Z","updated_at":"2025-04-21T15:31:35.078Z","avatar_url":"https://github.com/breakdance.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# breakdance-mercury [![NPM version](https://img.shields.io/npm/v/breakdance-mercury.svg?style=flat)](https://www.npmjs.com/package/breakdance-mercury) [![NPM monthly downloads](https://img.shields.io/npm/dm/breakdance-mercury.svg?style=flat)](https://npmjs.org/package/breakdance-mercury) [![NPM total downloads](https://img.shields.io/npm/dt/breakdance-mercury.svg?style=flat)](https://npmjs.org/package/breakdance-mercury) [![Linux Build Status](https://img.shields.io/travis/breakdance/breakdance-mercury.svg?style=flat\u0026label=Travis)](https://travis-ci.org/breakdance/breakdance-mercury)\n\n\u003e Breakdance plugin for mercury, the spiritual successor to readability.com. Mercury removes ads and distractions from HTML before passing it to breakdance, resulting in cleaner, more readable markdown.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save breakdance-mercury\n```\n\n## Usage\n\nAdd `breakdance-mercury` to your node.js application with the following line of JavaScript:\n\n```js\nvar mercury = require('breakdance-mercury');\n```\n\n## API\n\n### [mercury](index.js#L28)\n\nThe main export is a function that takes a `url` and `options`, and returns a promise. See [breakdance](http://breakdance.io) for documentation and all available options.\n\n**Params**\n\n* `url` **{String}**: The url of the HTML file to convert to markdown using [breakdance](http://breakdance.io)\n* `options` **{Object}**: Options to pass to [breakdance](http://breakdance.io)\n* `returns` **{Promise}**\n\n**Example**\n\n```js\nmercury('http://breakdance.io/plugins.html')\n  .then(function(res) {\n    console.log(res.markdown);\n  });\n```\n\n### [.reduce](index.js#L53)\n\nConvert multiple HTML files to markdown by passing a base `url` and an array of `paths`.\n\n**Params**\n\n* `url` **{String}**: The base url to use.\n* `paths` **{String}**: One or more paths to concatenate to the base `url`.\n* `options` **{Object}**: Options to pass to [breakdance](http://breakdance.io)\n* `returns` **{Promise}**\n\n**Example**\n\n```js\nmercury.reduce('http://breakdance.io/', ['docs.html', 'plugins.html'])\n  .then(function(urls) {\n    urls.forEach((res) =\u003e console.log(res.md));\n  });\n```\n\n## CLI\n\n### Installing the CLI\n\n```sh\n$ npm install  --global breakdance-mercury\n```\n\nThis adds the `bdm` command to your system path, allowing you to run breakdance-mercury CLI from any directory:\n\n```sh\n$ bdm [options] \u003csrc\u003e \u003cdest\u003e\n# or use the \"breakdance-mercury\" alias in case of conflicts\n$ breakdance-mercury [options] \u003csrc\u003e \u003cdest\u003e\n```\n\n### CLI examples\n\nGet `http://breakdance.io/plugins.html` and convert it to markdown with [breakdance](http://breakdance.io), then write it to `plugins.md`.\n\n```sh\n$ bdm http://breakdance.io/plugins.html\n# or using flags\n$ bdm -s http://breakdance.io/plugins.html -d foo.md\n# \"pick\" just the \".main-content\" section from the page\n$ bdm -s http://breakdance.io/plugins.html -d foo.md -p \".main-content\"\n```\n\n### CLI options\n\n```\nUsage: $ bdm [options] \u003csrc\u003e \u003cdest\u003e\n\n   src:  The URL of the source file to convert to markdown\n  dest:  Name of the markdown destination file to create.\n         By default the HTML filename is used with a .md\n         extension.\n\nOptions:\n\n  -h, --help     Show this help menu in the terminal\n  -s, --src      Show this help menu in the terminal\n  -c, --condense Collapse more than two newlines to only\n                 two newlines. Enabled by default\n  -d, --dest     The destination filepath to use.\n  -o, --omit     One or more tags to omit entirely from\n                 the HTML before converting to markdown.\n  -p, --pick     One or more tags to pick entirely from the\n                 HTML before converting to markdown.\n  --comments     Include HTML code comments in the generated\n                 markdown string. Disabled by default\n\n```\n\n## About\n\n### Related projects\n\nYou might also be interested in these projects:\n\n* [breakdance-cli](https://www.npmjs.com/package/breakdance-cli): CLI for breakdance, the HTML to markdown converter for node.js. | [homepage](https://github.com/breakdance/breakdance-cli \"CLI for breakdance, the HTML to markdown converter for node.js.\")\n* [breakdance-request](https://www.npmjs.com/package/breakdance-request): Get a webpage from a URL and convert it to markdown. | [homepage](https://github.com/breakdance/breakdance-request \"Get a webpage from a URL and convert it to markdown.\")\n* [breakdance](https://www.npmjs.com/package/breakdance): Breakdance is a node.js library for converting HTML to markdown. Highly pluggable, flexible and easy… [more](http://breakdance.io) | [homepage](http://breakdance.io \"Breakdance is a node.js library for converting HTML to markdown. Highly pluggable, flexible and easy to use. It's time for your markup to get down.\")\n\n### Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\nPlease read the [contributing guide](.github/contributing.md) for advice on opening issues, pull requests, and coding standards.\n\n### Building docs\n\n_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme \u0026\u0026 verb\n```\n\n### Running tests\n\nRunning and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:\n\n```sh\n$ npm install \u0026\u0026 npm test\n```\n\n### Author\n\n**Jon Schlinkert**\n\n* [github/jonschlinkert](https://github.com/jonschlinkert)\n* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)\n\n### License\n\nCopyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on August 12, 2017._","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbreakdance%2Fbreakdance-mercury","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbreakdance%2Fbreakdance-mercury","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbreakdance%2Fbreakdance-mercury/lists"}