phobos.el: improve documentation

This commit is contained in:
Jeremy Baxter 2024-07-17 17:12:49 +12:00
parent 7d64c06589
commit decfe0dc9c

View file

@ -24,16 +24,19 @@
;;; Code: ;;; Code:
(defvar phobos-browser "xdg-open" (defvar phobos-browser "xdg-open"
"Web browser to use when opening Phobos documentation.") "Web browser to use when opening documentation with `phobos'.")
(defvar phobos-root "https://dlang.org/library" (defvar phobos-root "https://dlang.org/library"
"Root URL to use when viewing Phobos documentation.") "Root URL to use when viewing documentation with `phobos'.")
(defun phobos (symbol-name) (defun phobos (symbol-name)
"View the documentation on SYMBOL-NAME from the Phobos documentation. "View the documentation on SYMBOL-NAME from the Phobos documentation.
SYMBOL-NAME can be a module (e.g. std.algorithm), a submodule (e.g. SYMBOL-NAME can be a module (e.g. std.sumtype), a submodule (e.g.
std.algorithm.searching), a function (e.g. std.algorithm.searching.findSplit) std.algorithm.searching), a function or type (e.g. std.stdio.File)
or any other symbol part of a standard module, such as object.Exception." or any other symbol part of a standard module, such as object.Exception.
Phobos is the standard library for the D programming language. For more
information on Phobos and the D programming language, see <https://dlang.org>."
(interactive "MModule or symbol: ") (interactive "MModule or symbol: ")
(shell-command (concat phobos-browser " " phobos-root "/" (shell-command (concat phobos-browser " " phobos-root "/"
(string-replace "." "/" symbol-name) ".html"))) (string-replace "." "/" symbol-name) ".html")))