From 946686521dab15d7725af9d28f4bfd5596ba27d6 Mon Sep 17 00:00:00 2001 From: Sam Ruby Date: Sat, 23 Jun 2018 15:42:12 -0400 Subject: tools: create HTML docs with unified/remark/rehype PR-URL: https://github.com/nodejs/node/pull/21490 Reviewed-By: Vse Mozhet Byt Reviewed-By: Rich Trott --- vcbuild.bat | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) (limited to 'vcbuild.bat') diff --git a/vcbuild.bat b/vcbuild.bat index fa14e321e6..7c88c25ed1 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -255,7 +255,7 @@ goto exit :wix-not-found echo Build skipped. To generate installer, you need to install Wix. -goto build-doc +goto install-doctools :msbuild-found @@ -385,7 +385,7 @@ exit /b 1 :msi @rem Skip msi generation if not requested -if not defined msi goto build-doc +if not defined msi goto install-doctools :msibuild echo Building node-v%FULLVERSION%-%target_arch%.msi @@ -400,7 +400,7 @@ if errorlevel 1 echo Failed to sign msi&goto exit :upload @rem Skip upload if not requested -if not defined upload goto build-doc +if not defined upload goto install-doctools if not defined SSHCONFIG ( echo SSHCONFIG is not set for upload @@ -428,6 +428,23 @@ ssh -F %SSHCONFIG% %STAGINGSERVER% "touch nodejs/%DISTTYPEDIR%/v%FULLVERSION%/no if errorlevel 1 goto exit +:install-doctools +REM only install if building doc OR testing doctool +if not defined doc ( + echo.%test_args% | findstr doctool 1>nul + if errorlevel 1 goto :skip-install-doctools +) +if exist "tools\doc\node_modules\unified\package.json" goto skip-install-doctools +SETLOCAL +cd tools\doc +%npm_exe% install +cd ..\.. +if errorlevel 1 goto exit +ENDLOCAL +:skip-install-doctools +@rem Clear errorlevel from echo.%test_args% | findstr doctool 1>nul +cd . + :build-doc @rem Build documentation if requested if not defined doc goto run @@ -439,14 +456,6 @@ mkdir %config%\doc robocopy /e doc\api %config%\doc\api robocopy /e doc\api_assets %config%\doc\api\assets -if exist "tools\doc\node_modules\js-yaml\package.json" goto doc-skip-js-yaml -SETLOCAL -cd tools\doc -%npm_exe% install -cd ..\.. -if errorlevel 1 goto exit -ENDLOCAL -:doc-skip-js-yaml for %%F in (%config%\doc\api\*.md) do ( %node_exe% tools\doc\generate.js --format=json %%F > %%~dF%%~pF%%~nF.json %node_exe% tools\doc\generate.js --node-version=v%FULLVERSION% --format=html --analytics=%DOCS_ANALYTICS% %%F > %%~dF%%~pF%%~nF.html -- cgit v1.2.3