finished markdown for docs

This commit is contained in:
2024-02-02 21:47:13 +01:00
parent 03798cdaf9
commit 17a0793843
8 changed files with 347 additions and 24 deletions

View File

@@ -3,6 +3,9 @@ import minify from 'astro-min';
import metaTags from "astro-meta-tags";
import rehypeSlug from 'rehype-slug';
import rehypeAutolinkHeadings from 'rehype-autolink-headings';
import remarkDirective from 'remark-directive';
import remarkCalloutDirectives from "@microflash/remark-callout-directives"
import remarkExternalLinks from 'remark-external-links';
import mdx from "@astrojs/mdx";
@@ -11,8 +14,9 @@ export default defineConfig({
integrations: [minify(), metaTags(), mdx()],
markdown: {
rehypePlugins: [rehypeSlug, [rehypeAutolinkHeadings, {
behavior: 'prepend'
behavior: 'wrap'
}]],
remarkPlugins: [remarkDirective, remarkCalloutDirectives, [remarkExternalLinks, { target: '_blank' }]],
drafts: true,
shikiConfig: {
theme: 'dracula'

233
package-lock.json generated
View File

@@ -10,12 +10,15 @@
"dependencies": {
"@astrojs/markdown-remark": "^4.2.1",
"@astrojs/mdx": "^2.1.1",
"@microflash/remark-callout-directives": "^2.0.0",
"astro": "^4.2.6",
"astro-meta-tags": "^0.2.1",
"astro-min": "^1.1.0-dev.4",
"npx": "^3.0.0",
"rehype-autolink-headings": "^7.1.0",
"rehype-slug": "^6.0.0",
"remark-directive": "^3.0.0",
"remark-external-links": "^9.0.1",
"sass": "^1.70.0"
}
},
@@ -888,6 +891,17 @@
"url": "https://opencollective.com/unified"
}
},
"node_modules/@microflash/remark-callout-directives": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@microflash/remark-callout-directives/-/remark-callout-directives-2.0.0.tgz",
"integrity": "sha512-SWb6kYBUI/Dq2XzHd+OqEoQ5Ciz69kJ4UWQJa/+nfiewT7IcSzRsjXxgiZWvScb1AbzZaraPVNVQjYaa0r6jAQ==",
"dependencies": {
"defu": "^6.1.3",
"hastscript": "^8.0.0",
"mdast-util-from-markdown": "^2.0.0",
"unist-util-visit": "^5.0.0"
}
},
"node_modules/@minify-html/node": {
"version": "0.15.0",
"resolved": "https://registry.npmjs.org/@minify-html/node/-/node-0.15.0.tgz",
@@ -2109,6 +2123,11 @@
"node": ">=4.0.0"
}
},
"node_modules/defu": {
"version": "6.1.4",
"resolved": "https://registry.npmjs.org/defu/-/defu-6.1.4.tgz",
"integrity": "sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg=="
},
"node_modules/dequal": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz",
@@ -3034,6 +3053,17 @@
"resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.1.1.tgz",
"integrity": "sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q=="
},
"node_modules/is-absolute-url": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/is-absolute-url/-/is-absolute-url-4.0.1.tgz",
"integrity": "sha512-/51/TKE88Lmm7Gc4/8btclNXWS+g50wXhYJq8HWIBAGUBnoAdRu1aXeh364t/O7wXDAcTJDP8PNuNKWUDWie+A==",
"engines": {
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/is-alphabetical": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-2.0.1.tgz",
@@ -3464,6 +3494,25 @@
"url": "https://opencollective.com/unified"
}
},
"node_modules/mdast-util-directive": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/mdast-util-directive/-/mdast-util-directive-3.0.0.tgz",
"integrity": "sha512-JUpYOqKI4mM3sZcNxmF/ox04XYFFkNwr0CFlrQIkCwbvH0xzMCqkMqAde9wRd80VAhaUrwFwKm2nxretdT1h7Q==",
"dependencies": {
"@types/mdast": "^4.0.0",
"@types/unist": "^3.0.0",
"devlop": "^1.0.0",
"mdast-util-from-markdown": "^2.0.0",
"mdast-util-to-markdown": "^2.0.0",
"parse-entities": "^4.0.0",
"stringify-entities": "^4.0.0",
"unist-util-visit-parents": "^6.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/mdast-util-find-and-replace": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/mdast-util-find-and-replace/-/mdast-util-find-and-replace-3.0.1.tgz",
@@ -3830,6 +3879,24 @@
"micromark-util-types": "^2.0.0"
}
},
"node_modules/micromark-extension-directive": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/micromark-extension-directive/-/micromark-extension-directive-3.0.0.tgz",
"integrity": "sha512-61OI07qpQrERc+0wEysLHMvoiO3s2R56x5u7glHq2Yqq6EHbH4dW25G9GfDdGCDYqA21KE6DWgNSzxSwHc2hSg==",
"dependencies": {
"devlop": "^1.0.0",
"micromark-factory-space": "^2.0.0",
"micromark-factory-whitespace": "^2.0.0",
"micromark-util-character": "^2.0.0",
"micromark-util-symbol": "^2.0.0",
"micromark-util-types": "^2.0.0",
"parse-entities": "^4.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/micromark-extension-gfm": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/micromark-extension-gfm/-/micromark-extension-gfm-3.0.0.tgz",
@@ -6532,6 +6599,172 @@
"url": "https://opencollective.com/unified"
}
},
"node_modules/remark-directive": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/remark-directive/-/remark-directive-3.0.0.tgz",
"integrity": "sha512-l1UyWJ6Eg1VPU7Hm/9tt0zKtReJQNOA4+iDMAxTyZNWnJnFlbS/7zhiel/rogTLQ2vMYwDzSJa4BiVNqGlqIMA==",
"dependencies": {
"@types/mdast": "^4.0.0",
"mdast-util-directive": "^3.0.0",
"micromark-extension-directive": "^3.0.0",
"unified": "^11.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/remark-external-links": {
"version": "9.0.1",
"resolved": "https://registry.npmjs.org/remark-external-links/-/remark-external-links-9.0.1.tgz",
"integrity": "sha512-EYw+p8Zqy5oT5+W8iSKzInfRLY+zeKWHCf0ut+Q5SwnaSIDGXd2zzvp4SWqyAuVbinNmZ0zjMrDKaExWZnTYqQ==",
"dependencies": {
"@types/hast": "^2.3.2",
"@types/mdast": "^3.0.0",
"extend": "^3.0.0",
"is-absolute-url": "^4.0.0",
"mdast-util-definitions": "^5.0.0",
"space-separated-tokens": "^2.0.0",
"unified": "^10.0.0",
"unist-util-visit": "^4.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/remark-external-links/node_modules/@types/hast": {
"version": "2.3.10",
"resolved": "https://registry.npmjs.org/@types/hast/-/hast-2.3.10.tgz",
"integrity": "sha512-McWspRw8xx8J9HurkVBfYj0xKoE25tOFlHGdx4MJ5xORQrMGZNqJhVQWaIbm6Oyla5kYOXtDiopzKRJzEOkwJw==",
"dependencies": {
"@types/unist": "^2"
}
},
"node_modules/remark-external-links/node_modules/@types/mdast": {
"version": "3.0.15",
"resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.15.tgz",
"integrity": "sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ==",
"dependencies": {
"@types/unist": "^2"
}
},
"node_modules/remark-external-links/node_modules/@types/unist": {
"version": "2.0.10",
"resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz",
"integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA=="
},
"node_modules/remark-external-links/node_modules/mdast-util-definitions": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/mdast-util-definitions/-/mdast-util-definitions-5.1.2.tgz",
"integrity": "sha512-8SVPMuHqlPME/z3gqVwWY4zVXn8lqKv/pAhC57FuJ40ImXyBpmO5ukh98zB2v7Blql2FiHjHv9LVztSIqjY+MA==",
"dependencies": {
"@types/mdast": "^3.0.0",
"@types/unist": "^2.0.0",
"unist-util-visit": "^4.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/remark-external-links/node_modules/unified": {
"version": "10.1.2",
"resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz",
"integrity": "sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==",
"dependencies": {
"@types/unist": "^2.0.0",
"bail": "^2.0.0",
"extend": "^3.0.0",
"is-buffer": "^2.0.0",
"is-plain-obj": "^4.0.0",
"trough": "^2.0.0",
"vfile": "^5.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/remark-external-links/node_modules/unist-util-is": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.2.1.tgz",
"integrity": "sha512-u9njyyfEh43npf1M+yGKDGVPbY/JWEemg5nH05ncKPfi+kBbKBJoTdsogMu33uhytuLlv9y0O7GH7fEdwLdLQw==",
"dependencies": {
"@types/unist": "^2.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/remark-external-links/node_modules/unist-util-stringify-position": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz",
"integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==",
"dependencies": {
"@types/unist": "^2.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/remark-external-links/node_modules/unist-util-visit": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.1.2.tgz",
"integrity": "sha512-MSd8OUGISqHdVvfY9TPhyK2VdUrPgxkUtWSuMHF6XAAFuL4LokseigBnZtPnJMu+FbynTkFNnFlyjxpVKujMRg==",
"dependencies": {
"@types/unist": "^2.0.0",
"unist-util-is": "^5.0.0",
"unist-util-visit-parents": "^5.1.1"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/remark-external-links/node_modules/unist-util-visit-parents": {
"version": "5.1.3",
"resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.1.3.tgz",
"integrity": "sha512-x6+y8g7wWMyQhL1iZfhIPhDAs7Xwbn9nRosDXl7qoPTSCy0yNxnKc+hWokFifWQIDGi154rdUqKvbCa4+1kLhg==",
"dependencies": {
"@types/unist": "^2.0.0",
"unist-util-is": "^5.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/remark-external-links/node_modules/vfile": {
"version": "5.3.7",
"resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz",
"integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==",
"dependencies": {
"@types/unist": "^2.0.0",
"is-buffer": "^2.0.0",
"unist-util-stringify-position": "^3.0.0",
"vfile-message": "^3.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/remark-external-links/node_modules/vfile-message": {
"version": "3.1.4",
"resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz",
"integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==",
"dependencies": {
"@types/unist": "^2.0.0",
"unist-util-stringify-position": "^3.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/remark-gfm": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/remark-gfm/-/remark-gfm-4.0.0.tgz",

View File

@@ -12,12 +12,15 @@
"dependencies": {
"@astrojs/markdown-remark": "^4.2.1",
"@astrojs/mdx": "^2.1.1",
"@microflash/remark-callout-directives": "^2.0.0",
"astro": "^4.2.6",
"astro-meta-tags": "^0.2.1",
"astro-min": "^1.1.0-dev.4",
"npx": "^3.0.0",
"rehype-autolink-headings": "^7.1.0",
"rehype-slug": "^6.0.0",
"remark-directive": "^3.0.0",
"remark-external-links": "^9.0.1",
"sass": "^1.70.0"
}
}

View File

@@ -7,6 +7,7 @@ interface Props {
const { title } = Astro.props;
const { description } = Astro.props;
import "../styles/main.scss";
import "../styles/callout.scss";
import Navbar from "../components/Navbar.astro";
import Footer from "../components/Footer.astro";

View File

@@ -4,28 +4,31 @@ title: Home
draft: true
---
> [!IMPORTANT]
> The GameSDK's Achievements, Applications, Voice, Images, Lobbies, Networking, Storage, and Store (purchases and discounts) features have been deprecated and will not be added. <br /> However the rest is and will still be supported by Discord.
:::note{title="Important Discord Game SDK information"}
The GameSDK's Achievements, Applications, Voice, Images, Lobbies, Networking, Storage, and Store (purchases and discounts) features have been deprecated and will not be added. <br /> However the rest is and will still be supported by Discord.
:::
**[![apple](https://github.com/vaporvee/discord-sdk-godot/assets/80621863/6d2c7a54-bfc9-4c8d-955a-40fa5c9e8c74)About MacOS Support](https://github.com/vaporvee/discord-sdk-godot/wiki/Building#macos-support)**<br />
> [!WARNING]
> The plugin only works with 4.2 and above for the current version
:::warn
The plugin only works with 4.2 and above for the current version
:::
<br/>
:::assert
To make anything work in the plugin make sure to run
> [!NOTE]
> To make anything work in the plugin make sure to run
>
> ```gdscript
> func _process(_delta):
> DiscordSDK.run_callbacks()
> ```
>
> This happens normaly inside the Autoload wich should be automatically added by the plugin. <br />
> Something that does **not get added automatically** is your `app_id`. It is also mandatory to be able to use anything in the plugin.
>
> ```gdscript
> DiscordSDK.app_id = #<your Application ID>
> ```
```gdscript
func _process(_delta):
DiscordSDK.run_callbacks()
```
This happens normaly inside the Autoload wich should be automatically added by the plugin. <br />
Something that does **not get added automatically** is your `app_id`. It is also mandatory to be able to use anything in the plugin.
```gdscript
DiscordSDK.app_id = #<your Application ID>
```
:::
# Quick start
@@ -66,8 +69,6 @@ func _ready():
[**Try a built demo**](https://github.com/vaporvee/discord-sdk-godot/releases/latest/download/Demo-Export.zip)<br /><br />
# Troubleshooting
> [!TIP]
> First of all try reinstalling the plugin and restart both your Godot Editor and your Discord client.
> <details><summary><b>I have no errors in my Godot console from the plugin but my Activity doesn't show up in my Discord Client.</b></summary>Make sure a `DiscordSDK.run_callbacks()` function runs in a `_process(delta)` function. This should happen in the Autoload added by the plugin. If it still doesn't help, try the Demo above. If still nothing appears in your Discord profile card, you have to reset the depending settings in you Discord or reinstall it.</details>
> <details><summary><b>I have a lot of `DiscordSDK not declared` errors spammed in my Godot Console and i can't use the plugin.</b></summary> Make sure the plugin is actually enabled. Then the plugin should work and after the second restart you shouldn't get any errors from the plugin. But if it still gives you the errors delete the file `/addons/discord-sdk-gd/bin/.gdignore` and restart the editor manually.</details>
First of all try reinstalling the plugin and restart both your Godot Editor and your Discord client.
<details><summary><b>I have no errors in my Godot console from the plugin but my Activity doesn't show up in my Discord Client.</b></summary>Make sure a `DiscordSDK.run_callbacks()` function runs in a `_process(delta)` function. This should happen in the Autoload added by the plugin. If it still doesn't help, try the Demo above. If still nothing appears in your Discord profile card, you have to reset the depending settings in you Discord or reinstall it.</details>
<details><summary><b>I have a lot of `DiscordSDK not declared` errors spammed in my Godot Console and i can't use the plugin.</b></summary> Make sure the plugin is actually enabled. Then the plugin should work and after the second restart you shouldn't get any errors from the plugin. But if it still gives you the errors delete the file `/addons/discord-sdk-gd/bin/.gdignore` and restart the editor manually.</details>

79
src/styles/callout.scss Normal file
View File

@@ -0,0 +1,79 @@
.callout {
max-width: 700px;
--callout-color: hsl(207, 14%, 62%);
--callout-background: ;
--callout-border: 1px solid hsl(205, 15%, 33%);
--callout-radius: 8px;
--callout-padding: 1.5vh;
border: var(--callout-border);
border-radius: var(--callout-radius);
background: var(--callout-background);
}
.callout code,
.callout pre {
border: none;
}
.callout-content {
padding: var(--callout-padding);
}
.callout-content:first-child,
.callout-content:only-child {
margin-block-start: 0;
}
.callout-content:last-child,
.callout-content:only-child {
margin-block-end: 0;
}
.callout-indicator {
display: flex;
align-items: center;
padding: var(--callout-padding) var(--callout-padding) 0;
}
.callout-hint {
margin-inline-end: calc(var(--callout-padding) / 4);
color: var(--callout-color);
}
.callout-title {
margin-inline-start: calc(var(--callout-padding) / 4);
color: var(--callout-color);
font-size: 0.9em;
font-weight: bold;
letter-spacing: 0.04em;
}
.callout-note {
--callout-background: hsl(0, 0%, 32%, 0.05);
--callout-color: hsl(0, 0%, 92%, 0.6);
--callout-border: 1px solid hsl(0, 0%, 66%, 0.25);
}
.callout-commend {
--callout-background: hsl(153, 47%, 49%, 0.05);
--callout-color: hsl(153, 62%, 54%);
--callout-border: 1px solid hsl(153, 47%, 49%, 0.25);
}
.callout-warn {
--callout-background: hsl(45, 100%, 55%, 0.05);
--callout-color: hsl(45, 97%, 66%);
--callout-border: 1px solid hsl(45, 100%, 55%, 0.25);
}
.callout-deter {
--callout-background: hsl(353, 83%, 58%, 0.05);
--callout-color: hsl(341, 89%, 63%);
--callout-border: 1px solid hsl(353, 83%, 58%, 0.25);
}
.callout-assert {
--callout-background: rgba(47, 131, 157, 0.05);
--callout-color: hsl(201, 89%, 63%);
--callout-border: 1px solid hsl(195, 61%, 56%, 0.25);
}

View File

@@ -35,6 +35,7 @@ main {
.content {
justify-self: flex-end;
margin: 0;
margin-top: 2vh;
max-width: 450px;
}
}

View File

@@ -19,6 +19,7 @@ h1 {
.content {
background-color: $highlight-primary;
border-radius: 25px;
border: 1px solid lighten($highlight-primary, 16%);
box-shadow: 0px 4px 4px 0px #00000040;
padding: 2vw;
margin-inline: 20vw;