summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2022-07-03 01:57:17 +0530
committerArun Isaac2022-07-03 23:21:42 +0530
commit0242897268b61151d9c89ef8ad1db46666517232 (patch)
treeb2117ddd0062a3367bf3be670ee58c6293f7b7be
parentedd7e4010ed228572945a7520d8eaa51cecafe09 (diff)
downloadtissue-0242897268b61151d9c89ef8ad1db46666517232.tar.gz
tissue-0242897268b61151d9c89ef8ad1db46666517232.tar.lz
tissue-0242897268b61151d9c89ef8ad1db46666517232.zip
issue: Use string-remove-prefix from (tissue utils).
* tissue/issue.scm (list-line->alist, file-details): Use string-remove-prefix from (tissue utils). (file-details): Delete function.
-rw-r--r--tissue/issue.scm14
1 files changed, 5 insertions, 9 deletions
diff --git a/tissue/issue.scm b/tissue/issue.scm
index 02982e1..4c9ca84 100644
--- a/tissue/issue.scm
+++ b/tissue/issue.scm
@@ -269,10 +269,6 @@ strings, and return them as a list."
(map (cut string-trim-both <>)
(string-split str #\,)))
-(define (remove-prefix prefix str)
- "Remove PREFIX from STR."
- (substring str (string-length prefix)))
-
(define (<=n-words? str n)
"Return #t if STR has N words or less. Else, return #f."
(<= (length (string-split str #\space))
@@ -298,7 +294,7 @@ return #f."
(cons (cons key (cons element values))
tail))))))
'()
- (comma-split (remove-prefix "* " line)))))
+ (comma-split (string-remove-prefix "* " line)))))
(define (resolve-alias name aliases)
"Resolve NAME against ALIASES, a list of aliases. ALIASES should be
@@ -354,7 +350,7 @@ gemtext file."
;; Is every comma-separated
;; element two words utmost?
(every (cut <=n-words? <> 2)
- (comma-split (remove-prefix "* " line)))
+ (comma-split (string-remove-prefix "* " line)))
;; Does any comma-separated
;; element contain a potential
;; keyword?
@@ -365,16 +361,16 @@ gemtext file."
"enhancement" "progress"
"testing" "later" "documentation"
"help" "closed")))
- (comma-split (remove-prefix "* " line))))
+ (comma-split (string-remove-prefix "* " line))))
(hashtable-append! result 'keywords
(comma-split
- (remove-prefix "* " line))))
+ (string-remove-prefix "* " line))))
;; The first level one heading is the
;; title.
((string-prefix? "# " line)
(unless (hashtable-contains? result 'title)
(hashtable-set! result 'title
- (remove-prefix "# " line)))))))
+ (string-remove-prefix "# " line)))))))
(const #t)
get-line-dos-or-unix
port)