From: John Benediktsson Date: Sun, 19 Jun 2022 00:17:52 +0000 (-0700) Subject: webapps.help: show vocabulary in word title. X-Git-Tag: 0.99~1378 X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=commitdiff_plain;h=a17da74181fc87938aee868e6e6f097b2119edc6 webapps.help: show vocabulary in word title. --- diff --git a/extra/webapps/help/help.factor b/extra/webapps/help/help.factor index d6f46f3166..faac2d4fd4 100644 --- a/extra/webapps/help/help.factor +++ b/extra/webapps/help/help.factor @@ -9,8 +9,14 @@ IN: webapps.help TUPLE: help-webapp < dispatcher ; +: fixup-words ( title href -- title' href' ) + dup "word-" head? [ + dup ".html" ?tail drop "," split1-last nip + '[ " (" _ 3append ")" append ] dip + ] when ; + : links ( apropos -- seq ) - [ swap ] { } assoc>map ; + [ swap fixup-words ] { } assoc>map ; : ?links ( has-links? apropos -- has-links? seq/f ) links [ f ] [ nip t swap ] if-empty ;