GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com β€” GitHub - ff6347/to-markdown-cli: a command line tool for turning html to markdown

BranchesTags
Open more actions menu

Latest commit

 

History

561 Commits
561 Commits

Folders and files

NameName
Last commit message
Last commit date
.devcontainer
.devcontainer
 
 
.github
.github
 
 
.vscode
.vscode
 
 
__tests__
__tests__
 
 
playground
playground
 
 
src
src
 
 
types/turndown-plugin-gfm
types/turndown-plugin-gfm
 
 
.all-contributorsrc
.all-contributorsrc
 
 
.editorconfig
.editorconfig
 
 
.eslintrc.cjs
.eslintrc.cjs
 
 
.gitignore
.gitignore
 
 
.npmignore
.npmignore
 
 
.nvmrc
.nvmrc
 
 
AGENTS.md
AGENTS.md
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
jest.config.cjs
jest.config.cjs
 
 
lint-staged.config.js
lint-staged.config.js
 
 
mise.toml
mise.toml
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
prettier.config.cjs
prettier.config.cjs
 
 
release.config.cjs
release.config.cjs
 
 
tsconfig.jest.json
tsconfig.jest.json
 
 
tsconfig.json
tsconfig.json
 
 

Repository files navigation

to-markdown-cli

All Contributors Node CI npm GitHub last commit FOSSA Status

Installation

npm install -g to-markdown-cli

Usage

Usage: html2md [options]

Options:
  -V, --version          output the version number
  -i, --input <input>    path to the input file (if input is stdin) it will be ignored
  -o, --output <output>  path to the output file
  -c, --clipboard        use only the clipboard for input and output
  -g, --gfm              use GitHub Flavored Markdown
  -h, --help             output usage information

     _   _   _   _   _   _   _
    / \ / \ / \ / \ / \ / \ / \
   ( h | t | m | l | 2 | m | d )
    \_/ \_/ \_/ \_/ \_/ \_/ \_/

    html2md turns html into markdown

    - if no input file is given it ueses the clipboard content
    - if no output file is given it logs the result to stdout
    - if there is input from stdin clipboard will be ignored for inputs

    Examples:
        $ html2md -i ./foo.html # output to stdout
        $ html2md -i ./foo.html -o out.md # output to out.md
        $ html2md -o out.md # clipboard to out.md
        $ html2md -c # clipboard to clipboard
        $ html2md # clipboard to stdout
        $ html2md -g # clipboard to stdout using GitHub flavored markdown
        $ echo "<h1>foo</h1>" | html2md # will output to stdout

    Acknowledgments:
        Build on these great modules:
        - https://github.com/domchristie/turndown
        - https://github.com/sindresorhus/clipboardy
        - https://github.com/tj/commander.js

Troubleshooting

The following error indicates that $DISPLAY is not set to a valid display: Error: Both xsel and fallback failed

html2md relies on a valid $DISPLAY because it uses clipboard via xsel. In some environments (for example, tmux) you may need to run the command as follows:

DISPLAY=:0 html2md ...  # or whatever your display id is.

Fully headless systems may not be able to use html2md.

Contributors

Thanks goes to these wonderful people (emoji key):

roose
roose

πŸ’»
Fabian MorΓ³n Zirfas
Fabian MorΓ³n Zirfas

πŸ’»
cayhorstmann
cayhorstmann

πŸ›
akomakom
akomakom

πŸ“– πŸ›
thenbe
thenbe

πŸ€”

This project follows the all-contributors specification. Contributions of any kind welcome!

Test

npm run test

Acknowledgements

Build on these great modules:

  • domchristie/turndown: An HTML to Markdown converter written in JavaScript
  • sindresorhus/clipboardy: Access the system clipboard (copy/paste)
  • tj/commander.js: node.js command-line interfaces made easy

Related Projects

  • suntong/html2md: HTML to Markdown converter https://github.com/suntong/html2md
  • 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
  • thebigbone/markhtml: a fast CLI tool for converting markdown to html https://github.com/thebigbone/markhtml
  • letmutex/htmd: A turndown.js inspired HTML to Markdown converter for Rust https://github.com/letmutex/htmd
  • romansky/dom-to-semantic-markdown: DOM to Semantic-Markdown for use in LLMs https://github.com/romansky/dom-to-semantic-markdown

About

a command line tool for turning html to markdown

www.npmjs.com/package/to-markdown-cli

Topics

cliconverterhtmlmarkdown

Resources

Readme
MIT license
Activity

Stars

33 stars

Watchers

1 watching

Forks

5 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 β€” GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800Γ—600. No cookies required.