Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add browse-github-url command
  • Loading branch information
lassik committed Oct 13, 2022
commit 52fc760eb0c846fc3d39bf3e72660b406d3ac32a
10 changes: 10 additions & 0 deletions srfi-tools/github.sld
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(define-library (srfi-tools github)
(export srfi-github-org
srfi-github-authorization-token
srfi-github-url
srfi-github-https-url
srfi-github-ssh-url
srfi-create-github-repository)
Expand Down Expand Up @@ -32,6 +33,15 @@
(define (srfi-github-relative-git num)
(string-append (srfi-github-relative num) ".git"))

(define (srfi-github-url num)
(string-append "https://github.com/"
(srfi-github-relative num)))

(define-command (github-url num)
(write-line-about-srfi srfi-github-url num))

;; Is this superfluous? `srfi-github-url` can fetch both the repo
;; and the web page.
(define (srfi-github-https-url num)
(string-append "https://github.com/"
(srfi-github-relative-git num)))
Expand Down
10 changes: 9 additions & 1 deletion srfi-tools/interactive.sld
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
srfi-browse-url
srfi-browse-landing
srfi-browse-landing-url
srfi-browse-github-url
srfi-pager
srfi-edit
srfi-browse-mail-archive-url)
Expand All @@ -17,7 +18,8 @@
(srfi-tools path)
(srfi-tools html)
(srfi-tools mail)
(srfi-tools url))
(srfi-tools url)
(srfi-tools github))
(begin

(define (srfi-open-dir num)
Expand Down Expand Up @@ -72,6 +74,12 @@
(define-command (browse-landing-url num)
(srfi-browse-landing-url (parse-srfi-number num)))

(define (srfi-browse-github-url num)
(browse-url (srfi-github-url num)))

(define-command (browse-github-url num)
(srfi-browse-github-url (parse-srfi-number num)))

;;

(define (srfi-pager num)
Expand Down