[Docs] Fix inline code blocks and misc tweaks. (#2878)
* Fix code blocks and list items having overlap if they contain code blocks. * Fixes for interaction framework intro guide. * Add NuGet icon to top navbar. * tweak action triggers * Fix mobile navbar links. * Add relatively ugly hack to improve toc filter functionality. --------- Co-authored-by: Mihail Gribkov <61027276+Misha-133@users.noreply.github.com>
This commit is contained in:
2
.github/workflows/docs.yml
vendored
2
.github/workflows/docs.yml
vendored
@@ -6,6 +6,8 @@ on:
|
|||||||
- '*'
|
- '*'
|
||||||
paths:
|
paths:
|
||||||
- 'docs/**'
|
- 'docs/**'
|
||||||
|
branches:
|
||||||
|
- 'dev'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
|
|||||||
14
docs/_template/material/public/main.css
vendored
14
docs/_template/material/public/main.css
vendored
@@ -184,10 +184,22 @@ code {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* MAKES PARAMETERS MORE SPACIOUS */
|
/* MAKES PARAMETERS MORE SPACIOUS */
|
||||||
dl.parameters > dt > code {
|
:not(pre) > code {
|
||||||
padding: 3px;
|
padding: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* MAKES LIST ITEMS BE SLIGHTLY MORE SEPARATED */
|
||||||
|
/* THIS AVOIDS CODE BLOCK OVERLAP */
|
||||||
|
ul:not(.navbar-nav) > li:not(:last-child) {
|
||||||
|
margin-bottom: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* MAKES NAVBAR LINKS LOOK BETTER IN MOBILE */
|
||||||
|
.navbar-expand-md .navbar-nav .nav-link {
|
||||||
|
padding-right: var(--bs-navbar-nav-link-padding-x);
|
||||||
|
padding-left: var(--bs-navbar-nav-link-padding-x);
|
||||||
|
}
|
||||||
|
|
||||||
/* MAKES INHERITANCE LIST READABLE */
|
/* MAKES INHERITANCE LIST READABLE */
|
||||||
:is(dl.typelist.inheritedMembers, dl.typelist.extensionMethods) > dd > div::after {
|
:is(dl.typelist.inheritedMembers, dl.typelist.extensionMethods) > dd > div::after {
|
||||||
content: none !important;
|
content: none !important;
|
||||||
|
|||||||
61
docs/_template/material/public/main.js
vendored
61
docs/_template/material/public/main.js
vendored
@@ -1,14 +1,69 @@
|
|||||||
export default {
|
export default
|
||||||
iconLinks: [
|
{
|
||||||
|
iconLinks:
|
||||||
|
[
|
||||||
{
|
{
|
||||||
icon: 'github',
|
icon: 'github',
|
||||||
href: 'https://github.com/discord-net/Discord.Net',
|
href: 'https://github.com/discord-net/Discord.Net',
|
||||||
title: 'GitHub'
|
title: 'GitHub'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
icon: 'box-seam-fill',
|
||||||
|
href: 'https://www.nuget.org/packages/Discord.Net/',
|
||||||
|
title: 'NuGet'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
icon: 'discord',
|
icon: 'discord',
|
||||||
href: 'https://discord.gg/dnet',
|
href: 'https://discord.gg/dnet',
|
||||||
title: 'Discord'
|
title: 'Discord'
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
start: () =>
|
||||||
|
{
|
||||||
|
// Ugly hack to improve toc filter.
|
||||||
|
let target = document.getElementById("toc");
|
||||||
|
let config = { attributes: false, childList: true, subtree: true };
|
||||||
|
let observer = new MutationObserver((list) =>
|
||||||
|
{
|
||||||
|
for(const mutation of list)
|
||||||
|
{
|
||||||
|
if(mutation.type === "childList" && mutation.target == target)
|
||||||
|
{
|
||||||
|
let filter = target.getElementsByClassName("form-control")[0];
|
||||||
|
|
||||||
|
let filterValue = localStorage.getItem("tocFilter");
|
||||||
|
let scrollValue = localStorage.getItem("tocScroll");
|
||||||
|
|
||||||
|
if(filterValue && filterValue !== "")
|
||||||
|
{
|
||||||
|
filter.value = filterValue;
|
||||||
|
|
||||||
|
let inputEvent = new Event("input");
|
||||||
|
filter.dispatchEvent(inputEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add event to store scroll pos.
|
||||||
|
let tocDiv = target.getElementsByClassName("flex-fill")[0];
|
||||||
|
|
||||||
|
tocDiv.addEventListener("scroll", (event) =>
|
||||||
|
{
|
||||||
|
if (event.target.scrollTop >= 0)
|
||||||
|
{
|
||||||
|
localStorage.setItem("tocScroll", event.target.scrollTop);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if(scrollValue && scrollValue >= 0)
|
||||||
|
{
|
||||||
|
tocDiv.scroll(0, scrollValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
observer.disconnect();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
observer.observe(target, config);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ A new module instance is created before a command execution starts then it will
|
|||||||
|
|
||||||
Every module class must:
|
Every module class must:
|
||||||
|
|
||||||
- be public
|
- Be public
|
||||||
- inherit [InteractionModuleBase]
|
- Inherit from [InteractionModuleBase]
|
||||||
|
|
||||||
Optionally you can override the included :
|
Optionally you can override the included :
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ Valid **Interaction Commands** must comply with the following requirements:
|
|||||||
|[Autocomplete Command](#autocomplete-commands)| `Task`/`Task<RuntimeResult>` | - | - | `[AutocompleteCommand]`|
|
|[Autocomplete Command](#autocomplete-commands)| `Task`/`Task<RuntimeResult>` | - | - | `[AutocompleteCommand]`|
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> a `TypeConverter` that is capable of parsing type in question must be registered to the [InteractionService] instance.
|
> A `TypeConverter` that is capable of parsing type in question must be registered to the [InteractionService] instance.
|
||||||
> You should avoid using long running code in your command module.
|
> You should avoid using long running code in your command module.
|
||||||
> Depending on your setup, long running code may block the Gateway thread of your bot, interrupting its connection to Discord.
|
> Depending on your setup, long running code may block the Gateway thread of your bot, interrupting its connection to Discord.
|
||||||
|
|
||||||
@@ -94,13 +94,17 @@ By default, your methods can feature the following parameter types:
|
|||||||
- `sbyte`, `byte`
|
- `sbyte`, `byte`
|
||||||
- `int16`, `int32`, `int64`
|
- `int16`, `int32`, `int64`
|
||||||
- `uint16`, `uint32`, `uint64`
|
- `uint16`, `uint32`, `uint64`
|
||||||
- `enum` (Values are registered as multiple choice options and are enforced by Discord. Use the `[Hide]` attribute on enum values to prevent them from getting registered.)
|
- `enum`
|
||||||
- `DateTime`
|
- `DateTime`
|
||||||
- `TimeSpan`
|
- `TimeSpan`
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> Enum values are registered as multiple choice options and are enforced by Discord. Use the `[Hide]` attribute on enum values to prevent them from getting registered.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**You can use more specialized implementations of [IChannel] to restrict the allowed channel types for a channel type option.*
|
**You can use more specialized implementations of [IChannel] to restrict the allowed channel types for a channel type option.**
|
||||||
|
|
||||||
| interface | Channel Type |
|
| interface | Channel Type |
|
||||||
|---------------------|-------------------------------|
|
|---------------------|-------------------------------|
|
||||||
| `IStageChannel` | Stage Channels |
|
| `IStageChannel` | Stage Channels |
|
||||||
|
|||||||
Reference in New Issue
Block a user