-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate index.json, pages and api.md for each package. Generate _sid…
…ebar.md
- Loading branch information
1 parent
c790372
commit 64f95b2
Showing
5 changed files
with
306 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,79 @@ | ||
- [Getting started](README.md) | ||
- npm packages | ||
- [supercolliderjs](packages/supercolliderjs/README.md) | ||
- [@supercollider/server](packages/server/README.md) | ||
- [Server](packages/server/Server.md) | ||
- [options](packages/server/options.md) | ||
- [OSC messages](packages/server/osc_msg.md) | ||
- [mapping](packages/server/mapping.md) | ||
- [bin/scsynth](packages/server/bin_scsynth.md) | ||
- internals | ||
- [SendOSC](packages/server/SendOSC.md) | ||
- [allocators](packages/server/internals_allocators.md) | ||
- [Store](packages/server/internals_Store.md) | ||
- [node-watcher](packages/server/node-watcher.md) | ||
- [@supercollider/server-plus](packages/server-plus/README.md) | ||
- [ServerPlus](packages/server-plus/ServerPlus.md) | ||
- [Synth](packages/server-plus/Synth.md) | ||
- [Group](packages/server-plus/Group.md) | ||
- [SynthDef](packages/server-plus/SynthDef.md) | ||
- [Buffer](packages/server-plus/Buffer.md) | ||
- [ControlBus](packages/server-plus/ControlBus.md) | ||
- [AudioBus](packages/server-plus/AudioBus.md) | ||
- [@supercollider/lang](packages/lang/README.md) | ||
- [Lang](packages/lang/sclang.md) | ||
- [options](packages/lang/options.md) | ||
- [boot](packages/lang/boot.md) | ||
- [SynthDefCompiler](packages/lang/SynthDefCompiler.md) | ||
- [SynthDefResultType](packages/lang/SynthDefResultType.md) | ||
- [SynthDefCompileRequest](packages/lang/SynthDefCompileRequest.md) | ||
- [Errors](packages/lang/Errors.md) | ||
- [@supercollider/dryads](packages/dryads/README.md) | ||
- [play](packages/dryads/index.md) | ||
- dryads | ||
- [Synth](packages/dryads/Synth.md) | ||
- [API](packages/dryads/api.md) | ||
- [SCServer](packages/dryads/SCServer.md) | ||
- [SCLang](packages/dryads/SCLang.md) | ||
- [Group](packages/dryads/Group.md) | ||
- [Synth](packages/dryads/Synth.md) | ||
- [AudioBus](packages/dryads/AudioBus.md) | ||
- [SCSynthDef](packages/dryads/SCSynthDef.md) | ||
- [SynthControl](packages/dryads/SynthControl.md) | ||
- [SynthEventList](packages/dryads/SynthEventList.md) | ||
- [SynthStream](packages/dryads/SynthStream.md) | ||
- [SCLang](packages/dryads/SCLang.md) | ||
- [SCServer](packages/dryads/SCServer.md) | ||
- middleware | ||
- [scserver](packages/dryads/middleware_scserver.md) | ||
- [SynthEventList](packages/dryads/SynthEventList.md) | ||
- [layer](packages/dryads/layer.md) | ||
- [dryadic](packages/dryads/dryadic.md) | ||
- [play](packages/dryads/play.md) | ||
- [h](packages/dryads/h.md) | ||
- [@supercollider/lang](packages/lang/README.md) | ||
- [API](packages/lang/api.md) | ||
- [SCLang](packages/lang/SCLang.md) | ||
- [boot](packages/lang/boot.md) | ||
- [resolveOptions](packages/lang/resolveOptions.md) | ||
- [SynthDefCompiler](packages/lang/SynthDefCompiler.md) | ||
- [SCLangError](packages/lang/SCLangError.md) | ||
- [@supercollider/logger](packages/logger/README.md) | ||
- [API](packages/logger/api.md) | ||
- [Logger](packages/logger/Logger.md) | ||
- [@supercollider/osc](packages/osc/README.md) | ||
- [packing](packages/osc/packing.md) | ||
- [types](packages/osc/types.md) | ||
- [timetags](packages/osc/timetags.md) | ||
- [index](packages/osc/index.md) | ||
- [API](packages/osc/api.md) | ||
- [packMessage](packages/osc/packMessage.md) | ||
- [packBundle](packages/osc/packBundle.md) | ||
- [unpack](packages/osc/unpack.md) | ||
- [unpackMessage](packages/osc/unpackMessage.md) | ||
- [unpackBundle](packages/osc/unpackBundle.md) | ||
- [pack](packages/osc/pack.md) | ||
- [dateToTimetag](packages/osc/dateToTimetag.md) | ||
- [timetagToDate](packages/osc/timetagToDate.md) | ||
- [deltaTimeTag](packages/osc/deltaTimeTag.md) | ||
- [asNTPTimeTag](packages/osc/asNTPTimeTag.md) | ||
- [@supercollider/scapi](packages/scapi/README.md) | ||
- [SCAPI](packages/scapi/SCAPI.md) | ||
- [API](packages/scapi/api.md) | ||
- [SCAPI](packages/scapi/SCAPI.md) | ||
- [@supercollider/server](packages/server/README.md) | ||
- [API](packages/server/api.md) | ||
- [Server](packages/server/Server.md) | ||
- [boot](packages/server/boot.md) | ||
- [resolveOptions](packages/server/resolveOptions.md) | ||
- [msg](packages/server/msg.md) | ||
- [mapping](packages/server/mapping.md) | ||
- [ServerState](packages/server/ServerState.md) | ||
- [watchNodeNotifications](packages/server/watchNodeNotifications.md) | ||
- [onNodeGo](packages/server/onNodeGo.md) | ||
- [whenNodeGo](packages/server/whenNodeGo.md) | ||
- [onNodeEnd](packages/server/onNodeEnd.md) | ||
- [whenNodeEnd](packages/server/whenNodeEnd.md) | ||
- [updateNodeState](packages/server/updateNodeState.md) | ||
- [deltaTimeTag](packages/server/deltaTimeTag.md) | ||
- [@supercollider/server-plus](packages/server-plus/README.md) | ||
- [API](packages/server-plus/api.md) | ||
- [Group](packages/server-plus/Group.md) | ||
- [Synth](packages/server-plus/Synth.md) | ||
- [AudioBus](packages/server-plus/AudioBus.md) | ||
- [ControlBus](packages/server-plus/ControlBus.md) | ||
- [Buffer](packages/server-plus/Buffer.md) | ||
- [SynthDef](packages/server-plus/SynthDef.md) | ||
- [ServerPlus](packages/server-plus/ServerPlus.md) | ||
- [boot](packages/server-plus/boot.md) | ||
- [supercolliderjs](packages/supercolliderjs/README.md) | ||
- [API](packages/supercolliderjs/api.md) | ||
- [server](packages/supercolliderjs/server.md) | ||
- [dryads](packages/supercolliderjs/dryads.md) | ||
- [lang](packages/supercolliderjs/lang.md) | ||
- [map](packages/supercolliderjs/map.md) | ||
- [msg](packages/supercolliderjs/msg.md) | ||
- [SCLangError](packages/supercolliderjs/SCLangError.md) | ||
- [resolveOptions](packages/supercolliderjs/resolveOptions.md) | ||
- Guide | ||
- [Guide](https://crucialfelix.gitbooks.io/supercollider-js-guide/content/) | ||
- [Examples](https://github.com/crucialfelix/supercolliderjs-examples) | ||
- [Examples](https://github.com/crucialfelix/supercolliderjs-examples) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/** | ||
* Typedocs does not detect a module's exports. | ||
* I should see if I can fix that. | ||
* | ||
* This script loads the index file for a package | ||
* and converts the exports to a nested tree of names | ||
* and saves this as index.json | ||
*/ | ||
const fs = require("fs"); | ||
const self = require(process.cwd() + "/"); | ||
|
||
const asNames = (object, name) => { | ||
if (!typeof object === "object") { | ||
return name; | ||
} | ||
|
||
if (Array.isArray(object)) { | ||
return object.map((x, i) => asNames(x, String(i))); | ||
} | ||
|
||
if (isPlainObject(object)) { | ||
const mapped = {}; | ||
for (const key in object) { | ||
if (object.hasOwnProperty(key)) { | ||
const element = object[key]; | ||
const name = asNames(element, key); | ||
// const emptyObject = name && (name.constructor === Object || Object.entries(name).length === 0); | ||
if (name) { | ||
mapped[key] = name; | ||
} | ||
} | ||
} | ||
return mapped; | ||
} | ||
// if has no name then it is an instrinsic | ||
return object.name; | ||
}; | ||
|
||
const result = asNames(self); | ||
const json = JSON.stringify(result, null, 2); | ||
fs.writeFileSync("./index.json", json); | ||
|
||
// https://github.com/jonschlinkert/is-plain-object/blob/master/index.js | ||
function isObjectObject(o) { | ||
return isObject(o) === true && Object.prototype.toString.call(o) === "[object Object]"; | ||
} | ||
|
||
function isPlainObject(o) { | ||
if (isObjectObject(o) === false) return false; | ||
|
||
// If has modified constructor | ||
const ctor = o.constructor; | ||
if (typeof ctor !== "function") return false; | ||
|
||
// If has modified prototype | ||
const prot = ctor.prototype; | ||
if (isObjectObject(prot) === false) return false; | ||
|
||
// If constructor does not have an Object-specific method | ||
if (prot.hasOwnProperty("isPrototypeOf") === false) { | ||
return false; | ||
} | ||
|
||
// Most likely a plain Object | ||
return true; | ||
} | ||
|
||
// https://github.com/jonschlinkert/isobject/blob/master/index.js | ||
function isObject(val) { | ||
return val != null && typeof val === "object" && Array.isArray(val) === false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.