diff options
Diffstat (limited to 'hnreader.el')
-rw-r--r-- | hnreader.el | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/hnreader.el b/hnreader.el index a2fd302..65b6d49 100644 --- a/hnreader.el +++ b/hnreader.el @@ -90,10 +90,19 @@ third one is 80.") (defun hnreader--past-time-top-links (node-list) "Get date, month and year links from NODE-LIST." - (seq-reduce (lambda (acc it) - (concat acc (hnreader--get-time-top-link it) " ")) - node-list - "Go back to a ")) + (if (= 3 (length node-list)) + (concat (seq-reduce (lambda (acc it) + (concat acc (hnreader--get-time-top-link it) " ")) + node-list + "- Go back to a ")) + (concat (seq-reduce (lambda (acc it) + (concat acc (hnreader--get-time-top-link it) " ")) + (seq-take node-list 3) + "- Go back to a ") + (seq-reduce (lambda (acc it) + (concat acc (hnreader--get-time-top-link it) " ")) + (seq-drop node-list 3) + "- Go forward to a ")))) (defun hnreader--get-route-top-info (dom) "Get top info of route like title, date of hn routes such as front, past from DOM." |