diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..1a312f0 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,53 @@ +name: Docs + +on: + push: + branches: + - main + paths: + - src/** + - docs/** + - .github/workflows/docs.yml + pull_request: + branches: + - main + paths: + - docs/** + - .github/workflows/docs.yml + workflow_dispatch: + +jobs: + generate-docs: + + runs-on: windows-latest + + steps: + - uses: actions/checkout@v2 + + - name: Setup .NET Core 3.1 + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 3.1.x + + - name: Setup .NET 5.0 + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 5.0.x + + - name: Setup DocFX + uses: crazy-max/ghaction-chocolatey@v1 + with: + args: install docfx + + - name: DocFX Build + working-directory: docs + run: docfx .\docfx.json + continue-on-error: false + + - name: Publish + if: github.event_name == 'push' + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: docs/_site + force_orphan: true diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 0000000..4378419 --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1,9 @@ +############### +# folder # +############### +/**/DROP/ +/**/TEMP/ +/**/packages/ +/**/bin/ +/**/obj/ +_site diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..a7fe0b1 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,29 @@ +# XPlat Documentation + +This folder contains source code for the generation of XPlat's documentation. + +## Contributing to the docs + +### Install dependencies + +Download and install docfx on your computer. + +#### MacOS + +``` +brew install docfx +``` + +#### Windows + +``` +choco install docfx +``` + +### Running locally + +``` +docfx .\docfx.json --serve +``` + +This will run the docs on `http://localhost:8080` \ No newline at end of file diff --git a/docs/api/.gitignore b/docs/api/.gitignore new file mode 100644 index 0000000..e8079a3 --- /dev/null +++ b/docs/api/.gitignore @@ -0,0 +1,5 @@ +############### +# temp file # +############### +*.yml +.manifest diff --git a/docs/api/index.md b/docs/api/index.md new file mode 100644 index 0000000..283261b --- /dev/null +++ b/docs/api/index.md @@ -0,0 +1,10 @@ +--- +uid: api-docs +title: Explore the APIs +--- + +# Explore the APIs + +Here you'll find all of the generated code documentation for the XPlat Windows APIs projects, similar to what you might find on Microsoft Docs! + +This documentation is designed to show you how each component of XPlat Windows APIs is constructed and provide a reference for you when building your projects. diff --git a/docs/articles/available-packages.md b/docs/articles/available-packages.md new file mode 100644 index 0000000..b5b0b49 --- /dev/null +++ b/docs/articles/available-packages.md @@ -0,0 +1,30 @@ +--- +uid: available-packages +title: Available packages +--- + +# Available XPlat packages + +XPlat Windows APIs are available via NuGet. Each available package is detailed below. + +We have purposefully split the XPlat Windows APIs to allow you to pick and choose the specific components that your app needs to prevent bloat! + +| Package | Current | Preview | +| ------ | ------ | ------ | +| XPlat.ApplicationModel | [![Nuget](https://img.shields.io/nuget/v/XPlat.ApplicationModel.svg)](https://www.nuget.org/packages/XPlat.ApplicationModel/) | [![Nuget](https://img.shields.io/nuget/vpre/XPlat.ApplicationModel.svg)](https://www.nuget.org/packages/XPlat.ApplicationModel/) | +| XPlat.ApplicationModel.DataTransfer | [![Nuget](https://img.shields.io/nuget/v/XPlat.ApplicationModel.DataTransfer.svg)](https://www.nuget.org/packages/XPlat.ApplicationModel.DataTransfer/) | [![Nuget](https://img.shields.io/nuget/vpre/XPlat.ApplicationModel.DataTransfer.svg)](https://www.nuget.org/packages/XPlat.ApplicationModel.DataTransfer/) | +| XPlat.Core | [![Nuget](https://img.shields.io/nuget/v/XPlat.Core.svg)](https://www.nuget.org/packages/XPlat.Core/) | [![Nuget](https://img.shields.io/nuget/vpre/XPlat.Core.svg)](https://www.nuget.org/packages/XPlat.Core/) | +| XPlat.Device.Display | [![Nuget](https://img.shields.io/nuget/v/XPlat.Device.Display.svg)](https://www.nuget.org/packages/XPlat.Device.Display/) | [![Nuget](https://img.shields.io/nuget/vpre/XPlat.Device.Display.svg)](https://www.nuget.org/packages/XPlat.Device.Display/) | +| XPlat.Device.Geolocation | [![Nuget](https://img.shields.io/nuget/v/XPlat.Device.Geolocation.svg)](https://www.nuget.org/packages/XPlat.Device.Geolocation/) | [![Nuget](https://img.shields.io/nuget/vpre/XPlat.Device.Geolocation.svg)](https://www.nuget.org/packages/XPlat.Device.Geolocation/) | +| XPlat.Device.Launcher | [![Nuget](https://img.shields.io/nuget/v/XPlat.Device.Launcher.svg)](https://www.nuget.org/packages/XPlat.Device.Launcher/) | [![Nuget](https://img.shields.io/nuget/vpre/XPlat.Device.Launcher.svg)](https://www.nuget.org/packages/XPlat.Device.Launcher/) | +| XPlat.Device.Power | [![Nuget](https://img.shields.io/nuget/v/XPlat.Device.Power.svg)](https://www.nuget.org/packages/XPlat.Device.Power/) | [![Nuget](https://img.shields.io/nuget/vpre/XPlat.Device.Power.svg)](https://www.nuget.org/packages/XPlat.Device.Power/) | +| XPlat.Device.Profile | [![Nuget](https://img.shields.io/nuget/v/XPlat.Device.Profile.svg)](https://www.nuget.org/packages/XPlat.Device.Profile/) | [![Nuget](https://img.shields.io/nuget/vpre/XPlat.Device.Profile.svg)](https://www.nuget.org/packages/XPlat.Device.Profile/) | +| XPlat.Foundation | [![Nuget](https://img.shields.io/nuget/v/XPlat.Foundation.svg)](https://www.nuget.org/packages/XPlat.Foundation/) | [![Nuget](https://img.shields.io/nuget/vpre/XPlat.Foundation.svg)](https://www.nuget.org/packages/XPlat.Foundation/) | +| XPlat.Media.Capture | [![Nuget](https://img.shields.io/nuget/v/XPlat.Media.Capture.svg)](https://www.nuget.org/packages/XPlat.Media.Capture/) | [![Nuget](https://img.shields.io/nuget/vpre/XPlat.Media.Capture.svg)](https://www.nuget.org/packages/XPlat.Media.Capture/) | +| XPlat.Services.Maps | [![Nuget](https://img.shields.io/nuget/v/XPlat.Services.Maps.svg)](https://www.nuget.org/packages/XPlat.Services.Maps/) | [![Nuget](https://img.shields.io/nuget/vpre/XPlat.Services.Maps.svg)](https://www.nuget.org/packages/XPlat.Services.Maps/) | +| XPlat.Storage | [![Nuget](https://img.shields.io/nuget/v/XPlat.Storage.svg)](https://www.nuget.org/packages/XPlat.Storage/) | [![Nuget](https://img.shields.io/nuget/vpre/XPlat.Storage.svg)](https://www.nuget.org/packages/XPlat.Storage/) | +| XPlat.Storage.Pickers | [![Nuget](https://img.shields.io/nuget/v/XPlat.Storage.Pickers.svg)](https://www.nuget.org/packages/XPlat.Storage.Pickers/) | [![Nuget](https://img.shields.io/nuget/vpre/XPlat.Storage.Pickers.svg)](https://www.nuget.org/packages/XPlat.Storage.Pickers/) | +| XPlat.UI | [![Nuget](https://img.shields.io/nuget/v/XPlat.UI.svg)](https://www.nuget.org/packages/XPlat.UI/) | [![Nuget](https://img.shields.io/nuget/vpre/XPlat.UI.svg)](https://www.nuget.org/packages/XPlat.UI/) | +| XPlat.UI.Controls | [![Nuget](https://img.shields.io/nuget/v/XPlat.UI.Controls.svg)](https://www.nuget.org/packages/XPlat.UI.Controls/) | [![Nuget](https://img.shields.io/nuget/vpre/XPlat.UI.Controls.svg)](https://www.nuget.org/packages/XPlat.UI.Controls/) | +| XPlat.UI.Core | [![Nuget](https://img.shields.io/nuget/v/XPlat.UI.Core.svg)](https://www.nuget.org/packages/XPlat.UI.Core/) | [![Nuget](https://img.shields.io/nuget/vpre/XPlat.UI.Core.svg)](https://www.nuget.org/packages/XPlat.UI.Core/) | +| XPlat.UI.Popups | [![Nuget](https://img.shields.io/nuget/v/XPlat.UI.Popups.svg)](https://www.nuget.org/packages/XPlat.UI.Popups/) | [![Nuget](https://img.shields.io/nuget/vpre/XPlat.UI.Popups.svg)](https://www.nuget.org/packages/XPlat.UI.Popups/) | diff --git a/docs/articles/intro.md b/docs/articles/intro.md new file mode 100644 index 0000000..9e6fc67 --- /dev/null +++ b/docs/articles/intro.md @@ -0,0 +1,24 @@ +--- +uid: xplat-intro +title: Overview +--- + +XPlat project banner + +# XPlat Windows APIs + +XPlat Windows APIs are designed to make it easier for developers adjusted to developing with the Windows Runtime APIs (UWP) to take those skills cross-platform with their applications in .NET. + +As each application platform offers their own unique platform-specific APIs, XPlat attempts to bring all of those APIs under one umbrella using a UWP like API, allowing a developer to learn a single API which works with any application built for Windows and Xamarin for Android and iOS. + +For a Windows developer, this is appealing as it allows you to easily migrate your existing Windows code to Xamarin shared code with minimal changes through the use of XPlat Windows APIs which mimic the UWP API alternatives. + +## Why should I use this project? + +You've spent years developing Windows applications and you've been using the Windows Runtime APIs (UWP) to build modern app experiences. Now you want to take your existing apps and skills cross-platform with Xamarin, but you don't know where to start because you don't know what APIs to use! + +I had this same problem! + +That's where XPlat Windows APIs started, a set of APIs which mimic those Windows APIs but that are cross-platform, supporting both Android and iOS. + +Use your existing skills and build epic cross-platform applications. \ No newline at end of file diff --git a/docs/articles/toc.yml b/docs/articles/toc.yml new file mode 100644 index 0000000..c6fa19c --- /dev/null +++ b/docs/articles/toc.yml @@ -0,0 +1,6 @@ +- name: Overview + topicHref: intro.md +- name: Get started + items: + - name: Available packages + href: available-packages.md diff --git a/docs/docfx.json b/docs/docfx.json new file mode 100644 index 0000000..cc7ac2c --- /dev/null +++ b/docs/docfx.json @@ -0,0 +1,82 @@ +{ + "metadata": [ + { + "src": [ + { + "src": "../", + "files": [ + "src/**.csproj" + ], + "exclude": [ + "**/bin/**", + "**/obj/**", + "_site/**" + ] + } + ], + "dest": "api", + "disableGitFeatures": false, + "disableDefaultFilter": false, + "properties": { + "TargetFramework": "netstandard2.0" + } + } + ], + "build": { + "content": [ + { + "files": [ + "api/**.yml", + "api/index.md" + ] + }, + { + "files": [ + "articles/**.md", + "articles/**/toc.yml", + "toc.yml", + "*.md" + ] + } + ], + "resource": [ + { + "files": [ + "images/**" + ] + } + ], + "overwrite": [ + { + "files": [ + "apidoc/**.md" + ], + "exclude": [ + "obj/**", + "_site/**" + ] + } + ], + "dest": "_site", + "globalMetadataFiles": [], + "fileMetadataFiles": [], + "template": [ + "default", + "templates/material" + ], + "postProcessors": [], + "markdownEngineName": "markdig", + "noLangKeyword": false, + "keepFileLink": false, + "cleanupCacheHistory": false, + "disableGitFeatures": false, + "globalMetadata": { + "_appLogoPath": "images/Logo.png", + "_appFaviconPath": "images/Logo.png", + "_appTitle": "XPlat Windows APIs", + "_appFooter": "Copyright (c) XPlat Apps", + "_enableSearch": true, + "_enableNewTab": true + } + } +} \ No newline at end of file diff --git a/docs/images/Logo.png b/docs/images/Logo.png new file mode 100644 index 0000000..ad84416 Binary files /dev/null and b/docs/images/Logo.png differ diff --git a/docs/images/ProjectBanner.png b/docs/images/ProjectBanner.png new file mode 100644 index 0000000..d8fef60 Binary files /dev/null and b/docs/images/ProjectBanner.png differ diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..f9dd6b8 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,76 @@ +--- +uid: front-page +title: Docs +--- + +XPlat project banner + +
+
+

