diff --git a/CHANGELOG.md b/CHANGELOG.md index eca5da979..a92ae9dd1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,97 +1,101 @@ # v10.1.0 **Full Changelog**: [GitHub](https://github.com/Aiko-IT-Systems/DisCatSharp/compare/10.0.0...v10.1.0) ## Changes > [!NOTE] > This release contains breaking changes. Please read the changelog carefully. - > Some bug fixes aren't noted here + > Some bug fixes aren't noted here. ### All packages NuGet packages now support Source Link & Deterministic Builds. - Updated the NuGet specs to be compatible with NuGet Gallery. - Changed PackageLicenseUrl to PackageLicenseFile and included the top-level LICENSE.md - Changed PackageIconUrl to PackageIcon and included DisCatSharp.Logos/logobig.png ### DisCatSharp -- Reworked documentation -- Support for sending component-only messages -- Reworked component result for modal submits -- DiscordClient.ReconnectAsync param startNewSession now defaults to true -- Added Avatar Decorations -- Added Theme Colors -- Fixed webhooks for threads -- Added DiscordMember.DisconnectFromVoiceAsync -- Added support for the 'X-Discord-Locale' Header in the [DiscordConfiguration](xref:DisCatSharp.DiscordConfiguration#DisCatSharp_DiscordConfiguration_Locale). +- Documentation has a bunch of new and reworked articles! +

