Skip to content

Commit

Permalink
[Feature] New option: grip-preview-host.
Browse files Browse the repository at this point in the history
Close #19.
  • Loading branch information
seagle0128 committed Jun 9, 2021
1 parent 02b7a81 commit 0ef2a35
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ Run `M-x customize-group RET grip RET` or set the variables.
;; after every text change
(setq grip-update-after-change nil)
;; Preview hostname
(setq grip-preview-host "localhost")
;; Use embedded webkit to previe
;; This requires GNU/Emacs version >= 26 and built with the `--with-xwidgets`
;; option.
Expand Down
7 changes: 6 additions & 1 deletion grip-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ When nil, only update the preview on file save."
:type 'boolean
:group 'grip)

(defcustom grip-preview-host "localhost"
"Preview hostname."
:type 'string
:group 'grip)

(defcustom grip-preview-use-webkit t
"Use embedded webkit to preview.
Expand Down Expand Up @@ -134,7 +139,7 @@ Use default browser unless `xwidget' is available."

(defun grip--preview-url ()
"Return grip preview url."
(format "http://localhost:%d" grip--port))
(format "http://%s:%d" grip-preview-host grip--port))

(defun grip-start-process ()
"Render and preview with grip."
Expand Down

0 comments on commit 0ef2a35

Please sign in to comment.