diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000..1510ed02 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,62 @@ +name: Documentation + +on: + push: + branches: ["main"] + pull_request: + workflow_dispatch: + +# Allow this job to clone the repo and create a page deployment +permissions: + contents: read + pages: write + id-token: write + +# Configure .NET +env: + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: "true" + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: "9.x.x" + + - name: Setup Android SDK + uses: android-actions/setup-android@v3 + + - name: Install Workloads + run: | + dotnet workload install android --ignore-failed-sources + + - name: Install docfx + run: | + dotnet tool update -g docfx + echo "~/.dotnet/tools" >> $GITHUB_PATH + + - name: Build docs + run: docfx docfx.json + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: "./_site/" + + deploy: + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + needs: build + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.gitignore b/.gitignore index 96e77496..b772ebff 100644 --- a/.gitignore +++ b/.gitignore @@ -364,3 +364,6 @@ FodyWeavers.xsd # Rider .idea + +# Docfx +_site/ diff --git a/LICENSE b/LICENSE.md similarity index 100% rename from LICENSE rename to LICENSE.md diff --git a/README.md b/README.md index e7581644..52512e9d 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,34 @@ +--- +title: About +outputFileName: index.html +--- + # Nearby Sharing (`NearShare`) -This repo contains a fully functional implementation of the [`MS-CDP`](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cdp) and `NearShare` protocol that powers the `Windows 10+` built-in sharing functionality (Aka [`Project Rome`]( https://github.com/microsoft/project-rome)). + +This repo contains a fully functional implementation of the [`MS-CDP`](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cdp) and `NearShare` protocol that powers the `Windows 10+` built-in sharing functionality (Aka [`Project Rome`](https://github.com/microsoft/project-rome)). > [!NOTE] -> This repository contains a fully functional `Android` app that serves as a frontend of `libCdp`. +> This repository contains a fully functional `Android` app that serves as a frontend of `libCdp`. > You can visit [nearshare.shortdev.de](https://nearshare.shortdev.de) for download and setup instructions. > [!TIP] > For other platforms have a look at the [other repositories](https://github.com/nearby-sharing)! ## Building -This project consists of `.NET 8` library and `Android` projects. + +This project consists of `.NET 8` library and `Android` projects. You can use the [`Visual Studio`](https://visualstudio.microsoft.com/de/) solution or the [`dotnet`](https://dotnet.microsoft.com/en-us/download) cli to build and deploy the app: + ```shell cd src dotnet run ``` ## Contribute -Contributions are welcome! -Have a look at the [Wiki](https://github.com/nearby-sharing/android/wiki/Contributing) or ask via [Discord](https://nearshare.shortdev.de/community/) to get started! + +Contributions are welcome! +Have a look at the [contributing guidelines](CONTRIBUTING.md) to get started! + +## License + +This project is licensed under [GPL-3.0](LICENSE.md). diff --git a/docfx.json b/docfx.json new file mode 100644 index 00000000..3fb007c1 --- /dev/null +++ b/docfx.json @@ -0,0 +1,37 @@ +{ + "$schema": "https://raw.githubusercontent.com/dotnet/docfx/main/schemas/docfx.schema.json", + "metadata": [ + { + "src": [ + { + "files": ["lib/**/*.csproj"] + } + ], + "output": "docs/lib/api/" + }, + { + "src": [ + { + "files": ["src/*.csproj"] + } + ], + "output": "docs/android/api/" + } + ], + "build": { + "content": [ + { + "files": "**/*.{md,yml}", + "exclude": "_site/**/*" + } + ], + "postProcessors": ["ExtractSearchIndex"], + "globalMetadata": { + "_disableNextArticle": true, + "_appName": "NearShare", + "_gitUrlPattern": "github" + }, + "output": "_site", + "template": ["default", "modern"] + } +} diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md new file mode 100644 index 00000000..41524600 --- /dev/null +++ b/docs/CONTRIBUTING.md @@ -0,0 +1,35 @@ +# Contributing + +This guide will explain you how you can contribute to this project! + +## What to do + +- 🐞 [Report bugs / feature requests](https://github.com/ShortDevelopment/Nearby-Sharing-Windows/issues) +- 🌍 [Add Translation](#add-translation) +- 📖 Better documentation (e.g. FAQ) +- 📱 UI / UX improvements (Xamarin c# android) +- 👨‍💻 Improve libCdp (.NET c#) + +## Where to start + +- Have a look at [good first issue](https://github.com/nearby-sharing/android/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue") + +## How to + +- If you have any questions, just ask via [Discord](https://discord.gg/ArFA3Nymr2)! + +--- + +## Add Translation + +> [!IMPORTANT] +> Make sure to choose the right language code! +> https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry + +- Fork repo on GitHub +- Replace all following `de`s with your language code! +- In the `src` directory + - Copy the `Resources/values/strings.xml` into a new folder like `Resources/values-de/strings.xml` and translate the individual strings. + - Copy the `Assets/en/*.html` files into a new folder like `Assets/de/` and translate. +- Add yourself to the `CREDITS.md` file! +- Open one PullRequest for all your changes diff --git a/docs/android/.gitignore b/docs/android/.gitignore new file mode 100644 index 00000000..ab08e583 --- /dev/null +++ b/docs/android/.gitignore @@ -0,0 +1,2 @@ +_site/ +api/ \ No newline at end of file diff --git a/docs/android/README.md b/docs/android/README.md new file mode 100644 index 00000000..c7e14a2e --- /dev/null +++ b/docs/android/README.md @@ -0,0 +1,5 @@ +--- +outputFileName: index.html +--- + +# Android App diff --git a/docs/android/toc.yml b/docs/android/toc.yml new file mode 100644 index 00000000..b84b15f6 --- /dev/null +++ b/docs/android/toc.yml @@ -0,0 +1,3 @@ +- href: README.md +- name: Api + href: api/toc.yml diff --git a/docs/lib/.gitignore b/docs/lib/.gitignore new file mode 100644 index 00000000..ab08e583 --- /dev/null +++ b/docs/lib/.gitignore @@ -0,0 +1,2 @@ +_site/ +api/ \ No newline at end of file diff --git a/docs/lib/README.md b/docs/lib/README.md new file mode 100644 index 00000000..fed8cd95 --- /dev/null +++ b/docs/lib/README.md @@ -0,0 +1,5 @@ +--- +outputFileName: index.html +--- + +# libCdp diff --git a/docs/lib/toc.yml b/docs/lib/toc.yml new file mode 100644 index 00000000..b84b15f6 --- /dev/null +++ b/docs/lib/toc.yml @@ -0,0 +1,3 @@ +- href: README.md +- name: Api + href: api/toc.yml diff --git a/docs/toc.yml b/docs/toc.yml new file mode 100644 index 00000000..475f98bf --- /dev/null +++ b/docs/toc.yml @@ -0,0 +1,5 @@ +- href: ../README.md + +- name: Development +- href: CONTRIBUTING.md +- href: ../CREDITS.md diff --git a/lib/ShortDev.Microsoft.ConnectedDevices/Messages/Connection/ConnectionRequest.cs b/lib/ShortDev.Microsoft.ConnectedDevices/Messages/Connection/ConnectionRequest.cs index b4c54a12..fffa2af7 100644 --- a/lib/ShortDev.Microsoft.ConnectedDevices/Messages/Connection/ConnectionRequest.cs +++ b/lib/ShortDev.Microsoft.ConnectedDevices/Messages/Connection/ConnectionRequest.cs @@ -1,4 +1,5 @@ using ShortDev.Microsoft.ConnectedDevices.Encryption; +using ShortDev.Microsoft.ConnectedDevices.Transports; namespace ShortDev.Microsoft.ConnectedDevices.Messages.Connection; @@ -21,7 +22,7 @@ public sealed class ConnectionRequest : ICdpPayload public required CdpNonce Nonce { get; set; } /// /// The maximum size of a single message fragment.
- /// (Fixed Value of ). + /// (Fixed Value of ). ///
public required uint MessageFragmentSize { get; set; } /// diff --git a/lib/ShortDev.Microsoft.ConnectedDevices/Messages/Connection/ConnectionResponse.cs b/lib/ShortDev.Microsoft.ConnectedDevices/Messages/Connection/ConnectionResponse.cs index 2e6d94df..f9a7f47b 100644 --- a/lib/ShortDev.Microsoft.ConnectedDevices/Messages/Connection/ConnectionResponse.cs +++ b/lib/ShortDev.Microsoft.ConnectedDevices/Messages/Connection/ConnectionResponse.cs @@ -1,4 +1,5 @@ using ShortDev.Microsoft.ConnectedDevices.Encryption; +using ShortDev.Microsoft.ConnectedDevices.Transports; namespace ShortDev.Microsoft.ConnectedDevices.Messages.Connection; @@ -22,7 +23,7 @@ public sealed class ConnectionResponse : ICdpPayload public required CdpNonce Nonce { get; set; } /// /// The maximum size of a single message fragment.
- /// (Fixed Value of ). + /// (Fixed Value of ). ///
public required uint MessageFragmentSize { get; set; } /// diff --git a/toc.yml b/toc.yml new file mode 100644 index 00000000..7da8f3d3 --- /dev/null +++ b/toc.yml @@ -0,0 +1,6 @@ +- name: Documentation + href: docs/ +- name: Android App + href: docs/android/ +- name: libCdp + href: docs/lib/