The example code extraction works for me now after loosening the search criteria (see #60), but I found that it would only generate an example section from a single file in the output doc.
It looks like the reason is that it was using the raw title string (e.g. jsPsychExtensionPause Example) as the title for all example files, and since these are not unique, each example was overwriting the same section. Since the example info already tracks the unique file name and adds it to the generated section title (e.g. jsPsychExtensionPause Example (examples/restart_trial_after_pause.html)), I got around this problem by (1) moving the title into ExampleInfo, (2) using the file path rather than title as the unique key, and (3) updating the renderer to use ### example.title (${example.path}) for the heading. Let me know what you think and if you want this in a PR.
Also, a tiny suggestion: Maybe we could have some way of setting the example title directly in each file, e.g. // jspsych-autodoc:title My title.
The example code extraction works for me now after loosening the search criteria (see #60), but I found that it would only generate an example section from a single file in the output doc.
It looks like the reason is that it was using the raw title string (e.g.
jsPsychExtensionPause Example) as thetitlefor all example files, and since these are not unique, each example was overwriting the same section. Since the example info already tracks the unique file name and adds it to the generated section title (e.g.jsPsychExtensionPause Example (examples/restart_trial_after_pause.html)), I got around this problem by (1) moving thetitleintoExampleInfo, (2) using the filepathrather thantitleas the unique key, and (3) updating the renderer to use### example.title (${example.path})for the heading. Let me know what you think and if you want this in a PR.Also, a tiny suggestion: Maybe we could have some way of setting the example title directly in each file, e.g.
// jspsych-autodoc:title My title.