Browse Source

Enable to skip pdf generating step

jklawreszuk 1 year ago
parent
commit
af6585458c
1 changed files with 18 additions and 2 deletions
  1. 18 2
      BuildDocs.ps1

+ 18 - 2
BuildDocs.ps1

@@ -15,12 +15,16 @@
     Switch parameter. If provided, the script will build documentation in all available languages and include API documentation.
     Switch parameter. If provided, the script will build documentation in all available languages and include API documentation.
 .PARAMETER Version
 .PARAMETER Version
     The Version to build the Docs, the default is the latest version
     The Version to build the Docs, the default is the latest version
+.PARAMETER SkipPdfBuilding
+    Switch parameter. If provided, It skips Pdf generation step.
 .EXAMPLE
 .EXAMPLE
     .\BuildDocs.ps1 -BuildAll
     .\BuildDocs.ps1 -BuildAll
     In this example, the script will build the documentation in all available languages and include API documentation. Use this in GitHub Actions.
     In this example, the script will build the documentation in all available languages and include API documentation. Use this in GitHub Actions.
 .EXAMPLE
 .EXAMPLE
     .\BuildDocs.ps1
     .\BuildDocs.ps1
     In this example, the script will prompt the user to select an operation and an optional language. If the user chooses to build the documentation, the script will also ask if they want to include API documentation.
     In this example, the script will prompt the user to select an operation and an optional language. If the user chooses to build the documentation, the script will also ask if they want to include API documentation.
+.EXAMPLE
+    .\BuildDocs.ps1 -SkipPdfBuilding
 #>
 #>
 
 
 param (
 param (
@@ -30,6 +34,7 @@ param (
         param([string] $CommandName,[string] $ParameterName,[string] $WordToComplete,[System.Management.Automation.Language.CommandAst] $CommandAst,[System.Collections.IDictionary] $FakeBoundParameters)
         param([string] $CommandName,[string] $ParameterName,[string] $WordToComplete,[System.Management.Automation.Language.CommandAst] $CommandAst,[System.Collections.IDictionary] $FakeBoundParameters)
         return (Get-Content $PSScriptRoot\versions.json -Encoding UTF8 | ConvertFrom-Json).versions
         return (Get-Content $PSScriptRoot\versions.json -Encoding UTF8 | ConvertFrom-Json).versions
     })]
     })]
+    [switch]$SkipPdfBuilding,
     $Version = $((Get-Content $PSScriptRoot\versions.json -Encoding UTF8 | ConvertFrom-Json).versions | Sort-Object -Descending | Select-Object -First 1)
     $Version = $((Get-Content $PSScriptRoot\versions.json -Encoding UTF8 | ConvertFrom-Json).versions | Sort-Object -Descending | Select-Object -First 1)
 )
 )
 
 
@@ -189,12 +194,23 @@ function Build-EnglishDoc {
     # Output to both build.log and console
     # Output to both build.log and console
     docfx build en/docfx.json -o $outputDirectory | Write-Host
     docfx build en/docfx.json -o $outputDirectory | Write-Host
 
 
-    # Build pdf files
-    docfx pdf en/docfx.json -o $outputDirectory | Write-Host
+    Build-EnglishPdf -SkipBuilding $SkipPdfBuilding
 
 
     return $LastExitCode
     return $LastExitCode
 }
 }
 
 
+function Build-EnglishPdf
+{
+    param (
+        $SkipBuilding
+    )
+    if(!$SkipBuilding)
+    {
+        # Build pdf files
+        docfx pdf en/docfx.json -o $outputDirectory | Write-Host
+    }
+}
+
 function Build-NonEnglishDoc {
 function Build-NonEnglishDoc {
     param (
     param (
         $SelectedLanguage
         $SelectedLanguage