From 60164ef1edac2e9e07b2ac26be21e242e99acf66 Mon Sep 17 00:00:00 2001 From: Thanh Vuong Date: Sun, 18 Aug 2019 23:20:48 -0600 Subject: wip work --- TODOs.org | 12 ++++++++++++ hnreader.el | 7 ++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/TODOs.org b/TODOs.org index 480852f..aa1d730 100644 --- a/TODOs.org +++ b/TODOs.org @@ -17,3 +17,15 @@ top level comment child +* TODO show number of child comments +https://emacs.stackexchange.com/questions/10245/counting-sub-headings-in-org-mode-using-elisp +or recursive on dom will be just fine +* TODO run eslip on org link + +#+begin_example org-mode +[[elisp:(find-function 'describe-function)]] +#+end_example + +[[elisp:(hnreader-comment 20724363)][read] + +* TODO comment page show main link and intro text diff --git a/hnreader.el b/hnreader.el index 57e8047..293744b 100644 --- a/hnreader.el +++ b/hnreader.el @@ -63,7 +63,9 @@ third one is 80.") ;; link (insert (dom-attr (dom-by-class thing "^storylink$") 'href) "\n" ) ;; comment link - (insert "https://news.ycombinator.com/item?id=" (dom-attr thing 'id))) + (insert (format "[[elisp:(hnreader-comment %s)][https://news.ycombinator.com/item?id=%s]]" + (dom-attr thing 'id) + (dom-attr thing 'id)))) (defun hnreader--print-frontpage (dom buf) "Print raw DOM on BUF." @@ -87,8 +89,7 @@ third one is 80.") (insert (format "%s %s\n" (hnreader--get-indent (hnreader--get-img-tag-width comment)) - (hnreader--get-comment-owner comment) - )) + (hnreader--get-comment-owner comment))) (shr-insert-document (hnreader--get-comment comment)))))) (defun hnreader--get-img-tag-width (comment-dom) -- cgit v1.2.3