History

new ckdoc title rendering

Ge Wang committed 3 years ago

Commit 48fbb601 parent 52ee6729 files · +59 −22Browse files

Unified · Split

9 files
  1. src/core/chuck_io.cpp +5 −4
  2. src/core/uana_extract.cpp +13 −4
  3. src/core/uana_xform.cpp +8 −0
  4. src/core/ugen_osc.cpp +5 −3
  5. src/core/ugen_stk.cpp +8 −3
  6. src/core/ugen_xxx.cpp +3 −1
  7. src/core/ulib_doc.cpp +2 −2
  8. src/core/ulib_std.cpp +13 −3
  9. src/scripts/ckdoc/gen-all.ck +2 −2
src/core/chuck_io.cpp+5−4
@@ -93,7 +93,7 @@ t_CKBOOL init_class_io( Chuck_Env * env, Chuck_Type * type ) · 92 unmodified lines
9393 {
9494 // init as base class
9595 Chuck_DL_Func * func = NULL;
96− std::string doc = "";
96+ std::string doc = "Base class for other IO classes such as FileIO, StdOut and StdErr. Besides IO.newline(), it’s unlikely you need to use this class directly.";
9797
9898 // log
9999 EM_log( CK_LOG_SEVERE, "class 'IO'" );
@@ -272,7 +272,8 @@ t_CKBOOL init_class_fileio( Chuck_Env * env, Chuck_Type * type ) · 172 unmodified lines
272272 // init as base class
273273 // TODO: ctor/dtor?
274274 // TODO: replace dummy with pure function
275− if( !type_engine_import_class_begin( env, type, env->global(), fileio_ctor, fileio_dtor ) )
275+ if( !type_engine_import_class_begin( env, type, env->global(), fileio_ctor, fileio_dtor,
276+ "Helper class doing file-related operations such as reading, writing, seeking, etc. See examples for usage." ) )
276277 return FALSE;
277278
278279 // add open(string)
@@ -444,7 +445,7 @@ t_CKBOOL init_class_chout( Chuck_Env * env, Chuck_Type * type ) · 165 unmodified lines
444445 EM_log( CK_LOG_SEVERE, "class 'chout'" );
445446
446447 // TODO: ctor/dtor?
447− if( !type_engine_import_class_begin( env, type, env->global(), NULL, NULL ) )
448+ if( !type_engine_import_class_begin( env, type, env->global(), NULL, NULL, "Do not instantiate this class directly! Use `chout` instead." ) )
448449 return FALSE;
449450
450451 // add good()
@@ -537,7 +538,7 @@ t_CKBOOL init_class_cherr( Chuck_Env * env, Chuck_Type * type ) · 86 unmodified lines
537538 EM_log( CK_LOG_SEVERE, "class 'cherr'" );
538539
539540 // TODO: ctor/dtor?
540− if( !type_engine_import_class_begin( env, type, env->global(), NULL, NULL ) )
541+ if( !type_engine_import_class_begin( env, type, env->global(), NULL, NULL, "Do not instantiate this class directly! Use `cherr` instead." ) )
541542 return FALSE;
542543
543544 // add good()
src/core/uana_extract.cpp+13−4
@@ -308,7 +308,7 @@ DLL_QUERY extract_query( Chuck_DL_Query * QUERY ) · 307 unmodified lines
308308 //---------------------------------------------------------------------
309309
310310 doc =
311− "A unit analyzer that computes the RMS power mean from a magnitude spectrum (either from an incoming UAna, or given manually), and outputs a single number.";
311+ "A unit analyzer that computes the root-mean-square (RMS) power mean from a magnitude spectrum (either from an incoming UAna, or given manually), and outputs a single number.";
312312
313313 if( !type_engine_import_uana_begin( env, "RMS", "UAna", env->global(),
314314 NULL, NULL,
@@ -535,7 +535,6 @@ DLL_QUERY extract_query( Chuck_DL_Query * QUERY ) · 220 unmodified lines
535535 //---------------------------------------------------------------------
536536 // init as base class: RollOff
537537 //---------------------------------------------------------------------
538−
539538 doc =
540539 "A unit analyzer that computes the spectral rolloff from a magnitude spectrum (either from incoming UAna, or given manually), and outputs a single number.";
541540
@@ -578,9 +577,14 @@ DLL_QUERY extract_query( Chuck_DL_Query * QUERY ) · 36 unmodified lines
578577 //---------------------------------------------------------------------
579578 // init as base class: AutoCorr
580579 //---------------------------------------------------------------------
580+ doc =
581+ "A unit analyzer that computes auto-correlation of the incoming analysis frame.";
582+
581583 if( !type_engine_import_uana_begin( env, "AutoCorr", "UAna", env->global(),
582584 AutoCorr_ctor, AutoCorr_dtor,
583− AutoCorr_tick, AutoCorr_tock, AutoCorr_pmsg ) )
585+ AutoCorr_tick, AutoCorr_tock, AutoCorr_pmsg,
586+ CK_NO_VALUE, CK_NO_VALUE, CK_NO_VALUE, CK_NO_VALUE,
587+ doc.c_str() ) )
584588 return FALSE;
585589
586590 // data offset
@@ -612,9 +616,14 @@ DLL_QUERY extract_query( Chuck_DL_Query * QUERY ) · 25 unmodified lines
612616 //---------------------------------------------------------------------
613617 // init as base class: XCorr
614618 //---------------------------------------------------------------------
619+ doc =
620+ "A unit analyzer that computes cross-correlation between two incoming analysis frames.";
621+
615622 if( !type_engine_import_uana_begin( env, "XCorr", "UAna", env->global(),
616623 XCorr_ctor, XCorr_dtor,
617− XCorr_tick, XCorr_tock, XCorr_pmsg ) )
624+ XCorr_tick, XCorr_tock, XCorr_pmsg,
625+ CK_NO_VALUE, CK_NO_VALUE, CK_NO_VALUE, CK_NO_VALUE,
626+ doc.c_str() ) )
618627 return FALSE;
619628
620629 // data offset
src/core/uana_xform.cpp+8−0
@@ -277,6 +277,11 @@ DLL_QUERY xform_query( Chuck_DL_Query * QUERY ) · 276 unmodified lines
277277 func->doc = "Manually take IFFT (as opposed to using .upchuck() / upchuck operator)";
278278 if( !type_engine_import_mfun( env, func ) ) goto error;
279279
280+ // add examples
281+ if( !type_engine_import_add_ex( env, "analysis/ifft.ck" ) ) goto error;
282+ if( !type_engine_import_add_ex( env, "analysis/ifft2.ck" ) ) goto error;
283+ if( !type_engine_import_add_ex( env, "analysis/ifft3.ck" ) ) goto error;
284+
280285 // end the class import
281286 type_engine_import_class_end( env );
282287
@@ -436,6 +441,9 @@ DLL_QUERY xform_query( Chuck_DL_Query * QUERY ) · 153 unmodified lines
436441 func->doc = "Manually take pilF (as opposed to using .upchuck() / upchuck operator)";
437442 if( !type_engine_import_mfun( env, func ) ) goto error;
438443
444+ // add example
445+ if( !type_engine_import_add_ex( env, "analysis/flip.ck" ) ) goto error;
446+
439447 // end the class import
440448 type_engine_import_class_end( env );
441449
src/core/ugen_osc.cpp+5−3
@@ -1139,10 +1139,9 @@ DLL_QUERY genX_query( Chuck_DL_Query * QUERY ) · 1138 unmodified lines
11391139 type_engine_import_class_end( env );
11401140
11411141 //---------------------------------------------------------------------
1142− // Warp
1142+ // WarpTable
11431143 //---------------------------------------------------------------------
1144− doc = "...";
1145−
1144+ doc = "An end-constrained mapping table, mostly useful for conditioning control signals.";
11461145 if( !type_engine_import_ugen_begin( env, "WarpTable", "GenX", env->global(),
11471146 NULL, NULL, genX_tick, NULL, doc.c_str() ) )
11481147 return FALSE;
@@ -1159,6 +1158,9 @@ DLL_QUERY genX_query( Chuck_DL_Query * QUERY ) · 10 unmodified lines
11591158 if( !type_engine_import_mfun( env, func ) ) goto error;
11601159 */
11611160
1161+ // add examples
1162+ if( !type_engine_import_add_ex( env, "special/GenX-WarpTable-test.ck" ) ) goto error;
1163+
11621164 // end the class import
11631165 type_engine_import_class_end( env );
11641166
src/core/ugen_stk.cpp+8−3
@@ -2932,7 +2932,7 @@ Phoneme Names:\n\ · 2931 unmodified lines
29322932 // begin FM ugen
29332933 //------------------------------------------------------------------------
29342934
2935− doc = "STK FM synthesis super class.\n\
2935+ doc = "STK FM synthesis super class. You should NOT need to use this UGen directly. Please refer to the documentation on FM subclasses instead.\n\
29362936 \n\
29372937 This class controls an arbitrary number of waves and envelopes, determined via a constructor argument.\n\
29382938 \n\
@@ -3990,7 +3990,8 @@ by Perry R. Cook and Gary P. Scavone, 1995 - 2002."; · 1051 unmodified lines
39903990
39913991 if( !type_engine_import_ugen_begin( env, "FilterStk", "UGen", env->global(),
39923992 FilterStk_ctor, FilterStk_dtor,
3993− FilterStk_tick, FilterStk_pmsg ) ) return FALSE;
3993+ FilterStk_tick, FilterStk_pmsg,
3994+ "FilterStk is an STK Filter base class inherited by all Stk Filter UGens such as BiQuad, TwoZero, PoleZero, etc. You should NOT need to use this UGen directly. Please refer to the documentation on other filter types instead." ) ) return FALSE;
39943995 // member variable
39953996 FilterStk_offset_data = type_engine_import_mvar ( env, "int", "@FilterStk_data", FALSE );
39963997 if( FilterStk_offset_data == CK_INVALID_OFFSET ) goto error;
@@ -4480,7 +4481,7 @@ by Perry R. Cook and Gary P. Scavone, 1995 - 2002."; · 483 unmodified lines
44804481 if( !type_engine_import_mfun( env, func ) ) goto error;
44814482
44824483 // add examples
4483− if( !type_engine_import_add_ex( env, "stk/chorus.ck" ) ) goto error;
4484+ if( !type_engine_import_add_ex( env, "effects/chorus.ck" ) ) goto error;
44844485
44854486 // end the class import
44864487 type_engine_import_class_end( env );
@@ -4609,6 +4610,10 @@ by Perry R. Cook and Gary P. Scavone, 1995 - 2002."; · 122 unmodified lines
46094610 func->doc = "get subsampling rate";
46104611 if( !type_engine_import_mfun( env, func ) ) goto error;
46114612
4613+ // add examples
4614+ if( !type_engine_import_add_ex( env, "stk/subnoise-control.ck" ) ) goto error;
4615+ if( !type_engine_import_add_ex( env, "stk/subnoise-audio.ck" ) ) goto error;
4616+
46124617 // end the class import
46134618 type_engine_import_class_end( env );
46144619
src/core/ugen_xxx.cpp+3−1
@@ -1072,7 +1072,9 @@ DLL_QUERY lisa_query( Chuck_DL_Query * QUERY ) · 1071 unmodified lines
10721072 Multiple voice facility is built in, allowing for a single\
10731073 LiSa object to serve as a source for sample layering and\
10741074 granular textures.\
1075− by Dan Trueman (2007)";
1075+ by Dan Trueman (2007)\n\
1076+ See also: a slowly growing <a target=\"_blank\" href=\"../program/lisa/tutorial-1.html\">tutorial</a>\
1077+ | <a target=\"_blank\" href=\"../examples/#lisa\">LiSa examples</a> in the ChucK distribution | <a target=\"_blank\" href=\"https://www.youtube.com/watch?v=7F75v_73pF4\">video tutorial</a> by Clint Hoagland.";
10761078 if( !type_engine_import_ugen_begin( env, "LiSa", "UGen", env->global(),
10771079 LiSaMulti_ctor, LiSaMulti_dtor,
10781080 LiSaMulti_tick, NULL,
src/core/ulib_doc.cpp+2−2
@@ -305,8 +305,8 @@ public: · 304 unmodified lines
305305 {
306306 m_outputStr += "<a name=\"top\"/>\n";
307307 m_outputStr += "<div id=\"title\">\n";
308− m_outputStr += "<div class=\"titleL\"><h1>" + m_title + "</h1></div>\n";
309− m_outputStr += "<div class=\"titleR\"><h1><a href=\"index.html\">ChucK Class Library Reference</a></h1></div>\n";
308+ m_outputStr += "<div class=\"titleL\"><h1><a href=\"./\">ChucK Class Library Reference</a></h1></div>\n";
309+ m_outputStr += "<h1>&nbsp;&nbsp;<span style=\"color:black\">/</span>&nbsp;&nbsp;" + m_title + "</h1></div>\n";
310310 m_outputStr += "</div>\n"; // #title
311311 }
312312
src/core/ulib_std.cpp+13−3
@@ -395,8 +395,8 @@ DLL_QUERY libstd_query( Chuck_DL_Query * QUERY ) · 394 unmodified lines
395395 #ifndef __DISABLE_PROMPTER__
396396 // begin class (Skot)
397397 if( !type_engine_import_class_begin( env, "ConsoleInput", "Event",
398− env->global(), Skot_ctor,
399− Skot_dtor ) )
398+ env->global(), Skot_ctor, Skot_dtor,
399+ "(Terminal only) a utility for prompting user input on the command line." ) )
400400 return FALSE;
401401
402402 // add member variable
@@ -405,25 +405,35 @@ DLL_QUERY libstd_query( Chuck_DL_Query * QUERY ) · 2 unmodified lines
405405
406406 // add prompt()
407407 func = make_new_mfun( "Event", "prompt", Skot_prompt );
408+ func->doc = "Return an Event to wait on.";
408409 if( !type_engine_import_mfun( env, func ) ) goto error;
409410
410411 // add prompt()
411412 func = make_new_mfun( "Event", "prompt", Skot_prompt2 );
412413 func->add_arg( "string", "what" );
414+ func->doc = "Print a prompt text and return an Event to wait on.";
413415 if( !type_engine_import_mfun( env, func ) ) goto error;
414416
415− // add ready()
417+ // add more()
416418 func = make_new_mfun( "int", "more", Skot_more );
419+ func->doc = "Return whether there is more input to read.";
417420 if( !type_engine_import_mfun( env, func ) ) goto error;
418421
419422 // add getString()
420423 func = make_new_mfun( "string", "getLine", Skot_getLine );
424+ func->doc = "Return the next line of input as a string.";
421425 if( !type_engine_import_mfun( env, func ) ) goto error;
422426
423427 // add can_wait()
424428 func = make_new_mfun( "int", "can_wait", Skot_can_wait );
429+ func->doc = "(internal) used by virtual machine for synthronization.";
425430 if( !type_engine_import_mfun( env, func ) ) goto error;
426431
432+ // add examples
433+ if( !type_engine_import_add_ex( env, "string/readline.ck" ) ) goto error;
434+ if( !type_engine_import_add_ex( env, "ai/word2vec/word2vec-prompt.ck" ) ) goto error;
435+ if( !type_engine_import_add_ex( env, "ai/word2vec/poem-ungenerate.ck" ) ) goto error;
436+
427437 // end class
428438 type_engine_import_class_end( env );
429439 #endif // __DISABLE_PROMPTER__
src/scripts/ckdoc/gen-all.ck+2−2
@@ -123,12 +123,12 @@ doc.addGroup( · 122 unmodified lines
123123
124124 // add group
125125 doc.addGroup(
126− [ "IO", "FileIO", "StdOut", "StdErr",
126+ [ "IO", "FileIO", /* "StdOut", "StdErr", */
127127 "OscIn", "OscOut", "OscMsg",
128128 "Hid", "HidMsg", "SerialIO",
129129 "MidiIn", "MidiOut", "MidiMsg", "MidiFileIn" ],
130130 // group name
131− "Input / Output",
131+ "Input & Output",
132132 // file name
133133 "io",
134134 // group descriptions

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t