====== Emacs for wiki editing ======
{{:tools:wikitricks:pasted:20230920-132834.png}}
Dokuwiki's XML-RPC interface allows remote editing outside a browser. [[:tools:emacs]] is one editor that implements this.
The advantagegs of editing in a specialized program include ergonomic link searching and insertion and access to personalized editor settings.
===== Alternatives =====
A less feature-full alternative is to use [[https://github.com/fregante/GhostText|GhostText]] to launch your preferred editor to edit within the browser's text area.
===== Setup =====
To edit dokuwiki in emacs, add the following to your emacs config (e.g. ''~/.emacs.d/init.el''). You will also need to install ''use-package-quelpa'' ((''M-x install-packages RET use-package-quelpa'')).
After evaluating the elisp, you should be able to push Alt + ''x'' and run ''lncd'' to open the wiki.
(setq wiki-user-name "YOURWIKIACCOUNTNAMEHERE")
(use-package dokuwiki
:quelpa ((dokuwiki :fetcher github :repo "WillForan/emacs-dokuwiki") :upgrade t)
:ensure t
:hook
((dokuwiki-open-page .
(lambda ()
(dokuwiki-setup)
(company-mode 1)
(display-line-numbers-mode -1)
(flyspell-mode 1)))))
(use-package dokuwiki-mode
:quelpa ((dokuwiki-mode :fetcher github :repo "WillForan/emacs-dokuwiki-mode") :upgrade t)
:ensure t
:config (require 'outline-magic))
(defun lncd ()
"Open lncd wiki."
(interactive)
(require 'dokuwiki)
(dokuwiki-launch "http://lncd.pitt.edu/wiki/lib/exe/xmlrpc.php" wiki-user-name))
save your password ''WIKIUSER'' and ''WIKIPASSWORD'' in ''~/.authinfo'' as a line like
machine http://lncd.pitt.edu/wiki/lib/exe/xmlrpc.php login WIKIUSER password WIKIPASSWORD