Why XPlat Windows APIs?

+

+Find yourself with .NET Windows API skills but unsure how to go cross-platform? +

+

+That's why I started XPlat Windows APIs. This is an API layer for Xamarin Android and iOS application mimicking the equivalent Windows API. So you can build cross-platform applications with the skills you know! +

+ + +[Learn more](articles/intro.md) + + +
+
+

Available packages

+

+Take advantage of what is available for XPlat Windows APIs in your applications. +

+

+You'll discover what packages are available for you from NuGet.org, plus how you can use them. +

+ + +[Discover XPlat](articles/available-packages.md) + + +
+
+ +
+
+

Contributing

+

+Are we missing an API you need in your application? +

+

+XPlat Windows APIs are available as an open-source project on GitHub! Dive into the codebase and bring your improvements. +

+ + +[Get the source](https://github.com/XPlat-Apps/XPlat-Windows-APIs) + + +
+
+

Supporting XPlat

+

+If you'd like to support our current and future endeavors in open-source projects, considering sponsoring the work we do! +

+ + +
+
diff --git a/docs/templates/material/partials/head.tmpl.partial b/docs/templates/material/partials/head.tmpl.partial new file mode 100644 index 0000000..c05e8c1 --- /dev/null +++ b/docs/templates/material/partials/head.tmpl.partial @@ -0,0 +1,21 @@ +{{!Copyright (c) Oscar Vasquez. All rights reserved. Licensed under the MIT license. See LICENSE file in the project root for full license information.}} + + + + + {{#title}}{{title}}{{/title}}{{^title}}{{>partials/title}}{{/title}} {{#_appTitle}}| {{_appTitle}} {{/_appTitle}} + + + + {{#_description}}{{/_description}} + + + + + + + + {{#_noindex}}{{/_noindex}} + {{#_enableSearch}}{{/_enableSearch}} + {{#_enableNewTab}}{{/_enableNewTab}} + \ No newline at end of file diff --git a/docs/templates/material/styles/main.css b/docs/templates/material/styles/main.css new file mode 100644 index 0000000..ef0b37f --- /dev/null +++ b/docs/templates/material/styles/main.css @@ -0,0 +1,335 @@ +/* COLOR VARIABLES*/ +:root { + --header-bg-color: #0d47a1; + --header-ft-color: #fff; + --highlight-light: #5e92f3; + --highlight-dark: #002171; + --accent-dim: #e0e0e0; + --accent-super-dim: #f3f3f3; + --font-color: #34393e; + --card-box-shadow: 0 1px 2px 0 rgba(61, 65, 68, 0.06), 0 1px 3px 1px rgba(61, 65, 68, 0.16); + --search-box-shadow: 0 1px 2px 0 rgba(41, 45, 48, 0.36), 0 1px 3px 1px rgba(41, 45, 48, 0.46); + --transition: 350ms; +} + +body { + color: var(--font-color); + font-family: "Roboto", sans-serif; + line-height: 1.5; + font-size: 16px; + -ms-text-size-adjust: 100%; + -webkit-text-size-adjust: 100%; + word-wrap: break-word; +} + +/* HIGHLIGHT COLOR */ + +button, +.button, +a { + color: var(--highlight-dark); + cursor: pointer; +} + +button:hover, +button:focus, +a:hover, +a:focus { + color: var(--highlight-light); + text-decoration: none; +} + +.toc .nav > li.active > a { + color: var(--highlight-dark); +} + +.toc .nav > li.active > a:hover, +.toc .nav > li.active > a:focus { + color: var(--highlight-light); +} + +.pagination > .active > a { + background-color: var(--header-bg-color); + border-color: var(--header-bg-color); +} + +.pagination > .active > a, +.pagination > .active > a:focus, +.pagination > .active > a:hover, +.pagination > .active > span, +.pagination > .active > span:focus, +.pagination > .active > span:hover { + background-color: var(--highlight-light); + border-color: var(--highlight-light); +} + +/* HEADINGS */ + +h1 { + font-weight: 600; + font-size: 32px; +} + +h2 { + font-weight: 600; + font-size: 24px; + line-height: 1.8; +} + +h3 { + font-weight: 600; + font-size: 20px; + line-height: 1.8; +} + +h5 { + font-size: 14px; + padding: 10px 0px; +} + +article h1, +article h2, +article h3, +article h4 { + margin-top: 35px; + margin-bottom: 15px; +} + +article h4 { + padding-bottom: 8px; + border-bottom: 2px solid #ddd; +} + +/* NAVBAR */ + +.navbar-brand > img { + color: var(--header-ft-color); +} + +.navbar { + border: none; + /* Both navbars use box-shadow */ + -webkit-box-shadow: var(--card-box-shadow); + -moz-box-shadow: var(--card-box-shadow); + box-shadow: var(--card-box-shadow); +} + +.subnav { + border-top: 1px solid #ddd; + background-color: #fff; +} + +.navbar-inverse { + background-color: var(--header-bg-color); + z-index: 100; +} + +.navbar-inverse .navbar-nav > li > a, +.navbar-inverse .navbar-text { + color: var(--header-ft-color); + background-color: var(--header-bg-color); + border-bottom: 3px solid transparent; + padding-bottom: 12px; + transition: 350ms; +} + +.navbar-inverse .navbar-nav > li > a:focus, +.navbar-inverse .navbar-nav > li > a:hover { + color: var(--header-ft-color); + background-color: var(--header-bg-color); + border-bottom: 3px solid white; +} + +.navbar-inverse .navbar-nav > .active > a, +.navbar-inverse .navbar-nav > .active > a:focus, +.navbar-inverse .navbar-nav > .active > a:hover { + color: var(--header-ft-color); + background-color: var(--header-bg-color); + border-bottom: 3px solid white; +} + +.navbar-form .form-control { + border: 0; + border-radius: 4px; + box-shadow: var(--search-box-shadow); + transition:var(--transition); +} + +.navbar-form .form-control:hover { + background-color: var(--accent-dim); +} + +/* NAVBAR TOGGLED (small screens) */ + +.navbar-inverse .navbar-collapse, .navbar-inverse .navbar-form { + border: none; +} +.navbar-inverse .navbar-toggle { + box-shadow: var(--card-box-shadow); + border: none; +} + +.navbar-inverse .navbar-toggle:focus, +.navbar-inverse .navbar-toggle:hover { + background-color: var(--highlight-dark); +} + +/* SIDEBAR */ + +.toc .level1 > li { + font-weight: 400; +} + +.toc .nav > li > a { + color: var(--font-color); +} + +.sidefilter { + background-color: #fff; + border-left: none; + border-right: none; +} + +.sidefilter { + background-color: #fff; + border-left: none; + border-right: none; +} + +.toc-filter { + padding: 5px; + margin: 0; + box-shadow: var(--card-box-shadow); + transition:var(--transition); +} + +.toc-filter:hover { + background-color: var(--accent-super-dim); +} + +.toc-filter > input { + border: none; + background-color: inherit; + transition: inherit; +} + +.toc-filter > .filter-icon { + display: none; +} + +.sidetoc > .toc { + background-color: #fff; + overflow-x: hidden; +} + +.sidetoc { + background-color: #fff; + border: none; +} + +/* ALERTS */ + +.alert { + padding: 0px 0px 5px 0px; + color: inherit; + background-color: inherit; + border: none; + box-shadow: var(--card-box-shadow); +} + +.alert > p { + margin-bottom: 0; + padding: 5px 10px; +} + +.alert > ul { + margin-bottom: 0; + padding: 5px 40px; +} + +.alert > h5 { + padding: 10px 15px; + margin-top: 0; + text-transform: uppercase; + font-weight: bold; + border-radius: 4px 4px 0 0; +} + +.alert-info > h5 { + color: #1976d2; + border-bottom: 4px solid #1976d2; + background-color: #e3f2fd; +} + +.alert-warning > h5 { + color: #f57f17; + border-bottom: 4px solid #f57f17; + background-color: #fff3e0; +} + +.alert-danger > h5 { + color: #d32f2f; + border-bottom: 4px solid #d32f2f; + background-color: #ffebee; +} + +/* CODE HIGHLIGHT */ +pre { + padding: 9.5px; + margin: 0 0 10px; + font-size: 13px; + word-break: break-all; + word-wrap: break-word; + background-color: #fffaef; + border-radius: 4px; + border: none; + box-shadow: var(--card-box-shadow); +} + +/* STYLE FOR IMAGES */ + +.article .small-image { + margin-top: 15px; + box-shadow: var(--card-box-shadow); + max-width: 350px; +} + +.article .medium-image { + margin-top: 15px; + box-shadow: var(--card-box-shadow); + max-width: 550px; +} + +.article .large-image { + margin-top: 15px; + box-shadow: var(--card-box-shadow); + max-width: 700px; +} + +.button { + display: inline-block; +} + +.button a { + display: inline-block; + padding: 8px 16px; + box-shadow: 0 2px 4px 0 rgba(31, 31, 31, 0.25); + border-radius: 8px; + transition: color 0.2s ease-in-out, + background-color 0.2s ease-in-out; +} + +.sponsor-button .octicon { + vertical-align: text-top; + overflow: visible; + transition: transform .15s cubic-bezier(.2,0,.13,2); +} + +.text-pink { + color: #ea4aaa; +} + +.octicon { + display: inline-block; + fill: currentcolor; +} diff --git a/docs/toc.yml b/docs/toc.yml new file mode 100644 index 0000000..046f4b0 --- /dev/null +++ b/docs/toc.yml @@ -0,0 +1,5 @@ +- name: Docs + href: docs/ + homepage: articles/intro.md +- name: APIs + href: api/ \ No newline at end of file