Giter Site home page Giter Site logo

shell-preview-markdown's Introduction

Preview Markdown files from the Shell

How is your markdown file going to be rendered? This receives a file and opens it in a browser for you.

$ preview-markdown --from README.md
/tmp/markdown-preview_README.html
$ preview-markdown --output email.rtf --from email.md
email.rtf

The output of the program is always the file generated for preview. By default, a browser is opened - if Lynx is present we prefer it. HTML is preferred as well, but any format supported by Pandoc can be used as output - use file extensions to denote them.

Usage: preview-markdown [options]
       preview-markdown --from README.md
       preview-markdown --from letter.md --output letter.pdf

Will generate an HTML preview of a markfown <file> and open it inside a
browser (Lynx if existing).

Options:
    -f <path>, --from       The markdown file to generate a preview from.
                            Default: README.md
    -o <path>, --output     The output file which will hold the preview.
    -b, --browser           Prefer a real browser (e.g: Firefox) instead of
                            Lynx (if it is available).
    -j, --just-preview      Avoids opening the browser, just generates the
                            preview file as HTML.
    -v, --version           Prints version of the program.
    -h, --help              This help message.
Environment variables:
    PM_CSS_URL              The CSS file to be used for the rendered mardown.
                            Default: GitHub markdown style
    PM_MARKDOWN_EXTENSION   File extension to remove from the generated
                            preview file.
                            Default: md
    PM_DEFAULT_INPUT        If no options are passed, which file should be
                            used as input?
                            Default: README.md

Report issues on https://github.com/augustohp/preview-markdown.
Contact me over augusto.hp [at] gmail [dot] com.

Installation

You can put the single file preview-markdown inside your BIN directories or declare a new PATH to where it is. If you want this easy, you can also use the line below:

sh <(curl -sSL http://git.io/sinister) -u https://github.com/augustohp/shell-preview-markdown/raw/master/preview-markdown

When you execute this, Pandoc may be installed in the first execution. command - only supported on OSX.

LICENSE

MIT

shell-preview-markdown's People

Contributors

augustohp avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

shell-preview-markdown's Issues

Store preferences of users

Opening the preview inside a browser or just creating a new file is probably a behavior the user wants to repeat for every use. Allow a option to save what the user wants as default behavior.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.