The idea is to be able to search for a particular class or method or keyword inside Quarks.
@Spacechild1 has pointed us at the deken package manager for PD which has the feature object lists .
deken uses help files to generate an object list automatically if one is not provided. This seems like a practical way to add this feature to legacy Quarks (of course many do not have adequate or any help files!)
If a Quark is installed and sclang is alive we can do
to make a list of the objects… Not sure how to do Class extension methods?
to get the summaries something like this:
(
var node = SCDoc.parseFileFull("/Applications/SuperCollider.app/Contents/Resources/HelpSource/Classes/SinOsc.schelp") ;
SCDocEntry(node,"/Applications/SuperCollider.app/Contents/Resources/HelpSource/Classes/SinOsc.schelp").summary
)
(sorry I haven’t figured out how to get the .schelp file path just yet…)
@scztt has called for the creation of a new spec for “Quarks 2.0” - should an objects list be part of such a spec? should that list be part of a single YAML file or a seperate txt file as in deken?
But in order to grep, all quarks have to be downloaded, no? Or do you envision keeping a separate “database” that is (hopefully automatically) kept in sync with the quark list?
It would be cool to have an API that allows you to search the quarks by either method name, Help files, or by some approximate search method. That would be a good project.
will display all the methods defined in MathLib…
sc files could be parsed for methods but that would be a little bit of a pain…
re database.I think its best if we expect each Quark to contain an objectList file - we could provide for legacy Quarks and generate on the fly for dlownloaded quarks that don’t have. Unless there’s a simpler approach?
@semiquaver , You may want to have a look at packages.sc, which already has existing implementations of some of the methods you are describing. For example, we can already do:
Ok… but one still needs to download the quark to get the object list file, no? Or is there a central repository of nothing but objectlist files somewhere?
OK I’m thinking I should fork the downloaded-quarks repo and write a script to add an ObjectList file to each Quark folder - dumb? (there is already an update script which doesn’t seem to have been run in 6 or 7 years,…)
I think most quarks remain fairly stable once they’ve past their initial few releases, but ideally such ObjectList should be regenerated once in a while. Or maybe it’s the quark’s author’s responsibility to ask for a regeneration if new classes were added? (I guess I need to do some digging to understand how all this works in systems which offer search already - I think many package management systems explicitly require developers to announce that new version of their software is available, which is different from the downloaded-quarks repo)