Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/saltyshiomix/gfm-preview

Preview your markdown with GitHub API in real time 🎉
https://github.com/saltyshiomix/gfm-preview

gfm javascript markdown markdown-previewer nodejs

Last synced: 16 days ago
JSON representation

Preview your markdown with GitHub API in real time 🎉

Awesome Lists containing this project

README

        


## Usage

```bash
# install it
$ npm install --global gfm-preview

# preview your markdown
$ preview file.md

# preview with firefox
$ preview file.md --browser firefox

# preview with chrome on macOS
$ preview file.md --browser 'google chrome'

# preview custom host and port number
$ preview file.md --host yourhost --port 3333

# preview with GitHub Enterprise API
$ preview file.md --github-api-url https://your-ghe-host:port/api/v3
```

## Feature

- Render your markdown with GitHub API
- Launch a local preview server (`http://localhost:4649`)
- Hot reload previews when detecting changes
- Close the server when the preview is closed
- Support GitHub Enterprise

## How to change default browser

The browser name is platform dependent. For example, Chrome is `google chrome` on macOS, `google-chrome` on Linux and `chrome` on Windows.

```bash
# with chrome on macOS
$ preview file.md --browser 'google chrome'

# with a custom executable
$ preview file.md --browser 'C:\\Program Files\\Mozilla Firefox\\firefox.exe'
```

## If you use GitHub Enterprise (GHE)

Add an alias to your `~./bashrc`:

```bash
alias preview='preview --github-api-url https://your-ghe-host:port/api/v3'
```

Then use it:

```bash
$ preview file.md
```