diff --git a/README.md b/README.md index f8e7834..e80e1e6 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/grip-mode.el b/grip-mode.el index 682187d..91a589f 100644 --- a/grip-mode.el +++ b/grip-mode.el @@ -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. @@ -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."