Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ docs/ui/build
docs/ui/public
share/mrdocs/libcxx/
share/mrdocs/clang/
docs/modules/reference
30 changes: 28 additions & 2 deletions CMakeUserPresets.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@
"Clang_ROOT": "$env{HOME}/Developer/cpp-libs/llvm-project/install/debug",
"duktape_ROOT": "$env{HOME}/Developer/cpp-libs/duktape/install/debug",
"Duktape_ROOT": "$env{HOME}/Developer/cpp-libs/duktape/install/debug",
"fmt_ROOT": "$env{HOME}/Developer/cpp-libs/fmt/install/debug",
"libxml2_ROOT": "$env{HOME}/Developer/cpp-libs/libxml2/install/release",
"LibXml2_ROOT": "$env{HOME}/Developer/cpp-libs/libxml2/install/release",
"MRDOCS_BUILD_TESTS": true,
Expand Down Expand Up @@ -238,7 +237,6 @@
"Clang_ROOT": "$env{HOME}/Developer/cpp-libs/llvm-project/install/release",
"duktape_ROOT": "$env{HOME}/Developer/cpp-libs/duktape/install/release",
"Duktape_ROOT": "$env{HOME}/Developer/cpp-libs/duktape/install/release",
"fmt_ROOT": "$env{HOME}/Developer/cpp-libs/fmt/install/release",
"libxml2_ROOT": "$env{HOME}/Developer/cpp-libs/libxml2/install/release",
"LibXml2_ROOT": "$env{HOME}/Developer/cpp-libs/libxml2/install/release",
"MRDOCS_BUILD_TESTS": true,
Expand All @@ -254,6 +252,34 @@
"warnings": {
"unusedCli": false
}
},
{
"name": "release-macos-gcc",
"displayName": "Release macOS (gcc)",
"description": "Preset for building MrDocs in Release mode with the gcc compiler in macOS.",
"inherits": "release",
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"LLVM_ROOT": "$env{HOME}/Developer/cpp-libs/llvm-project/install/release-gcc",
"Clang_ROOT": "$env{HOME}/Developer/cpp-libs/llvm-project/install/release-gcc",
"duktape_ROOT": "$env{HOME}/Developer/cpp-libs/duktape/install/release-gcc",
"Duktape_ROOT": "$env{HOME}/Developer/cpp-libs/duktape/install/release-gcc",
"libxml2_ROOT": "$env{HOME}/Developer/cpp-libs/libxml2/install/release-gcc",
"LibXml2_ROOT": "$env{HOME}/Developer/cpp-libs/libxml2/install/release-gcc",
"MRDOCS_BUILD_TESTS": true,
"MRDOCS_BUILD_DOCS": false,
"MRDOCS_GENERATE_REFERENCE": false,
"MRDOCS_GENERATE_ANTORA_REFERENCE": false
},
"warnings": {
"unusedCli": false
},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Darwin"
}
}
]
}
610 changes: 514 additions & 96 deletions bootstrap.py

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions docs/build_docs.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
@echo off
REM
REM Licensed under the Apache License v2.0 with LLVM Exceptions.
REM See https://llvm.org/LICENSE.txt for license information.
REM SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
REM
REM Copyright (c) 2025 Alan de Freitas ([email protected])
REM
REM Official repository: https://github.com/cppalliance/mrdocs
REM

echo Building documentation UI
set "cwd=%CD%"
set "script_dir=%~dp0"
if not exist "%script_dir%ui\build\ui-bundle.zip" (
echo Building antora-ui
pushd "%script_dir%ui"
call build.bat
popd
)

echo Building documentation with Antora...
echo Installing npm dependencies...
call npm ci

echo Building docs in custom dir...
call npx antora --clean --fetch antora-playbook.yml
echo Done
28 changes: 28 additions & 0 deletions docs/build_local_docs.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
@echo off
REM
REM Licensed under the Apache License v2.0 with LLVM Exceptions.
REM See https://llvm.org/LICENSE.txt for license information.
REM SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
REM
REM Copyright (c) 2025 Alan de Freitas ([email protected])
REM
REM Official repository: https://github.com/cppalliance/mrdocs
REM

echo Building documentation UI
set "cwd=%CD%"
set "script_dir=%~dp0"
if not exist "%script_dir%ui\build\ui-bundle.zip" (
echo Building antora-ui
pushd "%script_dir%ui"
call build.bat
popd
)

echo Building documentation with Antora...
echo Installing npm dependencies...
call npm ci

echo Building docs in custom dir...
call npx antora --clean --fetch antora-playbook.yml --attribute branchesarray=HEAD
echo Done
50 changes: 50 additions & 0 deletions docs/ui/build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
@echo off
REM
REM Licensed under the Apache License v2.0 with LLVM Exceptions.
REM See https://llvm.org/LICENSE.txt for license information.
REM SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
REM
REM Copyright (c) 2025 Alan de Freitas ([email protected])
REM
REM Official repository: https://github.com/cppalliance/mrdocs
REM

REM Check for npm
where npm >nul 2>nul
if errorlevel 1 (
echo npm is not installed
exit /b 1
)

REM Check for npx
where npx >nul 2>nul
if errorlevel 1 (
echo npx is not installed
exit /b 1
)

REM Install modules if needed
if not exist node_modules (
call npm ci
) else (
for %%F in (package.json) do set package_json_time=%%~tF
for %%F in (node_modules) do set node_modules_time=%%~tF
if "%package_json_time%" GTR "%node_modules_time%" (
call npm ci
)
)

REM Lint
call npx gulp lint
if errorlevel 1 (
set msg=Linting failed. Please run `npx gulp format` before pushing your code.
if "%GITHUB_ACTIONS%"=="true" (
echo ::error::%msg%
) else (
echo %msg%
call npx gulp format
)
)

REM Build
call npx gulp
1 change: 0 additions & 1 deletion docs/website/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const assert = require('assert');
const path = require('path');
const {execSync} = require('child_process');


// Read the template file
const templateFile = 'index.html.hbs';
const templateSource = fs.readFileSync(templateFile, 'utf8');
Expand Down
13 changes: 13 additions & 0 deletions test-files/golden-tests/remove_bad_files.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@echo off
REM This script deletes all files matching *.bad.* in the current directory and subdirectories.

setlocal enabledelayedexpansion
set count=0

for /r %%F in (*.bad.*) do (
del "%%F"
set /a count+=1
)

echo Deleted !count! files.
endlocal
Loading