diff --git a/.github/workflows/gh-pages.yaml b/.github/workflows/gh-pages.yaml new file mode 100644 index 0000000..9254c99 --- /dev/null +++ b/.github/workflows/gh-pages.yaml @@ -0,0 +1,21 @@ +name: Deploy github pages on tag push + +on: + push: + tags: + - 'release/*' + +jobs: + build: + name: Deploy documentation + runs-on: ubuntu-latest + + steps: + - name: Checkout source code + uses: actions/checkout@v2 + + - name: Deploy docs + uses: mhausenblas/mkdocs-deploy-gh-pages@nomaterial + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REQUIREMENTS: requirements.txt diff --git a/README.md b/README.md index dbddda2..b4aad0e 100644 --- a/README.md +++ b/README.md @@ -1,43 +1,37 @@ -# EDNA – An Elite Dangerous System Data Library +# YAVAPF – Yet Another VoiceAttack Plugin Framework -EDNA is a library for third party apps that want to access data about star -systems, stations and CMDRs of the game Elite Dangerous. It can query -[EDSM](https://edsm.net), [Spansh](https://spansh.uk) and -[EDTS](http://edts.thargoid.space) for data. +This is a framework for implementing VoiceAttack plugins. Simply put I had two +issues with the plugins I have been working on over the last couple years: -The general idea is that you usually do not care _where_ your data comes from, -so this will get it for you wherever it can depending on data availability and -API features. +1. The plugin API is … functional, but not great. I want to provide one that is + more pleasant to work with. +2. I have noticed that I keep re-implementing certain things for each and every + plugin that I write. For example, every single one of them wants to log to + VoiceAttack’s event log. A shared framework means writing the code once. -**THIS IS A HEAVY WIP PROJECT AND *NOT* READY FOR PRODUCTION USE.** Just saying. +The goal is to get you up & running with as little code and as little knowledge of +the inner workings of VoiceAttack as possible. -## Why EDNA⁈ +## Documentation & Installation Guide -Why not. I find it quite funny that most Elite-related project are 4 letter -acronyms starting with “ED”. So I stuck to that, and I had just played “Edna & -Harvey: The Breakout” with the kids. It’s not actually an acronym though because -I couldn’t come up with a meaning for NA. +You can find [comprehensive documentation on Github +Pages](https://alterNERDtive.github.io/YAVAPF). -## TODO for first proper release +Or at least you will once this is in a presentable state and I have actually +written the documentation :) -- [x] README -- [ ] Documentation -- [ ] Spansh API - - [ ] system data - - [ ] nearest system - - [ ] station data - - [ ] outdated stations - - [ ] rest (probably out of scope for now) -- [ ] EDSM API - - [x] Systems - - [x] Logs (CMDR data) - - [ ] Stations (probably out of scope for now) -- [x] EDTS API - - [x] system position -- [ ] convenience layer / unification -- [ ] sanity check / refactoring -- [ ] nuget package -- [ ] Github Actions build / package automation +There is also an [example plugin on +Github](https://github.com/alterNERDtive/YAVAPF/tree/release/ExamplePlugin). + +## Need Help / Want to Contribute? + +Have a look at [the troubleshooting +guide](https://alterNERDtive.github.io/YAVAPF/troubleshooting). If your problem +persists, please [file an +issue](https://github.com/alterNERDtive/YAVAPF/issues/new). Thanks! :) + +You can also [say “Hi” on Discord](https://discord.gg/3pWdJwfJc5) if that is +your thing. [![GitHub Sponsors](https://img.shields.io/github/sponsors/alterNERDtive?style=for-the-badge)](https://github.com/sponsors/alterNERDtive) [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/S6S1DLYBS) diff --git a/VoiceAttack-Framework.sln b/VoiceAttack-Framework.sln index 2a754cb..1aaca5d 100644 --- a/VoiceAttack-Framework.sln +++ b/VoiceAttack-Framework.sln @@ -14,27 +14,40 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Directory.Build.targets = Directory.Build.targets glider.jpg = glider.jpg LICENSE = LICENSE + mkdocs.yml = mkdocs.yml README.md = README.md stylecop.json = stylecop.json EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{1BE45F7D-E6DE-49D2-A906-5CC9CD49B639}" ProjectSection(SolutionItems) = preProject + .github\dependabot.yaml = .github\dependabot.yaml .github\FUNDING.yml = .github\FUNDING.yml - .github\workflows\push-test.yaml = .github\workflows\push-test.yaml EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{9109DB0F-4765-4C7E-9E65-53C729D6251D}" ProjectSection(SolutionItems) = preProject .github\workflows\create-release.yaml = .github\workflows\create-release.yaml - .github\dependabot.yaml = .github\dependabot.yaml + .github\workflows\gh-pages.yaml = .github\workflows\gh-pages.yaml + .github\workflows\push-test.yaml = .github\workflows\push-test.yaml EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExamplePlugin", "ExamplePlugin\ExamplePlugin.csproj", "{E390356B-4039-4364-B49C-38A37046A7BD}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ExamplePlugin", "ExamplePlugin\ExamplePlugin.csproj", "{E390356B-4039-4364-B49C-38A37046A7BD}" ProjectSection(ProjectDependencies) = postProject {788DDBA5-E959-4153-8580-4462600F2960} = {788DDBA5-E959-4153-8580-4462600F2960} EndProjectSection EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{3FE46F37-0E89-4E29-BBCA-8E28A396F478}" + ProjectSection(SolutionItems) = preProject + docs\commands.md = docs\commands.md + docs\contexts.md = docs\contexts.md + docs\events.md = docs\events.md + docs\gettingstarted.md = docs\gettingstarted.md + docs\index.md = docs\index.md + docs\troubleshooting.md = docs\troubleshooting.md + docs\variables.md = docs\variables.md + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -56,6 +69,7 @@ Global GlobalSection(NestedProjects) = preSolution {1BE45F7D-E6DE-49D2-A906-5CC9CD49B639} = {9E9DD44C-8D0E-4E41-BD7B-3588B94D007D} {9109DB0F-4765-4C7E-9E65-53C729D6251D} = {1BE45F7D-E6DE-49D2-A906-5CC9CD49B639} + {3FE46F37-0E89-4E29-BBCA-8E28A396F478} = {9E9DD44C-8D0E-4E41-BD7B-3588B94D007D} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {3BD38511-A1FB-4B6C-8463-AE6D8E546AE0} diff --git a/VoiceAttack-Framework/VoiceAttackPlugin.cs b/VoiceAttack-Framework/VoiceAttackPlugin.cs index 5b34723..a5e77f0 100644 --- a/VoiceAttack-Framework/VoiceAttackPlugin.cs +++ b/VoiceAttack-Framework/VoiceAttackPlugin.cs @@ -388,13 +388,11 @@ namespace alterNERDtive.Yavapf /// The internal GUID of the variable. private void BooleanVariableChanged(string name, bool? from, bool? to, Guid? internalID = null) { - List> actions = this.BoolChangedHandlers.Where( + foreach (Action action in this.BoolChangedHandlers.Where( action => action.Method.GetCustomAttributes().Where( attr => attr.Name == name || - (attr.Name.StartsWith("^") && Regex.Match(name, attr.Name).Success)) - .Any()).ToList(); - - foreach (Action action in actions) + (attr.Name.StartsWith("^") && Regex.Match(name, attr.Name).Success)) + .Any()).ToList()) { try { @@ -416,13 +414,11 @@ namespace alterNERDtive.Yavapf /// The internal GUID of the variable. private void DateVariableChanged(string name, DateTime? from, DateTime? to, Guid? internalID = null) { - List> actions = this.DateTimeChangedHandlers.Where( + foreach (Action action in this.DateTimeChangedHandlers.Where( action => action.Method.GetCustomAttributes().Where( attr => attr.Name == name || - (attr.Name.StartsWith("^") && Regex.Match(name, attr.Name).Success)) - .Any()).ToList(); - - foreach (Action action in actions) + (attr.Name.StartsWith("^") && Regex.Match(name, attr.Name).Success)) + .Any()).ToList()) { try { @@ -444,13 +440,11 @@ namespace alterNERDtive.Yavapf /// The internal GUID of the variable. private void DecimalVariableChanged(string name, decimal? from, decimal? to, Guid? internalID = null) { - List> actions = this.DecimalChangedHandlers.Where( + foreach (Action action in this.DecimalChangedHandlers.Where( action => action.Method.GetCustomAttributes().Where( attr => attr.Name == name || - (attr.Name.StartsWith("^") && Regex.Match(name, attr.Name).Success)) - .Any()).ToList(); - - foreach (Action action in actions) + (attr.Name.StartsWith("^") && Regex.Match(name, attr.Name).Success)) + .Any()).ToList()) { try { @@ -472,13 +466,11 @@ namespace alterNERDtive.Yavapf /// The internal GUID of the variable. private void IntegerVariableChanged(string name, int? from, int? to, Guid? internalID = null) { - List> actions = this.IntChangedHandlers.Where( + foreach (Action action in this.IntChangedHandlers.Where( action => action.Method.GetCustomAttributes().Where( attr => attr.Name == name || - (attr.Name.StartsWith("^") && Regex.Match(name, attr.Name).Success)) - .Any()).ToList(); - - foreach (Action action in actions) + (attr.Name.StartsWith("^") && Regex.Match(name, attr.Name).Success)) + .Any()).ToList()) { try { @@ -500,13 +492,11 @@ namespace alterNERDtive.Yavapf /// The internal GUID of the variable. private void TextVariableChanged(string name, string? from, string? to, Guid? internalID = null) { - List> actions = this.StringChangedHandlers.Where( + foreach (Action action in this.StringChangedHandlers.Where( action => action.Method.GetCustomAttributes().Where( attr => attr.Name == name || - (attr.Name.StartsWith("^") && Regex.Match(name, attr.Name).Success)) - .Any()).ToList(); - - foreach (Action action in actions) + (attr.Name.StartsWith("^") && Regex.Match(name, attr.Name).Success)) + .Any()).ToList()) { try { @@ -550,7 +540,7 @@ namespace alterNERDtive.Yavapf /// /// Denotes a handler for . + /// cref="VaExit1(VoiceAttackProxyClass)"/>. /// [AttributeUsage(AttributeTargets.Method)] protected class ExitAttribute : Attribute diff --git a/docs/commands.md b/docs/commands.md new file mode 100644 index 0000000..e69de29 diff --git a/docs/contexts.md b/docs/contexts.md new file mode 100644 index 0000000..e69de29 diff --git a/docs/events.md b/docs/events.md new file mode 100644 index 0000000..e69de29 diff --git a/docs/gettingstarted.md b/docs/gettingstarted.md new file mode 100644 index 0000000..e69de29 diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..9dd82ba --- /dev/null +++ b/docs/index.md @@ -0,0 +1,29 @@ +# YAVAPF – Yet Another VoiceAttack Plugin Framework + +This is a framework for implementing VoiceAttack plugins. Simply put I had two +issues with the plugins I have been working on over the last couple years: + +1. The plugin API is … functional, but not great. I want to provide one that is + more pleasant to work with. +2. I have noticed that I keep re-implementing certain things for each and every + plugin that I write. For example, every single one of them wants to log to + VoiceAttack’s event log. A shared framework means writing the code once. + +The goal is to get you up & running with as little code and as little knowledge of +the inner workings of VoiceAttack as possible. + +You can find an [example plugin on +Github](https://github.com/alterNERDtive/YAVAPF/tree/develop/ExamplePlugin). + +## Need Help / Want to Contribute? + +Have a look at [the troubleshooting +guide](https://alterNERDtive.github.io/YAVAPF/troubleshooting). If your problem +persists, please [file an +issue](https://github.com/alterNERDtive/YAVAPF/issues/new). Thanks! :) + +You can also [say “Hi” on Discord](https://discord.gg/3pWdJwfJc5) if that is +your thing. + +[![GitHub Sponsors](https://img.shields.io/github/sponsors/alterNERDtive?style=for-the-badge)](https://github.com/sponsors/alterNERDtive) +[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/S6S1DLYBS) diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md new file mode 100644 index 0000000..e69de29 diff --git a/docs/variables.md b/docs/variables.md new file mode 100644 index 0000000..e69de29 diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000..69c920f --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,32 @@ +site_name: "bindED VoiceAttack plugin" +site_url: https://alterNERDtive.github.io/YAVAPF +repo_url: https://github.com/alterNERDtive/YAVAPF +edit_uri: "edit/devel/docs/" +site_description: "YAVAPF is yet another VoiceAttack plugin framework." +site_author: "alterNERDtive" +remote_name: "origin" + +theme: + name: readthedocs + prev_next_buttons_location: both + +plugins: + - search + - roamlinks + +markdown_extensions: + - toc: + permalink: True + - sane_lists + +nav: + - 'Home': 'index.md' + - 'Usage': + - 'Getting Started': 'gettingstarted.md' + - 'Event Handlers': 'events.md' + - 'Plugin Contexts': 'contexts.md' + - 'Working with Variables': 'variables.md' + - 'Running Commands': 'commands.md' + - 'troubleshooting.md' + - '⎋ Changelog': 'https://github.com/alterNERDtive/YAVAPF/blob/release/CHANGELOG.md' + - '⎋ Report a Bug': 'https://github.com/alterNERDtive/YAVAPF/issues/' diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..978c5a1 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +mkdocs-roamlinks-plugin