- Implemented Forum Channels - * Added fields (DiscordChannel PostCreateUserRateLimit, DefaultReactionEmoji (new entity ForumReactionEmoji), AvailableTags | DiscordThreadChannel TotalMessagesSent, AppliedTags) - * Added operations to create a forum through the guild entity (DiscordGuild.CreateForumChannelAsync) - * Added operations to modify a forum channel (DiscordChannel.ModifyForumAsync) - * Added operations to create and delete tags (DiscordChannel CreateForumPostTagAsync, GetForumPostTag, DeleteForumPostTag) - * Added operations to modify tags (new entity ForumPostTag) (ForumPostTag ModifyAsync, DeleteAsync) + * Added fields (`DiscordChannel.PostCreateUserRateLimit`, `.DefaultReactionEmoji` (new entity `ForumReactionEmoji`), `.AvailableTags` and `DiscordThreadChannel.TotalMessagesSent`, `.AppliedTags`) + * Added function to create a forum through the guild entity (`DiscordGuild.CreateForumChannelAsync`) + * Added functions to modify a forum channel (`DiscordChannel.ModifyForumAsync`) + * Added functions to create and delete tags (`DiscordChannel.CreateForumPostTagAsync`, `.GetForumPostTag`, `.DeleteForumPostTag`) + * Added functions to modify tags (new entity ForumPostTag) (`ForumPostTag.ModifyAsync`, `.DeleteAsync`) * Fixed bugs in forum channel post creation * Added forum post tag operations on threads * Added checks to channel update - * AvailableTags Object in DiscordChannel is now read-only + * `AvailableTags` Object in DiscordChannel is now read-only * Handle available_tags Key in Channel Update - * Forum Channels are now included when using OrderedChannels, GetOrderedChannels or GetOrderedChannelsAsync -- Dropped support for channel banners, it sadly never made it's way into discord -- Implemented ResumeGatewayUrl -- Added GuildFeatures GuildHomeTest (Experimental) & InvitesDisabled -- Add disable invites for DiscordGuild (In experiment, won't work) - * Added new function EnableInvitesAsync - * Added new function DisableInvitesAsync -- Reworked DiscordIntegration - * Added SubscriberCount - * Added Revoked - * Added Application - * Added Scopes - * Removed int ExpireBehavior - * Added ExpireBehavior as new enum IntegrationExpireBehavior -- Reworked DiscordConnection - * Removed int Visibility - * Added Visibility as new enum ConnectionVisibilityType - * Added TwoWayLink -- Implemented DiscordWebhookBuilder.WithThreadName to create forum posts via webhook -- Added DisCatSharp.ApplicationFlags.ApplicationCommandBadge -- Added a bypassCache Option to DiscordChannel.GetMessageAsync +- Added disable invites for DiscordGuild (In experiment, won't work) + * Added new function `DiscordGuild.EnableInvitesAsync` + * Added new function `DiscordGuild.DisableInvitesAsync` +- `DiscordChannel.OrderedChannels`, `.GetOrderedChannels` and `.GetOrderedChannelsAsync` now include Forum Channels +- Added `DiscordMember.DisconnectFromVoiceAsync` +- Added Avatar Decorations +- Added Theme Colors +- Added support for the `X-Discord-Locale` Header in the [DiscordConfiguration] +- Added support for sending component-only messages +- Implemented `ResumeGatewayUrl` +- Added `GuildFeatures` `GuildHomeTest` (Experimental) & `InvitesDisabled` +- Implemented `DiscordWebhookBuilder.WithThreadName` to create forum posts via a webhook +- Added `DisCatSharp.ApplicationFlags.ApplicationCommandBadge` +- Added a `bypassCache` Option to `DiscordChannel.GetMessageAsync` - Added the new field app_permissions to the interaction entity and the context entities. -- Implemented DiscordGuild.EnableMfaAsync -- Implemented DiscordGuild.DisableMfaAsync -- Removed guild related enums from the DisCatSharp namespace -- Added guild related enums to the DisCatSharp.Enums namespace +- Added function `DiscordGuild.EnableMfaAsync` +- Added function `DiscordGuild.DisableMfaAsync` +

+- Reworked component result for modal submits +- Reworked `DiscordIntegration` + * Added `SubscriberCount` + * Added `Revoked` + * Added `Application` + * Added `Scopes` + * Removed int `ExpireBehavior` + * Added `ExpireBehavior` as new enum `IntegrationExpireBehavior` +- Reworked `DiscordConnection` + * Removed int `Visibility` + * Added `Visibility` as new enum `ConnectionVisibilityType` + * Added `TwoWayLink` +- `DiscordClient.ReconnectAsync` param `startNewSession` now defaults to true +- Moved guild related enums from the `DisCatSharp` to the `DisCatSharp.Enums` namespace +

+- Fixed webhooks for threads +(xref:DisCatSharp.DiscordConfiguration#DisCatSharp_DiscordConfiguration_Locale). +- Dropped support for channel banners, it sadly never made it's way into discord ### DisCatSharp.ApplicationCommands +- Added support for slash commands in shards - Added Translation Generator & Exporter +- Added `DiscordClient.RemoveGlobalApplicationCommandsAsync()` +- Added `DiscordClient.RemoveGuildApplicationCommandsAsync(ulong)` +- Added `DiscordClient.RemoveGuildApplicationCommandsAsync(DiscordGuild)` +- Implemented support for minimum_length and maximum_length for application command options of type string. + - Added `MinimumLengthAttribute`. Minimum int if set: 0. Valid for: string + - Added `MaximumLengthAttribute`. Minimum int if set: 1. Valid for: string +

+- Changed namespaces + * `DisCatSharp.ApplicationCommands`; + * `DisCatSharp.ApplicationCommands.Attributes`; + * `DisCatSharp.ApplicationCommands.Context`; + * `DisCatSharp.ApplicationCommands.Exceptions`; +- Renamed `MinimumAttribute` to `MinimumValueAttribute`. Valid for: int, long & double +- Renamed `MaximumAttribute` & `MaximumValueAttribute`. Valid for: int, long & double +- Proper exception log when registering app commands fails +- Reworked translation for application commands +- `ApplicationCommandsExtension.StartupFinished` now defaults to false +- `ApplicationCommandsExtension.UpdateAsync` checks now if it's just a restart to avoid crash +- Reworked application command registration +- Fixed DmPermissions check for Application Commands on registration - Fixed double interaction bug - Fixed int > long cast exception - Fixed a bug where the default help command would not work if auto defer was enabled -- Added support for slash commands in shards -- Removed ApplicationCommandsExtension.CleanGuildCommandsAsync() -- Removed ApplicationCommandsExtension.CleanGlobalCommandsAsync() -- Added DiscordClient.RemoveGlobalApplicationCommandsAsync() -- Added DiscordClient.RemoveGuildApplicationCommandsAsync(ulong) -- Added DiscordClient.RemoveGuildApplicationCommandsAsync(DiscordGuild) -- Fixed DmPermissions check for Application Commands on registration -- Reworked application command registration -- Changed namespaces - * DisCatSharp.ApplicationCommands; - * DisCatSharp.ApplicationCommands.Attributes; - * DisCatSharp.ApplicationCommands.Context; - * DisCatSharp.ApplicationCommands.Exceptions -- Reworked translation for application commands -- ApplicationCommandsExtension.StartupFinished now defaults to false -- ApplicationCommandsExtension.UpdateAsync checks now if it's just a restart to avoid crash - Various bug fixes -- Implemented support for minimum_length and maximum_length for application command options of type string. -- Renamed MinimumAttribute to MinimumValueAttribute. Valid for: int, long & double -- Renamed MaximumAttribute & MaximumValueAttribute. Valid for: int, long & double -- Added MinimumLengthAttribute . Minimum int if set: 0. Valid for: string -- Added MaximumLengthAttribute. Minimum int if set: 1. Valid for: string -- Proper exception log when registering app commands fails +

+- Removed `ApplicationCommandsExtension.CleanGuildCommandsAsync()` +- Removed `ApplicationCommandsExtension.CleanGlobalCommandsAsync()` ### DisCatSharp.Lavalink -- Added support for spotify search -- Added support for apple music search +- Added support for apple music & spotify search diff --git a/DisCatSharp.Docs/api/.gitignore b/DisCatSharp.Docs/api/.gitignore index da7c71b83..fb742eca1 100644 --- a/DisCatSharp.Docs/api/.gitignore +++ b/DisCatSharp.Docs/api/.gitignore @@ -1,4 +1,5 @@ ############### # temp file # ############### *.yml +!toc.yml diff --git a/DisCatSharp.Docs/api/DisCatSharp.ApplicationCommands/index.md b/DisCatSharp.Docs/api/DisCatSharp.ApplicationCommands/index.md new file mode 100644 index 000000000..d320330c7 --- /dev/null +++ b/DisCatSharp.Docs/api/DisCatSharp.ApplicationCommands/index.md @@ -0,0 +1,12 @@ +--- +uid: api_discatsharp_applicationcommands_index +title: DisCatSharp.ApplicationCommands API Reference +--- + +# API Reference + +Welcome to the DisCatSharp.ApplicationCommands API reference. + +To begin, select a namespace, then a class, from the table of contents on the left. + +If you encounter any problems or see typos, please inform us on our [Discord server](https://discord.gg/Uk7sggRBTm). diff --git a/DisCatSharp.Docs/api/DisCatSharp.CommandsNext/index.md b/DisCatSharp.Docs/api/DisCatSharp.CommandsNext/index.md new file mode 100644 index 000000000..4bd0dc89a --- /dev/null +++ b/DisCatSharp.Docs/api/DisCatSharp.CommandsNext/index.md @@ -0,0 +1,12 @@ +--- +uid: api_discatsharp_commandsnext_index +title: DisCatSharp.CommandsNext API Reference +--- + +# API Reference + +Welcome to the DisCatSharp.CommandsNext API reference. + +To begin, select a namespace, then a class, from the table of contents on the left. + +If you encounter any problems or see typos, please inform us on our [Discord server](https://discord.gg/Uk7sggRBTm). diff --git a/DisCatSharp.Docs/api/DisCatSharp.Common/index.md b/DisCatSharp.Docs/api/DisCatSharp.Common/index.md new file mode 100644 index 000000000..b5f4d9da6 --- /dev/null +++ b/DisCatSharp.Docs/api/DisCatSharp.Common/index.md @@ -0,0 +1,12 @@ +--- +uid: api_discatsharp_common_index +title: DisCatSharp.Common API Reference +--- + +# API Reference + +Welcome to the DisCatSharp.Common API reference. + +To begin, select a namespace, then a class, from the table of contents on the left. + +If you encounter any problems or see typos, please inform us on our [Discord server](https://discord.gg/Uk7sggRBTm). diff --git a/DisCatSharp.Docs/api/DisCatSharp.Configuration/index.md b/DisCatSharp.Docs/api/DisCatSharp.Configuration/index.md new file mode 100644 index 000000000..517c24c65 --- /dev/null +++ b/DisCatSharp.Docs/api/DisCatSharp.Configuration/index.md @@ -0,0 +1,12 @@ +--- +uid: api_discatsharp_configuration_index +title: DisCatSharp.Configuration API Reference +--- + +# API Reference + +Welcome to the DisCatSharp.Configuration API reference. + +To begin, select a namespace, then a class, from the table of contents on the left. + +If you encounter any problems or see typos, please inform us on our [Discord server](https://discord.gg/Uk7sggRBTm). diff --git a/DisCatSharp.Docs/api/DisCatSharp.Hosting.DependencyInjection/index.md b/DisCatSharp.Docs/api/DisCatSharp.Hosting.DependencyInjection/index.md new file mode 100644 index 000000000..0d2a3d0ee --- /dev/null +++ b/DisCatSharp.Docs/api/DisCatSharp.Hosting.DependencyInjection/index.md @@ -0,0 +1,12 @@ +--- +uid: api_discatsharp_hosting_dependencyinjection_index +title: DisCatSharp.Hosting.DependencyInjection API Reference +--- + +# API Reference + +Welcome to the DisCatSharp.Hosting.DependencyInjection API reference. + +To begin, select a namespace, then a class, from the table of contents on the left. + +If you encounter any problems or see typos, please inform us on our [Discord server](https://discord.gg/Uk7sggRBTm). diff --git a/DisCatSharp.Docs/api/DisCatSharp.Hosting/index.md b/DisCatSharp.Docs/api/DisCatSharp.Hosting/index.md new file mode 100644 index 000000000..599ecd284 --- /dev/null +++ b/DisCatSharp.Docs/api/DisCatSharp.Hosting/index.md @@ -0,0 +1,12 @@ +--- +uid: api_discatsharp_hosting_index +title: DisCatSharp.Hosting API Reference +--- + +# API Reference + +Welcome to the DisCatSharp.Hosting API reference. + +To begin, select a namespace, then a class, from the table of contents on the left. + +If you encounter any problems or see typos, please inform us on our [Discord server](https://discord.gg/Uk7sggRBTm). diff --git a/DisCatSharp.Docs/api/DisCatSharp.Interactivity/index.md b/DisCatSharp.Docs/api/DisCatSharp.Interactivity/index.md new file mode 100644 index 000000000..b43ab9a34 --- /dev/null +++ b/DisCatSharp.Docs/api/DisCatSharp.Interactivity/index.md @@ -0,0 +1,12 @@ +--- +uid: api_discatsharp_interactivity_index +title: DisCatSharp.Interactivity API Reference +--- + +# API Reference + +Welcome to the DisCatSharp.Interactivity API reference. + +To begin, select a namespace, then a class, from the table of contents on the left. + +If you encounter any problems or see typos, please inform us on our [Discord server](https://discord.gg/Uk7sggRBTm). diff --git a/DisCatSharp.Docs/api/DisCatSharp.Lavalink/index.md b/DisCatSharp.Docs/api/DisCatSharp.Lavalink/index.md new file mode 100644 index 000000000..b316d0620 --- /dev/null +++ b/DisCatSharp.Docs/api/DisCatSharp.Lavalink/index.md @@ -0,0 +1,12 @@ +--- +uid: api_discatsharp_lavalink_index +title: DisCatSharp.Lavalink API Reference +--- + +# API Reference + +Welcome to the DisCatSharp.Lavalink API reference. + +To begin, select a namespace, then a class, from the table of contents on the left. + +If you encounter any problems or see typos, please inform us on our [Discord server](https://discord.gg/Uk7sggRBTm). diff --git a/DisCatSharp.Docs/api/DisCatSharp.VoiceNext/index.md b/DisCatSharp.Docs/api/DisCatSharp.VoiceNext/index.md new file mode 100644 index 000000000..59bfe5a77 --- /dev/null +++ b/DisCatSharp.Docs/api/DisCatSharp.VoiceNext/index.md @@ -0,0 +1,12 @@ +--- +uid: api_discatsharp_voicenext_index +title: DisCatSharp.VoiceNext API Reference +--- + +# API Reference + +Welcome to the DisCatSharp.VoiceNext API reference. + +To begin, select a namespace, then a class, from the table of contents on the left. + +If you encounter any problems or see typos, please inform us on our [Discord server](https://discord.gg/Uk7sggRBTm). diff --git a/DisCatSharp.Docs/api/DisCatSharp/index.md b/DisCatSharp.Docs/api/DisCatSharp/index.md new file mode 100644 index 000000000..5208cb094 --- /dev/null +++ b/DisCatSharp.Docs/api/DisCatSharp/index.md @@ -0,0 +1,12 @@ +--- +uid: api_discatsharp_index +title: DisCatSharp API Reference +--- + +# API Reference + +Welcome to the DisCatSharp API reference. + +To begin, select a namespace, then a class, from the table of contents on the left. + +If you encounter any problems or see typos, please inform us on our [Discord server](https://discord.gg/Uk7sggRBTm). diff --git a/DisCatSharp.Docs/api/index.md b/DisCatSharp.Docs/api/index.md index 57fa48203..14b8b800e 100644 --- a/DisCatSharp.Docs/api/index.md +++ b/DisCatSharp.Docs/api/index.md @@ -1,3 +1,25 @@ # API Reference +--- +uid: api_index +title: DisCatSharp Global API +--- -Welcome to DisCatSharp API reference. To begin, select a namespace, then a class, from the table of contents on the left. \ No newline at end of file +Welcome to the DisCatSharp Global API reference. + +## Main packages +- [DisCatSharp](xref:api_discatsharp_index) +- [DisCatSharp.ApplicationCommands](xref:api_discatsharp_applicationcommands_index) +- [DisCatSharp.CommandsNext](xref:api_discatsharp_commandsnext_index) +- [DisCatSharp.Interactivity](xref:api_discatsharp_interactivity_index) + +## Voice packages +- [DisCatSharp.Lavalink](xref:api_discatsharp_lavalink_index) +- [DisCatSharp.VoiceNext](xref:api_discatsharp_voicenext_index) + +## Hosting packages +- [DisCatSharp.Configuration](xref:api_discatsharp_configuration_index) +- [DisCatSharp.Hosting](xref:api_discatsharp_hosting_index) +- [DisCatSharp.DependencyInjection](xref:api_discatsharp_hosting_dependencyinjection_index) + +## Other packages +- [DisCatSharp.Common](xref:api_discatsharp_common_index) diff --git a/DisCatSharp.Docs/api/toc.yml b/DisCatSharp.Docs/api/toc.yml new file mode 100644 index 000000000..73874f696 --- /dev/null +++ b/DisCatSharp.Docs/api/toc.yml @@ -0,0 +1,22 @@ +- name: Intro + href: index.md +- name: DisCatSharp + href: DisCatSharp/ +- name: DisCatSharp.ApplicationCommands + href: DisCatSharp.ApplicationCommands/ +- name: DisCatSharp.CommandsNext + href: DisCatSharp.CommandsNext/ +- name: DisCatSharp.Common + href: DisCatSharp.Common/ +- name: DisCatSharp.Configuration + href: DisCatSharp.Configuration/ +- name: DisCatSharp.Hosting + href: DisCatSharp.Hosting/ +- name: DisCatSharp.Hosting.DependencyInjection + href: DisCatSharp.Hosting.DependencyInjection/ +- name: DisCatSharp.Interactivity + href: DisCatSharp.Interactivity/ +- name: DisCatSharp.Lavalink + href: DisCatSharp.Lavalink/ +- name: DisCatSharp.VoiceNext + href: DisCatSharp.VoiceNext/ diff --git a/DisCatSharp.Docs/docfx.json b/DisCatSharp.Docs/docfx.json index c33ce6f3b..3ad3b3978 100644 --- a/DisCatSharp.Docs/docfx.json +++ b/DisCatSharp.Docs/docfx.json @@ -1,102 +1,258 @@ { - "metadata": [ - { - "src": [ - { - "src": "../", - "files": [ - "**.csproj" - ], - "exclude": [ - "**/obj/**", - "**/bin/**", - "_site/**" - ] - } - ], - "dest": "api", - "filter": "filter_config.yml" - } - ], - "build": { - "content": [ - { - "files": [ - "api/**.yml", - "api/**.md" - ] - }, - { - "files": [ - "**.md", - "toc.yml", - "faq/**.yml", - "faq/**.md", - "articles/**.yml", - "articles/**.md", - "natives/**.yml", - "natives/**.md" - ], - "exclude": [ - "**/bin/**", - "**/obj/**", - "_site/**", - "dcs/**" - ] - } - ], - "resource": [ - { - "files": [ - "images/**", - "natives/**.zip" - ], - "exclude": [ - "**/bin/**", - "**/obj/**", - "_site/**", - "images/_**" - ] - } - ], - "overwrite": [ - { - "files": [], - "exclude": [ - "**/bin/**", - "**/obj/**", - "_site/**" - ] - } - ], - "dest": "_site", - "globalMetadata": { - "_appFooter": "© 2021-2022 Aiko IT Systems", - "_enableSearch": true, - "_enableNewTab": true, - "_appTitle": "DisCatSharp Docs", - "_gitUrlPattern": "git", - "_gitContribute": { - "repo": "https://github.com/Aiko-IT-Systems/DisCatSharp", - "branch": "main" + "metadata":[ + { + "src":[ + { + "src":"../DisCatSharp/", + "files":[ + "**.csproj" + ], + "exclude":[ + "**/obj/**", + "**/bin/**" + ] + } + ], + "dest":"api/DisCatSharp", + "filter":"filter_config.yml" + }, + { + "src":[ + { + "src":"../DisCatSharp.Interactivity/", + "files":[ + "**.csproj" + ], + "exclude":[ + "**/obj/**", + "**/bin/**" + ] + } + ], + "dest":"api/DisCatSharp.Interactivity", + "filter":"filter_config.yml" + }, + { + "src":[ + { + "src":"../DisCatSharp.Common/", + "files":[ + "**.csproj" + ], + "exclude":[ + "**/obj/**", + "**/bin/**" + ] + } + ], + "dest":"api/DisCatSharp.Common", + "filter":"filter_config.yml" + }, + { + "src":[ + { + "src":"../DisCatSharp.Hosting/", + "files":[ + "**.csproj" + ], + "exclude":[ + "**/obj/**", + "**/bin/**" + ] + } + ], + "dest":"api/DisCatSharp.Hosting", + "filter":"filter_config.yml" + }, + { + "src":[ + { + "src":"../DisCatSharp.Configuration/", + "files":[ + "**.csproj" + ], + "exclude":[ + "**/obj/**", + "**/bin/**" + ] + } + ], + "dest":"api/DisCatSharp.Configuration", + "filter":"filter_config.yml" + }, + { + "src":[ + { + "src":"../DisCatSharp.ApplicationCommands/", + "files":[ + "**.csproj" + ], + "exclude":[ + "**/obj/**", + "**/bin/**" + ] + } + ], + "dest":"api/DisCatSharp.ApplicationCommands", + "filter":"filter_config.yml" + }, + { + "src":[ + { + "src":"../DisCatSharp.CommandsNext/", + "files":[ + "**.csproj" + ], + "exclude":[ + "**/obj/**", + "**/bin/**" + ] + } + ], + "dest":"api/DisCatSharp.CommandsNext", + "filter":"filter_config.yml" + }, + { + "src":[ + { + "src":"../DisCatSharp.Hosting.DependencyInjection/", + "files":[ + "**.csproj" + ], + "exclude":[ + "**/obj/**", + "**/bin/**" + ] + } + ], + "dest":"api/DisCatSharp.Hosting.DependencyInjection", + "filter":"filter_config.yml" + }, + { + "src":[ + { + "src":"../DisCatSharp.Lavalink/", + "files":[ + "**.csproj" + ], + "exclude":[ + "**/obj/**", + "**/bin/**" + ] + } + ], + "dest":"api/DisCatSharp.Lavalink", + "filter":"filter_config.yml" + }, + { + "src":[ + { + "src":"../DisCatSharp.VoiceNext/", + "files":[ + "**.csproj" + ], + "exclude":[ + "**/obj/**", + "**/bin/**" + ] + } + ], + "dest":"api/DisCatSharp.VoiceNext", + "filter":"filter_config.yml" + } + ], + "build":{ + "xrefService":[ + "https://xref.docs.microsoft.com/query?uid={uid}" + ], + "content":[ + { + "files":[ + "api/**/**.yml", + "api/**/**.md", + "api/**.yml", + "api/**.md" + ] + }, + { + "files":[ + "**.md", + "toc.yml", + "faq/**.yml", + "faq/**.md", + "articles/**.yml", + "articles/**.md", + "natives/**.yml", + "natives/**.md" + ], + "exclude":[ + "**/bin/**", + "**/obj/**", + "_site/**", + "dcs/**" + ] + } + ], + "resource":[ + { + "files":[ + "images/**", + "natives/**.zip" + ], + "exclude":[ + "**/bin/**", + "**/obj/**", + "_site/**", + "images/_**" + ] + } + ], + "overwrite":[ + { + "files":[ + + ], + "exclude":[ + "**/bin/**", + "**/obj/**", + "_site/**" + ] + } + ], + "dest":"_site", + "globalMetadata":{ + "_appFooter":"© 2021-2022 Aiko IT Systems", + "_enableSearch":true, + "_enableNewTab":true, + "_appTitle":"DisCatSharp Docs", + "_gitUrlPattern":"git", + "_gitContribute":{ + "repo":"https://github.com/Aiko-IT-Systems/DisCatSharp", + "branch":"main" + } + }, + "disableGitFeatures":false, + "exportRawModel":true, + "globalMetadataFiles":[ + + ], + "fileMetadataFiles":[ + + ], + "template":[ + "dcs" + ], + "postProcessors":[ + "ExtractSearchIndex", + "CustomMemberIndexer" + ], + "noLangKeyword":false, + "keepFileLink":false, + "cleanupCacheHistory":false, + "sitemap":{ + "baseUrl":"https://docs.discatsharp.tech/", + "changefreq":"daily", + "priority":1.0 } - }, - "disableGitFeatures": false, - "exportRawModel": true, - "rawModelOutputFolder": "_site/.bot-query/raw/", - "globalMetadataFiles": [], - "fileMetadataFiles": [], - "template": [ - "dcs" - ], - "postProcessors": ["ExtractSearchIndex", "CustomMemberIndexer"], - "noLangKeyword": false, - "keepFileLink": false, - "cleanupCacheHistory": false, - "sitemap": { - "baseUrl": "https://docs.discatsharp.tech/", - "changefreq": "daily", - "priority": 1.0 } - } } diff --git a/DisCatSharp.Docs/filter_config.yml b/DisCatSharp.Docs/filter_config.yml index 867d97547..0fe7ea8cf 100644 --- a/DisCatSharp.Docs/filter_config.yml +++ b/DisCatSharp.Docs/filter_config.yml @@ -1,132 +1,11 @@ apiRules: -- exclude: - uidRegex: ^System\.Collections\.Immutable$ -- exclude: - uidRegex: ^System\.Runtime\.CompilerServices\.Unsafe$ -- exclude: - uidRegex: ^System\.Runtime\.CompilerServices$ -- exclude: - uidRegex: ^System - exclude: uidRegex: ^DisCatSharp\.Hosting\.Tests$ - exclude: - uidRegex: ^DisCatSharp\.Tests + uidRegex: ^DisCatSharp\.Tests$ - exclude: uidRegex: ^DisCatSharp\.Configuration\.Tests$ - include: uidRegex: ^DisCatSharp -attributeRules: -- exclude: - uidRegex: ^System\.Collections\.Immutable$ - type: Namespace -- exclude: - uidRegex: ^Microsoft\.Extensions\.Logging$ - type: Namespace -- exclude: - uidRegex: ^Microsoft\.Extensions\.Logging\.LogLevel$ - type: Namespace -- exclude: - uidRegex: ^Microsoft\.Extensions\.Hosting\.BackgroundService$ - type: Namespace -- exclude: - uidRegex: ^Microsoft\.Extensions\.Hosting$ - type: Namespace -- exclude: - uidRegex: ^Microsoft\.Extensions$ - type: Namespace - exclude: uidRegex: ^Newtonsoft\.Json$ - type: Namespace -- exclude: - uidRegex: ^Newtonsoft\.Json\.JsonConverter$ - type: Namespace -- exclude: - uidRegex: ^System\.Runtime\.CompilerServices\.Unsafe$ - type: Namespace -- exclude: - uidRegex: ^System\.Runtime\.CompilerServices$ - type: Namespace -- exclude: - uidRegex: ^System\.ComponentModel\.Design$ - type: Namespace -- exclude: - uidRegex: ^System\.ComponentModel\.Design\.Serialization$ - type: Namespace -- exclude: - uidRegex: ^System\.Xml\.Serialization$ - type: Namespace -- exclude: - uidRegex: ^System\.Web\.Compilation$ - type: Namespace -- exclude: - uidRegex: ^System\.Runtime\.Versioning$ - type: Namespace -- exclude: - uidRegex: ^System\.Runtime\.ConstrainedExecution$ - type: Namespace -- exclude: - uidRegex: ^System\.EnterpriseServices$ - type: Namespace -- exclude: - uidRegex: ^System\.Numerics$ - type: Namespace -- exclude: - uidRegex: ^System\.Numerics\.Complex$ - type: Namespace -- exclude: - uidRegex: '^System\.[^.]+$' - type: Namespace -- exclude: - uidRegex: ^System\.Diagnostics\.CodeAnalysis$ - type: Namespace -- include: - uidRegex: ^System\.Diagnostics\.(ConditionalAttribute|EventLogPermissionAttribute|PerformanceCounterPermissionAttribute)$ - type: Type -- exclude: - uidRegex: '^System\.Diagnostics\.[^.]+$' - type: Type -- include: - uidRegex: ^System\.ComponentModel\.(BindableAttribute|BrowsableAttribute|ComplexBindingPropertiesAttribute|DataObjectAttribute|DefaultBindingPropertyAttribute|ListBindableAttribute|LookupBindingPropertiesAttribute|SettingsBindableAttribute|TypeConverterAttribute)$ - type: Type -- exclude: - uidRegex: '^System\.ComponentModel\.[^.]+$' - type: Type -- exclude: - uidRegex: ^System\.Reflection\.DefaultMemberAttribute$ - type: Type -- exclude: - uidRegex: ^System\.CodeDom\.Compiler\.GeneratedCodeAttribute$ - type: Type -- exclude: - uidRegex: ^Microsoft\.Extensions\.Hosting\.BackgroundService$ - type: Type -- exclude: - uidRegex: ^Microsoft\.Extensions\.Logging\.LogLevel\.Information$ - type: Type -- exclude: - uidRegex: ^Microsoft\.Extensions\.Logging\.ILoggerFactory$ - type: Type -- exclude: - uidRegex: ^Newtonsoft\.Json\.JsonConverter$ - type: Type -- exclude: - uidRegex: ^System\.Numerics\.Complex$ - type: Type -- exclude: - uidRegex: '^System\.Runtime\.CompilerServices\.[^.]+$' - type: Type -- exclude: - uidRegex: '^System\.Runtime\.InteropServices\.[^.]+$' - type: Type -- include: - uidRegex: ^System\.Security\.(SecurityCriticalAttribute|SecurityTreatAsSafeAttribute|AllowPartiallyTrustedCallersAttribute)$ - type: Type -- exclude: - uidRegex: '^System\.Security\.[^.]+$' - type: Type -- exclude: - uidRegex: '^System\.Web\.UI\.[^.]+$' - type: Type -- exclude: - uidRegex: '^System\.Windows\.Markup\.[^.]+$' - type: Type diff --git a/DisCatSharp.Docs/toc.yml b/DisCatSharp.Docs/toc.yml index ee1dbbeb2..31a3ef7fb 100644 --- a/DisCatSharp.Docs/toc.yml +++ b/DisCatSharp.Docs/toc.yml @@ -1,9 +1,8 @@ - name: Articles href: articles/ - name: FAQ href: faq.md - name: API Documentation - href: api/ - homepage: api/index.md + href: api/index.md - name: Voice Natives href: natives/index.md diff --git a/rebuild-docs.ps1 b/rebuild-docs.ps1 index 6b263df70..31c0e52d3 100644 --- a/rebuild-docs.ps1 +++ b/rebuild-docs.ps1 @@ -1,350 +1,351 @@ #!/usr/bin/env pwsh # Rebuild-docs # # Rebuilds the documentation for DisCatSharp project, and places artifacts in specified directory. # # Author: Emzi0767 # Version: 2017-09-11 14:20 # # Arguments: # .\rebuild-docs.ps1 # # Run as: # .\rebuild-docs.ps1 .\path\to\docfx\project .\path\to\output project-docs param ( [parameter(Mandatory = $true)] [string] $DocsPath, [parameter(Mandatory = $true)] [string] $OutputPath, [parameter(Mandatory = $true)] [string] $PackageName ) # Backup the environment $current_path = $Env:PATH $current_location = Get-Location # Tool paths $docfx_path = Join-Path "$current_location" "docfx" # Restores the environment function Restore-Environment() { Write-Host "Restoring environment variables" $Env:PATH = $current_path Set-Location -path "$current_location" if (Test-Path "$docfx_path") { Remove-Item -recurse -force "$docfx_path" } } # Downloads and installs latest version of DocFX function Install-DocFX([string] $target_dir_path) { Write-Host "Installing DocFX" # Check if the target directory exists # If it does, remove it if (Test-Path "$target_dir_path") { Write-Host "Target directory exists, deleting" Remove-Item -recurse -force "$target_dir_path" } # Create target directory $target_dir = New-Item -type directory "$target_dir_path" $target_fn = "docfx.zip" # Form target path $target_dir = $target_dir.FullName $target_path = Join-Path "$target_dir" "$target_fn" # Download release info from Chocolatey API try { Write-Host "Getting latest DocFX release" $release_json = Invoke-WebRequest -uri "https://chocolatey.org/api/v2/package-versions/docfx" | ConvertFrom-JSON $release_json = $release_json | ForEach-Object { [System.Version]::Parse($_) } | Sort-Object -Descending } catch { Return 1 } # Set TLS version to 1.2 [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 # Download the release # Since GH releases are unreliable, we have to try up to 3 times $tries = 0 $fail = $true while ($tries -lt 3) { # Prepare the assets $release = $release_json[$tries] # Pick the next available release $release_version = $release.ToString() # Convert to string - $release_version = "2.60.1" - $release_asset = "https://github.com/Aiko-IT-Systems/docfx/releases/download/v2.60.1/docfx.zip" + #$release_version = "2.60.1" + #$release_asset = "https://github.com/Aiko-IT-Systems/docfx/releases/download/v2.60.1/docfx.zip" + $release_asset = "https://github.com/dotnet/docfx/releases/download/v$release_version/docfx.zip" # increment try counter $tries = $tries + 1 try { Write-Host "Downloading DocFX $release_version to $target_path" Invoke-WebRequest -uri "$release_asset" -outfile "$target_path" # No failure, carry on Write-Host "DocFX version $release_version downloaded successfully" $fail = $false Break } catch { Write-Host "Downloading DocFX version $release_version failed, trying next ($tries / 3)" #Return 1 } } # Check if we succeeded in downloading if ($fail) { Return 1 } # Switch directory Set-Location -Path "$target_dir" # Extract the release try { Write-Host "Extracting DocFX" Expand-Archive -path "$target_path" -destinationpath "$target_dir" } catch { Return 1 } # Remove the downloaded zip Write-Host "Removing temporary files" Remove-Item "$target_path" # Add DocFX to PATH Write-Host "Adding DocFX to PATH" if ($null -eq $Env:OS) { $Env:DOCFX_PATH = "$target_dir" } else { $Env:PATH = "$target_dir;$current_path" } Set-Location -path "$current_location" Return 0 } # Builds the documentation using available DocFX function BuildDocs([string] $target_dir_path) { # Check if documentation source path exists if (-not (Test-Path "$target_dir_path")) { #Write-Host "Specified path does not exist" Return 65536 } # Check if documentation source path is a directory $target_path = Get-Item "$target_dir_path" if (-not ($target_path -is [System.IO.DirectoryInfo])) { #Write-Host "Specified path is not a directory" Return 65536 } # Form target path $target_path = $target_path.FullName # Form component paths $docs_site = Join-Path "$target_path" "_site" $docs_api = Join-Path "$target_path" "api" $docs_obj = Join-Path "$target_path" "obj" # Check if API documentation source path exists if (-not (Test-Path "$docs_api")) { #Write-Host "API build target directory does not exist" Return 32768 } # Check if API documentation source path is a directory $docs_api_dir = Get-Item "$docs_api" if (-not ($docs_api_dir -is [System.IO.DirectoryInfo])) { #Write-Host "API build target directory is not a directory" Return 32768 } # Purge old API documentation Write-Host "Purging old API documentation" Set-Location -path "$docs_api" Remove-Item "*.yml" Set-Location -path "$current_location" # Check if old built site exists # If it does, remove it if (Test-Path "$docs_site") { Write-Host "Purging old products" Remove-Item -recurse -force "$docs_site" } # Create target directory for the built site $docs_site = New-Item -type directory "$docs_site" $docs_site = $docs_site.FullName # Check if old object cache exists # If it does, remove it if (Test-Path "$docs_obj") { Write-Host "Purging object cache" Remove-Item -recurse -force "$docs_obj" } # Create target directory for the object cache $docs_obj = New-Item -type directory "$docs_obj" $docs_obj = $docs_obj.FullName # Enter the documentation directory Set-Location -path "$target_path" # Check OS # Null means non-Windows if ($null -eq $Env:OS) { # Generate new API documentation & mono "$Env:DOCFX_PATH/docfx.exe" docfx.json | Out-Host # Check if successful if ($LastExitCode -eq 0) { # Build new documentation site & mono "$Env:DOCFX_PATH/docfx.exe" build docfx.json | Out-Host } } else { # Generate new API documentation & docfx docfx.json | Out-Host # Check if successful if ($LastExitCode -eq 0) { # Build new documentation site & docfx build docfx.json | Out-Host } } # Exit back Set-Location -path "$current_location" # Check if building was a success if ($LastExitCode -eq 0) { Return 0 } else { Return $LastExitCode } } # Packages the build site to a .zip archive function PackDocs([string] $target_dir_path, [string] $output_dir_path, [string] $pack_name) { # Form target path $target_path = Get-Item "$target_dir_path" $target_path = $target_path.FullName $target_path = Join-Path "$target_path" "_site" # Form output path $output_path_dir = Get-Item "$output_dir_path" $output_path_dir = $output_path_dir.FullName $output_path = Join-Path "$output_path_dir" "$pack_name" # Enter target path Set-Location -path "$target_path" # Check if target .zip exists # If it does, remove it if (Test-Path "$output_path.zip") { Write-Host "$output_path.zip exists, deleting" Remove-Item "$output_path.zip" } # Package .zip archive Write-Host "Packing $output_path.zip" Compress-Archive -Path "$target_path/*" -DestinationPath "$output_path.zip" -Force -CompressionLevel Fastest # Exit back Set-Location -path "$current_location" # Check if packaging was a success if ($LastExitCode -eq 0) { Return 0 } else { Return $LastExitCode } } # Install DocFX $result = Install-DocFX "$docfx_path" if ($result -ne 0) { Write-Host "Installing DocFX failed" Restore-Environment $host.SetShouldExit(1) Exit 1 } # Build and package docs # At this point nothing should fail as everything is already set up $result = BuildDocs "$DocsPath" if ($result -eq 0) { $result = PackDocs "$DocsPath" "$OutputPath" "$PackageName" if ($result -ne 0) { Write-Host "Packaging API documentation failed" } } else { Write-Host "Building API documentation failed" } # Restore the environment Restore-Environment # All was well, exit with success if ($result -eq 0) { Write-Host "All operations completed" Exit 0 } else { $host.SetShouldExit($result) Exit $result }