diff --git a/packages/core/controls.mjs b/packages/core/controls.mjs index 50a494864..7c66b4002 100644 --- a/packages/core/controls.mjs +++ b/packages/core/controls.mjs @@ -2049,6 +2049,7 @@ export const { distort, dist } = registerControl(['distort', 'distortvol', 'dist * * @name distortvol * @synonyms distvol + * @tags fx, superdough, supradough * @param {number | Pattern} volume linear postgain of the distortion * @example * s("bd*4").bank("tr909").distort(2).distortvol(0.8) @@ -2059,6 +2060,7 @@ export const { distortvol } = registerControl('distortvol', 'distvol'); * Type of waveshaping distortion to apply. * * @name distorttype + * @tags fx, superdough, supradough * @synonyms disttype * @param {number | string | Pattern} type type of distortion to apply * @example @@ -2487,6 +2489,7 @@ export const { polyTouch } = registerControl('polyTouch'); /** * The host to send open sound control messages to. Requires running the OSC bridge. * @name oschost + * @tags external_io * @param {string | Pattern} oschost e.g. 'localhost' * @example * note("c4").oschost('127.0.0.1').oscport(57120).osc(); @@ -2496,6 +2499,7 @@ export const { oschost } = registerControl('oschost'); /** * The port to send open sound control messages to. Requires running the OSC bridge. * @name oscport + * @tags external_io * @param {number | Pattern} oscport e.g. 57120 * @example * note("c4").oschost('127.0.0.1').oscport(57120).osc(); diff --git a/packages/core/pattern.mjs b/packages/core/pattern.mjs index 8cb30e155..e8cd3d23f 100644 --- a/packages/core/pattern.mjs +++ b/packages/core/pattern.mjs @@ -3128,6 +3128,7 @@ export const extend = stepRegister('extend', function (factor, pat) { * `stepcat("a b".fast(2), "c d")` would be the same as `"[a b] [a b] c d"`. * * TODO: find out how this function differs from extend + * @tags temporal * @example * stepcat( * sound("bd bd - cp").replicate(2), @@ -3697,6 +3698,7 @@ export const morph = (frompat, topat, bypat) => { * Soft-clipping distortion * * @name soft + * @tags fx * @param {number | Pattern} distortion amount of distortion to apply * @param {number | Pattern} volume linear postgain of the distortion * @@ -3705,6 +3707,7 @@ export const morph = (frompat, topat, bypat) => { * Hard-clipping distortion * * @name hard + * @tags fx * @param {number | Pattern} distortion amount of distortion to apply * @param {number | Pattern} volume linear postgain of the distortion * @@ -3713,6 +3716,7 @@ export const morph = (frompat, topat, bypat) => { * Cubic polynomial distortion * * @name cubic + * @tags fx * @param {number | Pattern} distortion amount of distortion to apply * @param {number | Pattern} volume linear postgain of the distortion * @@ -3721,6 +3725,7 @@ export const morph = (frompat, topat, bypat) => { * Diode-emulating distortion * * @name diode + * @tags fx * @param {number | Pattern} distortion amount of distortion to apply * @param {number | Pattern} volume linear postgain of the distortion * @@ -3729,6 +3734,7 @@ export const morph = (frompat, topat, bypat) => { * Asymmetrical diode distortion * * @name asym + * @tags fx * @param {number | Pattern} distortion amount of distortion to apply * @param {number | Pattern} volume linear postgain of the distortion * @@ -3737,6 +3743,7 @@ export const morph = (frompat, topat, bypat) => { * Wavefolding distortion * * @name fold + * @tags fx * @param {number | Pattern} distortion amount of distortion to apply * @param {number | Pattern} volume linear postgain of the distortion * @@ -3745,6 +3752,7 @@ export const morph = (frompat, topat, bypat) => { * Wavefolding distortion composed with sinusoid * * @name sinefold + * @tags fx * @param {number | Pattern} distortion amount of distortion to apply * @param {number | Pattern} volume linear postgain of the distortion * @@ -3753,6 +3761,7 @@ export const morph = (frompat, topat, bypat) => { * Distortion via Chebyshev polynomials * * @name chebyshev + * @tags fx * @param {number | Pattern} distortion amount of distortion to apply * @param {number | Pattern} volume linear postgain of the distortion * diff --git a/website/src/repl/components/panel/Reference.jsx b/website/src/repl/components/panel/Reference.jsx index 2a7dcc2a8..3053f03dc 100644 --- a/website/src/repl/components/panel/Reference.jsx +++ b/website/src/repl/components/panel/Reference.jsx @@ -11,8 +11,13 @@ const availableFunctions = (() => { for (const doc of jsdocJson.docs) { if (!isValid(doc)) continue; if (seen.has(doc.name)) continue; - doc.tags = doc.tags?.filter((t) => t && typeof t === 'string') || []; + + // jsdoc also uses "tags" for when you use @something in the comments and it doesn't know what + // @something is. We only want data from comments like `@tags fx, superdough` here. + // If nothing is specified, we default to "untagged" for debugging + doc.tags = doc.tags?.filter((t) => t && typeof t === 'string') || ['untagged']; functions.push(doc); + const synonyms = doc.synonyms || []; seen.add(doc.name); for (const s of synonyms) { @@ -38,16 +43,6 @@ const getInnerText = (html) => { return div.textContent || div.innerText || ''; }; -const GROUP_DISPLAY_NAMES = { - external_io: 'External I/O', - effects: 'Effects', - untagged: 'Untagged', - structure: 'Structure', - transforms: 'Transforms', -}; - -const GROUP_ORDER = ['effects', 'transforms', 'structure', 'untagged', 'external_io']; - export function Reference() { const [search, setSearch] = useState(''); const [selectedTag, setSelectedTag] = useState(null); @@ -80,29 +75,6 @@ export function Reference() { }); }, [search, selectedTag]); - const visibleFunctionsByGroup = (() => { - const groups = {}; - for (const doc of visibleFunctions) { - const group = (doc.tags || ['untagged'])[0]; - if (!groups[group]) { - groups[group] = []; - } - groups[group].push(doc); - } - return groups; - })(); - // console.log(visibleFunctionsByGroup); - - // Sort and map group entries - const sortedGroups = Object.entries(visibleFunctionsByGroup).sort(([a], [b]) => { - const ai = GROUP_ORDER.indexOf(a); - const bi = GROUP_ORDER.indexOf(b); - if (ai === -1 && bi === -1) return a.localeCompare(b); - if (ai === -1) return 1; - if (bi === -1) return -1; - return ai - bi; - }); - const tagCounts = {}; for (const doc of availableFunctions) { (doc.tags || ['untagged']).forEach((t) => { @@ -114,7 +86,7 @@ export function Reference() { return (
-
+