From 491559212ba91f28e3f7df2686fd54fc662714fc Mon Sep 17 00:00:00 2001 From: Jeremy Baxter Date: Wed, 17 Jul 2024 18:25:57 +1200 Subject: [PATCH] phobos.el: add support for viewing dub package home pages --- phobos.el | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/phobos.el b/phobos.el index 6b8fd45..73c7dfa 100644 --- a/phobos.el +++ b/phobos.el @@ -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 ." (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)