branch: externals/kiwix commit 0acfd6a6cc8e8aa0d7df2ebda8e6fb697dbf41ea Author: Stefan Monnier <monn...@iro.umontreal.ca> Commit: stardiviner <numbch...@gmail.com>
Remove un-necessary autoload cookies, improve config of org-kiwix --- README.org | 17 +++++++++++------ kiwix.el | 1 - org-kiwix.el | 7 +------ 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/README.org b/README.org index e249fcd..cb471e3 100644 --- a/README.org +++ b/README.org @@ -89,7 +89,7 @@ https://chrome.google.com/webstore/detail/kiwix/donaljnlmapmngakoipdmehbfcioahhk :hook (org-load . org-kiwix-setup-link)) #+end_src -* Setup +* Setup kiwix-serve If you use kiwix-serve Docker container, you can create an Systemd unit service to auto start Docker container. Here is the systemd unit config file: @@ -279,7 +279,7 @@ docker container ls --all | grep "kiwix-serve" | cat : b47533ecd7f6 kiwix/kiwix-serve "/usr/local/bin/kiwi…" 3 hours ago Exited (137) 2 minutes ago kiwix-serve : e2f201e655ac kiwix/kiwix-serve "/usr/local/bin/kiwi…" 3 hours ago Created distracted_hofstadter -* Load +* Config ** use-package @@ -287,12 +287,13 @@ docker container ls --all | grep "kiwix-serve" | cat (use-package kiwix :ensure t :after org + :custom ((kiwix-server-use-docker t) + (kiwix-server-port 8089) + (kiwix-default-library "wikipedia_en_all_2016-02.zim") ; "wikipedia_zh_all_2015-11.zim" + (kiwix-default-browser-function 'eww)) :commands (kiwix-launch-server kiwix-at-point) :init (require 'org-kiwix) - (setq kiwix-server-use-docker t - kiwix-server-port 8089 - kiwix-default-library "wikipedia_en_all_2016-02.zim" ; "wikipedia_zh_all_2015-11.zim" - kiwix-default-browser-function 'eww)) + :config (add-hook 'org-load-hook #'org-kiwix-setup-link)) #+end_src * Usage @@ -303,6 +304,10 @@ docker container ls --all | grep "kiwix-serve" | cat ** Org Mode integration +#+begin_src emacs-lisp +(require 'org-kiwix) +#+end_src + =[C-c C-l]= to insert link. The link format is like this: diff --git a/kiwix.el b/kiwix.el index b044d6e..414542f 100644 --- a/kiwix.el +++ b/kiwix.el @@ -132,7 +132,6 @@ (const :tag "xwidget browser" xwidget-webkit-browse-url)) :safe #'symbolp) -;;;###autoload (defun kiwix--get-library-name (file) "Extract library name from library file." (replace-regexp-in-string "\\.zim\\'" "" file)) diff --git a/org-kiwix.el b/org-kiwix.el index 3e68c81..999bf01 100644 --- a/org-kiwix.el +++ b/org-kiwix.el @@ -1,6 +1,6 @@ ;;; org-kiwix.el --- Org Mode link support -*- lexical-binding: t; -*- -;;; Time-stamp: <2020-12-17 08:02:31 stardiviner> +;;; Time-stamp: <2020-12-29 17:34:08 stardiviner> ;; Copyright (C) 2019-2020 Free Software Foundation, Inc. @@ -56,7 +56,6 @@ t nil)) -;;;###autoload (defun kiwix-org-get-library (link) "Get library from Org-mode `LINK'." (let ((library (catch 'args-out-of-range @@ -71,7 +70,6 @@ (kiwix-select-library "en")) (t (kiwix-select-library)))))) -;;;###autoload (defun org-wikipedia-open-link (link) "Open LINK in external Wikipedia program." ;; The regexp: (library):query @@ -100,7 +98,6 @@ ;; (prin1 (format "library: %s, query: %s, url: %s" library query url)) (browse-url url))) -;;;###autoload (defun org-wikipedia-export-link (link description format) "Export the Wikipedia LINK with DESCRIPTION for FORMAT from Org files." (when (string-match "\\(?:(\\(.*\\)):\\)?\\([^] \n\t\r]*\\)" link) @@ -117,7 +114,6 @@ ((eq format 'latex) (format "\\href{%s}{%s}" path desc)) (t path)))))) -;;;###autoload (defun org-wikipedia-store-link () "Store a link to a Wikipedia link." ;; [C-c o C-l l] `org-store-link' @@ -131,7 +127,6 @@ :description query) link))) -;;;###autoload (defun org-wikipedia-complete-link (&optional arg) "Use kiwix AJAX request to provide available completion keywords." (let* ((query (or arg (read-from-minibuffer "Search keyword: ")))