2.0.0 • Published 9 months ago

to-markdown-cli v2.0.0

Weekly downloads
24
License
MIT
Repository
github
Last release
9 months ago

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):

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

Test

npm run test

Acknowledgements

Build on these great modules:

Related Projects

2.0.0

9 months ago

1.1.0

2 years ago

1.0.0

2 years ago

0.4.5

2 years ago

0.4.4

5 years ago

0.4.3

5 years ago

0.4.2

5 years ago

0.4.1

6 years ago

0.3.5

6 years ago

0.3.4

7 years ago

0.3.3

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.2.2

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago