From 2972fd715ae3c4c6065733708cc34b8d9eeeb4d3 Mon Sep 17 00:00:00 2001 From: Den Delimarsky <53200638+localden@users.noreply.github.com> Date: Tue, 25 Mar 2025 08:43:14 -0700 Subject: [PATCH] Update documentation configuration (#86) * Docs configuration * Update docs/index.md Co-authored-by: Eirik Tsarpalis * Update the configuration * Update docs/docfx.json Co-authored-by: Eirik Tsarpalis * Update config * Update icons, use Makefile, remove warnings * Use a link that passes markdown link validation * remove working directory --------- Co-authored-by: Eirik Tsarpalis --- .config/dotnet-tools.json | 13 +++++++ .github/workflows/docs.yml | 43 +++++++++++++++++++++ .gitignore | 4 ++ Makefile | 38 +++++++++++++++++++ docs/docfx.json | 48 ++++++++++++++++++++++++ docs/images/favicon.ico | Bin 0 -> 33310 bytes docs/images/mcp.svg | 74 +++++++++++++++++++++++++++++++++++++ docs/index.md | 23 ++++++++++++ docs/toc.yml | 5 +++ 9 files changed, 248 insertions(+) create mode 100644 .config/dotnet-tools.json create mode 100644 .github/workflows/docs.yml create mode 100644 Makefile create mode 100644 docs/docfx.json create mode 100644 docs/images/favicon.ico create mode 100644 docs/images/mcp.svg create mode 100644 docs/index.md create mode 100644 docs/toc.yml diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json new file mode 100644 index 0000000..d32441d --- /dev/null +++ b/.config/dotnet-tools.json @@ -0,0 +1,13 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "docfx": { + "version": "2.78.3", + "commands": [ + "docfx" + ], + "rollForward": false + } + } +} \ No newline at end of file diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..1f54981 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,43 @@ +on: + release: + types: [published] + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + actions: 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: + publish-docs: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: .NET Setup + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 9.x + + - name: Generate documentation + run: make generate-docs + + - name: Upload Pages artifact + uses: actions/upload-pages-artifact@v3 + with: + path: 'artifacts/_site' + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 1dc1beb..3fce642 100644 --- a/.gitignore +++ b/.gitignore @@ -73,3 +73,7 @@ _NCrunch_* nCrunchTemp_* *.orig + +# Auto-generated documentation +docs/_site +docs/api \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..c2a0a01 --- /dev/null +++ b/Makefile @@ -0,0 +1,38 @@ +SOURCE_DIRECTORY := $(dir $(realpath $(lastword $(MAKEFILE_LIST)))) +ARTIFACT_PATH := $(SOURCE_DIRECTORY)artifacts +DOCS_PATH := $(SOURCE_DIRECTORY)docs +CONFIGURATION ?= Release + +clean: + dotnet clean + rm -rf $(ARTIFACT_PATH)/* + rm -rf $(DOCS_PATH)/api + +restore: + dotnet tool restore + dotnet restore + +build: restore + dotnet build --no-restore --configuration $(CONFIGURATION) + +test: build + dotnet test \ + --no-build \ + --configuration $(CONFIGURATION) \ + --filter '(Execution!=Manual)' \ + --blame \ + --diag "$(ARTIFACT_PATH)/diag.txt" \ + --logger "trx" \ + --collect "Code Coverage;Format=cobertura" \ + --results-directory $(ARTIFACT_PATH)/test-results \ + -- \ + RunConfiguration.CollectSourceInformation=true + +generate-docs: clean restore + dotnet build --no-restore --configuration Release + dotnet docfx $(DOCS_PATH)/docfx.json + +serve-docs: generate-docs + dotnet docfx serve $(ARTIFACT_PATH)/_site --port 8080 + +.DEFAULT_GOAL := build \ No newline at end of file diff --git a/docs/docfx.json b/docs/docfx.json new file mode 100644 index 0000000..6b4feb8 --- /dev/null +++ b/docs/docfx.json @@ -0,0 +1,48 @@ +{ + "$schema": "https://raw.githubusercontent.com/dotnet/docfx/main/schemas/docfx.schema.json", + "metadata": [ + { + "src": [ + { + "src": "../src", + "files": [ + "**/*.csproj" + ] + } + ], + "output": "api" + } + ], + "build": { + "content": [ + { + "files": [ + "**/*.{md,yml}" + ], + "exclude": [ + "_site/**" + ] + } + ], + "resource": [ + { + "files": [ + "images/**" + ] + } + ], + "output": "../artifacts/_site", + "template": [ + "default", + "modern" + ], + "globalMetadata": { + "_appName": "MCP C# SDK", + "_appTitle": "MCP C# SDK", + "_appLogoPath": "images/mcp.svg", + "_appFaviconPath": "images/favicon.ico", + "_enableSearch": true, + "pdf": false + } + } +} \ No newline at end of file diff --git a/docs/images/favicon.ico b/docs/images/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..7b23c7bbcb5dc05ef91e0ce51fbdf96ca51416f7 GIT binary patch literal 33310 zcmeI43A9#K6~`|sim8Dj;DGupa|lr^b4DKuXqq{NA*4YnYMPnQJAjXFe)W!{9ZJa_}ddvsuYO*bn7vXpq2(nx8FM!&Z4Vsd&Mg1HCcY+t+ z#x@kh+R$7a3SWgkLMW_?WqKS#Xl-~~^o-{6%djuRB-X}QDvpQ8U<&L6mBhF4X(|qf zaUehB6}2HB{1hgEbXGe>WCJSy5H5k8V-IRj*lH4Wru|3KzS6Rw7XR!`BL~!?p-3Cr zCf|kIB4wS;8kV;GPr~&(+gRlJ-;(!6o!VA+XTpEs93|=?tJ3Bys8t{9(AEg}CJcsd zpgw*B>f=19R`%n;=Rxflw-DDp-`PIeXhY-pIP4EwgWetQ!6VQQI@5=ZquSjbP6Wv) z2>YmJJbq0(uc$%fFChQ?QVFEmK0dbm@n!#>&A)1M3)mFiPSe%)As=haj|R!+un6u4 zy}OF`aWv0(S(k*yO}@20#uEPk?gP!!SRbkzj>lZ`UWXpwMf2`qQ2oQxf^metk2cb8 zfqXX;B-Y1+#JhoXSGndzDAo3%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DuK1NuM#=JlY+3?$!wql; zybYnPg%`VMmqbY!nDpF@3}D^?^KiZS{-n%M8x hX8S{wkAQBlqRNICHU=ib#V`rRfxhK@Bz5$_{{STx3orlx literal 0 HcmV?d00001 diff --git a/docs/images/mcp.svg b/docs/images/mcp.svg new file mode 100644 index 0000000..b39ecaf --- /dev/null +++ b/docs/images/mcp.svg @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..facf209 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,23 @@ +--- +_layout: landing +--- + +# Overview + +The official C# SDK for the [Model Context Protocol](https://modelcontextprotocol.io/), enabling .NET applications, services, and libraries to implement and interact with MCP clients and servers. Please visit our [API documentation](https://modelcontextprotocol.github.io/csharp-sdk/api/ModelContextProtocol.html) for more details on available functionality. + +## About MCP + +The Model Context Protocol (MCP) is an open protocol that standardizes how applications provide context to Large Language Models (LLMs). It enables secure integration between LLMs and various data sources and tools. + +For more information about MCP: + +- [Official Documentation](https://modelcontextprotocol.io/) +- [Protocol Specification](https://spec.modelcontextprotocol.io/) +- [GitHub Organization](https://github.com/modelcontextprotocol) + +For how-to guides, tutorials, and additional guidance, refer to the [official MCP documentation](https://modelcontextprotocol.io/). + +## License + +This project is licensed under the [MIT License](https://github.com/modelcontextprotocol/csharp-sdk/blob/main/LICENSE). diff --git a/docs/toc.yml b/docs/toc.yml new file mode 100644 index 0000000..f63a013 --- /dev/null +++ b/docs/toc.yml @@ -0,0 +1,5 @@ +items: +- name: API Docs + href: api/ModelContextProtocol.yml +- name: Github + href: https://github.com/ModelContextProtocol/csharp-sdk \ No newline at end of file