From 444483355aca32d6ca4491224f14d3af553fcd0e Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Fri, 7 Jun 2019 19:24:02 -0400 Subject: hn/g: Add docstrings. --- hn/g | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hn/g b/hn/g index 6d2278b..3f3d133 100755 --- a/hn/g +++ b/hn/g @@ -30,17 +30,19 @@ (port->string port))) (define (athings) - "Get 20 athings from HN front page." + "Get top 20 athings from HN front page." (let ((x (html->xexp (fp))) (s (sxpath "//tr[@class=\"athing\"]"))) (take (s x) 20))) (define (athing:id a) + "Return athing id" (let ((id (sxml:attr a 'id))) (if (empty? id) (error "athing:id: Unable to get id") id))) (define (athing:link a) + "Return athing link (HREF DESC)" (let* ((s (sxpath "//a[@class=\"storylink\"]")) (l (s a))) (list (sxml:attr (car l) 'href) -- cgit v1.2.3