From d20a80c44c921daef5a71b0c34b63f4b4db27db7 Mon Sep 17 00:00:00 2001 From: "Nuno \"Omega Leo\" Diogo" Date: Wed, 28 Jan 2026 13:15:44 +0000 Subject: [PATCH] Migrated Documentation library from NetFlow.DocumentationHelper.Library --- .github/workflows/changelog.yml | 0 .github/workflows/dotnet.yml | 0 .github/workflows/nuget-publish.yml | 0 .gitignore | 0 .../.idea.GameDevLibrary/.idea/workspace.xml | 0 .../.idea.OmegaLeo.HelperLib/.idea/.gitignore | 0 .idea/.idea.OmegaLeo.HelperLib/.idea/.name | 0 .../.idea/copilot.data.migration.agent.xml | 0 .../.idea/copilot.data.migration.ask.xml | 0 .../copilot.data.migration.ask2agent.xml | 0 .../.idea/copilot.data.migration.edit.xml | 0 .../.idea/encodings.xml | 0 .../.idea/indexLayout.xml | 0 .idea/.idea.OmegaLeo.HelperLib/.idea/vcs.xml | 0 CODE_OF_CONDUCT.md | 0 CONTRIBUTING.md | 0 LICENSE | 0 OmegaLeo.HelperLib.Changelog/CHANGELOG.md | 2 +- .../Helpers/ChangelogHelper.cs | 114 +++++++++++ OmegaLeo.HelperLib.Changelog/LICENSE.md | 0 .../Models/Changelog.cs | 0 .../OmegaLeo.HelperLib.Changelog.csproj | 11 +- OmegaLeo.HelperLib.Changelog/README.md | 2 +- .../Tools/ChangelogTool.cs | 5 +- ...OmegaLeo.HelperLib.ChangelogHandler.csproj | 4 - .../Program.cs | 2 +- .../OmegaLeo.HelperLib.ConsoleApp.csproj | 4 - OmegaLeo.HelperLib.ConsoleApp/Program.cs | 4 +- OmegaLeo.HelperLib.ConsoleApp/TestClass.cs | 10 - .../Helpers/DocumentationHelper.cs | 193 ++++++++++++++++++ .../Models/DocumentationAssembly.cs | 11 + .../Models/DocumentationStructure.cs | 49 +++++ .../OmegaLeo.HelperLib.Documentation.csproj | 29 +++ .../Extensions/ListExtensions.cs | 2 +- .../Handlers/DelayedActionHandler.cs | 2 +- .../Interfaces/ISaveFileProvider.cs | 0 .../Models/ConsoleCommand.cs | 0 .../Models/DelayedAction.cs | 0 OmegaLeo.HelperLib.Game/Models/Loot.cs | 0 OmegaLeo.HelperLib.Game/Models/LootTable.cs | 0 OmegaLeo.HelperLib.Game/Models/RNG.cs | 0 OmegaLeo.HelperLib.Game/Models/SaveData.cs | 0 .../OmegaLeo.HelperLib.Game.csproj | 1 - .../Providers/GodotDelayedActionRunner.cs | 0 .../Providers/GodotSaveFileProvider.cs | 0 .../Providers/UnityDelayedActionRunner.cs | 0 .../Providers/UnitySaveFileProvider.cs | 0 OmegaLeo.HelperLib.Game/README | 0 .../Services/CommandConsole.cs | 2 +- .../Services/DelayedActionManager.cs | 2 +- .../Services/SaveManager.cs | 2 +- OmegaLeo.HelperLib.Game/UI/GodotConsoleUI.cs | 0 OmegaLeo.HelperLib.Game/UI/UnityConsoleUI.cs | 0 .../Utilities/WeightedPicker.cs | 2 +- OmegaLeo.HelperLib.Git/GitClient.cs | 2 +- OmegaLeo.HelperLib.Git/Models/ChangeFolder.cs | 0 .../OmegaLeo.HelperLib.Git.csproj | 3 +- .../Attributes/ChangelogAttribute.cs | 10 +- .../Attributes/DocumentationAttribute.cs | 21 ++ .../OmegaLeo.HelperLib.Shared.csproj | 8 + .../Controllers/HomeController.cs | 33 +-- .../Models/ErrorViewModel.cs | 0 .../Models/LibraryDocumentationViewModel.cs | 2 +- .../OmegaLeo.HelperLib.Web.csproj | 1 - OmegaLeo.HelperLib.Web/Program.cs | 0 .../Properties/launchSettings.json | 0 .../Views/Home/Index.cshtml | 0 .../Views/Home/Library.cshtml | 4 +- .../Views/Home/Privacy.cshtml | 0 .../Views/Shared/Error.cshtml | 0 .../Views/Shared/_Layout.cshtml | 3 + .../Views/Shared/_Layout.cshtml.css | 0 .../Shared/_ValidationScriptsPartial.cshtml | 0 .../Views/_ViewImports.cshtml | 0 .../Views/_ViewStart.cshtml | 0 .../appsettings.Development.json | 0 OmegaLeo.HelperLib.Web/appsettings.json | 0 OmegaLeo.HelperLib.Web/wwwroot/css/site.css | 0 OmegaLeo.HelperLib.Web/wwwroot/favicon.ico | Bin OmegaLeo.HelperLib.Web/wwwroot/js/site.js | 0 .../wwwroot/lib/bootstrap/LICENSE | 0 .../lib/bootstrap/dist/css/bootstrap-grid.css | 0 .../bootstrap/dist/css/bootstrap-grid.css.map | 0 .../bootstrap/dist/css/bootstrap-grid.min.css | 0 .../dist/css/bootstrap-grid.min.css.map | 0 .../bootstrap/dist/css/bootstrap-grid.rtl.css | 0 .../dist/css/bootstrap-grid.rtl.css.map | 0 .../dist/css/bootstrap-grid.rtl.min.css | 0 .../dist/css/bootstrap-grid.rtl.min.css.map | 0 .../bootstrap/dist/css/bootstrap-reboot.css | 0 .../dist/css/bootstrap-reboot.css.map | 0 .../dist/css/bootstrap-reboot.min.css | 0 .../dist/css/bootstrap-reboot.min.css.map | 0 .../dist/css/bootstrap-reboot.rtl.css | 0 .../dist/css/bootstrap-reboot.rtl.css.map | 0 .../dist/css/bootstrap-reboot.rtl.min.css | 0 .../dist/css/bootstrap-reboot.rtl.min.css.map | 0 .../dist/css/bootstrap-utilities.css | 0 .../dist/css/bootstrap-utilities.css.map | 0 .../dist/css/bootstrap-utilities.min.css | 0 .../dist/css/bootstrap-utilities.min.css.map | 0 .../dist/css/bootstrap-utilities.rtl.css | 0 .../dist/css/bootstrap-utilities.rtl.css.map | 0 .../dist/css/bootstrap-utilities.rtl.min.css | 0 .../css/bootstrap-utilities.rtl.min.css.map | 0 .../lib/bootstrap/dist/css/bootstrap.css | 0 .../lib/bootstrap/dist/css/bootstrap.css.map | 0 .../lib/bootstrap/dist/css/bootstrap.min.css | 0 .../bootstrap/dist/css/bootstrap.min.css.map | 0 .../lib/bootstrap/dist/css/bootstrap.rtl.css | 0 .../bootstrap/dist/css/bootstrap.rtl.css.map | 0 .../bootstrap/dist/css/bootstrap.rtl.min.css | 0 .../dist/css/bootstrap.rtl.min.css.map | 0 .../lib/bootstrap/dist/js/bootstrap.bundle.js | 0 .../bootstrap/dist/js/bootstrap.bundle.js.map | 0 .../bootstrap/dist/js/bootstrap.bundle.min.js | 0 .../dist/js/bootstrap.bundle.min.js.map | 0 .../lib/bootstrap/dist/js/bootstrap.esm.js | 0 .../bootstrap/dist/js/bootstrap.esm.js.map | 0 .../bootstrap/dist/js/bootstrap.esm.min.js | 0 .../dist/js/bootstrap.esm.min.js.map | 0 .../lib/bootstrap/dist/js/bootstrap.js | 0 .../lib/bootstrap/dist/js/bootstrap.js.map | 0 .../lib/bootstrap/dist/js/bootstrap.min.js | 0 .../bootstrap/dist/js/bootstrap.min.js.map | 0 .../jquery-validation-unobtrusive/LICENSE.txt | 0 .../jquery.validate.unobtrusive.js | 0 .../jquery.validate.unobtrusive.min.js | 0 .../wwwroot/lib/jquery-validation/LICENSE.md | 0 .../dist/additional-methods.js | 0 .../dist/additional-methods.min.js | 0 .../jquery-validation/dist/jquery.validate.js | 0 .../dist/jquery.validate.min.js | 0 .../wwwroot/lib/jquery/LICENSE.txt | 0 .../wwwroot/lib/jquery/dist/jquery.js | 0 .../wwwroot/lib/jquery/dist/jquery.min.js | 0 .../wwwroot/lib/jquery/dist/jquery.min.map | 0 OmegaLeo.HelperLib.sln | 12 ++ OmegaLeo.HelperLib.sln.DotSettings.user | 1 + OmegaLeo.HelperLib/CHANGELOG.md | 0 .../Extensions/ArrayExtensions.cs | 5 +- .../Extensions/FloatExtensions.cs | 27 ++- .../Extensions/IListExtensions.cs | 105 ++++++++-- .../Extensions/MathExtensions.cs | 32 ++- .../Extensions/StringExtensions.cs | 49 ++++- .../Helpers/BenchmarkUtility.cs | 5 +- OmegaLeo.HelperLib/LICENSE.md | 0 OmegaLeo.HelperLib/Models/InstancedObject.cs | 12 +- OmegaLeo.HelperLib/Models/NeoDictionary.cs | 5 +- OmegaLeo.HelperLib/OmegaLeo.HelperLib.csproj | 13 +- OmegaLeo.HelperLib/README.md | 0 README.md | 2 +- 152 files changed, 714 insertions(+), 94 deletions(-) mode change 100644 => 100755 .github/workflows/changelog.yml mode change 100644 => 100755 .github/workflows/dotnet.yml mode change 100644 => 100755 .github/workflows/nuget-publish.yml mode change 100644 => 100755 .gitignore mode change 100644 => 100755 .idea/.idea.GameDevLibrary/.idea/workspace.xml mode change 100644 => 100755 .idea/.idea.OmegaLeo.HelperLib/.idea/.gitignore mode change 100644 => 100755 .idea/.idea.OmegaLeo.HelperLib/.idea/.name mode change 100644 => 100755 .idea/.idea.OmegaLeo.HelperLib/.idea/copilot.data.migration.agent.xml mode change 100644 => 100755 .idea/.idea.OmegaLeo.HelperLib/.idea/copilot.data.migration.ask.xml mode change 100644 => 100755 .idea/.idea.OmegaLeo.HelperLib/.idea/copilot.data.migration.ask2agent.xml mode change 100644 => 100755 .idea/.idea.OmegaLeo.HelperLib/.idea/copilot.data.migration.edit.xml mode change 100644 => 100755 .idea/.idea.OmegaLeo.HelperLib/.idea/encodings.xml mode change 100644 => 100755 .idea/.idea.OmegaLeo.HelperLib/.idea/indexLayout.xml mode change 100644 => 100755 .idea/.idea.OmegaLeo.HelperLib/.idea/vcs.xml mode change 100644 => 100755 CODE_OF_CONDUCT.md mode change 100644 => 100755 CONTRIBUTING.md mode change 100644 => 100755 LICENSE mode change 100644 => 100755 OmegaLeo.HelperLib.Changelog/CHANGELOG.md create mode 100644 OmegaLeo.HelperLib.Changelog/Helpers/ChangelogHelper.cs mode change 100644 => 100755 OmegaLeo.HelperLib.Changelog/LICENSE.md mode change 100644 => 100755 OmegaLeo.HelperLib.Changelog/Models/Changelog.cs mode change 100644 => 100755 OmegaLeo.HelperLib.Changelog/OmegaLeo.HelperLib.Changelog.csproj mode change 100644 => 100755 OmegaLeo.HelperLib.Changelog/README.md mode change 100644 => 100755 OmegaLeo.HelperLib.Changelog/Tools/ChangelogTool.cs mode change 100644 => 100755 OmegaLeo.HelperLib.ChangelogHandler/OmegaLeo.HelperLib.ChangelogHandler.csproj mode change 100644 => 100755 OmegaLeo.HelperLib.ChangelogHandler/Program.cs mode change 100644 => 100755 OmegaLeo.HelperLib.ConsoleApp/OmegaLeo.HelperLib.ConsoleApp.csproj mode change 100644 => 100755 OmegaLeo.HelperLib.ConsoleApp/Program.cs delete mode 100644 OmegaLeo.HelperLib.ConsoleApp/TestClass.cs create mode 100755 OmegaLeo.HelperLib.Documentation/Helpers/DocumentationHelper.cs create mode 100755 OmegaLeo.HelperLib.Documentation/Models/DocumentationAssembly.cs create mode 100755 OmegaLeo.HelperLib.Documentation/Models/DocumentationStructure.cs create mode 100755 OmegaLeo.HelperLib.Documentation/OmegaLeo.HelperLib.Documentation.csproj mode change 100644 => 100755 OmegaLeo.HelperLib.Game/Extensions/ListExtensions.cs mode change 100644 => 100755 OmegaLeo.HelperLib.Game/Handlers/DelayedActionHandler.cs mode change 100644 => 100755 OmegaLeo.HelperLib.Game/Interfaces/ISaveFileProvider.cs mode change 100644 => 100755 OmegaLeo.HelperLib.Game/Models/ConsoleCommand.cs mode change 100644 => 100755 OmegaLeo.HelperLib.Game/Models/DelayedAction.cs mode change 100644 => 100755 OmegaLeo.HelperLib.Game/Models/Loot.cs mode change 100644 => 100755 OmegaLeo.HelperLib.Game/Models/LootTable.cs mode change 100644 => 100755 OmegaLeo.HelperLib.Game/Models/RNG.cs mode change 100644 => 100755 OmegaLeo.HelperLib.Game/Models/SaveData.cs mode change 100644 => 100755 OmegaLeo.HelperLib.Game/OmegaLeo.HelperLib.Game.csproj mode change 100644 => 100755 OmegaLeo.HelperLib.Game/Providers/GodotDelayedActionRunner.cs mode change 100644 => 100755 OmegaLeo.HelperLib.Game/Providers/GodotSaveFileProvider.cs mode change 100644 => 100755 OmegaLeo.HelperLib.Game/Providers/UnityDelayedActionRunner.cs mode change 100644 => 100755 OmegaLeo.HelperLib.Game/Providers/UnitySaveFileProvider.cs mode change 100644 => 100755 OmegaLeo.HelperLib.Game/README mode change 100644 => 100755 OmegaLeo.HelperLib.Game/Services/CommandConsole.cs mode change 100644 => 100755 OmegaLeo.HelperLib.Game/Services/DelayedActionManager.cs mode change 100644 => 100755 OmegaLeo.HelperLib.Game/Services/SaveManager.cs mode change 100644 => 100755 OmegaLeo.HelperLib.Game/UI/GodotConsoleUI.cs mode change 100644 => 100755 OmegaLeo.HelperLib.Game/UI/UnityConsoleUI.cs mode change 100644 => 100755 OmegaLeo.HelperLib.Game/Utilities/WeightedPicker.cs mode change 100644 => 100755 OmegaLeo.HelperLib.Git/GitClient.cs mode change 100644 => 100755 OmegaLeo.HelperLib.Git/Models/ChangeFolder.cs mode change 100644 => 100755 OmegaLeo.HelperLib.Git/OmegaLeo.HelperLib.Git.csproj rename {OmegaLeo.HelperLib.Changelog => OmegaLeo.HelperLib.Shared}/Attributes/ChangelogAttribute.cs (69%) mode change 100644 => 100755 create mode 100755 OmegaLeo.HelperLib.Shared/Attributes/DocumentationAttribute.cs create mode 100644 OmegaLeo.HelperLib.Shared/OmegaLeo.HelperLib.Shared.csproj mode change 100644 => 100755 OmegaLeo.HelperLib.Web/Controllers/HomeController.cs mode change 100644 => 100755 OmegaLeo.HelperLib.Web/Models/ErrorViewModel.cs mode change 100644 => 100755 OmegaLeo.HelperLib.Web/Models/LibraryDocumentationViewModel.cs mode change 100644 => 100755 OmegaLeo.HelperLib.Web/OmegaLeo.HelperLib.Web.csproj mode change 100644 => 100755 OmegaLeo.HelperLib.Web/Program.cs mode change 100644 => 100755 OmegaLeo.HelperLib.Web/Properties/launchSettings.json mode change 100644 => 100755 OmegaLeo.HelperLib.Web/Views/Home/Index.cshtml mode change 100644 => 100755 OmegaLeo.HelperLib.Web/Views/Home/Library.cshtml mode change 100644 => 100755 OmegaLeo.HelperLib.Web/Views/Home/Privacy.cshtml mode change 100644 => 100755 OmegaLeo.HelperLib.Web/Views/Shared/Error.cshtml mode change 100644 => 100755 OmegaLeo.HelperLib.Web/Views/Shared/_Layout.cshtml mode change 100644 => 100755 OmegaLeo.HelperLib.Web/Views/Shared/_Layout.cshtml.css mode change 100644 => 100755 OmegaLeo.HelperLib.Web/Views/Shared/_ValidationScriptsPartial.cshtml mode change 100644 => 100755 OmegaLeo.HelperLib.Web/Views/_ViewImports.cshtml mode change 100644 => 100755 OmegaLeo.HelperLib.Web/Views/_ViewStart.cshtml mode change 100644 => 100755 OmegaLeo.HelperLib.Web/appsettings.Development.json mode change 100644 => 100755 OmegaLeo.HelperLib.Web/appsettings.json mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/css/site.css mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/favicon.ico mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/js/site.js mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/bootstrap/LICENSE mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/bootstrap/dist/css/bootstrap-grid.css mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/bootstrap/dist/css/bootstrap-grid.css.map mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/bootstrap/dist/css/bootstrap-grid.min.css mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/bootstrap/dist/css/bootstrap-grid.min.css.map mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/bootstrap/dist/css/bootstrap-grid.rtl.css mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/bootstrap/dist/css/bootstrap-grid.rtl.css.map mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/bootstrap/dist/css/bootstrap-grid.rtl.min.css mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/bootstrap/dist/css/bootstrap-grid.rtl.min.css.map mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/bootstrap/dist/css/bootstrap-reboot.css mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/bootstrap/dist/css/bootstrap-reboot.css.map mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/bootstrap/dist/css/bootstrap-reboot.min.css mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/bootstrap/dist/css/bootstrap-reboot.min.css.map mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/bootstrap/dist/css/bootstrap-reboot.rtl.css mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/bootstrap/dist/css/bootstrap-reboot.rtl.css.map mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/bootstrap/dist/css/bootstrap-reboot.rtl.min.css mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/bootstrap/dist/css/bootstrap-reboot.rtl.min.css.map mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/bootstrap/dist/css/bootstrap-utilities.css mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/bootstrap/dist/css/bootstrap-utilities.css.map mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/bootstrap/dist/css/bootstrap-utilities.min.css mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/bootstrap/dist/css/bootstrap-utilities.min.css.map mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/bootstrap/dist/css/bootstrap-utilities.rtl.css mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/bootstrap/dist/css/bootstrap-utilities.rtl.css.map mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/bootstrap/dist/css/bootstrap-utilities.rtl.min.css mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/bootstrap/dist/css/bootstrap-utilities.rtl.min.css.map mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/bootstrap/dist/css/bootstrap.css mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/bootstrap/dist/css/bootstrap.css.map mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/bootstrap/dist/css/bootstrap.min.css mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/bootstrap/dist/css/bootstrap.min.css.map mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/bootstrap/dist/css/bootstrap.rtl.css mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/bootstrap/dist/css/bootstrap.rtl.css.map mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/bootstrap/dist/css/bootstrap.rtl.min.css mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/bootstrap/dist/css/bootstrap.rtl.min.css.map mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/bootstrap/dist/js/bootstrap.bundle.js mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/bootstrap/dist/js/bootstrap.bundle.js.map mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/bootstrap/dist/js/bootstrap.bundle.min.js mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/bootstrap/dist/js/bootstrap.bundle.min.js.map mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/bootstrap/dist/js/bootstrap.esm.js mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/bootstrap/dist/js/bootstrap.esm.js.map mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/bootstrap/dist/js/bootstrap.esm.min.js mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/bootstrap/dist/js/bootstrap.esm.min.js.map mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/bootstrap/dist/js/bootstrap.js mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/bootstrap/dist/js/bootstrap.js.map mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/bootstrap/dist/js/bootstrap.min.js mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/bootstrap/dist/js/bootstrap.min.js.map mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/jquery-validation/LICENSE.md mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/jquery-validation/dist/additional-methods.js mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/jquery-validation/dist/additional-methods.min.js mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/jquery-validation/dist/jquery.validate.js mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/jquery-validation/dist/jquery.validate.min.js mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/jquery/LICENSE.txt mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/jquery/dist/jquery.js mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/jquery/dist/jquery.min.js mode change 100644 => 100755 OmegaLeo.HelperLib.Web/wwwroot/lib/jquery/dist/jquery.min.map mode change 100644 => 100755 OmegaLeo.HelperLib.sln mode change 100644 => 100755 OmegaLeo.HelperLib.sln.DotSettings.user mode change 100644 => 100755 OmegaLeo.HelperLib/CHANGELOG.md mode change 100644 => 100755 OmegaLeo.HelperLib/Extensions/ArrayExtensions.cs mode change 100644 => 100755 OmegaLeo.HelperLib/Extensions/FloatExtensions.cs mode change 100644 => 100755 OmegaLeo.HelperLib/Extensions/IListExtensions.cs mode change 100644 => 100755 OmegaLeo.HelperLib/Extensions/MathExtensions.cs mode change 100644 => 100755 OmegaLeo.HelperLib/Extensions/StringExtensions.cs mode change 100644 => 100755 OmegaLeo.HelperLib/Helpers/BenchmarkUtility.cs mode change 100644 => 100755 OmegaLeo.HelperLib/LICENSE.md mode change 100644 => 100755 OmegaLeo.HelperLib/Models/InstancedObject.cs mode change 100644 => 100755 OmegaLeo.HelperLib/Models/NeoDictionary.cs mode change 100644 => 100755 OmegaLeo.HelperLib/OmegaLeo.HelperLib.csproj mode change 100644 => 100755 OmegaLeo.HelperLib/README.md mode change 100644 => 100755 README.md diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml old mode 100644 new mode 100755 diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml old mode 100644 new mode 100755 diff --git a/.github/workflows/nuget-publish.yml b/.github/workflows/nuget-publish.yml old mode 100644 new mode 100755 diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/.idea/.idea.GameDevLibrary/.idea/workspace.xml b/.idea/.idea.GameDevLibrary/.idea/workspace.xml old mode 100644 new mode 100755 diff --git a/.idea/.idea.OmegaLeo.HelperLib/.idea/.gitignore b/.idea/.idea.OmegaLeo.HelperLib/.idea/.gitignore old mode 100644 new mode 100755 diff --git a/.idea/.idea.OmegaLeo.HelperLib/.idea/.name b/.idea/.idea.OmegaLeo.HelperLib/.idea/.name old mode 100644 new mode 100755 diff --git a/.idea/.idea.OmegaLeo.HelperLib/.idea/copilot.data.migration.agent.xml b/.idea/.idea.OmegaLeo.HelperLib/.idea/copilot.data.migration.agent.xml old mode 100644 new mode 100755 diff --git a/.idea/.idea.OmegaLeo.HelperLib/.idea/copilot.data.migration.ask.xml b/.idea/.idea.OmegaLeo.HelperLib/.idea/copilot.data.migration.ask.xml old mode 100644 new mode 100755 diff --git a/.idea/.idea.OmegaLeo.HelperLib/.idea/copilot.data.migration.ask2agent.xml b/.idea/.idea.OmegaLeo.HelperLib/.idea/copilot.data.migration.ask2agent.xml old mode 100644 new mode 100755 diff --git a/.idea/.idea.OmegaLeo.HelperLib/.idea/copilot.data.migration.edit.xml b/.idea/.idea.OmegaLeo.HelperLib/.idea/copilot.data.migration.edit.xml old mode 100644 new mode 100755 diff --git a/.idea/.idea.OmegaLeo.HelperLib/.idea/encodings.xml b/.idea/.idea.OmegaLeo.HelperLib/.idea/encodings.xml old mode 100644 new mode 100755 diff --git a/.idea/.idea.OmegaLeo.HelperLib/.idea/indexLayout.xml b/.idea/.idea.OmegaLeo.HelperLib/.idea/indexLayout.xml old mode 100644 new mode 100755 diff --git a/.idea/.idea.OmegaLeo.HelperLib/.idea/vcs.xml b/.idea/.idea.OmegaLeo.HelperLib/.idea/vcs.xml old mode 100644 new mode 100755 diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md old mode 100644 new mode 100755 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md old mode 100644 new mode 100755 diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 diff --git a/OmegaLeo.HelperLib.Changelog/CHANGELOG.md b/OmegaLeo.HelperLib.Changelog/CHANGELOG.md old mode 100644 new mode 100755 index d853d46..5e4e0cd --- a/OmegaLeo.HelperLib.Changelog/CHANGELOG.md +++ b/OmegaLeo.HelperLib.Changelog/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## Version v1.0.0 +## Version 1.0.0 - **Class: ChangelogTool**: Created the class ChangelogTool to extract changelogs via attributes - **Class: ChangelogAttribute**: Created ChangelogAttribute to be used to register changes in the code. diff --git a/OmegaLeo.HelperLib.Changelog/Helpers/ChangelogHelper.cs b/OmegaLeo.HelperLib.Changelog/Helpers/ChangelogHelper.cs new file mode 100644 index 0000000..2deb36a --- /dev/null +++ b/OmegaLeo.HelperLib.Changelog/Helpers/ChangelogHelper.cs @@ -0,0 +1,114 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using OmegaLeo.HelperLib.Shared.Attributes; + +namespace OmegaLeo.HelperLib.Changelog.Helpers +{ + [Documentation(nameof(ChangelogHelper), + "Helper class to generate changelog markdown from ChangelogAttributes in the provided Assemblies.")] + [Changelog("1.2.0", "Created ChangelogHelper to generate markdown from changelog attributes.")] + public static class ChangelogHelper + { + [Documentation(nameof(GetChangelogMarkdown), + "Generates a markdown formatted changelog from the changelog attributes in the provided assemblies.")] + public static string GetChangelogMarkdown(IEnumerable assemblies) + { + var changelog = new StringBuilder(); + var entriesByVersionDate = + new Dictionary<(string Version, string Date), + Dictionary>>(); + + foreach (var assembly in assemblies) + { + try + { + foreach (var type in assembly.GetTypes()) + { + // Get type-level changelog attributes + var typeAttrs = type.GetCustomAttributes().ToList(); + + // Get member-level changelog attributes (methods, properties, fields, etc.) + var memberAttrs = type.GetMembers(BindingFlags.Public | BindingFlags.NonPublic | + BindingFlags.Static | BindingFlags.Instance) + .SelectMany(m => m.GetCustomAttributes() + .Select(attr => (Member: m, Attribute: attr))) + .ToList(); + + if (typeAttrs.Any() || memberAttrs.Any()) + { + var namespaceName = type.Namespace ?? "Global"; + var className = type.Name.Split('`')[0]; + + // Process type-level attributes + foreach (var attr in typeAttrs) + { + AddEntry(entriesByVersionDate, namespaceName, className, attr.Version, attr.Date, + attr.Description); + } + + // Process member-level attributes + foreach (var (member, attr) in memberAttrs) + { + var memberName = $"{className}.{member.Name}"; + AddEntry(entriesByVersionDate, namespaceName, memberName, attr.Version, attr.Date, + attr.Description); + } + } + } + } + catch (ReflectionTypeLoadException) + { + // Skip assemblies that can't be fully loaded + } + } + + foreach (var versionGroup in entriesByVersionDate.OrderByDescending(x => x.Key.Version)) + { + changelog.AppendLine($"## Version {versionGroup.Key.Version}"); + if (!string.IsNullOrEmpty(versionGroup.Key.Date)) + { + changelog.AppendLine($"### {versionGroup.Key.Date}"); + } + + changelog.AppendLine(); + + foreach (var namespaceGroup in versionGroup.Value.OrderBy(x => x.Key)) + { + changelog.AppendLine($"**{namespaceGroup.Key}**"); + foreach (var entry in namespaceGroup.Value.OrderBy(x => x.ClassName)) + { + changelog.AppendLine($@"- **{entry.ClassName}**: + - {entry.Description}"); + } + + changelog.AppendLine(); + } + } + + return changelog.ToString(); + } + + private static void AddEntry( + Dictionary<(string Version, string Date), Dictionary>> + entriesByVersionDate, + string namespaceName, + string className, + string version, + string date, + string description) + { + var key = (version, date ?? string.Empty); + + if (!entriesByVersionDate.ContainsKey(key)) + entriesByVersionDate[key] = new Dictionary>(); + + if (!entriesByVersionDate[key].ContainsKey(namespaceName)) + entriesByVersionDate[key][namespaceName] = new List<(string, string)>(); + + entriesByVersionDate[key][namespaceName].Add((className, description)); + } + } +} \ No newline at end of file diff --git a/OmegaLeo.HelperLib.Changelog/LICENSE.md b/OmegaLeo.HelperLib.Changelog/LICENSE.md old mode 100644 new mode 100755 diff --git a/OmegaLeo.HelperLib.Changelog/Models/Changelog.cs b/OmegaLeo.HelperLib.Changelog/Models/Changelog.cs old mode 100644 new mode 100755 diff --git a/OmegaLeo.HelperLib.Changelog/OmegaLeo.HelperLib.Changelog.csproj b/OmegaLeo.HelperLib.Changelog/OmegaLeo.HelperLib.Changelog.csproj old mode 100644 new mode 100755 index 42ffd10..e8cf401 --- a/OmegaLeo.HelperLib.Changelog/OmegaLeo.HelperLib.Changelog.csproj +++ b/OmegaLeo.HelperLib.Changelog/OmegaLeo.HelperLib.Changelog.csproj @@ -23,17 +23,14 @@ - - - - - - ..\..\..\..\..\..\home\omegaleo\.nuget\packages\netflow.documentationhelper.library\1.1.2\lib\netstandard2.1\NetFlow.DocumentationHelper.Library.dll + + ..\..\..\..\..\..\home\omegaleo\.nuget\packages\OmegaLeo.HelperLib.Documentation\1.1.2\lib\netstandard2.1\OmegaLeo.HelperLib.Documentation.dll - + + diff --git a/OmegaLeo.HelperLib.Changelog/README.md b/OmegaLeo.HelperLib.Changelog/README.md old mode 100644 new mode 100755 index 082b9f4..2799d04 --- a/OmegaLeo.HelperLib.Changelog/README.md +++ b/OmegaLeo.HelperLib.Changelog/README.md @@ -3,7 +3,7 @@ Package to help with Changelog generation by providing a new Changelog attribute Example attribute usage: ```cs -[Changelog("v1.0.0", "This is a test")] +[Changelog("1.0.0", "This is a test")] [Changelog("v1.0.1", "This is another test")] public class Test { diff --git a/OmegaLeo.HelperLib.Changelog/Tools/ChangelogTool.cs b/OmegaLeo.HelperLib.Changelog/Tools/ChangelogTool.cs old mode 100644 new mode 100755 index 5e6a444..e0312d3 --- a/OmegaLeo.HelperLib.Changelog/Tools/ChangelogTool.cs +++ b/OmegaLeo.HelperLib.Changelog/Tools/ChangelogTool.cs @@ -2,12 +2,11 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Text; -using NetFlow.DocumentationHelper.Library.Attributes; -using OmegaLeo.HelperLib.Changelog.Attributes; +using OmegaLeo.HelperLib.Shared.Attributes; namespace OmegaLeo.HelperLib.Changelog.Tools { - [Changelog("v1.0.0", "Created the class ChangelogTool to extract changelogs via attributes")] + [Changelog("1.0.0", "Created the class ChangelogTool to extract changelogs via attributes")] [Documentation("ChangelogTool", "Provides methods to extract changelog information from assembly attributes.")] public class ChangelogTool { diff --git a/OmegaLeo.HelperLib.ChangelogHandler/OmegaLeo.HelperLib.ChangelogHandler.csproj b/OmegaLeo.HelperLib.ChangelogHandler/OmegaLeo.HelperLib.ChangelogHandler.csproj old mode 100644 new mode 100755 index 762352a..5550538 --- a/OmegaLeo.HelperLib.ChangelogHandler/OmegaLeo.HelperLib.ChangelogHandler.csproj +++ b/OmegaLeo.HelperLib.ChangelogHandler/OmegaLeo.HelperLib.ChangelogHandler.csproj @@ -13,8 +13,4 @@ - - - - diff --git a/OmegaLeo.HelperLib.ChangelogHandler/Program.cs b/OmegaLeo.HelperLib.ChangelogHandler/Program.cs old mode 100644 new mode 100755 index ec00c21..93cdc97 --- a/OmegaLeo.HelperLib.ChangelogHandler/Program.cs +++ b/OmegaLeo.HelperLib.ChangelogHandler/Program.cs @@ -4,7 +4,7 @@ using System; using System.Collections.Generic; using System.IO; using System.Reflection; -using GameDevLibrary.Helpers; +using OmegaLeo.HelperLib.Helpers; using OmegaLeo.HelperLib.Changelog.Models; using OmegaLeo.HelperLib.Changelog.Tools; diff --git a/OmegaLeo.HelperLib.ConsoleApp/OmegaLeo.HelperLib.ConsoleApp.csproj b/OmegaLeo.HelperLib.ConsoleApp/OmegaLeo.HelperLib.ConsoleApp.csproj old mode 100644 new mode 100755 index 9332042..ca1ddff --- a/OmegaLeo.HelperLib.ConsoleApp/OmegaLeo.HelperLib.ConsoleApp.csproj +++ b/OmegaLeo.HelperLib.ConsoleApp/OmegaLeo.HelperLib.ConsoleApp.csproj @@ -13,8 +13,4 @@ - - - - diff --git a/OmegaLeo.HelperLib.ConsoleApp/Program.cs b/OmegaLeo.HelperLib.ConsoleApp/Program.cs old mode 100644 new mode 100755 index d4f2ccc..e56ba62 --- a/OmegaLeo.HelperLib.ConsoleApp/Program.cs +++ b/OmegaLeo.HelperLib.ConsoleApp/Program.cs @@ -3,8 +3,8 @@ // /media/omegaleo/Development/Library Dev/HelperLib using System.Reflection; -using GameDevLibrary.Extensions; -using GameDevLibrary.Helpers; +using OmegaLeo.HelperLib.Extensions; +using OmegaLeo.HelperLib.Helpers; using LibGit2Sharp; using OmegaLeo.HelperLib.Changelog.Tools; using OmegaLeo.HelperLib.Git; diff --git a/OmegaLeo.HelperLib.ConsoleApp/TestClass.cs b/OmegaLeo.HelperLib.ConsoleApp/TestClass.cs deleted file mode 100644 index 65d9104..0000000 --- a/OmegaLeo.HelperLib.ConsoleApp/TestClass.cs +++ /dev/null @@ -1,10 +0,0 @@ -using OmegaLeo.HelperLib.Changelog.Attributes; - -namespace OmegaLeo.HelperLib.ConsoleApp; - -[Changelog("v1.0.0", "Test")] -[Changelog("v1.0.1", "Test 1")] -public class TestClass -{ - -} \ No newline at end of file diff --git a/OmegaLeo.HelperLib.Documentation/Helpers/DocumentationHelper.cs b/OmegaLeo.HelperLib.Documentation/Helpers/DocumentationHelper.cs new file mode 100755 index 0000000..bbec13a --- /dev/null +++ b/OmegaLeo.HelperLib.Documentation/Helpers/DocumentationHelper.cs @@ -0,0 +1,193 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Xml; +using Microsoft.Extensions.DependencyModel; +using OmegaLeo.HelperLib.Shared.Attributes; +using OmegaLeo.HelperLib.Documentation.Models; + +namespace OmegaLeo.HelperLib.Documentation.Helpers +{ + + [Changelog("1.2.0", "Migrated DocumentationHelper library from NetFlow.DocumentationHelper.Library to it's own package in OmegaLeo.HelperLib")] + public static class DocumentationHelperTool + { + [Documentation("GenerateDocumentation (bool generateForPackageAssembly)", + @"Generates a List of objects of type DocumentationStructure that contain the following fields: +**AssemblyName**: Name of the main Assembly, used to identify the root namespace +**ClassName**: Name of the class, used to identify the upper level object +**Title**: Title what we're generating documentation for +**Description**: Description of what we're generating documentation for, this can contain usage examples and can use the args array to pass names(e.g.: This method uses this methodology) +**Args**: Array of strings that describe the parameters of the method or class +**CodeExample**: A code example of how to use the method or class + +*Note: If generateForPackageAssembly is set to true, this will generate documentation for the library as well.*", + new [] + { + "generateForPackageAssembly - Generate documentation for the DocumentationHelper library as well?" + }, + @"```csharp +DocumentationHelperTool.GenerateDocumentation(true); // Generates documentation for all assemblies including the DocumentationHelper.Library package assembly +DocumentationHelperTool.GenerateDocumentation(false); // Generates documentation for all assemblies excluding the DocumentationHelper.Library package assembly +```")] + public static IEnumerable GenerateDocumentation(bool generateForPackageAssembly = false) + { + EnsureReferencedAssembliesLoaded(); + + var assemblies = AppDomain.CurrentDomain.GetAssemblies() + .Where(a => !a.IsDynamic) + .Select(a => + new DocumentationAssembly() + { + AssemblyName = a.GetName(false)?.Name ?? nameof(a), + Types = GetTypesWithDocumentationAttribute(a) + }).Where(x => x.Types.Any()).ToList(); + + if (!generateForPackageAssembly) + { + assemblies = + assemblies.Where(x => x.AssemblyName != typeof(DocumentationHelperTool).Assembly.GetName().Name) + .ToList(); + } + + foreach (var assembly in assemblies) + { + foreach (var type in assembly.Types) + { + var doc = GetDocumentation(type, assembly.AssemblyName); + yield return doc; + } + } + } + + static void EnsureReferencedAssembliesLoaded() + { + try + { + var loadedNames = AppDomain.CurrentDomain.GetAssemblies() + .Where(a => a.GetName(false) != null) + .Select(a => a.GetName(false).Name) + .ToHashSet(StringComparer.OrdinalIgnoreCase); + + var deps = DependencyContext.Default?.RuntimeLibraries; + if (deps == null) return; + + foreach (var lib in deps) + { + if (!loadedNames.Contains(lib.Name)) + { + try + { + Assembly.Load(new AssemblyName(lib.Name)); + } + catch (Exception ex) + { + Console.Error.WriteLine($"warning OMEGA001: Failed to load assembly '{lib.Name}': {ex.Message}"); + } + } + } + } + catch (Exception ex) + { + // best-effort only + Console.Error.WriteLine($"warning OMEGA001: EnsureReferencedAssembliesLoaded failed: {ex.Message}"); + } + } + + static IEnumerable GetTypesWithDocumentationAttribute(Assembly assembly) + { + Type[] types; + try + { + types = assembly.GetTypes(); + } + catch (ReflectionTypeLoadException ex) + { + types = ex.Types.Where(t => t != null).ToArray(); + } + + foreach (Type type in types) + { + if (type == null) continue; + + var classHasDoc = type.GetCustomAttributes(typeof(DocumentationAttribute), true).Any(); + var fieldsHaveDoc = type.GetFields() + .Any(f => f.GetCustomAttributes(typeof(DocumentationAttribute), true).Any()); + var typesHaveDoc = type.GetProperties() + .Any(p => p.GetCustomAttributes(typeof(DocumentationAttribute), true).Any()); + var methodsHaveDoc = type.GetMethods() + .Any(m => m.GetCustomAttributes(typeof(DocumentationAttribute), true).Any()); + + if (classHasDoc || fieldsHaveDoc || typesHaveDoc || methodsHaveDoc) + { + yield return type; + } + } + } + + [Documentation(nameof(GetDocumentation), "Generates a DocumentationStructure object for the given Type and Assembly Name", + new [] + { + "type - The Type to generate documentation for", + "assemblyName - The name of the assembly the Type belongs to" + }, + @"```csharp + var doc = GetDocumentation(typeof(MyClass), ""MyAssembly""); +```")] + static DocumentationStructure GetDocumentation(Type type, string assemblyName) + { + var classDocs = type.GetCustomAttributes(typeof(DocumentationAttribute), true) + .Select(x => (DocumentationAttribute)x); + + var fieldDocs = type.GetFields().SelectMany(f => + f.GetCustomAttributes(typeof(DocumentationAttribute), true).Select(x => (DocumentationAttribute)x)); + var propertyDocs = type.GetProperties().SelectMany(p => + p.GetCustomAttributes(typeof(DocumentationAttribute), true).Select(x => (DocumentationAttribute)x)); + var methodDocs = type.GetMethods().SelectMany(m => + m.GetCustomAttributes(typeof(DocumentationAttribute), true).Select(x => (DocumentationAttribute)x)); + + var docStructure = new DocumentationStructure(assemblyName, type.Name); + + foreach (var doc in classDocs) + { + docStructure.AddDescription(new DocumentationDescription(doc.Title, doc.Description, doc.Args, doc.CodeExample)); + } + + foreach (var doc in fieldDocs) + { + docStructure.AddDescription(new DocumentationDescription(doc.Title, doc.Description, doc.Args, doc.CodeExample)); + } + + foreach (var doc in propertyDocs) + { + docStructure.AddDescription(new DocumentationDescription(doc.Title, doc.Description, doc.Args, doc.CodeExample)); + } + + foreach (var doc in methodDocs) + { + docStructure.AddDescription(new DocumentationDescription(doc.Title, doc.Description, doc.Args, doc.CodeExample)); + } + + return docStructure; + } + + static Dictionary loadedXmlDocumentation = + new Dictionary(); + public static void LoadXmlDocumentation(string xmlDocumentation) + { + using (XmlReader xmlReader = XmlReader.Create(new StringReader(xmlDocumentation))) + { + while (xmlReader.Read()) + { + if (xmlReader.NodeType == XmlNodeType.Element && xmlReader.Name == "member") + { + string raw_name = xmlReader["name"]; + loadedXmlDocumentation[raw_name] = xmlReader.ReadInnerXml(); + } + } + } + } + } +} \ No newline at end of file diff --git a/OmegaLeo.HelperLib.Documentation/Models/DocumentationAssembly.cs b/OmegaLeo.HelperLib.Documentation/Models/DocumentationAssembly.cs new file mode 100755 index 0000000..7d77973 --- /dev/null +++ b/OmegaLeo.HelperLib.Documentation/Models/DocumentationAssembly.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; + +namespace OmegaLeo.HelperLib.Documentation.Models +{ + public class DocumentationAssembly + { + public string AssemblyName; + public IEnumerable Types; + } +} \ No newline at end of file diff --git a/OmegaLeo.HelperLib.Documentation/Models/DocumentationStructure.cs b/OmegaLeo.HelperLib.Documentation/Models/DocumentationStructure.cs new file mode 100755 index 0000000..8bbef75 --- /dev/null +++ b/OmegaLeo.HelperLib.Documentation/Models/DocumentationStructure.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections.Generic; +using OmegaLeo.HelperLib.Shared.Attributes; + +namespace OmegaLeo.HelperLib.Documentation.Models +{ + + public class DocumentationStructure + { + public string AssemblyName; + public string ClassName; + public List Descriptions; + + public DocumentationStructure(string assemblyName, string className) + { + AssemblyName = assemblyName; + ClassName = className; + Descriptions = new List(); + } + + public void AddDescription(DocumentationDescription description) + { + Descriptions.Add(description); + } + } + + public class DocumentationDescription + { + public string Title; + public string Description; + public string[] Parameters; + public string CodeExample = string.Empty; + + [Documentation(nameof(DocumentationDescription), "Description of the current Documented object", new [] + { + "title - Name of the object", + "description - Description of what the object does", + "parameters - The parameters for the object (in case of a method with parameters)", + "codeExample - Code example of how to use the object" + })] + public DocumentationDescription(string title, string description, string[] parameters = default, string codeExample = "") + { + Title = title; + Description = description; + Parameters = parameters ?? Array.Empty(); + CodeExample = codeExample; + } + } +} \ No newline at end of file diff --git a/OmegaLeo.HelperLib.Documentation/OmegaLeo.HelperLib.Documentation.csproj b/OmegaLeo.HelperLib.Documentation/OmegaLeo.HelperLib.Documentation.csproj new file mode 100755 index 0000000..2380f8d --- /dev/null +++ b/OmegaLeo.HelperLib.Documentation/OmegaLeo.HelperLib.Documentation.csproj @@ -0,0 +1,29 @@ + + + + netstandard2.1 + enable + OmegaLeo.HelperLib.Documentation + 0.0.2 + Omega Leo's Helper Library + Nuno "Omega Leo" Diogo + README.md + https://github.com/omegaleo/HelperLib + https://github.com/omegaleo/HelperLib + true + AGPL-3.0-only + csharp;dotnet;utility;helper;documentation; + git + true + + + + + + + + + + + + diff --git a/OmegaLeo.HelperLib.Game/Extensions/ListExtensions.cs b/OmegaLeo.HelperLib.Game/Extensions/ListExtensions.cs old mode 100644 new mode 100755 index 21dc8db..39fd8c6 --- a/OmegaLeo.HelperLib.Game/Extensions/ListExtensions.cs +++ b/OmegaLeo.HelperLib.Game/Extensions/ListExtensions.cs @@ -1,5 +1,5 @@ using System.Collections.Generic; -using NetFlow.DocumentationHelper.Library.Attributes; +using OmegaLeo.HelperLib.Shared.Attributes; using OmegaLeo.HelperLib.Game.Models; namespace OmegaLeo.HelperLib.Game.Extensions diff --git a/OmegaLeo.HelperLib.Game/Handlers/DelayedActionHandler.cs b/OmegaLeo.HelperLib.Game/Handlers/DelayedActionHandler.cs old mode 100644 new mode 100755 index f59fc03..f035cf3 --- a/OmegaLeo.HelperLib.Game/Handlers/DelayedActionHandler.cs +++ b/OmegaLeo.HelperLib.Game/Handlers/DelayedActionHandler.cs @@ -1,4 +1,4 @@ -using NetFlow.DocumentationHelper.Library.Attributes; +using OmegaLeo.HelperLib.Shared.Attributes; using OmegaLeo.HelperLib.Game.Models; namespace OmegaLeo.HelperLib.Game.Handlers diff --git a/OmegaLeo.HelperLib.Game/Interfaces/ISaveFileProvider.cs b/OmegaLeo.HelperLib.Game/Interfaces/ISaveFileProvider.cs old mode 100644 new mode 100755 diff --git a/OmegaLeo.HelperLib.Game/Models/ConsoleCommand.cs b/OmegaLeo.HelperLib.Game/Models/ConsoleCommand.cs old mode 100644 new mode 100755 diff --git a/OmegaLeo.HelperLib.Game/Models/DelayedAction.cs b/OmegaLeo.HelperLib.Game/Models/DelayedAction.cs old mode 100644 new mode 100755 diff --git a/OmegaLeo.HelperLib.Game/Models/Loot.cs b/OmegaLeo.HelperLib.Game/Models/Loot.cs old mode 100644 new mode 100755 diff --git a/OmegaLeo.HelperLib.Game/Models/LootTable.cs b/OmegaLeo.HelperLib.Game/Models/LootTable.cs old mode 100644 new mode 100755 diff --git a/OmegaLeo.HelperLib.Game/Models/RNG.cs b/OmegaLeo.HelperLib.Game/Models/RNG.cs old mode 100644 new mode 100755 diff --git a/OmegaLeo.HelperLib.Game/Models/SaveData.cs b/OmegaLeo.HelperLib.Game/Models/SaveData.cs old mode 100644 new mode 100755 diff --git a/OmegaLeo.HelperLib.Game/OmegaLeo.HelperLib.Game.csproj b/OmegaLeo.HelperLib.Game/OmegaLeo.HelperLib.Game.csproj old mode 100644 new mode 100755 index 6f39ad5..9218585 --- a/OmegaLeo.HelperLib.Game/OmegaLeo.HelperLib.Game.csproj +++ b/OmegaLeo.HelperLib.Game/OmegaLeo.HelperLib.Game.csproj @@ -19,7 +19,6 @@ - diff --git a/OmegaLeo.HelperLib.Game/Providers/GodotDelayedActionRunner.cs b/OmegaLeo.HelperLib.Game/Providers/GodotDelayedActionRunner.cs old mode 100644 new mode 100755 diff --git a/OmegaLeo.HelperLib.Game/Providers/GodotSaveFileProvider.cs b/OmegaLeo.HelperLib.Game/Providers/GodotSaveFileProvider.cs old mode 100644 new mode 100755 diff --git a/OmegaLeo.HelperLib.Game/Providers/UnityDelayedActionRunner.cs b/OmegaLeo.HelperLib.Game/Providers/UnityDelayedActionRunner.cs old mode 100644 new mode 100755 diff --git a/OmegaLeo.HelperLib.Game/Providers/UnitySaveFileProvider.cs b/OmegaLeo.HelperLib.Game/Providers/UnitySaveFileProvider.cs old mode 100644 new mode 100755 diff --git a/OmegaLeo.HelperLib.Game/README b/OmegaLeo.HelperLib.Game/README old mode 100644 new mode 100755 diff --git a/OmegaLeo.HelperLib.Game/Services/CommandConsole.cs b/OmegaLeo.HelperLib.Game/Services/CommandConsole.cs old mode 100644 new mode 100755 index b3f4ca3..a2ff172 --- a/OmegaLeo.HelperLib.Game/Services/CommandConsole.cs +++ b/OmegaLeo.HelperLib.Game/Services/CommandConsole.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; -using NetFlow.DocumentationHelper.Library.Attributes; +using OmegaLeo.HelperLib.Shared.Attributes; using OmegaLeo.HelperLib.Game.Models; namespace OmegaLeo.HelperLib.Game.Services diff --git a/OmegaLeo.HelperLib.Game/Services/DelayedActionManager.cs b/OmegaLeo.HelperLib.Game/Services/DelayedActionManager.cs old mode 100644 new mode 100755 index dcb1f0d..a638e7c --- a/OmegaLeo.HelperLib.Game/Services/DelayedActionManager.cs +++ b/OmegaLeo.HelperLib.Game/Services/DelayedActionManager.cs @@ -1,6 +1,6 @@ using System; using System.Collections.Generic; -using NetFlow.DocumentationHelper.Library.Attributes; +using OmegaLeo.HelperLib.Shared.Attributes; using OmegaLeo.HelperLib.Game.Handlers; using OmegaLeo.HelperLib.Game.Models; diff --git a/OmegaLeo.HelperLib.Game/Services/SaveManager.cs b/OmegaLeo.HelperLib.Game/Services/SaveManager.cs old mode 100644 new mode 100755 index 5dc6edf..7dd69d1 --- a/OmegaLeo.HelperLib.Game/Services/SaveManager.cs +++ b/OmegaLeo.HelperLib.Game/Services/SaveManager.cs @@ -1,6 +1,6 @@ using System; using System.IO; -using NetFlow.DocumentationHelper.Library.Attributes; +using OmegaLeo.HelperLib.Shared.Attributes; using Newtonsoft.Json; using OmegaLeo.HelperLib.Game.Interfaces; diff --git a/OmegaLeo.HelperLib.Game/UI/GodotConsoleUI.cs b/OmegaLeo.HelperLib.Game/UI/GodotConsoleUI.cs old mode 100644 new mode 100755 diff --git a/OmegaLeo.HelperLib.Game/UI/UnityConsoleUI.cs b/OmegaLeo.HelperLib.Game/UI/UnityConsoleUI.cs old mode 100644 new mode 100755 diff --git a/OmegaLeo.HelperLib.Game/Utilities/WeightedPicker.cs b/OmegaLeo.HelperLib.Game/Utilities/WeightedPicker.cs old mode 100644 new mode 100755 index 81b75fb..8e1d3ae --- a/OmegaLeo.HelperLib.Game/Utilities/WeightedPicker.cs +++ b/OmegaLeo.HelperLib.Game/Utilities/WeightedPicker.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; using System.Linq; -using NetFlow.DocumentationHelper.Library.Attributes; +using OmegaLeo.HelperLib.Shared.Attributes; using OmegaLeo.HelperLib.Game.Models; namespace OmegaLeo.HelperLib.Game.Utilities diff --git a/OmegaLeo.HelperLib.Git/GitClient.cs b/OmegaLeo.HelperLib.Git/GitClient.cs old mode 100644 new mode 100755 index ac12680..498769e --- a/OmegaLeo.HelperLib.Git/GitClient.cs +++ b/OmegaLeo.HelperLib.Git/GitClient.cs @@ -2,7 +2,7 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; -using GameDevLibrary.Extensions; +using OmegaLeo.HelperLib.Extensions; using LibGit2Sharp; using OmegaLeo.HelperLib.Git.Models; diff --git a/OmegaLeo.HelperLib.Git/Models/ChangeFolder.cs b/OmegaLeo.HelperLib.Git/Models/ChangeFolder.cs old mode 100644 new mode 100755 diff --git a/OmegaLeo.HelperLib.Git/OmegaLeo.HelperLib.Git.csproj b/OmegaLeo.HelperLib.Git/OmegaLeo.HelperLib.Git.csproj old mode 100644 new mode 100755 index 03d8ca0..944857b --- a/OmegaLeo.HelperLib.Git/OmegaLeo.HelperLib.Git.csproj +++ b/OmegaLeo.HelperLib.Git/OmegaLeo.HelperLib.Git.csproj @@ -3,7 +3,7 @@ netstandard2.1 enable - GameDevLibrary.Git + OmegaLeo.HelperLib.Git 0.0.2 Omega Leo's Helper Library - LibGit2Sharp Implementation Nuno "Omega Leo" Diogo @@ -13,7 +13,6 @@ - diff --git a/OmegaLeo.HelperLib.Changelog/Attributes/ChangelogAttribute.cs b/OmegaLeo.HelperLib.Shared/Attributes/ChangelogAttribute.cs old mode 100644 new mode 100755 similarity index 69% rename from OmegaLeo.HelperLib.Changelog/Attributes/ChangelogAttribute.cs rename to OmegaLeo.HelperLib.Shared/Attributes/ChangelogAttribute.cs index d049169..59b5ea7 --- a/OmegaLeo.HelperLib.Changelog/Attributes/ChangelogAttribute.cs +++ b/OmegaLeo.HelperLib.Shared/Attributes/ChangelogAttribute.cs @@ -1,20 +1,22 @@ using System; -using NetFlow.DocumentationHelper.Library.Attributes; -namespace OmegaLeo.HelperLib.Changelog.Attributes +namespace OmegaLeo.HelperLib.Shared.Attributes { - [Changelog("v1.0.0", "Created ChangelogAttribute to be used to register changes in the code.")] + [Changelog("1.0.0", "Created ChangelogAttribute to be used to register changes in the code.")] [Documentation(nameof(ChangelogAttribute), "Attribute to annotate classes, methods, or properties with changelog information.")] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Property, AllowMultiple = true)] public class ChangelogAttribute : Attribute { public string Version { get; } public string Description { get; } + + public string Date { get; set; } - public ChangelogAttribute(string version, string description) + public ChangelogAttribute(string version, string description, string date = "") { Version = version; Description = description; + Date = date; } } } diff --git a/OmegaLeo.HelperLib.Shared/Attributes/DocumentationAttribute.cs b/OmegaLeo.HelperLib.Shared/Attributes/DocumentationAttribute.cs new file mode 100755 index 0000000..c905fff --- /dev/null +++ b/OmegaLeo.HelperLib.Shared/Attributes/DocumentationAttribute.cs @@ -0,0 +1,21 @@ +using System; + +namespace OmegaLeo.HelperLib.Shared.Attributes +{ + [System.AttributeUsage(AttributeTargets.All, AllowMultiple = false)] + public class DocumentationAttribute : Attribute + { + public string Title; + public string Description; + public string[] Args; + public string CodeExample = string.Empty; + + public DocumentationAttribute(string title, string description, string[] args = null, string codeExample = "") + { + Title = title; + Description = description; + Args = args ?? Array.Empty(); + CodeExample = codeExample; + } + } +} \ No newline at end of file diff --git a/OmegaLeo.HelperLib.Shared/OmegaLeo.HelperLib.Shared.csproj b/OmegaLeo.HelperLib.Shared/OmegaLeo.HelperLib.Shared.csproj new file mode 100644 index 0000000..950961d --- /dev/null +++ b/OmegaLeo.HelperLib.Shared/OmegaLeo.HelperLib.Shared.csproj @@ -0,0 +1,8 @@ + + + + netstandard2.1 + enable + + + diff --git a/OmegaLeo.HelperLib.Web/Controllers/HomeController.cs b/OmegaLeo.HelperLib.Web/Controllers/HomeController.cs old mode 100644 new mode 100755 index 225847a..e2dd0f7 --- a/OmegaLeo.HelperLib.Web/Controllers/HomeController.cs +++ b/OmegaLeo.HelperLib.Web/Controllers/HomeController.cs @@ -3,10 +3,11 @@ using System.Diagnostics; using System.Reflection; using System.Runtime.ExceptionServices; -using GameDevLibrary.Helpers; +using OmegaLeo.HelperLib.Helpers; using Microsoft.AspNetCore.Mvc; -using NetFlow.DocumentationHelper.Library.Helpers; -using NetFlow.DocumentationHelper.Library.Models; +using OmegaLeo.HelperLib.Changelog.Helpers; +using OmegaLeo.HelperLib.Documentation.Helpers; +using OmegaLeo.HelperLib.Documentation.Models; using OmegaLeo.HelperLib.Changelog.Tools; using OmegaLeo.HelperLib.Web.Models; @@ -52,7 +53,15 @@ public class HomeController : Controller "Game Development Library", "Game development utilities for Unity and Godot", "OmegaLeo.HelperLib.Game" - ) + ), + ["documentation"] = GenerateLibraryDocs( + typeof(OmegaLeo.HelperLib.Documentation.Helpers.DocumentationHelperTool).Assembly, + Path.Combine(root, "changelogs", "OmegaLeo.HelperLib.Documentation.CHANGELOG.md"), + "Documentation Library", + "Tools for generating documentation from code attributes", + "OmegaLeo.HelperLib.Documentation", + true + ), }; _logger.LogInformation("Initialized {Count} libraries", _libraryCache.Count); @@ -99,11 +108,11 @@ public class HomeController : Controller { var assemblies = AppDomain.CurrentDomain.GetAssemblies(); var target = assemblies.FirstOrDefault(a => - a.GetName().Name.Equals("NetFlow.DocumentationHelper.Library", StringComparison.OrdinalIgnoreCase)); + a.GetName().Name.Equals("OmegaLeo.HelperLib.Documentation", StringComparison.OrdinalIgnoreCase)); if (target == null) { - _logger.LogWarning("NetFlow.DocumentationHelper.Library not loaded. Loaded assemblies ({Count}):", + _logger.LogWarning("OmegaLeo.HelperLib.Documentation not loaded. Loaded assemblies ({Count}):", assemblies.Length); foreach (var a in assemblies.OrderBy(a => a.GetName().Name)) { @@ -120,7 +129,7 @@ public class HomeController : Controller Type attrType = null; try { - attrType = target.GetType("NetFlow.DocumentationHelper.Library.Attributes.DocumentationAttribute", + attrType = target.GetType("OmegaLeo.HelperLib.Documentation.Attributes.DocumentationAttribute", false, true); } catch (Exception ex) @@ -238,7 +247,7 @@ public class HomeController : Controller } private LibraryDocumentationViewModel GenerateLibraryDocs(Assembly assembly, string changelogPath, - string displayName, string description, string nugetPackageId) + string displayName, string description, string nugetPackageId, bool generateForDocumentationAssembly = false) { _logger.LogInformation("=== Starting GenerateLibraryDocs for {Assembly} ===", assembly.GetName().Name); _logger.LogInformation("Assembly location: {Location}", assembly.Location ?? ""); @@ -278,7 +287,7 @@ public class HomeController : Controller try { // Pass the specific assembly to only scan that assembly - var result = DocumentationHelperTool.GenerateDocumentation(); + var result = DocumentationHelperTool.GenerateDocumentation(generateForDocumentationAssembly); allDocumentation = result? .Where(d => d.AssemblyName?.Equals(assembly.GetName().Name ,StringComparison.OrdinalIgnoreCase) == true) .ToList() ?? Enumerable.Empty(); @@ -307,7 +316,7 @@ public class HomeController : Controller throw; } - var changelogMarkdown = string.Empty; + /*var changelogMarkdown = string.Empty; if (System.IO.File.Exists(changelogPath)) { try @@ -324,14 +333,14 @@ public class HomeController : Controller else { _logger.LogWarning("Changelog file not found at {Path}", changelogPath); - } + }*/ var viewModel = new LibraryDocumentationViewModel { LibraryName = displayName, Description = description, NuGetPackageId = nugetPackageId, - ChangelogMarkdown = changelogMarkdown, + ChangelogMarkdown = ChangelogHelper.GetChangelogMarkdown(new []{assembly}), Documentation = allDocumentation.ToList() }; diff --git a/OmegaLeo.HelperLib.Web/Models/ErrorViewModel.cs b/OmegaLeo.HelperLib.Web/Models/ErrorViewModel.cs old mode 100644 new mode 100755 diff --git a/OmegaLeo.HelperLib.Web/Models/LibraryDocumentationViewModel.cs b/OmegaLeo.HelperLib.Web/Models/LibraryDocumentationViewModel.cs old mode 100644 new mode 100755 index 5e890e2..b45c6f3 --- a/OmegaLeo.HelperLib.Web/Models/LibraryDocumentationViewModel.cs +++ b/OmegaLeo.HelperLib.Web/Models/LibraryDocumentationViewModel.cs @@ -1,5 +1,5 @@ // File: `OmegaLeo.HelperLib.Web/Models/LibraryDocumentationViewModel.cs` -using NetFlow.DocumentationHelper.Library.Models; +using OmegaLeo.HelperLib.Documentation.Models; namespace OmegaLeo.HelperLib.Web.Models { diff --git a/OmegaLeo.HelperLib.Web/OmegaLeo.HelperLib.Web.csproj b/OmegaLeo.HelperLib.Web/OmegaLeo.HelperLib.Web.csproj old mode 100644 new mode 100755 index 96a5f1f..1928e83 --- a/OmegaLeo.HelperLib.Web/OmegaLeo.HelperLib.Web.csproj +++ b/OmegaLeo.HelperLib.Web/OmegaLeo.HelperLib.Web.csproj @@ -16,7 +16,6 @@ - diff --git a/OmegaLeo.HelperLib.Web/Program.cs b/OmegaLeo.HelperLib.Web/Program.cs old mode 100644 new mode 100755 diff --git a/OmegaLeo.HelperLib.Web/Properties/launchSettings.json b/OmegaLeo.HelperLib.Web/Properties/launchSettings.json old mode 100644 new mode 100755 diff --git a/OmegaLeo.HelperLib.Web/Views/Home/Index.cshtml b/OmegaLeo.HelperLib.Web/Views/Home/Index.cshtml old mode 100644 new mode 100755 diff --git a/OmegaLeo.HelperLib.Web/Views/Home/Library.cshtml b/OmegaLeo.HelperLib.Web/Views/Home/Library.cshtml old mode 100644 new mode 100755 index 8e5d3b8..d896565 --- a/OmegaLeo.HelperLib.Web/Views/Home/Library.cshtml +++ b/OmegaLeo.HelperLib.Web/Views/Home/Library.cshtml @@ -1,6 +1,6 @@ @* File: `OmegaLeo.HelperLib.Web/Views/Home/Library.cshtml` *@ @using ColorCode.Styling -@using GameDevLibrary.Extensions +@using OmegaLeo.HelperLib.Extensions @using Markdig @model OmegaLeo.HelperLib.Web.Models.LibraryDocumentationViewModel @{ @@ -83,7 +83,7 @@ { @desc.Title - @Html.Raw(desc.Description)
+ @Html.Raw(Markdig.Markdown.ToHtml(desc.Description))
@if (desc.CodeExample.IsNotNullOrEmpty()) { Example:
diff --git a/OmegaLeo.HelperLib.Web/Views/Home/Privacy.cshtml b/OmegaLeo.HelperLib.Web/Views/Home/Privacy.cshtml old mode 100644 new mode 100755 diff --git a/OmegaLeo.HelperLib.Web/Views/Shared/Error.cshtml b/OmegaLeo.HelperLib.Web/Views/Shared/Error.cshtml old mode 100644 new mode 100755 diff --git a/OmegaLeo.HelperLib.Web/Views/Shared/_Layout.cshtml b/OmegaLeo.HelperLib.Web/Views/Shared/_Layout.cshtml old mode 100644 new mode 100755 index 3e42232..e77ff9d --- a/OmegaLeo.HelperLib.Web/Views/Shared/_Layout.cshtml +++ b/OmegaLeo.HelperLib.Web/Views/Shared/_Layout.cshtml @@ -33,6 +33,9 @@ +