2 // Helper, ClassHelper, UGenHelper, TopicHelper
3 // (In this file: Helper)
4 // ________________________________
6 // Helper chooses between ClassHelper, UGenHelpe, TopicHelper by verifying
7 // the class of the passed undocumentedObject. Only Helper must be used directly
8 // UGenHelper is fitted for ar/kr/ir methods.
9 // UGens not implementing the rate methods receive as a tag line:
10 // Name -->no ar/kr/ir methods: sorry, you have to complete as required
12 // Accepts as args the class name (for classes and ugens) or a string describing a topic
13 // Generates an html and then open it in with openHelpFile
15 // Usage: Helper(undocumentedObject, path)
16 // where if path.isNil, it prompts for a path where to save as
18 Helper(Helper, "Help/Helper.html")
21 // prompt for path (must be complete).
23 Helper(SinOsc, "/Users/andreavalle/Library/Application\ Support/SuperCollider/Extensions/Help/mine/SinOsc.html")
25 // In this case SinOsc has already a help file, so Helper opens that one
26 // as it calls SinOsc.openHelpFile
28 Helper("On_Helper", "/Users/andreavalle/Library/Application\ Support/SuperCollider/Extensions/Help/mine/On_Helper.html")
30 // it's a bit boring to repeat the class or the topic name with html as a path
31 // but I don't see a way to propose to GUI save dialog a fileName, so in that case you would have
32 // to specify it the same.
33 // Document was indeed more flexible
35 // or with an Help extension:
39 // *makeHelp { arg undocumentedObject, path ;
40 // Helper( undocumentedObject )
45 // Help.makeHelp(MyClass)
49 // Help.makeHelp(MyUGen)
53 // Help.makeHelp("MyClass")
54 // e.g. Help.makeHelp("Helper's corner")
56 // Escapes make the sources totally unreadable...
57 // andreavalle (started: 04/11/2007)
63 *new { arg undocumentedObject, path ;
64 ^super.new.initHelper( undocumentedObject, path )
67 initHelper { arg undocumentedObject, path ;
69 { undocumentedObject.class == Meta_Object }
70 { ^ClassHelper.new( undocumentedObject, path ) }
71 { undocumentedObject.class == String }
72 { ^TopicHelper.new( undocumentedObject, path ) }
73 { undocumentedObject.superclasses.includes(UGen).not }
74 { ^ClassHelper.new( undocumentedObject, path ) }
75 { undocumentedObject.superclasses.includes(UGen) }
76 { ^UGenHelper.new( undocumentedObject, path ) }