Command line tool that converts HTML to markdown.

Overview

@wcj/html-to-markdown

CI NPM @wcj/html-to-markdown version NPM @wcj/html-to-markdown-cli version

HTML conversion tool to markdown. command line tool => @wcj/html-to-markdown-cli.

Installation

This package is ESM only: Node 14+ is needed to use it and it must be import instead of require.

npm i @wcj/html-to-markdown

Command line tool

$ npx @wcj/html-to-markdown-cli ./html/index.html
# 🌐 Request: /Users/xxx/index.html
# 🎉 Compliled successfully!
# ╰┈ Output: /Users/xxx/dist/index.md

$ npx @wcj/html-to-markdown-cli https://jaywcjlove.github.io/idoc/
# 🌐 Request: https://jaywcjlove.github.io/idoc/
# 🎉 Compliled successfully!
# ╰┈ Output: /Users/xxx/dist/idoc.md

# Or

$ sudo npm i @wcj/html-to-markdown-cli -g
$ html-to-markdown ./html/index.html
# 🌐 Request: /Users/xxx/html/index.html
# 🎉 Compliled successfully!
# ╰┈ Output: /Users/xxx/html/dist/index.md

$ html-to-markdown https://jaywcjlove.github.io/idoc/
# 🌐 Request: https://jaywcjlove.github.io/idoc/
# 🎉 Compliled successfully!
# ╰┈ Output: /Users/xxx/dist/idoc.md

Usage

import htmlToMarkdown from '@wcj/html-to-markdown';

htmlToMarkdown({ html: '<h1>Markdown String</h1>' });
// => # Markdown String

API

import { PluggableList } from 'unified';
import { Options as RehypeParseOptions } from 'rehype-parse';
declare type Options = {
  html?: string;
  url?: string;
  rehypeParseOption?: RehypeParseOptions;
  /**
   * List of [remark plugins](https://github.com/remarkjs/remark/blob/main/doc/plugins.md#list-of-plugins) to use.
   * See the next section for examples on how to pass options
   */
  remarkPlugins?: PluggableList;
  /**
   * List of [rehype plugins](https://github.com/rehypejs/rehype/blob/main/doc/plugins.md#list-of-plugins) to use.
   * See the next section for examples on how to pass options
   */
  rehypePlugins?: PluggableList;
};
export default function htmlToMarkdown(options?: Options): Promise<string>;

Development

$ npm i
$ npm install --workspaces
$ npm run build
$ npm run build:cli

Related

Contributors

As always, thanks to our amazing contributors!

Made with action-contributors.

License

Licensed under the MIT License.

