Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic docs #189

Merged
merged 8 commits into from
Jan 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -364,3 +364,6 @@ FodyWeavers.xsd

# Rider
.idea

# Docfx
_site/
File renamed without changes.
23 changes: 18 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -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).
37 changes: 37 additions & 0 deletions docfx.json
Original file line number Diff line number Diff line change
@@ -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"]
}
}
35 changes: 35 additions & 0 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions docs/android/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
_site/
api/
5 changes: 5 additions & 0 deletions docs/android/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
outputFileName: index.html
---

# Android App
3 changes: 3 additions & 0 deletions docs/android/toc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- href: README.md
- name: Api
href: api/toc.yml
2 changes: 2 additions & 0 deletions docs/lib/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
_site/
api/
5 changes: 5 additions & 0 deletions docs/lib/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
outputFileName: index.html
---

# libCdp
3 changes: 3 additions & 0 deletions docs/lib/toc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- href: README.md
- name: Api
href: api/toc.yml
5 changes: 5 additions & 0 deletions docs/toc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- href: ../README.md

- name: Development
- href: CONTRIBUTING.md
- href: ../CREDITS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using ShortDev.Microsoft.ConnectedDevices.Encryption;
using ShortDev.Microsoft.ConnectedDevices.Transports;

namespace ShortDev.Microsoft.ConnectedDevices.Messages.Connection;

Expand All @@ -21,7 +22,7 @@ public sealed class ConnectionRequest : ICdpPayload<ConnectionRequest>
public required CdpNonce Nonce { get; set; }
/// <summary>
/// The maximum size of a single message fragment. <br/>
/// (Fixed Value of <see cref="Constants.DefaultMessageFragmentSize"/>).
/// (Fixed Value of <see cref="MessageFragmenter.DefaultMessageFragmentSize"/>).
/// </summary>
public required uint MessageFragmentSize { get; set; }
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using ShortDev.Microsoft.ConnectedDevices.Encryption;
using ShortDev.Microsoft.ConnectedDevices.Transports;

namespace ShortDev.Microsoft.ConnectedDevices.Messages.Connection;

Expand All @@ -22,7 +23,7 @@ public sealed class ConnectionResponse : ICdpPayload<ConnectionResponse>
public required CdpNonce Nonce { get; set; }
/// <summary>
/// The maximum size of a single message fragment. <br/>
/// (Fixed Value of <see cref="Constants.DefaultMessageFragmentSize"/>).
/// (Fixed Value of <see cref="MessageFragmenter.DefaultMessageFragmentSize"/>).
/// </summary>
public required uint MessageFragmentSize { get; set; }
/// <summary>
Expand Down
6 changes: 6 additions & 0 deletions toc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- name: Documentation
href: docs/
- name: Android App
href: docs/android/
- name: libCdp
href: docs/lib/
Loading