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CAAC,CAAC,IAAI,+BAAc,CAChB,QAAQ,EACR,IAAI,CAAC,4BAA4B,CAAC,KAAK,EACvC,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAChC,CAAC;QAEN,cAAc,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;IAC7C,CAAC;CACF;AApDD,gCAoDC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport type { CommandLineFlagParameter, CommandLineChoiceParameter } from '@rushstack/ts-command-line';\n\nimport type { ApiDocumenterCommandLine } from './ApiDocumenterCommandLine';\nimport { BaseAction } from './BaseAction';\n\nimport { YamlDocumenter } from '../documenters/YamlDocumenter';\nimport { OfficeYamlDocumenter } from '../documenters/OfficeYamlDocumenter';\n\nexport class YamlAction extends BaseAction {\n private readonly _officeParameter: CommandLineFlagParameter;\n private readonly _newDocfxNamespacesParameter: CommandLineFlagParameter;\n private readonly _yamlFormatParameter: CommandLineChoiceParameter;\n\n public constructor(parser: ApiDocumenterCommandLine) {\n super({\n actionName: 'yaml',\n summary: 'Generate documentation as universal reference YAML files (*.yml)',\n documentation:\n 'Generates API documentation as a collection of files conforming' +\n ' to the universal reference YAML format, which is used by the docs.microsoft.com' +\n ' pipeline.'\n });\n\n this._officeParameter = this.defineFlagParameter({\n parameterLongName: '--office',\n description: `Enables some additional features specific to Office Add-ins`\n });\n this._newDocfxNamespacesParameter = this.defineFlagParameter({\n parameterLongName: '--new-docfx-namespaces',\n description:\n `This enables an experimental feature that will be officially released with the next major version` +\n ` of API Documenter. It requires DocFX 2.46 or newer. It enables documentation for namespaces and` +\n ` adds them to the table of contents. This will also affect file layout as namespaced items will be nested` +\n ` under a directory for the namespace instead of just within the package.`\n });\n this._yamlFormatParameter = this.defineChoiceParameter({\n parameterLongName: '--yaml-format',\n alternatives: ['udp', 'sdp'],\n defaultValue: 'sdp',\n description:\n `Specifies the YAML format - udp or sdp. Universal Document Processor (udp) should be used if you generating` +\n ` YAML files for DocFX 2.x. Schema Driven Processor (sdp) should be used with DocFX 3.x.` +\n ` NOTE: This parameter is ignored if you use --office.`\n });\n }\n\n protected async onExecute(): Promise<void> {\n // override\n const { apiModel, inputFolder, outputFolder } = this.buildApiModel();\n\n const yamlDocumenter: YamlDocumenter = this._officeParameter.value\n ? new OfficeYamlDocumenter(apiModel, inputFolder, this._newDocfxNamespacesParameter.value)\n : new YamlDocumenter(\n apiModel,\n this._newDocfxNamespacesParameter.value,\n this._yamlFormatParameter.value\n );\n\n yamlDocumenter.generateFiles(outputFolder);\n }\n}\n"]}
\No newline at end of file