aboutsummaryrefslogtreecommitdiff
path: root/wiki-engine.el
diff options
context:
space:
mode:
authorYuchen Pei <id@ypei.org>2023-07-20 21:26:38 +1000
committerYuchen Pei <id@ypei.org>2023-07-20 21:26:38 +1000
commitfcf126f8aab283078111f8dac0b589e51f30f0ce (patch)
tree47aebf5c531ad8d57b0925d369a8a7048dac46d9 /wiki-engine.el
parentd94ab3b180c974682b90bd6587547b87d2da301d (diff)
Adding functions to get html url
Diffstat (limited to 'wiki-engine.el')
-rw-r--r--wiki-engine.el20
1 files changed, 17 insertions, 3 deletions
diff --git a/wiki-engine.el b/wiki-engine.el
index 6da4ad2..74dbe15 100644
--- a/wiki-engine.el
+++ b/wiki-engine.el
@@ -29,6 +29,17 @@
(require 'wiki-utils)
(require 'wiki-markup)
+(defun wiki-engine-html-url (site title)
+ "Return the url of the html webpage of TITLE on SITE."
+ (format "%s%s" (plist-get (alist-get site wiki-sites) :base-url)
+ title))
+
+(defun wiki-current-html-url ()
+ "Return the url of the html webpage of the current wiki buffer."
+ (unless (and wiki-site wiki-title)
+ (error "Nil wiki-site or wiki-title!"))
+ (wiki-engine-html-url wiki-site wiki-title))
+
(defun wiki-engine-mediawiki-fetch (wiki-site title)
"Fetch a mediawiki entry describing TITLE.
@@ -47,7 +58,8 @@ The site handle is passed as a symbol WIKI-SITE."
(wiki-locate-dir wiki-site)
(lambda ()
(wiki-mode)
- (setq-local wiki-site wiki-site)
+ (setq-local wiki-site wiki-site
+ wiki-title title)
)
))))
@@ -65,7 +77,8 @@ The site handle is passed as a symbol WIKI-SITE."
(wiki-locate-dir wiki-site)
(lambda ()
(wiki-mode)
- (setq-local wiki-site wiki-site)
+ (setq-local wiki-site wiki-site
+ wiki-title title)
)
title))))
@@ -83,7 +96,8 @@ The site handle is passed as a symbol WIKI-SITE."
(wiki-locate-dir wiki-site)
(lambda ()
(wiki-mode)
- (setq-local wiki-site wiki-site)
+ (setq-local wiki-site wiki-site
+ wiki-title title)
)
title))))