! Copyright (C) 2008 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
-USING: help.markup help.syntax kernel strings words ;
+USING: help.markup help.syntax kernel strings words vocabs ;
IN: tools.scaffold
HELP: developer-name
{ $description "Prints out scaffold help markup for a given word." } ;
HELP: scaffold-help
-{ $values { "string" string } }
+{ $values { "vocab" vocab } }
{ $description "Takes an existing vocabulary and creates a help file with scaffolded help for each word. This word only works if no help file yet exists." } ;
HELP: scaffold-undocumented
: docs-header. ( word -- )
"HELP: " write name>> print ;
-: (docs.) ( word -- )
+: (help.) ( word -- )
[ docs-header. ] [ $values. ] [ $description. ] tri ;
: interesting-words ( vocab -- array )
natural-sort ;
: interesting-words. ( vocab -- )
- interesting-words [ (docs.) nl ] each ;
+ interesting-words [ (help.) nl ] each ;
: docs-file-string ( vocab -- str2 )
[
"Edit documentation: " write
"-docs.factor" vocab/suffix>path <pathname> . ;
-: docs. ( word -- )
- [ (docs.) ] [ nl vocabulary>> link-vocab ] bi ;
-
PRIVATE>
+: help. ( word -- )
+ [ (help.) ] [ nl vocabulary>> link-vocab ] bi ;
+
: scaffold-help ( vocab -- )
[
dup "-docs.factor" vocab/suffix>path scaffolding? [