From c3f60fdcf16a9c7607b90b76e1d249a631347ce0 Mon Sep 17 00:00:00 2001 From: Conor Finegan Date: Wed, 23 Aug 2017 20:00:09 -0400 Subject: [PATCH] Fixes get-implied-docs procedure. (#56) * Added todo level for no description. * Added todo category for no description, added warnings in table for todos. * Fixed label xexps * now displays implied docs. * fixed formatting * removed comment * fixed issue with implied docs not being gathered correctly. * replaced 'for/fold' with 'append-map' in 'get-implied-docs'. --- src/site.rkt | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/site.rkt b/src/site.rkt index 7882c54..58dc701 100644 --- a/src/site.rkt +++ b/src/site.rkt @@ -552,6 +552,10 @@ (string-append (date->string (seconds->date utc #f) #t) " (UTC)") "N/A")) +(define (get-implied-docs pkg) + (define implied-names (package-implies pkg)) + (append-map package-docs (package-batch-detail implied-names))) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Package hashtable getters. ;; TODO factor this stuff out into a proper data structure @@ -613,11 +617,6 @@ "No packages found.")))) ,@pkg-rows))) -(define (get-implied-docs pkg) - (let* ([implied-names (package-implies pkg)] - [implied-pkgs (package-batch-detail implied-names)]) - (map package-docs implied-pkgs))) - (define (build-pkg-rows/num-todos package-names) ;; Builds the list of rows in the package table as an x-exp. ;; Also returns the total number of non-zero todo keys, @@ -627,12 +626,7 @@ (define-values (pkg-rows num-todos) (for/fold ([pkg-rows null] [num-todos 0]) ([pkg (package-batch-detail package-names)]) - (define pkg-docs - (let ([implied-docs (get-implied-docs pkg)] - [pkg-docs (package-docs pkg)]) - (if (null? pkg-docs) - implied-docs - (append pkg-docs implied-docs)))) + (define pkg-docs (append (package-docs pkg) (get-implied-docs pkg))) (define has-docs? (pair? pkg-docs)) (define has-readme? (pair? (package-readme-url pkg))) (define has-tags? (pair? (package-tags pkg)))