Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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 🎉
- Host: GitHub
- URL: https://github.com/saltyshiomix/gfm-preview
- Owner: saltyshiomix
- License: mit
- Created: 2018-08-01T12:06:53.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-01-10T09:36:39.000Z (10 months ago)
- Last Synced: 2024-10-12T05:46:49.330Z (about 1 month ago)
- Topics: gfm, javascript, markdown, markdown-previewer, nodejs
- Language: JavaScript
- Homepage: https://npm.im/gfm-preview
- Size: 273 KB
- Stars: 19
- Watchers: 2
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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
```