diff --git a/docs/docs.json b/docs/docs.json index e0cb59039..a347d8e0b 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -1 +1 @@ -{"meta":{"version":1},"custom":{"general":{"Getting Started":"# Welcome!\ndiscord.js is an easy-to-use and intuitive JavaScript library that wraps around the Discord API.\n"}},"json":[{"id":"Client","longname":"Client","name":"Client","scope":"global","kind":"class","description":"Creates a new Discord Client\n```js\nconst Discord = require(\"discord.js\");\nconst client = new Discord.Client();\n```","meta":{"lineno":18,"filename":"Client.js","path":"src/client"},"order":0},{"id":"User","longname":"User","name":"User","scope":"global","kind":"class","description":"Represents a User on Discord.","meta":{"lineno":6,"filename":"User.js","path":"src/structures"},"order":3},{"id":"Client#user","longname":"Client#user","name":"user","scope":"instance","kind":"member","description":"The User of the logged in Client, only available after `READY` has been fired.","memberof":"Client","params":[],"returns":[{"type":{"names":["ClientUser"]},"description":"[description]"}],"meta":{"lineno":55,"filename":"Client.js","path":"src/client"},"order":2},{"id":"User#username","longname":"User#username","name":"username","scope":"instance","kind":"member","description":"The username of the User","memberof":"User","type":{"names":["String"]},"meta":{"lineno":19,"filename":"User.js","path":"src/structures"},"order":4},{"id":"User#id","longname":"User#id","name":"id","scope":"instance","kind":"member","description":"The ID of the User","memberof":"User","type":{"names":["String"]},"meta":{"lineno":24,"filename":"User.js","path":"src/structures"},"order":5},{"id":"User#discriminator","longname":"User#discriminator","name":"discriminator","scope":"instance","kind":"member","description":"A discriminator based on username for the User","memberof":"User","type":{"names":["String"]},"meta":{"lineno":29,"filename":"User.js","path":"src/structures"},"order":6},{"id":"User#avatar","longname":"User#avatar","name":"avatar","scope":"instance","kind":"member","description":"The ID of the user's avatar","memberof":"User","type":{"names":["String"]},"meta":{"lineno":34,"filename":"User.js","path":"src/structures"},"order":7},{"id":"User#bot","longname":"User#bot","name":"bot","scope":"instance","kind":"member","description":"Whether or not the User is a Bot.","memberof":"User","type":{"names":["Boolean"]},"meta":{"lineno":39,"filename":"User.js","path":"src/structures"},"order":8},{"id":"User#status","longname":"User#status","name":"status","scope":"instance","kind":"member","description":"The status of the user:\n\n* **`online`** - user is online\n* **`offline`** - user is offline\n* **`idle`** - user is AFK","memberof":"User","type":{"names":["String"]},"meta":{"lineno":48,"filename":"User.js","path":"src/structures"},"order":9},{"id":"Client#login","longname":"Client#login","name":"login","scope":"instance","kind":"function","description":"Logs the client in. If successful, resolves with the account's token.","memberof":"Client","params":[{"type":{"names":["string"]},"description":"The email or token used for the account. If it is an email, a password _must_ be\nprovided.","name":"emailOrToken"},{"type":{"names":["string"]},"optional":true,"description":"The password for the account, only needed if an email was provided.","name":"password"}],"examples":["client.login(\"token\");\n// or\nclient.login(\"email\", \"password\");"],"returns":[{"type":{"names":["Promise."]}}],"meta":{"lineno":42,"filename":"Client.js","path":"src/client"},"order":1},{"id":"User#deleteDM","longname":"User#deleteDM","name":"deleteDM","scope":"instance","kind":"function","description":"Deletes a DM Channel (if one exists) between the Client and the User. Resolves with the Channel if successful.","memberof":"User","params":[],"returns":[{"type":{"names":["Promise."]}}],"meta":{"lineno":60,"filename":"User.js","path":"src/structures"},"order":10}]} \ No newline at end of file +{"meta":{"version":2},"custom":{"general":{"Getting Started":"# Welcome!\ndiscord.js is an easy-to-use and intuitive JavaScript library that wraps around the Discord API.\n"}},"json":{"classes":{"Client":{"meta":{"id":"Client","longname":"Client","name":"Client","scope":"global","kind":"class","description":"Creates a new Discord Client\n```js\nconst Discord = require(\"discord.js\");\nconst client = new Discord.Client();\n```","meta":{"lineno":18,"filename":"Client.js","path":"src/client"},"order":0},"functions":[{"id":"Client#login","longname":"Client#login","name":"login","scope":"instance","kind":"function","description":"Logs the client in. If successful, resolves with the account's token.","memberof":"Client","params":[{"type":{"names":["string"]},"description":"The email or token used for the account. If it is an email, a password _must_ be\nprovided.","name":"emailOrToken"},{"type":{"names":["string"]},"optional":true,"description":"The password for the account, only needed if an email was provided.","name":"password"}],"examples":["client.login(\"token\");\n// or\nclient.login(\"email\", \"password\");"],"returns":[{"type":{"names":["Promise."]}}],"meta":{"lineno":42,"filename":"Client.js","path":"src/client"},"order":1}],"properties":[{"id":"Client#user","longname":"Client#user","name":"user","scope":"instance","kind":"member","description":"The User of the logged in Client, only available after `READY` has been fired.","memberof":"Client","params":[],"returns":[{"type":{"names":["ClientUser"]},"description":"[description]"}],"meta":{"lineno":55,"filename":"Client.js","path":"src/client"},"order":2}],"events":[]},"User":{"meta":{"id":"User","longname":"User","name":"User","scope":"global","kind":"class","description":"Represents a User on Discord.","meta":{"lineno":6,"filename":"User.js","path":"src/structures"},"order":3},"functions":[{"id":"User#deleteDM","longname":"User#deleteDM","name":"deleteDM","scope":"instance","kind":"function","description":"Deletes a DM Channel (if one exists) between the Client and the User. Resolves with the Channel if successful.","memberof":"User","params":[],"returns":[{"type":{"names":["Promise."]}}],"meta":{"lineno":60,"filename":"User.js","path":"src/structures"},"order":10}],"properties":[{"id":"User#username","longname":"User#username","name":"username","scope":"instance","kind":"member","description":"The username of the User","memberof":"User","type":{"names":["String"]},"meta":{"lineno":19,"filename":"User.js","path":"src/structures"},"order":4},{"id":"User#id","longname":"User#id","name":"id","scope":"instance","kind":"member","description":"The ID of the User","memberof":"User","type":{"names":["String"]},"meta":{"lineno":24,"filename":"User.js","path":"src/structures"},"order":5},{"id":"User#discriminator","longname":"User#discriminator","name":"discriminator","scope":"instance","kind":"member","description":"A discriminator based on username for the User","memberof":"User","type":{"names":["String"]},"meta":{"lineno":29,"filename":"User.js","path":"src/structures"},"order":6},{"id":"User#avatar","longname":"User#avatar","name":"avatar","scope":"instance","kind":"member","description":"The ID of the user's avatar","memberof":"User","type":{"names":["String"]},"meta":{"lineno":34,"filename":"User.js","path":"src/structures"},"order":7},{"id":"User#bot","longname":"User#bot","name":"bot","scope":"instance","kind":"member","description":"Whether or not the User is a Bot.","memberof":"User","type":{"names":["Boolean"]},"meta":{"lineno":39,"filename":"User.js","path":"src/structures"},"order":8},{"id":"User#status","longname":"User#status","name":"status","scope":"instance","kind":"member","description":"The status of the user:\n\n* **`online`** - user is online\n* **`offline`** - user is offline\n* **`idle`** - user is AFK","memberof":"User","type":{"names":["String"]},"meta":{"lineno":48,"filename":"User.js","path":"src/structures"},"order":9}],"events":[]}}}} \ No newline at end of file diff --git a/docs/gen/index.js b/docs/gen/index.js index cb688b22e..a12185e5a 100644 --- a/docs/gen/index.js +++ b/docs/gen/index.js @@ -4,7 +4,7 @@ let parse; const customDocs = require('../custom/index'); -const GEN_VERSION = 1; +const GEN_VERSION = 2; try { fs = require('fs-extra'); @@ -33,10 +33,33 @@ function cleanPaths() { } } +function clean() { + const cleaned = { + classes: {}, + }; + for (const item of json) { + if (item.kind === 'class') { + cleaned.classes[item.longname] = { + meta: item, + functions: [], + properties: [], + events: [], + }; + } else if (item.kind === 'member') { + cleaned.classes[item.memberof].properties.push(item); + } else if (item.kind === 'function' && item.memberof) { + cleaned.classes[item.memberof].functions.push(item); + } + } + json = cleaned; +} + function next() { json = JSON.parse(json); cleanPaths(); console.log('parsed inline code'); + console.log(json); + clean(); json = { meta: { version: GEN_VERSION,