phobos.el: add support for viewing dub package home pages

This commit is contained in:
Jeremy Baxter 2024-07-17 18:25:57 +12:00
parent 134d726321
commit 491559212b

View file

@ -29,6 +29,8 @@
"Root URL to use when viewing documentation with `phobos'.")
(defvar phobos-dpldocs-domain "dpldocs.info"
"Root domain to use when viewing documentation on dub packages with `dub-doc'.")
(defvar phobos-registry-root "https://code.dlang.org"
"Root URL of the D package registry used with `describe-dub-package'.")
(defun phobos (symbol)
"View the documentation on SYMBOL from the Phobos documentation.
@ -60,4 +62,13 @@ site hosted at <https://dpldocs.info>."
(defalias 'view-dub-documentation 'dub-doc)
(defun describe-dub-package (package)
"View the home page for dub package PACKAGE.
PACKAGE is the name of a package listed on the code.dlang.org registry.
Also see `dub-doc' for retrieving documentation for a specific symbol."
(interactive "MPackage name: ")
(shell-command (format "%s %s/packages/%s"
phobos-browser phobos-registry-root package)))
(provide 'phobos)