Need help with grip-mode?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

seagle0128
161 Stars 3 Forks GNU General Public License v3.0 75 Commits 1 Opened issues

Description

Instant Github-flavored Markdown/Org preview using grip

Services available

!
?

Need anything else?

Contributors list

# 35,532
emacs-l...
Emacs
doom-em...
Angular
73 commits

grip-mode

Build Status MELPA MELPA Stable License

Table of Contents

Instant Github-flavored Markdown/Org preview using Grip (GitHub Readme Instant Preview).

Prerequisite

Install

Manual

From melpa,

M-x package-install RET grip-mode RET
.
;; Make a keybinding: `C-c C-c g'
(define-key markdown-mode-command-map (kbd "g") #'grip-mode)

;; Or start grip when opening a markdown/org buffer (add-hook 'markdown-mode-hook #'grip-mode) (add-hook 'org-mode-hook #'grip-mode)

Use-package

;; Use keybindings
(use-package grip-mode
  :ensure t
  :bind (:map markdown-mode-command-map
         ("g" . grip-mode)))

;; Or using hooks (use-package grip-mode :ensure t :hook ((markdown-mode org-mode) . grip-mode))

Run

M-x grip-mode
to preview the markdown and org buffers in the embedded webkit browser if Emacs supports (built with
--with-xwidgets
), or in the default browser (Chrome, Firefox, etc.).

ox-gfm is optional, but it brings better rendering for org files.

Enjoy! :smile:

Customize

Run

M-x customize-group RET grip RET
or set the variables.
;; Path to the grip binary
(setq grip-binary-path "/path/to/grip")

;; A GitHub username for API authentication (setq grip-github-user "")

;; A GitHub password or auth token for API auth (setq grip-github-password "")

;; When nil, update the preview after file saves only, instead of also ;; after every text change (setq grip-update-after-change nil)

;; Use embedded webkit to previe ;; This requires GNU/Emacs version >= 26 and built with the --with-xwidgets ;; option. (setq grip-preview-use-webkit t)

If you don't set them you may have limitation to access Github APIs. Please visit Grip Access for details.

You can get the user name and password from

~/.authinfo
like this.
(require 'auth-source)
(let ((credential (auth-source-user-and-password "api.github.com")))
  (setq grip-github-user (car credential)
        grip-github-password (cadr credential)))

Screenshots

default_browser

xwidget_webkit

Limitations

  • Need to save to preview org buffers due to the performance trade-off.

FAQ

  1. How to resolve the issue: "GitHub Rate Limit Reached"?

You need to set your GitHub username to

grip-github-user
, then Creating a personal access token for the command line and set the new token to
grip-github-password
.

Donate

If you think the it's helpful for you, please consider paying a cup of coffee for me. Thank you! :smile:

Alipay      Wechat Pay

PayPal      Buy Me A Coffee

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.