Comments
  • chore(deps): update dependency lerna to v5

    chore(deps): update dependency lerna to v5

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | lerna (source) | ^4.0.0 -> ^5.0.0 | age | adoption | passing | confidence |


    Release Notes

    lerna/lerna

    v5.1.6

    Compare Source

    Note: Version bump only for package lerna

    v5.1.5

    Compare Source

    Note: Version bump only for package lerna

    v5.1.4

    Compare Source

    Note: Version bump only for package lerna

    v5.1.3

    Compare Source

    Note: Version bump only for package lerna

    v5.1.2

    Compare Source

    Bug Fixes

    v5.1.1

    Compare Source

    Bug Fixes
    • allow maintenance LTS node 14 engines starting at 14.15.0 (#​3161) (72305e4)

    v5.1.0

    Compare Source

    Note: Version bump only for package lerna

    v5.0.0

    Compare Source

    Note: Version bump only for package lerna


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • fix(deps): pin dependencies - autoclosed

    fix(deps): pin dependencies - autoclosed

    WhiteSource Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | @types/minimist | dependencies | pin | ~1.2.2 -> 1.2.2 | | fs-extra | dependencies | pin | ~10.1.0 -> 10.1.0 | | idoc (source) | devDependencies | pin | ^1.13.11 -> 1.13.11 | | lerna | devDependencies | pin | ^4.0.0 -> 4.0.0 | | minimist | dependencies | pin | ~1.2.6 -> 1.2.6 | | node-fetch | dependencies | pin | ^3.2.3 -> 3.2.3 | | tsbb (source) | devDependencies | pin | ^3.7.2 -> 3.7.2 |

    Add the preset :preserveSemverRanges to your config if you don't want to pin your dependencies.


    Configuration

    📅 Schedule: At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about these updates again.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

    This PR has been generated by WhiteSource Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Configure Renovate

    Configure Renovate

    WhiteSource Renovate

    Welcome to Renovate! This is an onboarding PR to help you understand and configure settings before regular Pull Requests begin.

    🚦 To activate Renovate, merge this Pull Request. To disable Renovate, simply close this Pull Request unmerged.


    Detected Package Files

    • package.json (npm)
    • packages/cli/package.json (npm)
    • packages/html-to-markdown/package.json (npm)

    Configuration Summary

    Based on the default config's presets, Renovate will:

    • Start dependency updates only once this onboarding PR is merged
    • Enable Renovate Dependency Dashboard creation
    • If semantic commits detected, use semantic commit type fix for dependencies and chore for all others
    • Ignore node_modules, bower_components, vendor and various test/tests directories
    • Autodetect whether to pin dependencies or maintain ranges
    • Rate limit PR creation to a maximum of two per hour
    • Limit to maximum 10 open PRs at any time
    • Group known monorepo packages together
    • Use curated list of recommended non-monorepo package groupings
    • Fix some problems with very old Maven commons versions
    • Ignore spring cloud 1.x releases
    • Ignore web3j 5.0.0 release
    • Ignore http4s digest-based 1.x milestones
    • Use node versioning for @types/node
    • Limit concurrent requests to reduce load on Repology servers until we can fix this properly, see issue 10133
    • Do not upgrade from Alpine stable to edge

    🔡 Would you like to change the way Renovate is upgrading your dependencies? Simply edit the renovate.json in this branch with your custom config and the list of Pull Requests in the "What to Expect" section below will be updated the next time Renovate runs.


    What to Expect

    With your current configuration, Renovate will create 1 Pull Request:

    fix(deps): pin dependencies

    ❓ Got questions? Check out Renovate's Docs, particularly the Getting Started section. If you need any further assistance then you can also request help here.


    This PR has been generated by WhiteSource Renovate. View repository job log here.

    opened by renovate[bot] 0
  • chore(deps): update dependency lerna to v6

    chore(deps): update dependency lerna to v6

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | lerna (source) | ^5.0.0 -> ^6.0.0 | age | adoption | passing | confidence |


    Release Notes

    lerna/lerna

    v6.0.3

    Compare Source

    Note: Version bump only for package lerna

    v6.0.2

    Compare Source

    Note: Version bump only for package lerna

    v6.0.1

    Compare Source

    Bug Fixes

    v6.0.0

    Compare Source

    Note: Version bump only for package lerna


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Dependency Dashboard

    Dependency Dashboard

    This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

    Other Branches

    These updates are pending. To force PRs open, click the checkbox below.

    • [ ] chore(deps): update jaywcjlove/create-tag-action action to v1.3.15
    • [ ] chore(deps): update jaywcjlove/changelog-generator action to v1.6.2

    Open

    These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

    Detected dependencies

    github-actions
    .github/workflows/ci.yml
    • actions/checkout v3
    • actions/setup-node v3
    • jaywcjlove/create-tag-action v1.3.6
    • peaceiris/actions-gh-pages v3
    • jaywcjlove/changelog-generator v1.5.3
    • ncipollo/release-action v1
    • JS-DevTools/npm-publish v1
    npm
    package.json
    • idoc ^1.13.11
    • lerna ^5.0.0
    • tsbb ^3.7.2
    packages/cli/package.json
    • @types/minimist ~1.2.2
    • fs-extra ~10.1.0
    • minimist ~1.2.6
    • node-fetch ^3.2.3
    • node ^14.16 || >=16.0.0
    packages/html-to-markdown/package.json
    • rehype ^12.0.1
    • rehype-format ^4.0.1
    • rehype-ignore ^1.0.1
    • rehype-remark ^9.1.2
    • rehype-video ^1.2.2
    • remark-gfm ^3.0.1
    • remark-stringify ^10.0.2
    • unified ^10.1.2
    • node ^14.16 || >=16.0.0

    • [ ] Check this box to trigger a request for Renovate to run again on this repository
    opened by renovate[bot] 0
Releases(v1.0.1)
  • v1.0.1(Apr 25, 2022)

    Documentation v1.0.1: https://raw.githack.com/jaywcjlove/html-to-markdown-cli/678a689/index.html
    Comparing Changes: https://github.com/jaywcjlove/html-to-markdown-cli/compare/v1.0.0...v1.0.1

    • 💄 chore: update workflows config. 38a91e7
    • 📖 doc: Update README.md b127e0c
    • 💄 chore: Update workflows config. 1b6d8b6
    • 💄 chore: update enovate.json 9cf58c3
    • 📖 doc: Update README.md 7c27907
    • 📖 doc: Update README.md cc54aa9
    • 🌟 feat: add remarkPlugins/rehypePlugins options. 226cd10
    • 📖 doc: Update API document. 6e50f05
    Source code(tar.gz)
    Source code(zip)
Owner
小弟调调™
(͡·̮̃·̃) 如今撸码,像是早上起来需要刷牙一样的习惯。
小弟调调™
🦄 A command line tool to get tokens on testnets quickly!

?? faucetli A command line tool to get tokens on testnets quickly! Usage Commands Usage $ npm install -g faucetli $ faucetli COMMAND running command..

Kira 60 Jan 1, 2023
A command-line tool to convert Project Zomboid map data into Deep Zoom format

pzmap2dzi pzmap2dzi is a command-line tool running on Windows to convert Project Zomboid map data into Deep Zoom format. Features Supports both python

Min Xiang 14 Dec 31, 2022
Command line tool that automatically migrates tests from protractor to playwright.

Protractor to Playwright migration tool This tool is designed to automatically migrate code from Protractor to Playwright. It is inspired by the "Migr

Amadeus IT Group 9 Nov 20, 2022
📸 A command-line tool to generate code images of your local code right away from the terminal

?? rayli ?? A command-line tool to generate code images of your local code right away from the terminal Usage Commands Usage $ npm install -g rayli $

buidler's hub 45 Nov 4, 2022
🦄 A command line tool to get tokens on testnets quickly!

?? faucetli ?? A command line tool to get tokens on testnets quickly! Usage Commands Usage $ npm install -g faucetli $ faucetli COMMAND running comman

buidler's hub 56 May 11, 2022
Command line tool to interact with exist-db instances (pre-release)

xst [ĭg-zĭst′] Command line tool to interact with exist-db instances. Built on top of @existdb/node-exist. Installation Until this package is official

Juri Leino 0 Aug 4, 2022
A command-line tool to manage Deno scripts installed via deno install

??️ nublar nublar is a command-line tool to manage your scripts installed via deno install. ??️ Installation deno install --allow-read --allow-write -

Shun Ueda 16 Dec 26, 2022
Prismatic's CLI tool for managing prismatic.io resources from the command line

@prismatic-io/prism Prism is Prismatic's CLI tool that allows you to build, deploy, and support integrations in Prismatic from the comfort of your com

Prismatic.io 7 Oct 4, 2022
CloudCrafter CLI is a command-line interface tool that provides templates for common cloud resources to help you get started quickly.

CloudCrafter CLI CloudCrafter CLI is a command-line interface tool that provides templates for common cloud resources to help you get started quickly.

Missio 7 May 5, 2023
CLI tool that converts rgb(), rgba(), hex, hsl() and hsla() colors to oklch() in specified CSS files.

convert-to-oklch CLI tool that converts rgb(), rgba(), hex, hsl() and hsla() colors to oklch() in specified CSS files. npx convert-to-oklch ./src/**/*

Fedya Petrakov 43 Dec 20, 2022
Converts JSX to HTML strings at compile time.

unplugin-jsx-string Converts JSX to HTML strings at compile time. Installation npm i unplugin-jsx-string Vite // vite.config.ts import JsxString from

三咲智子 9 Sep 3, 2022
A plugin for the Obsidian markdown note application, adding functionality to render markdown documents with multiple columns of text.

Multi-Column Markdown Take your boring markdown document and add some columns to it! With Multi Column Markdown rather than limiting your document lay

Cameron Robinson 91 Jan 2, 2023
A markdown-it plugin that process images through the eleventy-img plugin. Can be used in any projects that uses markdown-it.

markdown-it-eleventy-img A markdown-it plugin that process images through the eleventy-img plugin. Can be used in any projects that use markdown-it. F

null 25 Dec 20, 2022
An obsidian plugin for uploading local images embedded in markdown to remote store and export markdown for publishing to static site.

Obsidian Publish This plugin cloud upload all local images embedded in markdown to specified remote image store (support imgur only, currently) and ex

Addo.Zhang 7 Dec 13, 2022
Markdown Transformer. Transform markdown files to different formats

Mdtx Inspired by generative programming and weed :). So I was learning Elm language at home usually in the evening and now I am missing all this gener

Aexol 13 Jan 2, 2023
🎨ansi escape code generator to help make colorful command line tools

ansicodes ?? ansi escape code generator to help make colorful command line tools i got tired of looking up ansi code tables when writing command line

Gabe Banks 53 Dec 17, 2022
enables communication between command-line or desktop applications and browser-based Ethereum wallets such as Metamask.

@securerpc/walletbus @securerpc/walletbus Abstract Quickstart Installation Usage Ethers.js Web3.js Configuration options Logging Development Automated

Manifold Finance 8 Dec 27, 2022
Offline rendering examples at the command line with Node.js

Elementary Audio Offline Rendering Examples This repository holds a set of small examples using Elementary in Node.js to process audio files. Each sub

Elementary Audio 8 Jun 12, 2022
✨ A command-line interface for quickly sharing code snippets of your local files

?? snipli ✨ A command-line interface for quickly sharing code snippets for your local files Usage Commands Usage $ npm install -g snipli $ snipli COMM

Kira 146 Nov 3, 2022