Skip to content

Commit

Permalink
chore: Fix Node.js prerequisite issues (#10406)
Browse files Browse the repository at this point in the history
chore: fix node.js prerequisite for docfx default command
  • Loading branch information
filzrev authored Nov 20, 2024
1 parent 602f6c9 commit 5dce25b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ In this section we will build a simple documentation site on your local machine.
> Prerequisites
> - Familiarity with the command line
> - Install [.NET SDK](https://dotnet.microsoft.com/en-us/download) 8.0 or higher
> - Install [Node.js](https://nodejs.org/) v20 or higher
> - Install [Node.js](https://nodejs.org/) v20 or higher (Optional: It's required when using [Create PDF Files](https://filzrev.github.io/docfx/docs/pdf.html))
Make sure you have [.NET SDK](https://dotnet.microsoft.com/en-us/download) installed, then open a terminal and enter the following command to install the latest docfx:

Expand Down
7 changes: 2 additions & 5 deletions src/Docfx.App/PdfBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,6 @@ class Outline
public string? pdfFooterTemplate { get; init; }
}

static PdfBuilder()
{
PlaywrightHelper.EnsurePlaywrightNodeJsPath();
}

public static Task Run(BuildJsonConfig config, string configDirectory, string? outputDirectory = null)
{
var outputFolder = Path.GetFullPath(Path.Combine(
Expand All @@ -70,6 +65,8 @@ public static async Task CreatePdf(string outputFolder)
if (pdfTocs.Count == 0)
return;

PlaywrightHelper.EnsurePlaywrightNodeJsPath();

Program.Main(["install", "chromium"]);

var builder = WebApplication.CreateBuilder();
Expand Down

0 comments on commit 5dce25b

Please sign in to comment.