From 63a16c873195c2559fe18bf2bef5d4a9d95c53ba Mon Sep 17 00:00:00 2001 From: filzrev <103790468+filzrev@users.noreply.github.com> Date: Thu, 22 Feb 2024 21:37:49 +0900 Subject: [PATCH] docs: Split docfx CLI reference docs based on commands (#9708) docs: split docfx CLI reference docs based on commands --- docs/docs/toc.yml | 3 +- docs/reference/docfx-cli-reference.md | 148 ----------------- .../docfx-cli-reference/docfx-build.md | 142 +++++++++++++++++ .../docfx-cli-reference/docfx-download.md | 43 +++++ .../docfx-cli-reference/docfx-init.md | 35 ++++ .../docfx-cli-reference/docfx-merge.md | 58 +++++++ .../docfx-cli-reference/docfx-metadata.md | 105 ++++++++++++ .../docfx-cli-reference/docfx-pdf.md | 54 +++++++ .../docfx-cli-reference/docfx-serve.md | 56 +++++++ .../docfx-cli-reference/docfx-template.md | 56 +++++++ docs/reference/docfx-cli-reference/docfx.md | 150 ++++++++++++++++++ .../reference/docfx-cli-reference/overview.md | 42 +++++ docs/reference/docfx-cli-reference/toc.yml | 10 ++ src/docfx/Models/BuildCommandOptions.cs | 2 +- 14 files changed, 754 insertions(+), 150 deletions(-) delete mode 100644 docs/reference/docfx-cli-reference.md create mode 100644 docs/reference/docfx-cli-reference/docfx-build.md create mode 100644 docs/reference/docfx-cli-reference/docfx-download.md create mode 100644 docs/reference/docfx-cli-reference/docfx-init.md create mode 100644 docs/reference/docfx-cli-reference/docfx-merge.md create mode 100644 docs/reference/docfx-cli-reference/docfx-metadata.md create mode 100644 docs/reference/docfx-cli-reference/docfx-pdf.md create mode 100644 docs/reference/docfx-cli-reference/docfx-serve.md create mode 100644 docs/reference/docfx-cli-reference/docfx-template.md create mode 100644 docs/reference/docfx-cli-reference/docfx.md create mode 100644 docs/reference/docfx-cli-reference/overview.md create mode 100644 docs/reference/docfx-cli-reference/toc.yml diff --git a/docs/docs/toc.yml b/docs/docs/toc.yml index 3f1c7a4b9c6..711c69513ac 100644 --- a/docs/docs/toc.yml +++ b/docs/docs/toc.yml @@ -17,7 +17,8 @@ - name: Reference - href: ../reference/docfx-json-reference.md -- href: ../reference/docfx-cli-reference.md +- name: Commandline Reference + href: ../reference/docfx-cli-reference/toc.yml - href: ../reference/docfx-environment-variables-reference.md - href: api-page.yml diff --git a/docs/reference/docfx-cli-reference.md b/docs/reference/docfx-cli-reference.md deleted file mode 100644 index efe6bdf5c54..00000000000 --- a/docs/reference/docfx-cli-reference.md +++ /dev/null @@ -1,148 +0,0 @@ -# Commandline Reference - -## Introduction - -`docfx` is used to generate documentation for programs. It has the ability to: - -1. Extract language metadata for programing languages as defined in [Metadata Format Specification](../spec/metadata_format_spec.md). Currently `C#` and `VB` are supported (although see note below regarding `VB` support). The language metadata is saved in `YAML` format as described in [YAML 1.2][1]. -2. Look for available conceptual files as provided and link them with existing programs using the syntax described in [Metadata Yaml Format](../spec/metadata_format_spec.md). Supported conceptual files are *plain text* files, *html* files, and *markdown* files. -3. Generate documentation to - a. Visualize language metadata, with extra **content** provided by linked conceptual files using the syntax described in [Metadata Yaml Format](../spec/metadata_format_spec.md). - b. Organize and render available conceptual files which can be easily cross-referenced with language metadata pages. Docfx supports **Docfx Flavored Markdown(DFM)** for writing conceptual files. **DFM** supports all *Github Flavored Markdown(GFM)* syntax with 2 exceptions when resolving [list](../docs/markdown.md#differences-introduced-by-dfm-syntax). It also adds several new features including *file inclusion*, *cross reference*, and *yaml header*. For detailed description about DFM, please refer to [DFM](../spec/docfx_flavored_markdown.md). - -> [!NOTE] -> Although Docfx is able to process `VB` projects and individual `VB` source code files and extract metadata from them, the documentation output from Docfx is always in `C#` format, i.e. types and member signatures, etc., are shown in `C#` format and not `VB` format. - -Currently generating documentation to a *client only* **website** is supported. The generated **website** can be easily published to whatever platform such as *Github Pages* and *Azure Website* with little extra effort. - -Generating offline documentation such as **PDF** is also supported. - -## Syntax - -``` -docfx [] -``` - -Run `docfx --version` to get the version of the docfx. - -Run `docfx --help` or `docfx -h` to get a list of all available commands and options. Run `docfx --help` or `docfx -h` to get help on a specific command. - -## Commands - -### Init command `docfx init` -`docfx init` helps generate an `docfx.json` file. - -### Extract language metadata command `docfx metadata` - -**Syntax** -``` -docfx metadata [] [--property =;=] -``` - -**Layout** -``` -|-- - |-- api - | |-- .yml - | |-- .yml - |-- toc.yml - |-- index.yml -``` - - -#### Optional arguments for the `docfx metadata` command - -* **`` argument (optional)** - - `` specifies the projects to have metadata extracted. There are several approaches to extract language metadata. - - 1. From a supported file or file list - Supported file extensions include `.csproj`, `.vbproj`, `.sln`, `.slnf`, `exe`, `dll` assembly file, `.cs` source file and `.vb` source file. - - Multiple files are separated by whitespace, e.g. `docfx metadata Class1.cs a.csproj` - - > [!Note] - > Glob pattern is **NOT** supported in command line options. - - 2. From *docfx.json* file, as described in **Section3**. - - 3. If the argument is not specified, `docfx` will try reading `docfx.json` under current directory. - - The default output folder is `_site/` folder if it is not specified in `docfx.json` under current directory. - -* **`--shouldSkipMarkup` command option** - - If adding option `--shouldSkipMarkup` in metadata command, it means that DocFX would not render triple-slash-comments in source code as markdown. - - e.g. `docfx metadata --shouldSkipMarkup` - -* **`--property =;=` command option** - -An optional set of MSBuild properties used when interpreting project files. These are the same properties that are passed to msbuild via the /property:=;= command line argument. -For example: `docfx metadata --property TargetFramework=net48` generates metadata files with .NET framework 4.8. This command can be used when the project supports multiple `TargetFrameworks`. - -### Generate documentation command `docfx build` - -**Syntax** -``` -docfx build [-o:] [-t: