From 55283eb79ba70f67520550408635cd1311a38654 Mon Sep 17 00:00:00 2001 From: Nikolay Borisenko <22616990+nvborisenko@users.noreply.github.com> Date: Sat, 6 May 2023 01:14:48 +0300 Subject: [PATCH] [dotnet] Generate API documentation (#11968) Co-authored-by: Diego Molina --- dotnet/docs/.gitignore | 9 +++++ dotnet/docs/api/.gitignore | 5 +++ dotnet/docs/api/index.md | 2 ++ dotnet/docs/articles/intro.md | 1 + dotnet/docs/articles/toc.yml | 2 ++ dotnet/docs/build.desc | 12 ------- dotnet/docs/docfx.json | 58 ++++++++++++++++++++++++++++++ dotnet/docs/docs.shfbproj | 68 ----------------------------------- dotnet/docs/index.md | 4 +++ dotnet/docs/toc.yml | 5 +++ generate_api_docs.sh | 10 ++++++ 11 files changed, 96 insertions(+), 80 deletions(-) create mode 100644 dotnet/docs/.gitignore create mode 100644 dotnet/docs/api/.gitignore create mode 100644 dotnet/docs/api/index.md create mode 100644 dotnet/docs/articles/intro.md create mode 100644 dotnet/docs/articles/toc.yml delete mode 100644 dotnet/docs/build.desc create mode 100644 dotnet/docs/docfx.json delete mode 100644 dotnet/docs/docs.shfbproj create mode 100644 dotnet/docs/index.md create mode 100644 dotnet/docs/toc.yml diff --git a/dotnet/docs/.gitignore b/dotnet/docs/.gitignore new file mode 100644 index 0000000000000..4378419e7fcbf --- /dev/null +++ b/dotnet/docs/.gitignore @@ -0,0 +1,9 @@ +############### +# folder # +############### +/**/DROP/ +/**/TEMP/ +/**/packages/ +/**/bin/ +/**/obj/ +_site diff --git a/dotnet/docs/api/.gitignore b/dotnet/docs/api/.gitignore new file mode 100644 index 0000000000000..e8079a3bef9d6 --- /dev/null +++ b/dotnet/docs/api/.gitignore @@ -0,0 +1,5 @@ +############### +# temp file # +############### +*.yml +.manifest diff --git a/dotnet/docs/api/index.md b/dotnet/docs/api/index.md new file mode 100644 index 0000000000000..78dc9c005756b --- /dev/null +++ b/dotnet/docs/api/index.md @@ -0,0 +1,2 @@ +# PLACEHOLDER +TODO: Add .NET projects to the *src* folder and run `docfx` to generate **REAL** *API Documentation*! diff --git a/dotnet/docs/articles/intro.md b/dotnet/docs/articles/intro.md new file mode 100644 index 0000000000000..c0478cedea03f --- /dev/null +++ b/dotnet/docs/articles/intro.md @@ -0,0 +1 @@ +# Add your introductions here! diff --git a/dotnet/docs/articles/toc.yml b/dotnet/docs/articles/toc.yml new file mode 100644 index 0000000000000..ff89ef1fe0946 --- /dev/null +++ b/dotnet/docs/articles/toc.yml @@ -0,0 +1,2 @@ +- name: Introduction + href: intro.md diff --git a/dotnet/docs/build.desc b/dotnet/docs/build.desc deleted file mode 100644 index 442b9a68224fb..0000000000000 --- a/dotnet/docs/build.desc +++ /dev/null @@ -1,12 +0,0 @@ -dotnet_docs(name = "docs", - srcs = [ - "//dotnet/src/webdriver:webdriver", - "//dotnet/src/support:support", - "//dotnet/src/core:core", - "//dotnet/src/webdriverbackedselenium:webdriverbackedselenium", - ], - project = "docs.shfbproj", - website = "build/docs/dotnet/web", - helpfile = "WebDriver.chm", - out = "build/dotnet/dist/WebDriver.chm" -) diff --git a/dotnet/docs/docfx.json b/dotnet/docs/docfx.json new file mode 100644 index 0000000000000..8849817c90e27 --- /dev/null +++ b/dotnet/docs/docfx.json @@ -0,0 +1,58 @@ +{ + "metadata": [ + { + "src": [ + { + "files": [ + "src/webdriver/WebDriver.csproj", + "bin/**/*.dll" + ], + "src": "../" + } + ], + "dest": "api", + "includePrivateMembers": false, + "disableGitFeatures": false, + "disableDefaultFilter": false, + "noRestore": false, + "namespaceLayout": "flattened", + "memberLayout": "samePage", + "allowCompilationErrors": false + } + ], + "build": { + "content": [ + { + "files": [ + "api/**.yml", + "api/index.md" + ] + }, + { + "files": [ + "articles/**.md", + "articles/**/toc.yml", + "toc.yml", + "*.md" + ] + } + ], + "resource": [ + { + "files": [ + "images/**" + ] + } + ], + "dest": "../../build/docs/api/dotnet", + "globalMetadataFiles": [], + "fileMetadataFiles": [], + "template": [ + "default", + "modern" + ], + "postProcessors": [], + "keepFileLink": false, + "disableGitFeatures": false + } +} \ No newline at end of file diff --git a/dotnet/docs/docs.shfbproj b/dotnet/docs/docs.shfbproj deleted file mode 100644 index 857ea4de669ce..0000000000000 --- a/dotnet/docs/docs.shfbproj +++ /dev/null @@ -1,68 +0,0 @@ - - - - - Debug - AnyCPU - 2.0 - {5eb412cf-43cf-4f45-ad86-eae23cf68111} - 1.9.5.0 - - Documentation - Documentation - Documentation - - .\ - WebDriver - HtmlHelp1, Website - InheritedMembers, InheritedFrameworkMembers, Protected - .NET Framework 4.0 - VS2010 - - - Summary, Parameter, Returns, AutoDocumentCtors, TypeParameter, AutoDocumentDispose - Copyright &#169%3b 2013 Software Freedom Conservancy - WebDriver - WebDriver Users Google Group - webdriver%40googlegroups.com - Local - MemberName - Standard - Blank - False - False - en-US - AboveNamespaces - - OnlyWarningsAndErrors - False - True - False - False - True - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/dotnet/docs/index.md b/dotnet/docs/index.md new file mode 100644 index 0000000000000..3ae2506361442 --- /dev/null +++ b/dotnet/docs/index.md @@ -0,0 +1,4 @@ +# This is the **HOMEPAGE**. +Refer to [Markdown](http://daringfireball.net/projects/markdown/) for how to write markdown files. +## Quick Start Notes: +1. Add images to the *images* folder if the file is referencing an image. diff --git a/dotnet/docs/toc.yml b/dotnet/docs/toc.yml new file mode 100644 index 0000000000000..59f8010471070 --- /dev/null +++ b/dotnet/docs/toc.yml @@ -0,0 +1,5 @@ +- name: Articles + href: articles/ +- name: Api Documentation + href: api/ + homepage: api/index.md diff --git a/generate_api_docs.sh b/generate_api_docs.sh index 512968faf5e4b..56eb8bf0755ca 100755 --- a/generate_api_docs.sh +++ b/generate_api_docs.sh @@ -13,6 +13,12 @@ rb) bazel run //rb:docs || exit docs="$(bazel cquery --output=files //rb:docs 2> /dev/null).runfiles/selenium/docs/api/rb" ;; +dotnet) + # dotnet sdk should be installed + # bazel should be installed + dotnet tool update -g docfx + docfx dotnet/docs/docfx.json + ;; *) echo "Selenium API docs generation" echo "ERROR: unknown parameter \"$API_DOCS_LANGUAGE\"" @@ -44,6 +50,10 @@ rb) rm -rf docs/api/rb mv $docs docs/api/rb ;; +dotnet) + rm -rf docs/api/dotnet + mv build/docs/api/dotnet docs/api/dotnet + ;; *) echo "ERROR: unknown parameter \"$API_DOCS_LANGUAGE\"" exit 1