racket / racket-pkg-website

A frontend for the Racket Package Catalog.
Other
9 stars 15 forks source link

Fixes get-implied-docs procedure. #56

Closed cfinegan closed 6 years ago

cfinegan commented 6 years ago

This pull request fixes an issue where the get-implied-docs procedure was not returning the correct data structure. Previously, get-implied-docs would invoke map over the list of implied packages to get their docs, but since package-docs returns a list of packages, this was generating a list of lists, each containing one doc. I swapped out the call to map with a for/fold clause that returns a single list of doc items.

It may be pragmatic to test the HTML rendering in an isolated environment before pushing this to the live server, as I'm unable to do proper testing of the whole renderer (i.e. to make sure I didn't inadvertently break something) from my dev environment.

jackfirth commented 6 years ago

You could also use append-map:

> (define (repeat v) (list v v))
> (append-map repeat '(1 2 3))
'(1 1 2 2 3 3)