diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml new file mode 100644 index 000000000..fa8372db9 --- /dev/null +++ b/.github/workflows/documentation.yml @@ -0,0 +1,55 @@ +name: Deploy documentation + +on: + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Pages + uses: actions/configure-pages@v5 + + - name: Prepare .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: | + 6.0.x + 7.0.x + 8.0.x + + - name: Call generator + run: dotnet fsi GenerateLibs.fsx + working-directory: './src' + - name: Restore solution + run: dotnet restore GirCore.Libs.slnf + working-directory: './src' + + - name: Install docfx + run: dotnet tool update -g docfx + - name: Build website + run: docfx docs/docfx.json + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: './_site' + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file diff --git a/docs/api/index.md b/docs/api/index.md new file mode 100644 index 000000000..6c18dc202 --- /dev/null +++ b/docs/api/index.md @@ -0,0 +1,2 @@ +# GirCore Api Documentation +Please select the namespace you are interested in on the left side. \ No newline at end of file diff --git a/docs/docfx.json b/docs/docfx.json new file mode 100644 index 000000000..a9d85e23c --- /dev/null +++ b/docs/docfx.json @@ -0,0 +1,39 @@ +{ + "metadata": [ + { + "src": [ + { + "src": "../src/Libs", + "files": ["**/*.csproj"], + "exclude": ["GirTest-0.1/**"] + } + ], + "dest": "api" + } + ], + "build": { + "content": [ + { + "files": ["**/*.{md,yml}"], + "exclude": ["_site/**"] + } + ], + "resource": [ + { + "files": ["img/**"] + } + ], + "output": "../_site", + "template": [ + "default", + "modern" + ], + "globalMetadata": { + "_appName": "GirCore", + "_appTitle": "GirCore", + "_appLogoPath": "img/gircore-logo.svg", + "_enableSearch": true, + "pdf": false + } + } +} \ No newline at end of file diff --git a/docs/readme.md b/docs/index.md similarity index 100% rename from docs/readme.md rename to docs/index.md diff --git a/docs/docs/toc.yml b/docs/toc.yml similarity index 51% rename from docs/docs/toc.yml rename to docs/toc.yml index eb425b434..afcf3ea6d 100644 --- a/docs/docs/toc.yml +++ b/docs/toc.yml @@ -1,19 +1,22 @@ items: - name: Home - href: ../index.md + href: index.md +- name: Api Documentation + href: api/ + homepage: api/index.md - name: Use items: - name: Get started - href: use.md + href: docs/use.md - name: Apps - href: apps.md + href: docs/apps.md - name: Libraries - href: libraries.md + href: docs/libraries.md - name: Contribute items: - name: Guidelines - href: contributing.md + href: docs/contributing.md - name: Build - href: build.md + href: docs/build.md - name: Github href: https://github.com/gircore/ diff --git a/src/GirCore.sln b/src/GirCore.sln index 6f48d451f..21b8fa7ce 100644 --- a/src/GirCore.sln +++ b/src/GirCore.sln @@ -81,7 +81,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionItems", "SolutionIt EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{0D9C5C7E-F81B-4E0E-B203-22D558E6D7F1}" ProjectSection(SolutionItems) = preProject - ..\docs\readme.md = ..\docs\readme.md + ..\docs\index.md = ..\docs\index.md + ..\docs\toc.yml = ..\docs\toc.yml + ..\docs\docfx.json = ..\docs\docfx.json EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "img", "img", "{C48DB577-12BB-4AA8-8734-802A39C093BE}" @@ -105,6 +107,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{ ..\.github\workflows\ci.yml = ..\.github\workflows\ci.yml ..\.github\workflows\codeql-analysis.yml = ..\.github\workflows\codeql-analysis.yml ..\.github\workflows\update-gir-files.yml = ..\.github\workflows\update-gir-files.yml + ..\.github\workflows\documentation.yml = ..\.github\workflows\documentation.yml EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Generation", "Generation", "{5D5D80C1-4D21-4619-8B59-7B7750016E9D}" @@ -153,7 +156,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{4EE9860B-6 ..\docs\docs\use.md = ..\docs\docs\use.md ..\docs\docs\apps.md = ..\docs\docs\apps.md ..\docs\docs\build.md = ..\docs\docs\build.md - ..\docs\docs\toc.yml = ..\docs\docs\toc.yml EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Adw-1", "Libs\Adw-1\Adw-1.csproj", "{CC67D284-6ADE-4F4D-9EE0-544143A7FF40}" @@ -180,6 +182,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "img", "img", "{15AC3143-968 ProjectSection(SolutionItems) = preProject ..\docs\img\GstSintel.png = ..\docs\img\GstSintel.png ..\docs\img\GtkApp.png = ..\docs\img\GtkApp.png + ..\docs\img\gircore-logo.svg = ..\docs\img\gircore-logo.svg EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GtkSource-5", "Libs\GtkSource-5\GtkSource-5.csproj", "{9D19B388-AD8B-4DC5-B351-5D9FCEAE8FEA}" @@ -222,6 +225,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ListView", "Samples\Gtk-4.0 EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GridView", "Samples\Gtk-4.0\GridView\GridView.csproj", "{EE13D29A-42BC-4694-9980-D0498AA15115}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "api", "api", "{23ED17AC-703E-40D6-8B4C-0DAE232E1E33}" + ProjectSection(SolutionItems) = preProject + ..\docs\api\index.md = ..\docs\api\index.md + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -945,5 +953,6 @@ Global {48FEE015-C1AD-41EE-A39D-E441F03AC5A3} = {7B70E5ED-C5E7-4F32-A458-E5A10F39DA00} {3F6B722F-5192-46BC-A389-5E40ABA9041B} = {7B70E5ED-C5E7-4F32-A458-E5A10F39DA00} {EE13D29A-42BC-4694-9980-D0498AA15115} = {7B70E5ED-C5E7-4F32-A458-E5A10F39DA00} + {23ED17AC-703E-40D6-8B4C-0DAE232E1E33} = {0D9C5C7E-F81B-4E0E-B203-22D558E6D7F1} EndGlobalSection EndGlobal