summaryrefslogtreecommitdiff
path: root/cider-util.el
diff options
context:
space:
mode:
authorBozhidar Batsov <bozhidar@batsov.com>2016-04-04 12:39:01 +0300
committerBozhidar Batsov <bozhidar@batsov.com>2016-04-04 12:39:01 +0300
commit0cccdabfee4eee235f21b66563a2b790112999fe (patch)
treede4ac5afdaf5fea5495fb694d977eca933bc915a /cider-util.el
parentb123f8f555ea12da83312add926ac261796f722e (diff)
Update the REPL warnings to refer to the new manual
Diffstat (limited to 'cider-util.el')
-rw-r--r--cider-util.el52
1 files changed, 49 insertions, 3 deletions
diff --git a/cider-util.el b/cider-util.el
index 8a889e4d..6566b603 100644
--- a/cider-util.el
+++ b/cider-util.el
@@ -348,8 +348,28 @@ plugin or dependency with:
"Return t if SYM is namespace-qualified."
(string-match-p "[^/]+/" sym))
-(defun cider--readme-button (label section-id)
- "Return a button string that links to the online readme.
+(defvar cider-version)
+
+(defconst cider-manual-url "http://cider.readthedocs.org/en/%s/"
+ "The URL to CIDER's manual.")
+
+(defun cider--manual-version ()
+ "Convert the version to a ReadTheDocs-friendly version."
+ (if (string-match-p "-snapshot" cider-version)
+ "latest"
+ "stable"))
+
+(defun cider-manual-url ()
+ "The CIDER manual's url."
+ (format cider-manual-url (cider--manual-version)))
+
+(defun cider-view-manual ()
+ "View the manual in your default browser."
+ (interactive)
+ (browse-url (cider-manual-url)))
+
+(defun cider--manual-button (label section-id)
+ "Return a button string that links to the online manual.
LABEL is the displayed string, and SECTION-ID is where it points
to."
(with-temp-buffer
@@ -357,10 +377,36 @@ to."
label
'follow-link t
'action (lambda (&rest _) (interactive)
- (browse-url (concat "https://github.com/clojure-emacs/cider#"
+ (browse-url (concat (cider-manual-url)
section-id))))
(buffer-string)))
+(defconst cider-refcard-url "https://github.com/clojure-emacs/cider/raw/%s/doc/cider-refcard.pdf"
+ "The URL to CIDER's refcard.")
+
+(defun cider--github-version ()
+ "Convert the version to a GitHub-friendly version."
+ (if (string-match-p "-snapshot" cider-version)
+ "master"
+ (concat "v" cider-version)))
+
+(defun cider-refcard-url ()
+ "The CIDER manual's url."
+ (format cider-refcard-url (cider--github-version)))
+
+(defun cider-view-refcard ()
+ "View the refcard in your default browser."
+ (interactive)
+ (browse-url (cider-refcard-url)))
+
+(defconst cider-report-bug-url "https://github.com/clojure-emacs/cider/issues/new"
+ "The URL to report a CIDER issue.")
+
+(defun cider-report-bug ()
+ "Report a bug in your default browser."
+ (interactive)
+ (browse-url cider-report-bug-url))
+
(defun cider--project-name (dir)
"Extracts a project name from DIR, possibly nil.
The project name is the final component of DIR if not nil."