Skip to content

Commit

Permalink
basis.help.vocabs: include links to parent vocabs in metadata
Browse files Browse the repository at this point in the history
For vocabs that are children of other vocabs, this gives you easy access
to all of the parent vocabs in the vocab help. It uses the same
breadcrumbing as $vocab-link.
  • Loading branch information
ToxicFrog authored and mrjbq7 committed May 23, 2024
1 parent c9c5e62 commit 74a4be3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions basis/help/vocabs/vocabs.factor
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,12 @@ C: <vocab-author> vocab-author

: describe-metadata ( vocab -- )
[
[ vocab-tags [ "Tags:" swap \ $tags prefix 2array , ] unless-empty ]
[ vocab-authors [ "Authors:" swap \ $authors prefix 2array , ] unless-empty ]
[ vocab-platforms [ "Platforms:" swap \ $links prefix 2array , ] unless-empty ]
tri
{
[ "." split1-last [ '[ { "Parents:" { $vocab-link _ } } ] call , ] [ drop ] if ]
[ vocab-tags [ "Tags:" swap \ $tags prefix 2array , ] unless-empty ]
[ vocab-authors [ "Authors:" swap \ $authors prefix 2array , ] unless-empty ]
[ vocab-platforms [ "Platforms:" swap \ $links prefix 2array , ] unless-empty ]
} cleave
] { } make
[ "Metadata" $heading $table ] unless-empty ;

Expand Down

0 comments on commit 74a4be3

Please sign in to comment.