Imported Robodoc.
[robodoc.git] / Contributions / robodoc.kaptn
1 #!/usr/bin/env kaptain
2 # $Id: robodoc.kaptn,v 1.3 2007/01/29 22:28:20 gumpu Exp $
3 # NAME
4 #   robodoc.kaptn - robodoc.rc gui composer
5 # COPYRIGHT
6 # Copyright (C) 2003 gian paolo ciceri <gp.ciceri@acm.org>
7
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
12
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 # GNU General Public License for more details.
17
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21 # MA  02111-1307  USA
22
23 #
24 # HISTORY
25 #   Sep, 9th 2003: v0.1.0 - initial, tentative release (borrowed from procmail.kaptn).
26 #
27
28
29 #############################################################
30 #
31 # main wizard
32 #
33 start :wizard "Robodoc Configuration Wizard" ->  intro setup finish;
34 #############################################################
35
36 #############################################################
37 #
38 # into page
39 #
40 intro "robodoc.rc builder" -> intro1 intro2;
41 intro1 -> text1 introa;
42 text1 -> @text("This is a graphical front-end for creating robodoc.rc \
43 configuration files made using Kaptain, the Universal graphical front-end.");
44 intro2 "" -> @;
45 introa "" -> workdir @fill;
46 workdir "Choose Working Directory" -> "\nWORKDIR=" @directory="$PWD";
47 #############################################################
48
49 #############################################################
50 #
51 # finish page, where I write the robodoc.rc file
52 #
53 finish "Finish" -> text3 other_settings;
54 text3 -> @text("Now press the Preview button to see the settings you have made.\
55  Don't forget to press Write button in order to save the setting in the given file.");
56 other_settings -> filename @fill @preview(allfile)="Preview" @action(writetofile)="Write";
57 writetofile-> "echo '" allfile "' > " filename ;
58 filename -> @outfile="$PWD/robodoc.rc";
59 #############################################################
60
61 #############################################################
62 #
63 # setup page, here's the beef!
64 #
65 setup :horizontal "Settings" -> recipe;
66 recipe :framed :horizontal -> recipe1 recipe2;
67 recipe1 :framed "Main documentation options" -> outputtype sourcedir docdir cssfile ;
68 recipe2 :framed "Items and misc. options" -> items ignoreitems ignoreext flags;
69 #recipe :framed -> outputtype sourcedir docdir cssfile items ignoreitems ignoreext flags regexp;
70
71 outputtype :horizontal "Output Types" -> !these_output | more_output ;
72   these_output :beside -> "--html\n" @string="--html";
73   more_output :beside -> "\n" more_output0;
74   
75 sourcedir  "Sources Directory" -> "--src\n" @directory="$PWD"; 
76
77 docdir  "Documents Directory" -> "--doc\n" @directory="$PWD"; 
78
79 cssfile  "CSS stylesheet" -> "--css\n" @infile("*.css"); 
80
81 items :horizontal  "Items" -> !these_items | more_items;
82   these_items :beside -> @string;
83   more_items :beside -> more_items0;
84   
85 ignoreitems :horizontal  "Ignore Items" -> !these_iitems | more_iitems;
86   these_iitems :beside -> @string;
87   more_iitems :beside -> more_iitems0;
88
89 ignoreext :horizontal  "Ignore file Extensions" -> these_iexts | !more_iexts;
90   these_iexts :beside -> @string="*.bkp\n ~";
91   more_iexts :beside -> more_iexts0;
92
93 ###########################################################
94 #@list('NAME', 'SYNOPSIS', 'INPUTS', 'OUTPUTS', 'HISTORY') ;
95 #ignoreitems "Ignore Items" -> "ignore items:\n" @combow('HISTORY', 'BUGS', 'AUTHORS', 'TODO', 'NEWS');
96 #ignoreext "Ignore Extensions" -> "extensions:\n" @combow('*.bkp', '~');  
97 ###########################################################
98
99
100   
101 flags :horizontal "Misc.Options" -> these_flags | !more_flags ;
102   these_flags :beside -> ":0 " @string;
103   more_flags :beside -> ":0 " more_flags0;
104 #############################################################
105
106
107 #############################################################
108 #
109 # robodoc.rc file setup, in the `allfile` variable
110 #
111 allfile -> "#This file was created by Kaptain\n\n" 
112    "#options" "\n"
113    options  "\n" 
114
115    "#output types" "\n"
116    out_options  "\n" 
117
118    "#source directory" "\n"   
119    sourcedir "\n"
120
121    "#document directory" "\n"   
122    docdir "\n"
123
124    "#stylesheet" "\n"   
125    cssfile "\n"
126
127    "#items" "\n"  
128    "items" "\n" 
129    items "\n"
130
131    "#ignore items" "\n"  
132    "ignore items:\n" 
133    ignoreitems "\n"
134
135    "#ignore files by extension" "\n"   
136    "extensions:" "\n"
137    ignoreext "\n"
138    
139    "#end\n" ;
140 #############################################################
141
142
143 #############################################################
144 #
145 # auxiliary dialog, to setup options
146 #
147 more_flags0 :dialog "Options..." -> flags_top flags_buttons;
148 flags_buttons -> @close="OK";
149 flags_top :horizontal :framed  -> options;# extras;
150 # extras "Extras" -> @;
151  options "Options"
152   -> index multidoc singledoc singlefile 
153      tell folds internal internalonly 
154      nosource nodesc sections tabsize toc;
155      
156   index "Also create a master index file" -> "--index\n"! | @;
157   multidoc "Generate one document per source file, and copy the directory hierarchys" ->
158   "--multidoc\n"! | @;
159   singledoc  "Define the documentation directory or documentation file." -> "--singledoc\n" |!@;
160   singlefile "Generate a single document from a single file."  -> "--singlefile\n" |!@;
161   tell "ROBODoc tells you what steps it is taking." -> "--tell\n" |!@;
162   folds "Use fold marks to split a big document into smaller ones." -> "--folds\n" |!@;
163   internal "Also include headers marked internal." -> "--internal\n" |!@;
164   internalonly "Only include headers marked internal." -> "--internalonly\n" |!@;
165   nosource "Do not include the SOURCE items."  -> "--nosource\n" |!@;
166   nodesc "Do not scan any subdirectories." -> "--nodesc\n" |!@;
167   sections "Create sections based on the module hierarchy." -> "--sections\n" |!@;
168   tabsize "Lets you specify the tabsize." -> "--tabsize\n" |!@;
169   toc "Add a table of contents." -> "--toc\n" |!@;
170 #############################################################
171
172 #############################################################
173 #
174 # auxiliary dialog, to setup output types (html, latex, rtf, docbook)
175 #
176 more_output0 :dialog "Output Types..." -> output_top output_buttons;
177 output_buttons -> @close="OK";
178 output_top :horizontal :framed  -> out_options;# extras;
179 # extras "Extras" -> @;
180  out_options "Output Types"
181   -> html ascii rtf latex docbook;
182   html "HTML" -> "--html\n"! | @;
183   ascii "ASCII" -> "--ascii\n"! | @;
184   latex "LaTeX" -> "--latex\n" | !@;
185   rtf "Rich Text format" -> "--rtf\n" | !@;
186   docbook "DocBook" -> "--dbxml\n" | !@;
187 #############################################################
188
189 #############################################################
190 #
191 # auxiliary dialog, to setup items
192 #
193 more_items0 :dialog "Include Items..." -> item_top item_buttons ;
194 item_buttons -> @close="OK";
195 item_top :horizontal :framed  -> item_options;# extras;
196 # extras "Extras" -> @;
197 item_options :horizontal "Items"
198   -> itemleft itemright;
199
200  itemleft -> NAME SYNOPSIS INPUTS   
201   USAGE SOURCE COPYRIGHT FUNCTION AUTHOR RESULT EXAMPLE NOTES DIAGNOSTICS;
202  
203  itemright ->  WARNINGS ERRORS BUGS SEEALSO METHODS ATTRIBUTES TAGS COMMAND DERIVEDFROM 
204   DERIVEDBY USES USEDBY INPUTS OUTPUTS HISTORY;
205   
206   NAME "NAME, Item name + short description" -> "    NAME\n"! | @;
207   SYNOPSIS "SYNOPSIS, how to use it" -> "    SYNOPSIS\n" | !@;  
208   USAGE "USAGE, how to use it" -> "    USAGE\n" | !@;
209   SOURCE "SOURCE, source code inclusion" -> "    SOURCE\n" | !@;
210   COPYRIGHT "COPYRIGHT, who own the copyright" -> "    COPYRIGHT\n" | !@;
211   FUNCTION "FUNCTION, what does it" -> "    FUNCTION\n" | !@;
212   AUTHOR  "AUTHOR, who wrote it" -> "    AUTHOR\n" | !@;
213   RESULT "RESULT, what do we get returned" -> "    RESULT\n" | !@;
214   EXAMPLE "EXAMPLE, a clear example of the items use" -> "    EXAMPLE\n" | !@;
215   NOTES "NOTES, any annotations" -> "    NOTES\n" | !@;
216   DIAGNOSTICS "DIAGNOSTICS, diagnostical output" -> "    DIAGNOSTICS\n" | !@;
217   WARNINGS "WARNINGS, warning messages" -> "    WARNINGS\n" | !@;
218   ERRORS "ERRORS, error messages" -> "    ERRORS\n" | !@;
219   BUGS "BUGS, known bugs" -> "    BUGS\n" | !@;
220   SEEALSO "SEE ALSO, references" -> "    SEE ALSO\n" | !@;
221   METHODS "METHODS, oop attributes" -> "    METHODS\n" | !@;
222   ATTRIBUTES "ATTRIBUTES, oop attributes" -> "    ATTRIBUTES\n" | !@;
223   TAGS "TAGS, tagitem description" -> "    TAGS\n" | !@;
224   COMMAND "COMMAND, command description" -> "    COMMAND\n" | !@; 
225   DERIVEDFROM "DERIVED FROM, oop super class" -> "    DERIVED FROM\n" | !@; 
226   DERIVEDBY "DERIVED BY, oop sub class" -> "    DERIVED BY\n" | !@; 
227   USES "USES, what modules are used by this one" -> "    USES\n" | !@;
228   USEDBY "USED BY,which modules do use this" -> "    USED BY\n" | !@;
229   INPUTS "INPUTS, what can we feed into it" -> "    INPUTS\n" | !@;
230   OUTPUTS "OUTPUTS, what output will be made" -> "    OUTPUTS\n" | !@;
231   HISTORY "HISTORY, who done what changes when" -> "    HISTORY\n" | !@;  
232 #############################################################
233
234 #############################################################
235 #
236 # auxiliary dialog, to setup ignore items
237 #
238 more_iitems0 :dialog "Ignore Items..." -> iitem_top iitem_buttons;
239 iitem_buttons -> @close="OK";
240 iitem_top :horizontal :framed  -> iitem_options;# extras;
241 # extras "Extras" -> @;
242  iitem_options :horizontal "Ignore Items"
243   -> iitemleft iitemright;
244   
245  iitemleft -> iNAME iSYNOPSIS iINPUTS   
246   iUSAGE iSOURCE iCOPYRIGHT iFUNCTION iAUTHOR iRESULT iEXAMPLE iNOTES iDIAGNOSTICS;
247  
248  iitemright ->  iWARNINGS iERRORS iBUGS iSEEALSO iMETHODS iATTRIBUTES iTAGS iCOMMAND iDERIVEDFROM 
249   iDERIVEDBY iUSES iUSEDBY iOUTPUTS iHISTORY iBUGS;
250   
251   iNAME "NAME, Item name + short description" -> "    NAME\n" | !@;
252   iSYNOPSIS "SYNOPSIS, how to use it" -> "    SYNOPSIS\n" | !@;  
253   iUSAGE "USAGE, how to use it" -> "    USAGE\n" | !@;
254   iSOURCE "SOURCE, source code inclusion" -> "    SOURCE\n" | !@;
255   iCOPYRIGHT "COPYRIGHT, who own the copyright" -> "    COPYRIGHT\n" | !@;
256   iFUNCTION "FUNCTION, what does it" -> "    FUNCTION\n" | !@;
257   iAUTHOR  "AUTHOR, who wrote it" -> "    AUTHOR\n" | !@;
258   iRESULT "RESULT, what do we get returned" -> "    RESULT\n" | !@;
259   iEXAMPLE "EXAMPLE, a clear example of the items use" -> "    EXAMPLE\n" | !@;
260   iNOTES "NOTES, any annotations" -> "    NOTES\n" | !@;
261   iDIAGNOSTICS "DIAGNOSTICS, diagnostical output" -> "    DIAGNOSTICS\n" | !@;
262   iWARNINGS "WARNINGS, warning messages" -> "    WARNINGS\n" | !@;
263   iERRORS "ERRORS, error messages" -> "    ERRORS\n" | !@;
264   iBUGS "BUGS, known bugs" -> "    BUGS\n" | !@;
265   iSEEALSO "SEE ALSO, references" -> "    SEE ALSO\n" | !@;
266   iMETHODS "METHODS, oop attributes" -> "    METHODS\n" | !@;
267   iATTRIBUTES "ATTRIBUTES, oop attributes" -> "    ATTRIBUTES\n" | !@;
268   iTAGS "TAGS, tagitem description" -> "    TAGS\n" | !@;
269   iCOMMAND "COMMAND, command description" -> "    COMMAND\n" | !@; 
270   iDERIVEDFROM "DERIVED FROM, oop super class" -> "    DERIVED FROM\n" | !@; 
271   iDERIVEDBY "DERIVED BY, oop sub class" -> "    DERIVED BY\n" | !@; 
272   iUSES "USES, what modules are used by this one" -> "    USES\n" | !@;
273   iUSEDBY "USED BY,which modules do use this" -> "    USED BY\n" | !@;
274   iINPUTS "INPUTS, what can we feed into it" -> "    INPUTS\n" | !@;
275   iOUTPUTS "OUTPUTS, what output will be made" -> "    OUTPUTS\n" | !@;
276   iHISTORY "HISTORY, who done what changes when" -> "    HISTORY\n" | !@;    
277 #############################################################
278
279 #############################################################
280 #
281 # auxiliary dialog, to setup excluded file by extension
282 #
283 more_iexts0 :dialog "Exclude Extensions..." -> iextm_top iextm_buttons;
284 iextm_buttons -> @close="OK";
285 iextm_top :horizontal :framed  -> iextm_options;# extras;
286 # extras "Extras" -> @;
287  iextm_options "Exclude files by extension"
288   -> BAK TILDE;
289   BAK "*.bak" -> "    *.bak\n" | @;
290   TILDE "~" -> "    ~\n" | @;
291 #############################################################
292