1 // a class testing autodoc. You will see some naming conventions and a special comment block
2 // adding @ to multiline comment
3 // In the following we try to test all the possible situations
6 You can use multiline comments here
11 // this is a fake class indeed
14 shortDesc: A class to test automatic documentation from source
15 longDesc: The only limit of this tag is that it cannot break a line. This can be cumbersone, indeed. You can use <br> blocks. You will see that you have to specify in the source what you want to document. Note in any case that for specified args in method the default value is extracted automatically. Works with the Class template (no sense for UGens).
16 seeAlso: Homunculus, Leviathan
17 issues: Caution! Frailty thy name is AutoClassHelper. You can omit tags but in order to have it running you cannot change their order. More, it works only for the first class defined in a source file. Note also that actually it assumes that you have one class for sourcefile. It crashes if there's no class desc block. If method block descriptions are not indented as demonstrated they are not recognized properly. <br> Please use conventions specified in this class source file.
18 testvar: nothing special
19 classtestvar: really interesting
20 instDesc: How to become an anthropogenist
21 longInstDesc: It's easy. Consider using the following methods.
24 var <>testvar, <another, >one, last ;
25 // if you like to comment here, you can
26 classvar classtestvar ;
28 *new { arg ens = "Adam";
30 // if you like to comment here, you can
31 // for each method you can (optionally) provide
32 // desc: a description line
34 // ex: a (multiline) example
37 desc: creation is typically reserved to God. Args follows.
38 ens: it's a good start
40 // a multiline example is possible
41 // assuming that ex tag is the LAST one
42 // a pity: no colored syntax
43 TestClass.new("Eve").postln ; // comment
44 TestClass.class.postln ;
48 // if you like to comment here, you can
52 *open { arg ensPattern ;
53 // nothing should appear in docs
54 "creating from a mould".postln ;
58 // here we omit description
63 Maybe you want to separate blocks of source code
68 // start working stuff
70 generate { arg fromScratch = true, deus ;
72 fromScratch: whether you're a real constructivist or not
73 deus: sive natura (as you prefer)
75 "I like test".postln ;
78 destroy { arg ens, method = \evaporate ;
80 desc: it's a dirty job, but someone's got to do it
81 method: there are many options. Quite efficient implementation
86 makeBadKarma { arg ens, toMineral = true ;
88 desc: "you can't always get what you want"
89 toMineral: back to the roots
91 k = AutoDocTestClass.new ;
92 k.makeBadKarma(toMineral: false) ;
97 // stop real working stuff
102 // only the first class in a source file can be documented.
103 // If you ask for autodoc on AutoDocTestClass2, e.g.
104 // AutoClassHelper(AutoDocTestClass2)
105 // SC raises an error.
106 // If AutoDocTestClass2 is in a separate file, all is ok.
107 // Note that at least you need a /*@@*/ block in the class you need to document,
108 // otherwise SC raises an error
109 // (well, does not make sense to autogenerate ah help file from no provided infos)
115 print { arg first, second ;
116 [first, second].postln ;
121 desc: "Saigon, shit, I'm still only in Saigon"