diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4b735644c2..1f1c97eef1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,13 +9,10 @@ on: tags: - "v*.*.*" - # pull_request runs the matrix/build on the PR head with the fork-scoped token - # (no comment perms on base repo). pull_request: branches: - develop - concurrency: group: ${{format('{0}:{1}', github.repository, github.ref)}} cancel-in-progress: true @@ -23,27 +20,12 @@ concurrency: jobs: cpp-matrix: runs-on: ubuntu-24.04 - container: - image: ubuntu:24.04 name: Generate Test Matrix - # Permissions allow Danger to read PR context and post comments. - permissions: - contents: read - pull-requests: write outputs: matrix: ${{ steps.cpp-matrix.outputs.matrix }} llvm-matrix: ${{ steps.llvm-matrix.outputs.llvm-matrix }} releases-matrix: ${{ steps.releases-matrix.outputs.releases-matrix }} steps: - - name: Install prerequisites - run: | - set -e - apt-get update - apt-get install -y git ca-certificates curl nodejs npm - if ! command -v node >/dev/null 2>&1 && command -v nodejs >/dev/null 2>&1; then - ln -s /usr/bin/nodejs /usr/bin/node - fi - - name: Checkout uses: actions/checkout@v4 @@ -58,6 +40,7 @@ jobs: apple-clang * standards: '20' latest-factors: | + msvc Optimized-Debug gcc UBSan Coverage clang UBSan ASan MSan apple-clang UBSan ASan @@ -72,17 +55,22 @@ jobs: clang: Release apple-clang: Release msvc: RelWithDebInfo + msvc Optimized-Debug: Debug + ccflags: | + msvc Optimized-Debug: /Ob1 /O2 /Zi + cxxflags: | + msvc Optimized-Debug: /Ob1 /O2 /Zi install: | - gcc: git build-essential pkg-config python3 curl unzip openjdk-11-jdk pkg-config libncurses-dev libxml2-utils libxml2-dev - gcc Coverage: git build-essential pkg-config python3 curl unzip openjdk-11-jdk pkg-config libncurses-dev libxml2-utils libxml2-dev lcov - clang: git build-essential pkg-config python3 curl unzip openjdk-11-jdk pkg-config libncurses-dev libxml2-utils libxml2-dev g++-14=14.2.0-4ubuntu2~24.04 + gcc: git build-essential pkg-config python3 curl openjdk-11-jdk pkg-config libncurses-dev libxml2-utils libxml2-dev + gcc Coverage: git build-essential pkg-config python3 curl openjdk-11-jdk pkg-config libncurses-dev libxml2-utils libxml2-dev lcov + clang: git build-essential pkg-config python3 curl openjdk-11-jdk pkg-config libncurses-dev libxml2-utils libxml2-dev g++-14=14.2.0-4ubuntu2~24.04 msvc: '' extra-values: | use-libcxx: {{#if (and (ieq compiler 'clang') (ge major 19)) }}true{{else}}false{{/if}} libcxx-runtimes: libcxx{{#if (ne compiler 'msvc')}};libcxxabi{{/if}} llvm-runtimes: {{#if (ine use-libcxx 'true') }}{{{ libcxx-runtimes }}}{{/if}} llvm-hash: dc4cef81d47c7bc4a3c4d58fbacf8a6359683fae - llvm-build-preset-prefix: {{{lowercase build-type}}} + llvm-build-preset-prefix: {{#if optimized-debug}}optimizeddebug{{else}}{{{lowercase build-type}}}{{/if}} llvm-build-preset-os: {{#if (ieq os 'windows') }}win{{else}}unix{{/if}} llvm-sanitizer: {{#if (eq compiler 'gcc')}}{{else if ubsan}}-UBSan{{else if asan}}-ASan{{else if msan}}-MSan{{/if}} llvm-build-preset: {{{ llvm-build-preset-prefix }}}-{{{ llvm-build-preset-os }}} @@ -146,16 +134,6 @@ jobs: contents: write steps: - - name: Ensure Node - if: matrix.container != '' && env.ACT == 'true' - run: | - set -e - apt-get update - apt-get install -y nodejs npm - if ! command -v node >/dev/null 2>&1 && command -v nodejs >/dev/null 2>&1; then - ln -s /usr/bin/nodejs /usr/bin/node - fi - # We install git if we are using a container because # containers don't always include git. # We need git to ensure actions/checkout@v4 will use git and @@ -196,55 +174,6 @@ jobs: compiler: ${{ matrix.compiler }} version: ${{ matrix.version }} - - name: Configure symbolizer paths - if: matrix.compiler != 'msvc' - shell: bash - run: | - set -e - candidates=() - # 1) Anything on PATH - if command -v llvm-symbolizer >/dev/null 2>&1; then - candidates+=("$(command -v llvm-symbolizer)") - fi - uname_out="$(uname -s || true)" - # 2) Platform-specific common locations - case "$uname_out" in - Darwin) - if xcrun --find llvm-symbolizer >/dev/null 2>&1; then - candidates+=("$(xcrun --find llvm-symbolizer)") - fi - candidates+=("/opt/homebrew/opt/llvm/bin/llvm-symbolizer") - ;; - Linux) - for dir in /usr/lib/llvm-* /usr/lib/llvm; do - if [ -x "$dir/bin/llvm-symbolizer" ]; then - candidates+=("$dir/bin/llvm-symbolizer") - fi - done - ;; - MINGW*|MSYS*|CYGWIN*) - for dir in "/c/Program Files/LLVM/bin" "/c/ProgramData/chocolatey/lib/llvm/tools/llvm/bin"; do - if [ -x "$dir/llvm-symbolizer.exe" ]; then - candidates+=("$dir/llvm-symbolizer.exe") - fi - done - ;; - esac - sym="" - for c in "${candidates[@]}"; do - if [ -n "$c" ] && [ -x "$c" ]; then - sym="$c" - break - fi - done - if [ -n "$sym" ]; then - echo "Using llvm-symbolizer at: $sym" - echo "LLVM_SYMBOLIZER_PATH=$sym" >> "$GITHUB_ENV" - echo "ASAN_SYMBOLIZER_PATH=$sym" >> "$GITHUB_ENV" - else - echo "Warning: llvm-symbolizer not found; ASan stacks may be unsymbolized." >&2 - fi - # If apple-clang on macos, select the newest Xcode. - name: Select Xcode 16.4 if: matrix.compiler == 'apple-clang' @@ -332,6 +261,36 @@ jobs: path: ${{ steps.rmatrix.outputs.llvm-path }} key: ${{ matrix.llvm-archive-basename }} + - name: Download LLVM Binaries + id: llvm-download + if: steps.llvm-cache.outputs.cache-hit != 'true' + run: | + set -x + url=https://mrdocs.com/llvm+clang/${{ matrix.llvm-archive-filename }} + http_status=$(curl -s -o /dev/null -w "%{http_code}" -I "$url") + if [ "$http_status" -eq 200 ]; then + found="true" + echo "found=$found" >> $GITHUB_OUTPUT + curl -L -o ${{ matrix.llvm-archive-filename }} "$url" + install_prefix=${{ steps.rmatrix.outputs.llvm-path }} + mkdir -p $install_prefix + if [[ ${{ matrix.llvm-archive-extension }} == '7z' ]]; then + 7z x ${{ matrix.llvm-archive-filename }} -o$install_prefix + else + tar -xjf ${{ matrix.llvm-archive-filename }} -C $install_prefix + fi + if [[ $(ls -1 $install_prefix | wc -l) -eq 1 ]]; then + single_dir=$(ls -1 $install_prefix) + if [[ -d $install_prefix/$single_dir ]]; then + mv $install_prefix/$single_dir/* $install_prefix/ + rmdir $install_prefix/$single_dir + fi + fi + else + found="false" + echo "found=$found" >> $GITHUB_OUTPUT + fi + # Installs libc++ separately, using the LLVM standalone runtimes build. # The libc++ built here will be built using the host compiler, so this is # limited by what libc++ at the current LLVM revision supports. @@ -345,27 +304,16 @@ jobs: # FIXME: Build this for the GCC and MacOS sanitizer jobs. # Currently GCC fails linking it, and for MacOS there are compiler-rt # requirements not satisfied. - - name: Fetch LLVM source archive - if: steps.llvm-cache.outputs.cache-hit != 'true' - run: | - set -eux - mkdir -p ../third-party - cd ../third-party - archive="llvm-${{ matrix.llvm-hash }}.zip" - if [ ! -d llvm-project ]; then - curl -L -o "$archive" "https://github.com/llvm/llvm-project/archive/${{ matrix.llvm-hash }}.zip" - unzip -q "$archive" - mv "llvm-project-${{ matrix.llvm-hash }}" llvm-project - rm "$archive" - fi - - name: Install libc++ id: install_libcxx uses: alandefreitas/cpp-actions/cmake-workflow@v1.8.12 - if: matrix.use-libcxx == 'true' && steps.llvm-cache.outputs.cache-hit != 'true' + if: matrix.use-libcxx == 'true' && steps.llvm-cache.outputs.cache-hit != 'true' && steps.llvm-download.outputs.found != 'true' with: cmake-version: '>=3.26' source-dir: ../third-party/llvm-project/runtimes + git-repository: https://github.com/llvm/llvm-project.git + git-tag: ${{ matrix.llvm-hash }} + download-dir: ../third-party/llvm-project build-dir: ${sourceDir}/build build-type: ${{ matrix.build-type }} extra-args: | @@ -396,13 +344,16 @@ jobs: - name: Install LLVM id: install_llvm uses: alandefreitas/cpp-actions/cmake-workflow@v1.8.12 - if: steps.llvm-cache.outputs.cache-hit != 'true' + if: steps.llvm-cache.outputs.cache-hit != 'true' && steps.llvm-download.outputs.found != 'true' with: cmake-version: '>=3.26' source-dir: ../third-party/llvm-project/llvm + git-repository: https://github.com/llvm/llvm-project.git + git-tag: ${{ matrix.llvm-hash }} + download-dir: ../third-party/llvm-project patches: | - ./third-party/patches/llvm/llvm/CMakePresets.json - ./third-party/patches/llvm/llvm/CMakeUserPresets.json + ./third-party/llvm/CMakePresets.json + ./third-party/llvm/CMakeUserPresets.json build-dir: ${sourceDir}/build preset: ${{ matrix.llvm-build-preset }} build-type: ${{ matrix.build-type }} @@ -438,8 +389,8 @@ jobs: source-dir: ../third-party/duktape url: https://github.com/svaarala/duktape/releases/download/v2.7.0/duktape-2.7.0.tar.xz patches: | - ./third-party/patches/duktape/CMakeLists.txt - ./third-party/patches/duktape/duktapeConfig.cmake.in + ./third-party/duktape/CMakeLists.txt + ./third-party/duktape/duktapeConfig.cmake.in build-dir: ${sourceDir}/build cc: ${{ steps.setup-cpp.outputs.cc }} cxx: ${{ steps.setup-cpp.outputs.cxx }} @@ -458,8 +409,8 @@ jobs: source-dir: ../third-party/lua url: https://github.com/lua/lua/archive/refs/tags/v5.4.8.tar.gz patches: | - ./third-party/patches/lua/CMakeLists.txt - ./third-party/patches/lua/LuaConfig.cmake.in + ./third-party/lua/CMakeLists.txt + ./third-party/lua/LuaConfig.cmake.in build-dir: ${sourceDir}/build cc: ${{ steps.setup-cpp.outputs.cc }} cxx: ${{ steps.setup-cpp.outputs.cxx }} @@ -533,9 +484,6 @@ jobs: - name: CMake Workflow uses: alandefreitas/cpp-actions/cmake-workflow@v1.8.12 - env: - # Bump per-test timeout on Windows to avoid CTest default (1500s) killing slow golden suites. - CTEST_TEST_TIMEOUT: ${{ runner.os == 'Windows' && '3600' || '' }} with: cmake-version: '>=3.26' cxxstd: ${{ matrix.cxxstd }} @@ -671,9 +619,8 @@ jobs: done dir="./build" - lcov --rc lcov_branch_coverage=0 --gcov-tool "$gcov_tool" --directory "$dir" --capture --output-file "$dir/all.info" --ignore-errors inconsistent,negative --no-external - lcov --rc lcov_branch_coverage=0 --remove "$dir/all.info" "/usr/*" "/lib/*" "/opt/*" --ignore-errors unused,negative --output-file "$dir/all.info" - lcov --rc lcov_branch_coverage=0 --ignore-errors inconsistent,negative --list "$dir/all.info" + lcov --rc lcov_branch_coverage=0 --gcov-tool "$gcov_tool" --directory "$dir" --capture --output-file "$dir/all.info" --ignore-errors inconsistent + lcov --rc lcov_branch_coverage=0 --ignore-errors inconsistent --list "$dir/all.info" echo "file=$(realpath "$dir/all.info")" >> $GITHUB_OUTPUT - name: Upload Coverage as Artifact @@ -714,16 +661,6 @@ jobs: contents: write steps: - - name: Ensure Node - if: matrix.container != '' && env.ACT == 'true' - run: | - set -e - apt-get update - apt-get install -y nodejs npm - if ! command -v node >/dev/null 2>&1 && command -v nodejs >/dev/null 2>&1; then - ln -s /usr/bin/nodejs /usr/bin/node - fi - - name: Install packages uses: alandefreitas/cpp-actions/package-install@v1.8.12 id: package-install @@ -881,17 +818,6 @@ jobs: npx gulp lint npx gulp - - name: Ensure all refs for Antora - if: github.event_name == 'push' && (contains(fromJSON('["master", "develop"]'), github.ref_name) || startsWith(github.ref, 'refs/tags/')) && runner.os == 'Linux' - run: | - set -euo pipefail - # Make sure Antora sees every branch and tag from the upstream repo, - # regardless of who triggered the workflow. - git remote set-url origin https://github.com/cppalliance/mrdocs.git - git fetch --prune --prune-tags origin \ - '+refs/heads/*:refs/remotes/origin/*' \ - '+refs/tags/*:refs/tags/*' - - name: Generate Remote Documentation working-directory: docs run: | @@ -1009,7 +935,6 @@ jobs: root="$(pwd)/demos/$project/$variant" src="$root/adoc" dst="$root/adoc-asciidoc" - stylesheet="$(pwd)/share/mrdocs/addons/generator/common/layouts/style.css" # Create the top-level output dir mkdir -p "$dst" @@ -1020,7 +945,7 @@ jobs: rel="${f#"$src/"}" # path relative to $src outdir="$dst/$(dirname "$rel")" # mirror subdir inside $dst mkdir -p "$outdir" - asciidoctor -a stylesheet="${stylesheet}" -D "$outdir" "$f" + asciidoctor -D "$outdir" "$f" done done fi @@ -1192,16 +1117,6 @@ jobs: contents: write steps: - - name: Ensure Node - if: matrix.container != '' && env.ACT == 'true' - run: | - set -e - apt-get update - apt-get install -y nodejs npm - if ! command -v node >/dev/null 2>&1 && command -v nodejs >/dev/null 2>&1; then - ln -s /usr/bin/nodejs /usr/bin/node - fi - # This calculates a couple of variables, which would normally go in to the regular matrix extra-values # section, but which depend on paths not known at that point. - name: Resolved Matrix @@ -1224,9 +1139,69 @@ jobs: with: apt-get: ${{ matrix.install }} + - name: Check website releases + id: website-releases + run: | + set -x + archive_url="https://mrdocs.com/llvm+clang/${{ matrix.llvm-archive-filename }}" + http_status=$(curl -s -o /dev/null -w "%{http_code}" -I "$archive_url") + if [ "$http_status" -eq 200 ]; then + exists="true" + else + exists="false" + fi + echo "exists=$exists" >> $GITHUB_OUTPUT + - name: LLVM Binaries id: llvm-cache + if: steps.website-releases.outputs.exists != 'true' uses: actions/cache@v4 with: path: ${{ steps.rmatrix.outputs.llvm-path }} key: ${{ matrix.llvm-archive-basename }} + + - name: Compress LLVM + id: llvm-upload + if: steps.llvm-cache.outputs.cache-hit == 'true' + shell: bash + run: | + # LLVM is be installed with the default compiler + set -x + + # Use 7z on windows + if [[ ${{ runner.os }} == 'Windows' ]]; then + 7z a -t7z -m0=lzma2 -mx=9 -mfb=64 -md=32m -ms=on "${{ matrix.llvm-archive-filename }}" "${{ steps.rmatrix.outputs.llvm-path }}" + else + tar -cjf "${{ matrix.llvm-archive-filename }}" -C "${{ steps.rmatrix.outputs.llvm-path }}/.." llvm + fi + + - name: Website LLVM Releases + if: steps.llvm-cache.outputs.cache-hit == 'true' && github.event_name == 'push' && (contains(fromJSON('["master", "develop"]'), github.ref_name) || startsWith(github.ref, 'refs/tags/')) + run: | + set -x + + # Ensure required commands exist + for cmd in ssh-keyscan ssh-agent ssh-add scp; do + if ! command -v $cmd >/dev/null; then + echo "$cmd not found" + exit 1 + fi + done + + # Add SSH key + mkdir -p ~/.ssh + ssh-keyscan dev-websites.cpp.al >> ~/.ssh/known_hosts + chmod 600 ~/.ssh/known_hosts + echo "${{ secrets.DEV_WEBSITES_SSH_KEY }}" > ~/.ssh/github_actions + chmod 600 ~/.ssh/github_actions + + # Start ssh-agent and add the key + SSH_AUTH_SOCK="$RUNNER_TEMP/ssh_agent.sock" + export SSH_AUTH_SOCK + ssh-agent -a $SSH_AUTH_SOCK > /dev/null + ssh-add ~/.ssh/github_actions + + # Copy llvm archive: This step will copy the archive to www.mrdocs.com/llvm+clang + llvm_dir="/var/www/mrdox.com/llvm+clang" + chmod 755 ${{ matrix.llvm-archive-filename }} + scp -o StrictHostKeyChecking=no $(pwd)/${{ matrix.llvm-archive-filename }} ubuntu@dev-websites.cpp.al:$llvm_dir/ diff --git a/.github/workflows/pr-target-checks.yml b/.github/workflows/pr-target-checks.yml deleted file mode 100644 index e9024afb47..0000000000 --- a/.github/workflows/pr-target-checks.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: PR Target Checks - -on: - # Uses base-repo token and never executes PR code. - pull_request_target: - branches: - - develop - -concurrency: - group: ${{ format('{0}:{1}:{2}', github.repository, github.ref, github.event_name) }} - cancel-in-progress: true - -jobs: - repo-checks: - name: Base-token checks - runs-on: ubuntu-24.04 - permissions: - contents: read - pull-requests: write - issues: write - statuses: write - steps: - - name: Checkout base revision - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: 20 - - - name: Install repo-check tools - run: npm --prefix util/danger ci - - - name: Repo checks (Danger.js) - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: npx --prefix util/danger danger ci --dangerfile util/danger/dangerfile.ts diff --git a/.gitignore b/.gitignore index d087b6de0e..fe65040f97 100644 --- a/.gitignore +++ b/.gitignore @@ -20,12 +20,6 @@ /share/mrdocs/libcxx/ /share/mrdocs/clang/ /docs/modules/reference -/node_modules /.gdbinit /.lldbinit -/.github/node_modules/ -/util/danger/node_modules/ -/.roadmap -/AGENTS.md -# Ignore hidden OS files under golden fixtures -test-files/golden-tests/**/.* +/.github/node_modules/ \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index cd2db0f870..eb3aa42bcd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -527,24 +527,6 @@ if (MRDOCS_BUILD_TESTS) set(MRDOCS_SELF_DOC_OUTPUT "${CMAKE_BINARY_DIR}/docs/self-reference") set(MRDOCS_SELF_DOC_TAGFILE "${MRDOCS_SELF_DOC_OUTPUT}/reference.tag.xml") - add_test(NAME mrdocs-self-doc - COMMAND - mrdocs - "${CMAKE_SOURCE_DIR}/CMakeLists.txt" - "--config=${CMAKE_SOURCE_DIR}/docs/mrdocs.yml" - "--output=${MRDOCS_SELF_DOC_OUTPUT}" - --generator=adoc - "--addons=${CMAKE_SOURCE_DIR}/share/mrdocs/addons" - "--stdlib-includes=${LIBCXX_DIR}" - "--stdlib-includes=${STDLIB_INCLUDE_DIR}" - "--libc-includes=${CMAKE_SOURCE_DIR}/share/mrdocs/headers/libc-stubs" - "--tagfile=${MRDOCS_SELF_DOC_TAGFILE}" - --multipage=true - --concurrency=16 - --log-level=debug - $<$:--warn-as-error=true> - ) - #------------------------------------------------- # XML lint #------------------------------------------------- diff --git a/CMakeUserPresets.json.example b/CMakeUserPresets.json.example new file mode 100644 index 0000000000..e04454a031 --- /dev/null +++ b/CMakeUserPresets.json.example @@ -0,0 +1,438 @@ +{ + "version": 3, + "cmakeMinimumRequired": { + "major": 3, + "minor": 10, + "patch": 0 + }, + "configurePresets": [ + { + "name": "debug-msvc", + "displayName": "Debug MSVC", + "description": "Build on Windows + MSVC natively (Debug)", + "inherits": "debug", + "generator": "Ninja", + "binaryDir": "${sourceDir}/build/${presetName}", + "cacheVariables": { + "LLVM_ROOT": "C:\\Users\\$env{USERNAME}\\Libraries\\llvm\\install\\MSVC\\Debug", + "Clang_ROOT": "C:\\Users\\$env{USERNAME}\\Libraries\\llvm\\install\\MSVC\\Debug", + "CMAKE_EXPORT_COMPILE_COMMANDS": "ON", + "CMAKE_CXX_FLAGS": "/W4", + "CMAKE_C_FLAGS": "/W4" + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Windows" + } + }, + { + "name": "release-msvc", + "displayName": "Release MSVC", + "description": "Build on Windows + MSVC natively (Release)", + "inherits": "debug-msvc", + "binaryDir": "${sourceDir}/build/${presetName}", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release", + "LLVM_ROOT": "C:\\Users\\$env{USERNAME}\\Libraries\\llvm\\Release", + "Clang_ROOT": "C:\\Users\\$env{USERNAME}\\Libraries\\llvm\\Release" + } + }, + { + "name": "debug-wsl-gcc", + "displayName": "Debug WSL GCC", + "description": "Build on WSL + GCC (Debug). Windows developers can use this preset to catch GCC-specific issues with WSL. WSL tends to be very slow, so this is not recommended for interactive development.", + "inherits": "debug", + "binaryDir": "${sourceDir}/build/${presetName}", + "cacheVariables": { + "CMAKE_CXX_COMPILER": "/usr/bin/g++", + "CMAKE_C_COMPILER": "/usr/bin/gcc", + "LLVM_ROOT": "${sourceDir}/build/third-party/llvm", + "Clang_ROOT": "${sourceDir}/build/third-party/llvm", + "CMAKE_EXPORT_COMPILE_COMMANDS": "ON", + "CMAKE_CXX_FLAGS": "-Wall -Wextra -Werror", + "CMAKE_C_FLAGS": "-Wall -Wextra -Werror" + }, + "vendor": { + "microsoft.com/VisualStudioSettings/CMake/1.0": { + "hostOS": [ + "Linux" + ], + "intelliSenseMode": "windows-msvc-x64" + }, + "jetbrains.com/clion": { + "toolchain": "WSL GCC" + } + } + }, + { + "name": "debug-wsl-gcc-asan", + "displayName": "Debug WSL GCC AddressSanitizer", + "description": "Build on WSL + GCC with AddressSanitizer (Debug). This is useful for catching memory issues.", + "inherits": "debug-wsl-gcc", + "binaryDir": "${sourceDir}/build/${presetName}", + "cacheVariables": { + "CMAKE_CXX_FLAGS": "-fsanitize=address -fno-omit-frame-pointer -g -O0 -fno-inline-functions" + } + }, + { + "name": "release-wsl-gcc", + "displayName": "Release WSL GCC", + "description": "Build on WSL + GCC (Release). Windows developers can use this preset to catch GCC-specific issues with WSL. WSL tends to be very slow, so this is not recommended for interactive development.", + "inherits": "debug-wsl-gcc", + "binaryDir": "${sourceDir}/build/${presetName}", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release", + "LLVM_ROOT": "${sourceDir}/build/third-party/llvm-project/llvm/install/Linux/Release", + "Clang_ROOT": "${sourceDir}/build/third-party/llvm-project/llvm/install/Linux/Release" + } + }, + { + "name": "relwithdebinfo-wsl-gcc", + "displayName": "RelWithDebInfo WSL GCC", + "description": "Build on WSL + GCC (RelWithDebInfo). Windows developers can use this preset to catch GCC-specific issues with WSL. WSL tends to be very slow, so this is not recommended for interactive development.", + "inherits": "debug-wsl-gcc", + "binaryDir": "${sourceDir}/build/${presetName}", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "RelWithDebInfo", + "LLVM_ROOT": "${sourceDir}/build/third-party/llvm-project/llvm/install/Linux/Release", + "Clang_ROOT": "${sourceDir}/build/third-party/llvm-project/llvm/install/Linux/Release" + } + }, + { + "name": "debug-wsl-clang", + "displayName": "Debug WSL Clang", + "description": "Build on WSL + Clang (Debug). Windows developers can use this preset to catch Clang-specific issues with WSL. WSL tends to be very slow, so this is not recommended for interactive development.", + "inherits": "debug-wsl-gcc", + "binaryDir": "${sourceDir}/build/${presetName}", + "cacheVariables": { + "CMAKE_CXX_COMPILER": "/usr/bin/clang++-16", + "CMAKE_C_COMPILER": "/usr/bin/clang-16" + }, + "vendor": { + "jetbrains.com/clion": { + "toolchain": "WSL Clang" + } + } + }, + { + "name": "debug-macos", + "displayName": "Debug (macOS)", + "description": "Preset for building MrDocs in Debug mode with the default compiler in macOS.", + "inherits": "debug", + "binaryDir": "${sourceDir}/build/${presetName}", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "LLVM_ROOT": "${sourceDir}/build/third-party/llvm-project/install/debug", + "Clang_ROOT": "${sourceDir}/build/third-party/llvm-project/install/debug", + "duktape_ROOT": "${sourceDir}/build/third-party/duktape/install/debug", + "Duktape_ROOT": "${sourceDir}/build/third-party/duktape/install/debug", + "libxml2_ROOT": "${sourceDir}/build/third-party/libxml2/install/release", + "LibXml2_ROOT": "${sourceDir}/build/third-party/libxml2/install/release", + "MRDOCS_BUILD_TESTS": true, + "MRDOCS_BUILD_DOCS": false, + "MRDOCS_GENERATE_REFERENCE": false, + "MRDOCS_GENERATE_ANTORA_REFERENCE": false, + "CMAKE_MAKE_PROGRAM": "${sourceDir}/build/third-party/ninja/ninja", + "CMAKE_CXX_FLAGS": "-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE" + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Darwin" + }, + "warnings": { + "unusedCli": false + }, + "generator": "Ninja" + }, + { + "name": "debug-macos-fast", + "displayName": "Debug with Optimized Dependencies (macOS)", + "description": "Preset for building MrDocs in Debug mode with the default compiler in macOS.", + "inherits": "debug", + "binaryDir": "${sourceDir}/build/${presetName}", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "LLVM_ROOT": "${sourceDir}/build/third-party/llvm-project/install/release", + "Clang_ROOT": "${sourceDir}/build/third-party/llvm-project/install/release", + "duktape_ROOT": "${sourceDir}/build/third-party/duktape/install/release", + "Duktape_ROOT": "${sourceDir}/build/third-party/duktape/install/release", + "libxml2_ROOT": "${sourceDir}/build/third-party/libxml2/install/release", + "LibXml2_ROOT": "${sourceDir}/build/third-party/libxml2/install/release", + "MRDOCS_BUILD_TESTS": true, + "MRDOCS_BUILD_DOCS": false, + "MRDOCS_GENERATE_REFERENCE": false, + "MRDOCS_GENERATE_ANTORA_REFERENCE": false, + "CMAKE_MAKE_PROGRAM": "${sourceDir}/build/third-party/ninja/ninja", + "CMAKE_CXX_FLAGS": "-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE" + }, + "warnings": { + "unusedCli": false + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Darwin" + }, + "generator": "Ninja" + }, + { + "name": "release-macos", + "displayName": "Release (macOS)", + "description": "Preset for building MrDocs in Release mode with the default compiler in macOS.", + "inherits": "release", + "binaryDir": "${sourceDir}/build/${presetName}", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release", + "LLVM_ROOT": "${sourceDir}/build/third-party/llvm-project/install/release", + "Clang_ROOT": "${sourceDir}/build/third-party/llvm-project/install/release", + "duktape_ROOT": "${sourceDir}/build/third-party/duktape/install/release", + "Duktape_ROOT": "${sourceDir}/build/third-party/duktape/install/release", + "libxml2_ROOT": "${sourceDir}/build/third-party/libxml2/install/release", + "LibXml2_ROOT": "${sourceDir}/build/third-party/libxml2/install/release", + "MRDOCS_BUILD_TESTS": true, + "MRDOCS_BUILD_DOCS": false, + "MRDOCS_GENERATE_REFERENCE": false, + "MRDOCS_GENERATE_ANTORA_REFERENCE": false, + "CMAKE_MAKE_PROGRAM": "${sourceDir}/build/third-party/ninja/ninja" + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Darwin" + }, + "warnings": { + "unusedCli": false + }, + "generator": "Ninja" + }, + { + "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": "${sourceDir}/build/third-party/llvm-project/install/release-gcc", + "Clang_ROOT": "${sourceDir}/build/third-party/llvm-project/install/release-gcc", + "duktape_ROOT": "${sourceDir}/build/third-party/duktape/install/release-gcc", + "Duktape_ROOT": "${sourceDir}/build/third-party/duktape/install/release-gcc", + "libxml2_ROOT": "${sourceDir}/build/third-party/libxml2/install/release-gcc", + "LibXml2_ROOT": "${sourceDir}/build/third-party/libxml2/install/release-gcc", + "MRDOCS_BUILD_TESTS": true, + "MRDOCS_BUILD_DOCS": false, + "MRDOCS_GENERATE_REFERENCE": false, + "MRDOCS_GENERATE_ANTORA_REFERENCE": false, + "CMAKE_C_COMPILER": "/usr/bin/gcc", + "CMAKE_CXX_COMPILER": "/usr/bin/g++", + "CMAKE_MAKE_PROGRAM": "${sourceDir}/build/third-party/ninja/ninja" + }, + "warnings": { + "unusedCli": false + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Darwin" + }, + "generator": "Ninja" + }, + { + "name": "debug-macos-gcc-asan", + "displayName": "Debug (macOS: gcc) with ASan", + "description": "Preset for building MrDocs in Debug mode with the gcc compiler in macOS.", + "inherits": "debug", + "binaryDir": "${sourceDir}/build/${presetName}", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "LLVM_ROOT": "${sourceDir}/build/third-party/llvm-project/install/debug-gcc-asan", + "Clang_ROOT": "${sourceDir}/build/third-party/llvm-project/install/debug-gcc-asan", + "duktape_ROOT": "${sourceDir}/build/third-party/duktape/install/debug-gcc-asan", + "Duktape_ROOT": "${sourceDir}/build/third-party/duktape/install/debug-gcc-asan", + "libxml2_ROOT": "${sourceDir}/build/third-party/libxml2/install/release-gcc", + "LibXml2_ROOT": "${sourceDir}/build/third-party/libxml2/install/release-gcc", + "MRDOCS_BUILD_TESTS": true, + "MRDOCS_BUILD_DOCS": false, + "MRDOCS_GENERATE_REFERENCE": false, + "MRDOCS_GENERATE_ANTORA_REFERENCE": false, + "CMAKE_C_COMPILER": "/usr/bin/gcc", + "CMAKE_CXX_COMPILER": "/usr/bin/g++", + "CMAKE_MAKE_PROGRAM": "${sourceDir}/build/third-party/ninja/ninja", + "CMAKE_C_FLAGS": "-fsanitize=address -fno-sanitize-recover=address -fno-omit-frame-pointer", + "CMAKE_CXX_FLAGS": "-fsanitize=address -fno-sanitize-recover=address -fno-omit-frame-pointer" + }, + "warnings": { + "unusedCli": false + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Darwin" + }, + "generator": "Ninja" + }, + { + "name": "debug-macos-gcc-ubsan", + "displayName": "Debug (macOS: gcc) with UBSan", + "description": "Preset for building MrDocs in Debug mode with the gcc compiler in macOS.", + "inherits": "debug", + "binaryDir": "${sourceDir}/build/${presetName}", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "LLVM_ROOT": "${sourceDir}/build/third-party/llvm-project/install/debug-gcc-ubsan", + "Clang_ROOT": "${sourceDir}/build/third-party/llvm-project/install/debug-gcc-ubsan", + "duktape_ROOT": "${sourceDir}/build/third-party/duktape/install/debug-gcc-ubsan", + "Duktape_ROOT": "${sourceDir}/build/third-party/duktape/install/debug-gcc-ubsan", + "libxml2_ROOT": "${sourceDir}/build/third-party/libxml2/install/release-gcc", + "LibXml2_ROOT": "${sourceDir}/build/third-party/libxml2/install/release-gcc", + "MRDOCS_BUILD_TESTS": true, + "MRDOCS_BUILD_DOCS": false, + "MRDOCS_GENERATE_REFERENCE": false, + "MRDOCS_GENERATE_ANTORA_REFERENCE": false, + "CMAKE_C_COMPILER": "/usr/bin/gcc", + "CMAKE_CXX_COMPILER": "/usr/bin/g++", + "CMAKE_MAKE_PROGRAM": "${sourceDir}/build/third-party/ninja/ninja", + "CMAKE_C_FLAGS": "-fsanitize=undefined -fno-sanitize-recover=undefined -fno-omit-frame-pointer", + "CMAKE_CXX_FLAGS": "-fsanitize=undefined -fno-sanitize-recover=undefined -fno-omit-frame-pointer" + }, + "warnings": { + "unusedCli": false + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Darwin" + }, + "generator": "Ninja" + }, + { + "name": "debug-macos-clang", + "displayName": "Debug (macOS: clang)", + "description": "Preset for building MrDocs in Debug mode with the clang compiler in macOS.", + "inherits": "debug", + "binaryDir": "${sourceDir}/build/${presetName}", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "LLVM_ROOT": "${sourceDir}/build/third-party/llvm-project/install/debug-clang", + "Clang_ROOT": "${sourceDir}/build/third-party/llvm-project/install/debug-clang", + "duktape_ROOT": "${sourceDir}/build/third-party/duktape/install/debug-clang", + "Duktape_ROOT": "${sourceDir}/build/third-party/duktape/install/debug-clang", + "libxml2_ROOT": "${sourceDir}/build/third-party/libxml2/install/release-clang", + "LibXml2_ROOT": "${sourceDir}/build/third-party/libxml2/install/release-clang", + "MRDOCS_BUILD_TESTS": true, + "MRDOCS_BUILD_DOCS": false, + "MRDOCS_GENERATE_REFERENCE": false, + "MRDOCS_GENERATE_ANTORA_REFERENCE": false, + "CMAKE_C_COMPILER": "/opt/homebrew/opt/llvm/bin/clang", + "CMAKE_CXX_COMPILER": "/opt/homebrew/opt/llvm/bin/clang++", + "CMAKE_MAKE_PROGRAM": "${sourceDir}/build/third-party/ninja/ninja", + "CMAKE_AR": "/opt/homebrew/opt/llvm/bin/llvm-ar", + "CMAKE_CXX_COMPILER_AR": "/opt/homebrew/opt/llvm/bin/llvm-ar", + "CMAKE_C_COMPILER_AR": "/opt/homebrew/opt/llvm/bin/llvm-ar", + "CMAKE_RANLIB": "/opt/homebrew/opt/llvm/bin/llvm-ranlib", + "CMAKE_C_COMPILER_LINKER": "/opt/homebrew/bin/ld.lld", + "CMAKE_CXX_COMPILER_LINKER": "/opt/homebrew/bin/ld.lld", + "CMAKE_EXE_LINKER_FLAGS": "-L/opt/homebrew/opt/llvm/lib/c++ -L/opt/homebrew/opt/llvm/lib/unwind -lunwind", + "CMAKE_SHARED_LINKER_FLAGS": "-L/opt/homebrew/opt/llvm/lib/c++ -L/opt/homebrew/opt/llvm/lib/unwind -lunwind", + "CMAKE_MODULE_LINKER_FLAGS": "-L/opt/homebrew/opt/llvm/lib/c++ -L/opt/homebrew/opt/llvm/lib/unwind -lunwind", + "CMAKE_CXX_FLAGS": "-stdlib=libc++ -I/opt/homebrew/opt/llvm/include/c++/v1" + }, + "warnings": { + "unusedCli": false + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Darwin" + }, + "generator": "Ninja" + }, + { + "name": "debug-macos-clang-asan", + "generator": "Ninja", + "displayName": "Debug (macOS: clang) with ASan", + "description": "Preset for building MrDocs in Debug mode with the clang compiler in macOS.", + "inherits": "debug", + "binaryDir": "${sourceDir}/build/${presetName}", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "LLVM_ROOT": "${sourceDir}/build/third-party/llvm-project/install/debug-clang-asan", + "Clang_ROOT": "${sourceDir}/build/third-party/llvm-project/install/debug-clang-asan", + "duktape_ROOT": "${sourceDir}/build/third-party/duktape/install/debug-clang-asan", + "Duktape_ROOT": "${sourceDir}/build/third-party/duktape/install/debug-clang-asan", + "libxml2_ROOT": "${sourceDir}/build/third-party/libxml2/install/release-clang", + "LibXml2_ROOT": "${sourceDir}/build/third-party/libxml2/install/release-clang", + "MRDOCS_BUILD_TESTS": true, + "MRDOCS_BUILD_DOCS": false, + "MRDOCS_GENERATE_REFERENCE": false, + "MRDOCS_GENERATE_ANTORA_REFERENCE": false, + "CMAKE_C_COMPILER": "/opt/homebrew/opt/llvm/bin/clang", + "CMAKE_CXX_COMPILER": "/opt/homebrew/opt/llvm/bin/clang++", + "CMAKE_MAKE_PROGRAM": "${sourceDir}/build/third-party/ninja/ninja", + "CMAKE_AR": "/opt/homebrew/opt/llvm/bin/llvm-ar", + "CMAKE_CXX_COMPILER_AR": "/opt/homebrew/opt/llvm/bin/llvm-ar", + "CMAKE_C_COMPILER_AR": "/opt/homebrew/opt/llvm/bin/llvm-ar", + "CMAKE_RANLIB": "/opt/homebrew/opt/llvm/bin/llvm-ranlib", + "CMAKE_C_COMPILER_LINKER": "/opt/homebrew/bin/ld.lld", + "CMAKE_CXX_COMPILER_LINKER": "/opt/homebrew/bin/ld.lld", + "CMAKE_EXE_LINKER_FLAGS": "-L/opt/homebrew/opt/llvm/lib/c++ -L/opt/homebrew/opt/llvm/lib/unwind -lunwind -fsanitize=address", + "CMAKE_SHARED_LINKER_FLAGS": "-L/opt/homebrew/opt/llvm/lib/c++ -L/opt/homebrew/opt/llvm/lib/unwind -lunwind -fsanitize=address", + "CMAKE_MODULE_LINKER_FLAGS": "-L/opt/homebrew/opt/llvm/lib/c++ -L/opt/homebrew/opt/llvm/lib/unwind -lunwind -fsanitize=address", + "CMAKE_C_FLAGS": "-fsanitize=address -fno-sanitize-recover=address -fno-omit-frame-pointer", + "CMAKE_CXX_FLAGS": "-fsanitize=address -fno-sanitize-recover=address -fno-omit-frame-pointer -stdlib=libc++ -I/opt/homebrew/opt/llvm/include/c++/v1" + }, + "warnings": { + "unusedCli": false + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Darwin" + } + }, + { + "name": "release-macos-clang", + "generator": "Ninja", + "displayName": "Release (macOS: clang)", + "description": "Preset for building MrDocs in Release mode with the clang compiler in macOS.", + "inherits": "release", + "binaryDir": "${sourceDir}/build/${presetName}", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release", + "LLVM_ROOT": "${sourceDir}/build/third-party/llvm-project/install/release-clang", + "Clang_ROOT": "${sourceDir}/build/third-party/llvm-project/install/release-clang", + "duktape_ROOT": "${sourceDir}/build/third-party/duktape/install/release-clang", + "Duktape_ROOT": "${sourceDir}/build/third-party/duktape/install/release-clang", + "libxml2_ROOT": "${sourceDir}/build/third-party/libxml2/install/release-clang", + "LibXml2_ROOT": "${sourceDir}/build/third-party/libxml2/install/release-clang", + "MRDOCS_BUILD_TESTS": true, + "MRDOCS_BUILD_DOCS": false, + "MRDOCS_GENERATE_REFERENCE": false, + "MRDOCS_GENERATE_ANTORA_REFERENCE": false, + "CMAKE_C_COMPILER": "/opt/homebrew/opt/llvm/bin/clang", + "CMAKE_CXX_COMPILER": "/opt/homebrew/opt/llvm/bin/clang++", + "CMAKE_MAKE_PROGRAM": "${sourceDir}/build/third-party/ninja/ninja", + "CMAKE_AR": "/opt/homebrew/opt/llvm/bin/llvm-ar", + "CMAKE_CXX_COMPILER_AR": "/opt/homebrew/opt/llvm/bin/llvm-ar", + "CMAKE_C_COMPILER_AR": "/opt/homebrew/opt/llvm/bin/llvm-ar", + "CMAKE_RANLIB": "/opt/homebrew/opt/llvm/bin/llvm-ranlib", + "CMAKE_C_COMPILER_LINKER": "/opt/homebrew/bin/ld.lld", + "CMAKE_CXX_COMPILER_LINKER": "/opt/homebrew/bin/ld.lld", + "CMAKE_EXE_LINKER_FLAGS": "-L/opt/homebrew/opt/llvm/lib/c++ -L/opt/homebrew/opt/llvm/lib/unwind -lunwind", + "CMAKE_SHARED_LINKER_FLAGS": "-L/opt/homebrew/opt/llvm/lib/c++ -L/opt/homebrew/opt/llvm/lib/unwind -lunwind", + "CMAKE_MODULE_LINKER_FLAGS": "-L/opt/homebrew/opt/llvm/lib/c++ -L/opt/homebrew/opt/llvm/lib/unwind -lunwind", + "CMAKE_CXX_FLAGS": "-stdlib=libc++ -I/opt/homebrew/opt/llvm/include/c++/v1" + }, + "warnings": { + "unusedCli": false + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Darwin" + } + } + ] +} \ No newline at end of file diff --git a/bootstrap.py b/bootstrap.py index d61ce644a2..6f85633afb 100644 --- a/bootstrap.py +++ b/bootstrap.py @@ -14,7 +14,6 @@ import sys import platform import shutil -import math from dataclasses import dataclass, field import dataclasses import urllib.request @@ -23,9 +22,7 @@ import shlex import re import zipfile -from pathlib import Path from functools import lru_cache -from typing import Optional, Dict, Any, List, Iterable, Set @lru_cache(maxsize=1) @@ -39,237 +36,6 @@ def running_from_mrdocs_source_dir(): return cwd == script_dir -class TextUI: - """ - Lightweight console formatting helper that keeps default output plain - but can emit color/emoji when available or explicitly enabled. - """ - - COLOR = { - "reset": "\033[0m", - "info": "\033[97m", # bright white - "warn": "\033[93m", # yellow - "error": "\033[1;91m", # bold red - "ok": "\033[1;92m", # bold green - "section": "\033[1;96m", # bold cyan - "subsection": "\033[96m", # cyan - "command": "\033[95m", # magenta - "dim": "\033[2m", - } - EMOJI = { - "info": "", - "warn": "⚠️ ", - "error": "β›” ", - "ok": "βœ… ", - "section": "", - "command": "πŸ’» ", - } - - def __init__(self, enable_color: bool = False, enable_emoji: bool = False): - force_color = os.environ.get("BOOTSTRAP_FORCE_COLOR") or os.environ.get("CLICOLOR_FORCE") - force_emoji = os.environ.get("BOOTSTRAP_FORCE_EMOJI") - self.color_enabled = bool(enable_color and (force_color or self._supports_color())) - self.emoji_enabled = bool(enable_emoji and (force_emoji or self._supports_emoji())) - # keep displayed paths compact; we shorten aggressively past this length - self.max_path = 50 - self.base_path: Optional[str] = None - self.base_token: str = "." - - @staticmethod - def _supports_color() -> bool: - if os.environ.get("NO_COLOR") or os.environ.get("BOOTSTRAP_PLAIN"): - return False - return sys.stdout.isatty() - - @staticmethod - def _supports_emoji() -> bool: - if os.environ.get("BOOTSTRAP_PLAIN"): - return False - return True - - def _fmt(self, text: str, kind: str, icon: Optional[str] = None) -> str: - prefix = "" - if self.emoji_enabled: - prefix = icon if icon is not None else self.EMOJI.get(kind, "") - if not self.color_enabled: - return f"{prefix}{text}" - color = self.COLOR.get(kind, "") - reset = self.COLOR["reset"] - return f"{color}{prefix}{text}{reset}" - - def info(self, msg: str, icon: Optional[str] = None): - print(self._fmt(msg, "info", icon)) - - def warn(self, msg: str, icon: Optional[str] = None): - print(self._fmt(msg, "warn", icon)) - - def error(self, msg: str, icon: Optional[str] = None): - print(self._fmt(msg, "error", icon)) - - def error_block(self, header: str, tips: Optional[List[str]] = None): - print(self._fmt(f"!! {header}", "error")) - if tips: - for tip in tips: - print(self._fmt(f" β€’ {tip}", "warn")) - - def ok(self, msg: str, icon: Optional[str] = None): - print(self._fmt(msg, "ok", icon)) - - def section(self, title: str, icon: Optional[str] = None): - prefix = (icon + " ") if (self.emoji_enabled and icon) else "" - line = "━" * 60 - print() - print(self._fmt(line, "section", "")) - print(self._fmt(f"{prefix}{title}", "section", "")) - print(self._fmt(line, "section", "")) - - def command(self, cmd: str, icon: Optional[str] = None): - print(self._fmt(cmd, "command", icon)) - - def subsection(self, title: str, icon: Optional[str] = None): - prefix = (icon + " ") if (self.emoji_enabled and icon) else "" - banner = f" {prefix}{title}" - print() # blank line for breathing room - print(self._fmt(banner, "subsection", "")) - # underline matches text length (indent + title) plus a small cushion - underline_len = max(15, len(banner.strip()) + 4) - print(self._fmt("-" * underline_len, "subsection", "")) - - def shorten_path(self, path: str) -> str: - if not path: - return path - try: - if os.path.abspath(path) == os.path.abspath(os.getcwd()): - return "." - except Exception: - pass - if not (path.startswith(self.base_token) or path.startswith("$MRDOCS")): - path = os.path.abspath(path) - if self.base_path and path.startswith(self.base_path): - suffix = path[len(self.base_path):] - if suffix.startswith(os.sep): - suffix = suffix[1:] - path = f"{self.base_token}" + (f"/{suffix}" if suffix else "") - home = os.path.expanduser("~") - if path.startswith(home): - path = path.replace(home, "~", 1) - if len(path) <= self.max_path: - return path - parts = path.split(os.sep) - if len(parts) <= 4: - return path - return os.sep.join(parts[:2]) + os.sep + "..." + os.sep + os.sep.join(parts[-2:]) - - @staticmethod - def _shorten_middle(text: str, max_len: int) -> str: - if len(text) <= max_len: - return text - take = max_len // 2 - 2 - return text[:take] + "..." + text[-take:] - - def set_base_path(self, path: Optional[str], token: str = "."): - if path: - self.base_path = os.path.abspath(path) - self.base_token = token - - def maybe_shorten(self, value: str) -> str: - """ - Shorten likely-path values but leave URLs and simple tokens intact. - """ - if not isinstance(value, str): - return value - lowered = value.lower() - if lowered.startswith("http://") or lowered.startswith("https://"): - return value - if value.startswith(self.base_token) or value.startswith("$MRDOCS") or value.startswith("~"): - return self._shorten_middle(value, self.max_path) - is_pathish = (os.sep in value) or value.startswith("~") or value.startswith(".") or value.startswith("/") - # Prefer replacing the MrDocs source prefix with a short token for path-like strings - if is_pathish: - try: - if self.base_path: - abs_val = value if value.startswith(self.base_token) or value.startswith("$MRDOCS") else os.path.abspath(value) - if abs_val.startswith(self.base_path): - rel = abs_val[len(self.base_path):] - if rel.startswith(os.sep): - rel = rel[1:] - replaced = self.base_token + (f"/{rel}" if rel else "") - return self._shorten_middle(replaced, self.max_path) - except Exception: - pass - if is_pathish: - return self.shorten_path(value) - return value - - def kv(self, key: str, value: str, key_width: int = 18): - key_fmt = key.rjust(key_width) - display_value = self.maybe_shorten(value) if isinstance(value, str) else value - print(self._fmt(f"{key_fmt}: ", "dim") + self._fmt(display_value, "info")) - - def kv_block(self, title: Optional[str], items: List[tuple], icon: Optional[str] = None, indent: int = 2): - """ - Print an aligned key-value block with optional header. - """ - if title: - self.section(title, icon=icon) - if not items: - return - key_width = max(len(k) for k, _ in items) + 2 - pad = " " * indent - for k, v in items: - key_fmt = k.rjust(key_width) - display_value = self.maybe_shorten(v) if isinstance(v, str) else v - line = f"{pad}{key_fmt}: " - if self.color_enabled: - line = f"{self.COLOR['dim']}{line}{self.COLOR['reset']}" - print(line + self._fmt(str(display_value), "info")) - - def checklist(self, title: str, items): - if title: - self.section(title) - for label, done in items: - mark = "βœ“" if done else "βœ—" - style = "ok" if done else "warn" - print(self._fmt(f" {mark} {label}", style)) - - def step(self, current: int, total: int, title: str): - prefix = f"[{current}/{total}] " - print(self._fmt(f"{prefix}{title}", "subsection")) - - -# default UI; may be replaced once options are parsed -ui = TextUI() - - -@dataclass -class RecipeSource: - type: str - url: str - branch: Optional[str] = None - tag: Optional[str] = None - commit: Optional[str] = None - ref: Optional[str] = None - depth: Optional[int] = None - submodules: bool = False - - -@dataclass -class Recipe: - name: str - version: str - source: RecipeSource - dependencies: List[str] - source_dir: str - build_dir: str - install_dir: str - build_type: str - source_subdir: Optional[str] = None - build: List[Dict[str, Any]] = field(default_factory=list) - tags: List[str] = field(default_factory=list) - package_root_var: Optional[str] = None - install_scope: str = "per-preset" # "per-preset" (default) or "global" - - @dataclass class InstallOptions: """ @@ -300,23 +66,58 @@ class InstallOptions: ninja_path: str = '' # MrDocs - source_dir: str = field(default_factory=lambda: os.path.dirname(os.path.abspath(__file__))) - build_type: str = "Release" - preset: str = "-<\"-\":if(cc)><\"-\":if(sanitizer)>" - build_dir: str = "/build/-<\"-\":if(cc)><\"-\":if(sanitizer)><\"-\":if(sanitizer)>" - build_tests: bool = True - system_install: bool = field(default_factory=lambda: not running_from_mrdocs_source_dir()) - install_dir: str = field( - default_factory=lambda: "/install/-<\"-\":if(cc)><\"-\":if(sanitizer)>" if running_from_mrdocs_source_dir() else "") - run_tests: bool = False - - # Third-party dependencies root and recipes - third_party_src_dir: str = "/build/third-party" + mrdocs_src_dir: str = field( + default_factory=lambda: os.getcwd() if running_from_mrdocs_source_dir() else os.path.join(os.getcwd(), + "mrdocs")) + mrdocs_build_type: str = "Release" + mrdocs_repo: str = "https://github.com/cppalliance/mrdocs" + mrdocs_branch: str = "develop" + mrdocs_use_user_presets: bool = True + mrdocs_preset_name: str = "-<\"-\":if(cc)><\"-\":if(sanitizer)>" + mrdocs_build_dir: str = "/build/-<\"-\":if(cc)><\"-\":if(sanitizer)><\"-\":if(sanitizer)>" + mrdocs_build_tests: bool = True + mrdocs_system_install: bool = field(default_factory=lambda: not running_from_mrdocs_source_dir()) + mrdocs_install_dir: str = field( + default_factory=lambda: "/install/-<\"-\":if(cc)><\"-\":if(sanitizer)>" if running_from_mrdocs_source_dir() else "") + mrdocs_run_tests: bool = False + + # Third-party dependencies + third_party_src_dir: str = "/build/third-party" + + # Duktape + duktape_src_dir: str = "/duktape" + duktape_url: str = "https://github.com/svaarala/duktape/releases/download/v2.7.0/duktape-2.7.0.tar.xz" + duktape_build_type: str = "" + duktape_build_dir: str = "/build/<\"-\":if(cc)><\"-\":if(sanitizer)>" + duktape_install_dir: str = "/install/<\"-\":if(cc)><\"-\":if(sanitizer)>" + + # Lua + lua_src_dir: str = "/lua" + lua_url: str = "https://github.com/lua/lua/archive/refs/tags/v5.4.8.tar.gz" + lua_build_type: str = "" + lua_build_dir: str = "/build/<\"-\":if(cc)><\"-\":if(sanitizer)>" + lua_install_dir: str = "/install/<\"-\":if(cc)><\"-\":if(sanitizer)>" + + # LLVM + llvm_src_dir: str = "/llvm-project" + llvm_build_type: str = "" + llvm_build_dir: str = "/build/<\"-\":if(cc)><\"-\":if(sanitizer)>" + llvm_install_dir: str = "/install/<\"-\":if(cc)><\"-\":if(sanitizer)>" + llvm_repo: str = "https://github.com/llvm/llvm-project.git" + llvm_commit: str = "dc4cef81d47c7bc4a3c4d58fbacf8a6359683fae" + + # Libxml2 + libxml2_src_dir: str = "/libxml2" + libxml2_build_type: str = "Release" # purposefully does not depend on mrdocs-build-type because we only need the executable + libxml2_build_dir: str = "/build/<\"-\":if(cc)>" + libxml2_install_dir: str = "/install/<\"-\":if(cc)>" + libxml2_repo: str = "https://github.com/GNOME/libxml2" + libxml2_branch: str = "v2.12.6" # Information to create run configurations generate_run_configs: bool = field(default_factory=lambda: running_from_mrdocs_source_dir()) - jetbrains_run_config_dir: str = "/.run" - boost_src_dir: str = "/../boost" + jetbrains_run_config_dir: str = "/.run" + boost_src_dir: str = "/../boost" generate_clion_run_configs: bool = True generate_vscode_run_configs: bool = field(default_factory=lambda: os.name != "nt") generate_vs_run_configs: bool = field(default_factory=lambda: os.name == "nt") @@ -329,15 +130,64 @@ class InstallOptions: refresh_all: bool = False force_rebuild: bool = False remove_build_dir: bool = True - plain_ui: bool = False - verbose: bool = False - debug: bool = False - dry_run: bool = False - list_recipes: bool = False - recipe_filter: str = "" - skip_build: bool = False - clean: bool = False - force: bool = False + + +# Constant for option descriptions +INSTALL_OPTION_DESCRIPTIONS = { + "cc": "Path to the C compiler executable. Leave empty for default.", + "cxx": "Path to the C++ compiler executable. Leave empty for default.", + "sanitizer": "Sanitizer to use for the build. Leave empty for no sanitizer. (ASan, UBSan, MSan, TSan)", + "git_path": "Path to the git executable, if not in system PATH.", + "cmake_path": "Path to the cmake executable, if not in system PATH.", + "python_path": "Path to the python executable, if not in system PATH.", + "java_path": "Path to the java executable, if not in system PATH.", + "ninja_path": "Path to the ninja executable. Leave empty to look for ninja in PATH or to download it automatically.", + "mrdocs_src_dir": "MrDocs source directory.", + "mrdocs_repo": "URL of the MrDocs repository to clone.", + "mrdocs_branch": "Branch or tag of the MrDocs repository to use.", + "mrdocs_build_type": "CMake build type for MrDocs (Release, Debug, RelWithDebInfo, MilRelSize).", + "mrdocs_use_user_presets": "Whether to use CMake User Presets for building MrDocs.", + "mrdocs_preset_name": "Name of the CMake User Preset to use for MrDocs.", + "mrdocs_build_dir": "Directory where MrDocs will be built.", + "mrdocs_build_tests": "Whether to build tests for MrDocs.", + "mrdocs_install_dir": "Directory where MrDocs will be installed.", + "mrdocs_system_install": "Whether to install MrDocs to the system directories instead of a custom install directory.", + "mrdocs_run_tests": "Whether to run tests after building MrDocs.", + "third_party_src_dir": "Directory for all third-party source dependencies.", + "duktape_src_dir": "Directory for the Duktape source code.", + "duktape_url": "Download URL for the Duktape source archive.", + "duktape_build_type": "CMake build type for Duktape. (Release, Debug, RelWithDebInfo, MilRelSize)", + "duktape_build_dir": "Directory where Duktape will be built.", + "duktape_install_dir": "Directory where Duktape will be installed.", + "lua_src_dir": "Directory for the Lua source code.", + "lua_url": "Download URL for the Lua source archive.", + "lua_build_type": "Build type for Lua. (Release, Debug)", + "lua_build_dir": "Directory where Lua will be built.", + "lua_install_dir": "Directory where Lua will be installed.", + "libxml2_src_dir": "Directory for the libxml2 source code.", + "libxml2_build_type": "CMake build type for libxml2: Release always recommended. (Release, Debug, RelWithDebInfo, MilRelSize)", + "libxml2_build_dir": "Directory where libxml2 will be built.", + "libxml2_install_dir": "Directory where libxml2 will be installed.", + "libxml2_repo": "URL of the libxml2 repository to clone.", + "libxml2_branch": "Branch or tag of libxml2 to use.", + "llvm_src_dir": "Directory for the LLVM project source code.", + "llvm_build_type": "CMake build type for LLVM. (Release, Debug, RelWithDebInfo, MilRelSize)", + "llvm_build_dir": "Directory where LLVM will be built.", + "llvm_install_dir": "Directory where LLVM will be installed.", + "llvm_repo": "URL of the LLVM project repository to clone.", + "llvm_commit": "Specific commit hash of LLVM to checkout.", + "generate_run_configs": "Whether to generate run configurations for IDEs.", + "jetbrains_run_config_dir": "Directory where JetBrains run configurations will be stored.", + "boost_src_dir": "Directory where the source files of the Boost libraries are located.", + "generate_clion_run_configs": "Whether to generate run configurations for CLion.", + "generate_vscode_run_configs": "Whether to generate run configurations for Visual Studio Code.", + "generate_vs_run_configs": "Whether to generate run configurations for Visual Studio.", + "generate_pretty_printer_configs": "Whether to generate pretty printer configurations for debuggers.", + "non_interactive": "Whether to use all default options without interactive prompts.", + "refresh_all": "Call the command to refresh dependencies for all configurations", + "force_rebuild": "Whether to force a rebuild of all dependencies, even if they are already built.", + "remove_build_dir": "Whether to remove the build directory of dependencies after installation.", +} class MrDocsInstaller: @@ -352,8 +202,6 @@ def __init__(self, cmd_line_args=None): self.cmd_line_args = cmd_line_args or dict() self.default_options = InstallOptions() self.options = InstallOptions() - self.package_roots: Dict[str, str] = {} - self.recipe_info: Dict[str, Recipe] = {} for field in dataclasses.fields(self.options): if field.type == str: setattr(self.options, field.name, '') @@ -361,42 +209,11 @@ def __init__(self, cmd_line_args=None): setattr(self.options, field.name, None) else: raise TypeError(f"Unsupported type {field.type} for field {field.name} in InstallOptions.") - # Seed critical defaults for path expansion before prompting - self.options.source_dir = self.default_options.source_dir - self.options.third_party_src_dir = self.default_options.third_party_src_dir - self.recipes_dir = os.path.join(self.options.source_dir, "third-party", "recipes") - self.patches_dir = os.path.join(self.options.source_dir, "third-party", "patches") self.options.non_interactive = self.cmd_line_args.get("non_interactive", False) self.options.refresh_all = self.cmd_line_args.get("refresh_all", False) self.prompted_options = set() self.compiler_info = {} - self.env = os.environ.copy() - # Disable pkg-config to avoid CMake regex issues with paths containing '+' (e.g., C++). - # Find modules will still use CMAKE_PREFIX_PATH and hints. - self.env["PKG_CONFIG"] = "false" - # Seed options from command-line for all fields we already know - for field in dataclasses.fields(self.options): - name = field.name - if name in self.cmd_line_args and self.cmd_line_args[name] is not None: - setattr(self.options, name, self.cmd_line_args[name]) - plain_ui_flag = bool(self.cmd_line_args.get("plain_ui", False)) - self.ui = TextUI(enable_color=not plain_ui_flag, enable_emoji=not plain_ui_flag) - # allow UI shortening to replace MrDocs source dir with a compact token - self.ui.set_base_path(self.options.source_dir) - global ui - ui = self.ui - self.package_roots: Dict[str, str] = {} - self.recipe_info: Dict[str, Recipe] = {} - - def _load_json_file(self, path: str) -> Optional[Dict[str, Any]]: - if not os.path.exists(path): - return None - try: - with open(path, "r", encoding="utf-8") as f: - return json.load(f) - except Exception as exc: - self.ui.warn(f"Failed to read {path}: {exc}") - return None + self.env = None def prompt_string(self, prompt, default): """ @@ -406,7 +223,6 @@ def prompt_string(self, prompt, default): :param default: The default value to use if the user does not provide input. :return: """ - indent = " " if self.options.non_interactive and default is not None: return default prompt = prompt.strip() @@ -415,19 +231,12 @@ def prompt_string(self, prompt, default): prompt = prompt.strip() BLUE = "\033[94m" RESET = "\033[0m" - display_default = default - if isinstance(default, str): - try: - display_default = self.ui.maybe_shorten(default) - except Exception: - display_default = default - if self.supports_ansi(): prompt = f"{BLUE}{prompt}{RESET}" - if display_default not in (None, ""): - prompt += f" ({display_default})" + if default: + prompt += f" ({default})" prompt += f": " - inp = input(indent + prompt) + inp = input(prompt) result = inp.strip() or default return result @@ -439,7 +248,6 @@ def prompt_boolean(self, prompt, default=None): :param default: The default value to return if the user does not provide input. :return: bool: True if the user answers yes, False otherwise. """ - indent = " " if self.options.non_interactive and default is not None: return default prompt = prompt.strip() @@ -451,7 +259,7 @@ def prompt_boolean(self, prompt, default=None): if self.supports_ansi(): prompt = f"{BLUE}{prompt}{RESET}" while True: - answer = input(f"{indent}{prompt} ({'y/n' if default is None else 'yes' if default else 'no'}): ").strip().lower() + answer = input(f"{prompt} ({'y/n' if default is None else 'yes' if default else 'no'}): ").strip().lower() if answer in ('y', 'yes'): return True elif answer in ('n', 'no'): @@ -462,7 +270,7 @@ def prompt_boolean(self, prompt, default=None): else: print("Please answer 'y or 'n'.") - def prompt_option(self, name, prompt_text, force_prompt=False): + def prompt_option(self, name, force_prompt=False): """ Prompts the user for a configuration option based on its name. @@ -473,7 +281,6 @@ def prompt_option(self, name, prompt_text, force_prompt=False): or from user input. :param name: The name of the option to prompt for. - :param prompt_text: The text to display when prompting. :return: The value of the option after prompting the user. """ name = name.replace("-", "_") @@ -498,8 +305,8 @@ def prompt_option(self, name, prompt_text, force_prompt=False): # Replace placeholders in the default value if isinstance(default_value, str): - contains_placeholder = "<" in default_value and ">" in default_value - if contains_placeholder: + constains_placeholder = "<" in default_value and ">" in default_value + if constains_placeholder: has_dir_key = False def repl(match): @@ -546,15 +353,17 @@ def repl(match): default_value = os.path.abspath(default_value) setattr(self.default_options, name, default_value) - # If it's non-interactive, display and use the value directly + # If it's non-interactive, use the default value directly if self.options.non_interactive: - display = self.ui.maybe_shorten(default_value) if isinstance(default_value, str) else default_value - self.ui.info(f"{prompt_text}: {display}") setattr(self.options, name, default_value) self.prompted_options.add(name) return default_value - prompt = prompt_text + # Generate prompt to ask for value + if name in INSTALL_OPTION_DESCRIPTIONS: + prompt = INSTALL_OPTION_DESCRIPTIONS[name] + else: + raise ValueError(f"Missing description for option '{name}' in INSTALL_OPTION_DESCRIPTIONS.") # Prompt the user for the option value depending on the type if isinstance(getattr(self.default_options, name), bool): value = self.prompt_boolean(prompt, default_value) @@ -566,31 +375,27 @@ def repl(match): self.prompted_options.add(name) return value - def reprompt_option(self, name, prompt_text): - return self.prompt_option(name, prompt_text, force_prompt=True) + def reprompt_option(self, name): + return self.prompt_option(name, force_prompt=True) def prompt_build_type_option(self, name): - value = self.prompt_option(name, "Build type") - valid_build_types = ["Debug", "Release", "RelWithDebInfo", "MinSizeRel", "OptimizedDebug", "DebugFast"] + value = self.prompt_option(name) + valid_build_types = ["Debug", "Release", "RelWithDebInfo", "MinSizeRel", "OptimizedDebug"] for t in valid_build_types: - if t.lower().replace("-", "") == value.lower().replace("-", ""): - if t == "DebugFast": - value = "DebugFast" + if t.lower() == value.lower(): setattr(self.options, name, t) return value print(f"Invalid build type '{value}'. Must be one of: {', '.join(valid_build_types)}.") - value = self.reprompt_option(name, "Build type") + value = self.reprompt_option(name) for t in valid_build_types: - if t.lower().replace("-", "") == value.lower().replace("-", ""): - if t == "DebugFast": - value = "DebugFast" + if t.lower() == value.lower(): setattr(self.options, name, t) return value print(f"Invalid build type '{value}'. Must be one of: {', '.join(valid_build_types)}.") raise ValueError(f"Invalid build type '{value}'. Must be one of: {', '.join(valid_build_types)}.") def prompt_sanitizer_option(self, name): - value = self.prompt_option(name, "Sanitizer (asan/ubsan/msan/tsan/none)") + value = self.prompt_option(name) if not value: value = '' return value @@ -600,7 +405,7 @@ def prompt_sanitizer_option(self, name): setattr(self.options, name, t) return value print(f"Invalid sanitizer '{value}'. Must be one of: {', '.join(valid_sanitizers)}.") - value = self.reprompt_option(name, "Sanitizer (asan/ubsan/msan/tsan/none)") + value = self.reprompt_option(name) for t in valid_sanitizers: if t.lower() == value.lower(): setattr(self.options, name, t) @@ -609,130 +414,31 @@ def prompt_sanitizer_option(self, name): raise ValueError(f"Invalid sanitizer '{value}'. Must be one of: {', '.join(valid_sanitizers)}.") def supports_ansi(self): - return bool(self.ui.color_enabled) + if os.name == "posix": + return True + if os.name == "nt": + # Windows 10+ with VT enabled, or running in Windows Terminal + return "WT_SESSION" in os.environ or sys.stdout.isatty() + return False - def run_cmd(self, cmd, cwd=None, tail=False): + def run_cmd(self, cmd, cwd=None): """ - Runs a shell command in the specified directory. - When tail=True, only the last line of live output is shown (npm-style), - while the full output is buffered and displayed only on failure. + Runs a shell command in the specified directory, printing the command in blue if supported. """ + BLUE = "\033[94m" + RESET = "\033[0m" if cwd is None: cwd = os.getcwd() - display_cwd = self.ui.shorten_path(cwd) if cwd else os.getcwd() + color = BLUE if self.supports_ansi() else "" + reset = RESET if self.supports_ansi() else "" if isinstance(cmd, list): cmd_str = ' '.join(shlex.quote(arg) for arg in cmd) + print(f"{color}{cwd}> {cmd_str}{reset}") else: - cmd_str = cmd - # Always show the command with cwd for transparency - self.ui.command(f"{display_cwd}> {cmd_str}", icon="πŸ’»") - if self.options.dry_run: - self.ui.info("dry-run: command not executed") - return - # Favor parallel builds unless user already set it - effective_env = (self.env or os.environ).copy() - if "CMAKE_BUILD_PARALLEL_LEVEL" not in effective_env: - try: - effective_env["CMAKE_BUILD_PARALLEL_LEVEL"] = str(max(1, os.cpu_count() or 1)) - except Exception: - effective_env["CMAKE_BUILD_PARALLEL_LEVEL"] = "4" - if not tail: - try: - r = subprocess.run(cmd, shell=isinstance(cmd, str), check=True, cwd=cwd, env=effective_env) - except subprocess.CalledProcessError as exc: - if self.options.debug: - raise - tips = [ - f"Working dir: {self.ui.shorten_path(cwd)}", - ] - if not self.options.verbose: - tips.append("Re-run with --verbose for full output") - self.ui.error_block(f"Command failed: {exc}", tips) - raise RuntimeError(f"Command '{cmd}' failed. Re-run with --debug for traceback.") from None - if r.returncode != 0: - raise RuntimeError(f"Command '{cmd}' failed with return code {r.returncode}.") - return - - # tail == True: stream output but only show the last line live - output_lines: List[str] = [] - try: - proc = subprocess.Popen( - cmd, - shell=isinstance(cmd, str), - cwd=cwd, - env=effective_env, - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT, - text=True, - bufsize=1, - universal_newlines=True, - ) - except Exception as exc: # noqa: BLE001 - raise RuntimeError(f"Failed to launch command '{cmd}': {exc}") from None - - try: - term_width = shutil.get_terminal_size(fallback=(80, 24)).columns or 80 - prev_height = 0 - if proc.stdout: - for line in proc.stdout: - line = line.rstrip("\r\n") - output_lines.append(line + "\n") - # compute how many terminal rows this line will wrap to - visible = line - height = max(1, math.ceil(len(visible) / term_width)) - # move cursor up to start of previous render and clear those rows - if prev_height: - sys.stdout.write(f"\x1b[{prev_height}F") - for _ in range(prev_height): - sys.stdout.write("\x1b[2K\x1b[1E") - sys.stdout.write(f"\x1b[{prev_height}F") - # render current line (letting terminal wrap naturally) - sys.stdout.write("\x1b[2K" + line + "\n") - sys.stdout.flush() - prev_height = height - proc.wait() - finally: - if proc.stdout: - proc.stdout.close() - - if output_lines: - # Ensure cursor ends on a clean line after the last render - sys.stdout.write("\x1b[2K") - sys.stdout.flush() - - if proc.returncode != 0: - # On failure, show the full buffered output - if not self.options.verbose: - self.ui.error_block( - f"Command failed: {cmd}", - ["Working dir: " + self.ui.shorten_path(cwd or os.getcwd())], - ) - print("".join(output_lines), end="") - raise RuntimeError(f"Command '{cmd}' failed with return code {proc.returncode}.") - - def ensure_dir(self, path, exist_ok=True): - if self.options.dry_run: - self.ui.info(f"dry-run: would create directory {path}") - return - os.makedirs(path, exist_ok=exist_ok) - - def remove_dir(self, path): - if not os.path.exists(path): - return - if self.options.dry_run: - self.ui.info(f"dry-run: would remove directory {path}") - return - shutil.rmtree(path, ignore_errors=True) - - def write_text(self, path, content, encoding="utf-8"): - if self.options.dry_run: - self.ui.info(f"dry-run: would write file {path}") - return - parent = os.path.dirname(path) - if parent: - os.makedirs(parent, exist_ok=True) - with open(path, "w", encoding=encoding) as f: - f.write(content) + print(f"{color}{cwd}> {cmd}{reset}") + r = subprocess.run(cmd, shell=isinstance(cmd, str), check=True, cwd=cwd, env=self.env) + if r.returncode != 0: + raise RuntimeError(f"Command '{cmd}' failed with return code {r.returncode}.") def clone_repo(self, repo, dest, branch=None, depth=None): """ @@ -758,17 +464,12 @@ def download_file(self, url, dest): :param dest: The destination file path where the file will be saved. :return: None """ - if self.options.dry_run: - self.ui.info(f" πŸ“₯ dry-run: would download {self.ui.maybe_shorten(url)} -> {self.ui.shorten_path(dest)}") - return if os.path.exists(dest): - self.ui.info(f"File {self.ui.shorten_path(dest)} already exists. Skipping download.") + print(f"File {dest} already exists. Skipping download.") return # Ensure the destination directory exists - self.ensure_dir(os.path.dirname(dest)) - self.ui.info(f" πŸ“₯ Downloading") - self.ui.kv("🌐 url", self.ui.maybe_shorten(url), key_width=9) - self.ui.kv("πŸ“ dest", self.ui.shorten_path(dest), key_width=9) + os.makedirs(os.path.dirname(dest), exist_ok=True) + print(f"Downloading {url} to {dest}") urllib.request.urlretrieve(url, dest) def is_windows(self): @@ -793,27 +494,27 @@ def is_macos(self): return os.name == "posix" and sys.platform.startswith("darwin") def cmake_workflow(self, src_dir, build_type, build_dir, install_dir, extra_args=None, cc_flags=None, - cxx_flags=None, force_rebuild=False, remove_build_dir=True, allow_skip=True): + cxx_flags=None, force_rebuild=False, remove_build_dir=True): """ Configures and builds a CMake project. """ # Check if we can skip the build - if allow_skip and self.is_non_empty_dir(install_dir): - if force_rebuild or self.prompt_option("force_rebuild", "Force rebuild deps"): + if self.is_non_empty_dir(install_dir): + if force_rebuild or self.prompt_option("force_rebuild"): print(f"Force rebuild requested. Removing existing install directory {install_dir}.") - self.remove_dir(install_dir) + shutil.rmtree(install_dir, ignore_errors=True) if remove_build_dir and self.is_non_empty_dir(build_dir): print(f"Removing existing build directory {build_dir}.") - self.remove_dir(build_dir) + shutil.rmtree(build_dir, ignore_errors=True) else: print(f"Install directory {install_dir} already exists and is not empty. Skipping build.") return if remove_build_dir and force_rebuild and self.is_non_empty_dir(build_dir): - self.remove_dir(build_dir) + shutil.rmtree(build_dir, ignore_errors=True) if self.is_non_empty_dir(install_dir): - self.remove_dir(install_dir) + shutil.rmtree(install_dir, ignore_errors=True) # Adjust any potential CMake flags from extra_args if cc_flags is None: @@ -867,10 +568,10 @@ def cmake_workflow(self, src_dir, build_type, build_dir, install_dir, extra_args config_args.extend(["-DGit_ROOT=" + os.path.dirname(self.options.git_path)]) # Maybe adjust build type based on the options for the main project - if not self.is_abi_compatible(self.options.build_type, build_type): + if not self.is_abi_compatible(self.options.mrdocs_build_type, build_type): print( - f"Warning: The build type '{build_type}' is not ABI compatible with the MrDocs build type '{self.options.build_type}'.") - if self.options.build_type.lower() in ("debug", "debugfast", "debug-fast"): + f"Warning: The build type '{build_type}' is not ABI compatible with the MrDocs build type '{self.options.mrdocs_build_type}'.") + if self.options.mrdocs_build_type.lower() == "debug": # User asked for Release dependency, so we do the best we can and change it to # an optimized debug build. print("Changing build type to 'OptimizedDebug' for ABI compatibility.") @@ -879,8 +580,8 @@ def cmake_workflow(self, src_dir, build_type, build_dir, install_dir, extra_args # User asked for a Debug dependency with Release build type for MrDocs. # The dependency should just copy the release type here. Other options wouldn't make sense # because we can't even debug it. - print(f"Changing build type to '{self.options.build_type}' for ABI compatibility.") - build_type = self.options.build_type + print(f"Changing build type to '{self.options.mrdocs_build_type}' for ABI compatibility.") + build_type = self.options.mrdocs_build_type # "OptimizedDebug" is not a valid build type. We interpret it as a special case # where the build type is Debug and optimizations are enabled. @@ -903,39 +604,65 @@ def cmake_workflow(self, src_dir, build_type, build_dir, install_dir, extra_args else: raise TypeError(f"extra_args must be a list, got {type(extra_args)}.") - cc_flags, cxx_flags = self._inject_clang_toolchain_flags(config_args, cc_flags, cxx_flags) + if self.is_homebrew_clang(): + homebrew_clang_root = os.path.dirname(os.path.dirname(self.options.cxx)) + ar_path = os.path.join(homebrew_clang_root, "bin", "llvm-ar") + if self.is_executable(ar_path): + for cxx_flag_var in [ + "CMAKE_AR", + "CMAKE_CXX_COMPILER_AR", + "CMAKE_C_COMPILER_AR" + ]: + config_args.append(f"-D{cxx_flag_var}={ar_path}") + runlib_path = os.path.join(homebrew_clang_root, "bin", "llvm-ranlib") + if self.is_executable(runlib_path): + config_args.append(f"-DCMAKE_RANLIB={runlib_path}") + ld_path = os.path.join(homebrew_clang_root, "bin", "ld.lld") + if self.is_executable(ld_path): + config_args.append(f"-DCMAKE_C_COMPILER_LINKER={ld_path}") + config_args.append(f"-DCMAKE_CXX_COMPILER_LINKER={ld_path}") + else: + ld_path = '/opt/homebrew/bin/ld.lld' + if self.is_executable(ld_path): + config_args.append(f"-DCMAKE_C_COMPILER_LINKER={ld_path}") + config_args.append(f"-DCMAKE_CXX_COMPILER_LINKER={ld_path}") + libcxx_include = os.path.join(homebrew_clang_root, "include", "c++", "v1") + libcxx_lib = os.path.join(homebrew_clang_root, "lib", "c++") + libunwind = os.path.join(homebrew_clang_root, "lib", "unwind") + if os.path.exists(libcxx_include) and os.path.exists(libcxx_lib) and os.path.exists(libunwind): + cxx_flags += f' -stdlib=libc++ -I{libcxx_include}' + ld_flags = f'-L{libcxx_lib} -L{libunwind} -lunwind' + if self.options.sanitizer: + ld_flags += f' -fsanitize={self.sanitizer_flag_name(self.options.sanitizer)}' + for cxx_linker_flag_var in [ + "CMAKE_EXE_LINKER_FLAGS", + "CMAKE_SHARED_LINKER_FLAGS", + "CMAKE_MODULE_LINKER_FLAGS" + ]: + config_args.append(f"-D{cxx_linker_flag_var}={ld_flags}") if cc_flags: config_args.append(f"-DCMAKE_C_FLAGS={cc_flags.strip()}") if cxx_flags: config_args.append(f"-DCMAKE_CXX_FLAGS={cxx_flags.strip()}") - cache_file = os.path.join(build_dir, "CMakeCache.txt") - # Decide expected build file based on generator (default to Ninja if available) - expected_build_file = os.path.join(build_dir, "build.ninja") - gen = "ninja" if self.options.ninja_path else self.compiler_info.get("CMAKE_GENERATOR", "").lower() - if "ninja" not in gen: - expected_build_file = os.path.join(build_dir, "Makefile") - needs_configure = force_rebuild or not (os.path.isfile(cache_file) and os.path.exists(expected_build_file)) - if needs_configure: - # Configure step can be verbose; show last line live - self.run_cmd(config_args, tail=True) - - # Always build; CMake will noop if nothing to do. - build_args = [self.options.cmake_path, "--build", build_dir, "--config", cmake_build_type] - # Use all available cores unless caller overrides via env/flags - parallel_level = max(1, os.cpu_count() or 1) - build_args.extend(["--parallel", str(parallel_level)]) - self.run_cmd(build_args, tail=True) + if not self.is_non_empty_dir(build_dir) or force_rebuild: + self.run_cmd(config_args) + + build_args = [self.options.cmake_path, "--build", build_dir, "--config", cmake_build_type] + num_cores = os.cpu_count() or 1 + max_safe_parallel = 4 # Ideally 4GB per job + build_args.extend(["--parallel", str(min(num_cores, max_safe_parallel))]) + self.run_cmd(build_args) install_args = [self.options.cmake_path, "--install", build_dir] if install_dir: install_args.extend(["--prefix", install_dir]) if cmake_build_type: install_args.extend(["--config", cmake_build_type]) - self.run_cmd(install_args, tail=True) - if remove_build_dir and self.prompt_option('remove_build_dir', 'Remove dep build dir'): + self.run_cmd(install_args) + if remove_build_dir and self.prompt_option('remove_build_dir'): print(f"Installation complete. Removing build directory {build_dir}.") - self.remove_dir(build_dir) + shutil.rmtree(build_dir, ignore_errors=True) def is_executable(self, path): if not os.path.exists(path): @@ -1087,13 +814,13 @@ def check_tool(self, tool): if not default_value: default_value = tool setattr(self.default_options, f"{tool}_path", default_value) - tool_path = self.prompt_option(f"{tool}_path", tool) + tool_path = self.prompt_option(f"{tool}_path") if not self.is_executable(tool_path): raise FileNotFoundError(f"{tool} executable not found at {tool_path}.") def check_compilers(self): for option in ["cc", "cxx"]: - self.prompt_option(option, option.replace("_", " ")) + self.prompt_option(option) if getattr(self.options, option): if not os.path.isabs(getattr(self.options, option)): exec = shutil.which(getattr(self.options, option)) @@ -1109,15 +836,28 @@ def check_tools(self): for tool in tools: self.check_tool(tool) - def setup_source_dir(self): - # Source dir is fixed to the repository containing this script; no prompts. - self.options.source_dir = os.path.dirname(os.path.abspath(__file__)) - if not os.path.isdir(self.options.source_dir): - raise NotADirectoryError(f"Source dir '{self.options.source_dir}' is not a directory.") + def setup_mrdocs_src_dir(self): + self.prompt_option("mrdocs_src_dir") + if not os.path.isabs(self.options.mrdocs_src_dir): + self.options.mrdocs_src_dir = os.path.abspath(self.options.mrdocs_src_dir) + if not os.path.exists(self.options.mrdocs_src_dir): + if not self.prompt_boolean( + f"Source directory '{self.options.mrdocs_src_dir}' does not exist. Create and clone MrDocs there?", + True): + print("Installation aborted by user.") + exit(1) + self.prompt_option("mrdocs_branch") + self.prompt_option("mrdocs_repo") + self.clone_repo(self.options.mrdocs_repo, self.options.mrdocs_src_dir, branch=self.options.mrdocs_branch) + else: + if not os.path.isdir(self.options.mrdocs_src_dir): + raise NotADirectoryError( + f"Specified mrdocs_src_dir '{self.options.mrdocs_src_dir}' is not a directory.") + # MrDocs build type - self.prompt_build_type_option("build_type") + self.prompt_build_type_option("mrdocs_build_type") self.prompt_sanitizer_option("sanitizer") - if self.prompt_option("build_tests", "Build tests"): + if self.prompt_option("mrdocs_build_tests"): self.check_tool("java") def is_inside_mrdocs_dir(self, path): @@ -1126,15 +866,15 @@ def is_inside_mrdocs_dir(self, path): :param path: The path to check. :return: bool: True if the path is inside the MrDocs source directory, False otherwise. """ - return os.path.commonpath([self.options.source_dir, path]) == self.options.source_dir + return os.path.commonpath([self.options.mrdocs_src_dir, path]) == self.options.mrdocs_src_dir - def prompt_dependency_path_option(self, name, prompt_text): + def prompt_dependency_path_option(self, name): """ Prompts the user for a dependency path option, ensuring it is not inside the MrDocs source directory. :param name: The name of the option to prompt for. :return: The value of the option after prompting the user. """ - self.prompt_option(name, prompt_text) + self.prompt_option(name) value = getattr(self.options, name) value = os.path.abspath(value) setattr(self.options, name, value) @@ -1144,8 +884,8 @@ def prompt_dependency_path_option(self, name, prompt_text): return value def setup_third_party_dir(self): - self.prompt_dependency_path_option("third_party_src_dir", "3rd-party root (src/build/install)") - self.ensure_dir(self.options.third_party_src_dir) + self.prompt_dependency_path_option("third_party_src_dir") + os.makedirs(self.options.third_party_src_dir, exist_ok=True) @lru_cache(maxsize=1) def probe_compilers(self): @@ -1158,12 +898,9 @@ def probe_compilers(self): variables.append("CMAKE_GENERATOR") probe_dir = os.path.join(self.options.third_party_src_dir, "cmake-probe") - if self.options.dry_run: - self.ui.info("dry-run: would probe compilers via CMake") - return if os.path.exists(probe_dir): - self.remove_dir(probe_dir) - self.ensure_dir(probe_dir) + shutil.rmtree(probe_dir) + os.makedirs(probe_dir, exist_ok=True) # Create minimal CMakeLists.txt cmake_lists = [ @@ -1172,7 +909,8 @@ def probe_compilers(self): ] for var in variables: cmake_lists.append(f'message(STATUS "{var}=${{{var}}}")') - self.write_text(os.path.join(probe_dir, "CMakeLists.txt"), "\n".join(cmake_lists)) + with open(os.path.join(probe_dir, "CMakeLists.txt"), "w") as f: + f.write("\n".join(cmake_lists)) # Build command cmd = [self.options.cmake_path, "-S", probe_dir] @@ -1201,518 +939,13 @@ def probe_compilers(self): self.compiler_info = values # Clean up probe directory - self.remove_dir(probe_dir) + shutil.rmtree(probe_dir) # Print default C++ compiler path print( f"Default C++ compiler: {self.compiler_info.get('CMAKE_CXX_COMPILER_ID', 'unknown')} ({self.compiler_info.get('CMAKE_CXX_COMPILER', 'unknown')})") - - # -------------------------- - # Recipe-driven dependencies - # -------------------------- - def build_archive_url(self, url, ref): - """ - For GitHub URLs, return an archive download URL for a commit or tag. - """ - if "github.com" not in url or not ref: - return None - # strip .git and trailing slash - clean = url - if clean.endswith(".git"): - clean = clean[:-4] - clean = clean.rstrip("/") - parts = clean.split("github.com/", 1)[1].split("/") - if len(parts) < 2: - return None - owner, repo = parts[0], parts[1] - return f"https://github.com/{owner}/{repo}/archive/{ref}.zip" - - def extract_zip_flatten(self, zip_path, dest_dir): - if self.options.dry_run: - self.ui.info(f"dry-run: would extract {zip_path} into {dest_dir}") - return - with zipfile.ZipFile(zip_path, 'r') as zf: - infos = zf.infolist() - # determine top-level prefix - prefix = None - for info in infos: - name = info.filename - if name.endswith("/"): - continue - parts = name.split("/", 1) - if len(parts) == 2: - prefix = parts[0] + "/" - break - if prefix is None: - prefix = "" - for info in infos: - name = info.filename - if name.endswith("/"): - continue - rel = name[len(prefix):] if name.startswith(prefix) else name - target_path = os.path.join(dest_dir, rel) - target_dir = os.path.dirname(target_path) - self.ensure_dir(target_dir) - with zf.open(info, 'r') as src, open(target_path, 'wb') as dst: - shutil.copyfileobj(src, dst) - - def extract_tar_flatten(self, tar_path, dest_dir): - if self.options.dry_run: - self.ui.info(f"dry-run: would extract {tar_path} into {dest_dir}") - return - mode = "r:*" - with tarfile.open(tar_path, mode) as tf: - # determine top-level prefix - prefix = None - for member in tf.getmembers(): - parts = member.name.split("/", 1) - if len(parts) == 2: - prefix = parts[0] + "/" - break - if prefix is None: - prefix = "" - for member in tf.getmembers(): - if member.isdir(): - continue - rel = member.name[len(prefix):] if member.name.startswith(prefix) else member.name - target_path = os.path.join(dest_dir, rel) - self.ensure_dir(os.path.dirname(target_path)) - with tf.extractfile(member) as src, open(target_path, "wb") as dst: - shutil.copyfileobj(src, dst) - - def recipe_stamp_path(self, recipe: Recipe): - return os.path.join(recipe.install_dir, ".bootstrap-stamp.json") - - def is_recipe_up_to_date(self, recipe: Recipe, resolved_ref: str): - stamp_path = self.recipe_stamp_path(recipe) - if not os.path.exists(stamp_path): - return False - try: - data = json.loads(open(stamp_path, "r", encoding="utf-8").read()) - except Exception: - return False - return data.get("version") == recipe.version and data.get("ref") == resolved_ref - - def write_recipe_stamp(self, recipe: Recipe, resolved_ref: str): - if self.options.dry_run: - self.ui.info(f"dry-run: would write stamp for {recipe.name} at {self.recipe_stamp_path(recipe)}") - return - payload = { - "name": recipe.name, - "version": recipe.version, - "ref": resolved_ref, - } - self.ensure_dir(recipe.install_dir) - self.write_text(self.recipe_stamp_path(recipe), json.dumps(payload, indent=2)) - - def fetch_recipe_source(self, recipe: Recipe): - src = recipe.source - dest = recipe.source_dir - archive_url = None - resolved_ref = src.commit or src.tag or src.branch or src.ref or "" - - if self.options.clean and os.path.exists(dest): - self.remove_dir(dest) - if not self.options.force and self.is_recipe_up_to_date(recipe, resolved_ref): - self.ui.ok(f"[{recipe.name}] already up to date ({resolved_ref or 'HEAD'}).") - return resolved_ref - # If source already exists and we're not forcing or cleaning, skip re-download - if os.path.isdir(dest) and not self.options.clean and not self.options.force: - self.ui.info(f"{recipe.name}: source already present at {self.ui.shorten_path(dest)}; skipping download.") - return resolved_ref or "HEAD" - - if src.type == "git": - archive_url = self.build_archive_url(src.url, src.commit or src.tag or src.ref) - elif src.type in ("archive", "http", "zip"): - archive_url = src.url - - if archive_url: - filename = os.path.basename(archive_url.split("?")[0]) - tmp_archive = os.path.join(self.options.source_dir, "build", "third-party", "source", filename) - self.download_file(archive_url, tmp_archive) - if not self.options.dry_run and os.path.exists(dest): - self.remove_dir(dest) - self.ensure_dir(dest) - if not self.options.dry_run: - if archive_url.endswith(".zip"): - self.extract_zip_flatten(tmp_archive, dest) - else: - self.extract_tar_flatten(tmp_archive, dest) - os.remove(tmp_archive) - else: - # fallback to git - depth = ["--depth", str(src.depth)] if src.depth else [] - if not os.path.exists(dest): - self.ensure_dir(os.path.dirname(dest)) - clone_cmd = [self.options.git_path or "git", "clone", src.url, dest, *depth] - if src.branch and not src.commit: - clone_cmd.extend(["--branch", src.branch]) - self.run_cmd(clone_cmd) - if resolved_ref: - self.run_cmd([self.options.git_path or "git", "fetch", "--tags"], cwd=dest) - self.run_cmd([self.options.git_path or "git", "checkout", resolved_ref], cwd=dest) - else: - self.run_cmd([self.options.git_path or "git", "pull", "--ff-only"], cwd=dest) - - return resolved_ref or "HEAD" - - def apply_recipe_patches(self, recipe: Recipe): - patch_root = os.path.join(self.patches_dir, recipe.name) - if not os.path.isdir(patch_root): - return - entries = sorted(os.listdir(patch_root)) - for entry in entries: - path = os.path.join(patch_root, entry) - if entry.endswith(".patch"): - self.ui.info(f"Applying patch {path}") - self.run_cmd(["patch", "-p1", "-i", path], cwd=recipe.source_dir) - else: - target = os.path.join(recipe.source_dir, entry) - if os.path.isdir(path): - if self.options.dry_run: - self.ui.info(f"dry-run: would copy directory {path} -> {target}") - else: - shutil.copytree(path, target, dirs_exist_ok=True) - else: - if self.options.dry_run: - self.ui.info(f"dry-run: would copy file {path} -> {target}") - else: - self.ensure_dir(os.path.dirname(target)) - shutil.copy(path, target) - - def _expand_path(self, template: str, build_type: str): - if not template: - return template - mrdocs = self.options.source_dir - third = self.options.third_party_src_dir - build_lower = build_type.lower() if build_type else "" - repl = { - "${source_dir}": mrdocs, - "${third_party_src_dir}": third, - "${build_type}": build_type, - "${build_type_lower}": build_lower, - } - out = template - for k, v in repl.items(): - out = out.replace(k, v) - if not os.path.isabs(out): - out = os.path.normpath(os.path.join(mrdocs, out)) - return out - - def load_recipe_files(self) -> List[Recipe]: - recipes_dir = self.recipes_dir - patches_dir = self.patches_dir - if not os.path.isdir(recipes_dir): - return [] - # For debug-fast, dependencies reuse release (or optimized debug on Windows) builds/presets. - dep_build_type = "OptimizedDebug" if self.is_windows() else "Release" - dep_preset = self.options.preset - if self.options.build_type.lower() in ("debugfast", "debug-fast"): - if "debug-fast" in dep_preset: - dep_preset = dep_preset.replace("debug-fast", dep_build_type.lower()) - elif "debugfast" in dep_preset: - dep_preset = dep_preset.replace("debugfast", dep_build_type.lower()) - recipes: List[Recipe] = [] - for path in sorted(os.listdir(recipes_dir)): - if not path.endswith(".json"): - continue - full = os.path.join(recipes_dir, path) - try: - data = json.load(open(full, "r", encoding="utf-8")) - except Exception as exc: - self.ui.warn(f"Skipping recipe {path}: {exc}") - continue - src = data.get("source", {}) - recipe = Recipe( - name=data.get("name") or os.path.splitext(path)[0], - version=str(data.get("version", "")), - source=RecipeSource( - type=src.get("type", "git"), - url=src.get("url", ""), - branch=src.get("branch"), - tag=src.get("tag"), - commit=src.get("commit"), - ref=src.get("ref"), - depth=src.get("depth"), - submodules=bool(src.get("submodules", False)), - ), - dependencies=data.get("dependencies", []), - source_dir=data.get("source_dir", ""), - build_dir=data.get("build_dir", ""), - install_dir=data.get("install_dir", ""), - build_type=data.get("build_type", "Release"), - build=data.get("build", []), - tags=data.get("tags", []), - package_root_var=data.get("package_root_var"), - install_scope=data.get("install_scope", "per-preset"), - ) - placeholders = self._recipe_placeholders(recipe) - - # Apply placeholders to source reference fields - recipe.source.url = self._apply_placeholders(recipe.source.url, placeholders) - recipe.source.branch = self._apply_placeholders(recipe.source.branch, placeholders) - recipe.source.tag = self._apply_placeholders(recipe.source.tag, placeholders) - recipe.source.commit = self._apply_placeholders(recipe.source.commit, placeholders) - recipe.source.ref = self._apply_placeholders(recipe.source.ref, placeholders) - - # Paths are controlled by bootstrap, not the recipe file. - tp_root = os.path.join(self.options.source_dir, "build", "third-party") - preset = dep_preset - if recipe.install_scope == "global": - recipe.source_dir = os.path.join(tp_root, "source", recipe.name) - recipe.build_dir = os.path.join(tp_root, "build", recipe.name) - recipe.install_dir = os.path.join(tp_root, "install", recipe.name) - else: - recipe.source_dir = os.path.join(tp_root, "source", recipe.name) - recipe.build_dir = os.path.join(tp_root, "build", preset, recipe.name) - recipe.install_dir = os.path.join(tp_root, "install", preset, recipe.name) - recipes.append(recipe) - return recipes - - def _topo_sort_recipes(self, recipes: List[Recipe]) -> List[Recipe]: - by_name = {r.name: r for r in recipes} - visited: Dict[str, bool] = {} - order: List[Recipe] = [] - - def visit(name, stack): - state = visited.get(name) - if state is True: - return - if state is False: - raise RuntimeError(f"Dependency cycle: {' -> '.join(stack + [name])}") - visited[name] = False - stack.append(name) - for dep in by_name[name].dependencies: - if dep not in by_name: - raise RuntimeError(f"Missing dependency recipe '{dep}' needed by '{name}'") - visit(dep, stack) - visited[name] = True - stack.pop() - order.append(by_name[name]) - - for n in by_name: - if visited.get(n) is not True: - visit(n, []) - return order - - def _recipe_placeholders(self, recipe: Recipe) -> Dict[str, str]: - host_suffix = "windows" if self.is_windows() else "unix" - return { - "BOOTSTRAP_BUILD_TYPE": recipe.build_type, - "BOOTSTRAP_BUILD_TYPE_LOWER": recipe.build_type.lower(), - "BOOTSTRAP_CONFIGURE_PRESET": self.options.preset, - "BOOTSTRAP_CC": self.options.cc or "", - "BOOTSTRAP_CXX": self.options.cxx or "", - "BOOTSTRAP_PROJECT_BUILD_DIR": self.options.build_dir, - "BOOTSTRAP_PROJECT_INSTALL_DIR": self.options.install_dir, - "BOOTSTRAP_HOST_PRESET_SUFFIX": host_suffix, - "build_type": recipe.build_type, - "build_type_lower": recipe.build_type.lower(), - } - - def _apply_placeholders(self, value: Any, placeholders: Dict[str, str]) -> Any: - if isinstance(value, str): - for k, v in placeholders.items(): - value = value.replace("${" + k + "}", v) - return value - if isinstance(value, list): - return [self._apply_placeholders(v, placeholders) for v in value] - if isinstance(value, dict): - return {self._apply_placeholders(k, placeholders): self._apply_placeholders(v, placeholders) for k, v in value.items()} - return value - - def _run_cmake_recipe_step(self, recipe: Recipe, step: Dict[str, Any]): - cmake_exe = shutil.which("cmake") - if not cmake_exe: - raise RuntimeError("cmake executable not found in PATH.") - placeholders = self._recipe_placeholders(recipe) - opts = self._apply_placeholders(step.get("options", []), placeholders) - build_dir = self._expand_path(step.get("build_dir", recipe.build_dir), recipe.build_type) - source_dir = self._expand_path(step.get("source_dir", recipe.source_dir), recipe.build_type) - source_subdir = step.get("source_subdir") - if source_subdir: - source_dir = os.path.join(source_dir, self._apply_placeholders(source_subdir, placeholders)) - generator = step.get("generator") - config = self._apply_placeholders(step.get("config", recipe.build_type), placeholders) - targets = self._apply_placeholders(step.get("targets", []), placeholders) - install_flag = step.get("install", True) - - # Optional sanitizer-specific options declared in the recipe - san_map = step.get("sanitizers", {}) - if self.options.sanitizer: - san = self.options.sanitizer.lower() - if san_map: - extra = san_map.get(san) - if extra is None: - raise ValueError(f"Unknown sanitizer '{self.options.sanitizer}' for recipe '{recipe.name}'.") - extra_opts = self._apply_placeholders(extra, placeholders) - if isinstance(extra_opts, list): - opts.extend(extra_opts) - else: - opts.append(extra_opts) - else: - # Fallback: apply typical compiler sanitizer flags (data-driven by compiler/sanitizer) - if self.is_windows(): - msvc_flags = { - "asan": "/fsanitize=address", - } - flag = msvc_flags.get(san) - else: - posix_flags = { - "asan": "-fsanitize=address", - "ubsan": "-fsanitize=undefined", - "msan": "-fsanitize=memory", - "tsan": "-fsanitize=thread", - } - flag = posix_flags.get(san) - - if flag: - # Initialize build/link flags; use *_FLAGS_INIT to avoid clobbering cache if present - opts.extend([ - f"-DCMAKE_C_FLAGS_INIT={flag}", - f"-DCMAKE_CXX_FLAGS_INIT={flag}", - f"-DCMAKE_EXE_LINKER_FLAGS_INIT={flag}", - f"-DCMAKE_SHARED_LINKER_FLAGS_INIT={flag}", - ]) - - self.ensure_dir(build_dir) - cfg_cmd = [cmake_exe, "-S", source_dir, "-B", build_dir] - if generator: - cfg_cmd.extend(["-G", generator]) - cfg_cmd.append(f"-DCMAKE_BUILD_TYPE={config}") - cfg_cmd.append(f"-DCMAKE_INSTALL_PREFIX={recipe.install_dir}") - if self.options.cc: - cfg_cmd.append(f"-DCMAKE_C_COMPILER={self.options.cc}") - if self.options.cxx: - cfg_cmd.append(f"-DCMAKE_CXX_COMPILER={self.options.cxx}") - cfg_cmd.extend(opts) - # Configure step can be chatty; use tail view - self.run_cmd(cfg_cmd, tail=True) - - build_cmd = [cmake_exe, "--build", build_dir] - if config: - build_cmd.extend(["--config", config]) - if targets: - build_cmd.extend(["--target", *targets]) - # Use available cores unless caller specified parallelism via env/flags - if "--parallel" not in build_cmd: - try: - parallel_level = max(1, os.cpu_count() or 1) - build_cmd.extend(["--parallel", str(parallel_level)]) - except Exception: - pass - if self.options.force: - build_cmd.extend(["--clean-first"]) - self.run_cmd(build_cmd, tail=True) - - if install_flag: - inst_cmd = [cmake_exe, "--install", build_dir] - if config: - inst_cmd.extend(["--config", config]) - self.run_cmd(inst_cmd, tail=True) - - def _run_command_recipe_step(self, recipe: Recipe, step: Dict[str, Any]): - placeholders = self._recipe_placeholders(recipe) - command = self._apply_placeholders(step.get("command", []), placeholders) - cwd = step.get("cwd") - if cwd: - cwd = self._expand_path(self._apply_placeholders(cwd, placeholders), recipe.build_type) - env = step.get("env") - if env: - env = {k: self._apply_placeholders(v, placeholders) for k, v in env.items()} - env.update(self.env or {}) - self.run_cmd(command, cwd=cwd) - - def build_recipe(self, recipe: Recipe): - for raw_step in (recipe.build or []): - step_type = raw_step.get("type", "").lower() - if step_type == "cmake": - self._run_cmake_recipe_step(recipe, raw_step) - elif step_type == "command": - self._run_command_recipe_step(recipe, raw_step) - else: - raise RuntimeError(f"Unsupported build step type '{step_type}' in recipe '{recipe.name}'") - - def install_recipes(self): - recipe_list = self.load_recipe_files() - if not recipe_list: - raise RuntimeError(f"No recipes found in {self.recipes_dir}. Add recipe JSON files to proceed.") - - if self.options.recipe_filter: - wanted = {name.strip().lower() for name in self.options.recipe_filter.split(",") if name.strip()} - recipe_list = [r for r in recipe_list if r.name.lower() in wanted] - - ordered = self._topo_sort_recipes(recipe_list) - - def detect_root_var(recipe: Recipe) -> Optional[str]: - # Prefer an inferred name from installed *Config.cmake (matches actual package case) - cfg_name = None - for dirpath, _, filenames in os.walk(recipe.install_dir): - for fn in filenames: - if fn.endswith("Config.cmake"): - cfg_name = fn[:-len("Config.cmake")] - break - if cfg_name: - break - if cfg_name: - return f"{cfg_name}_ROOT" - # Fallback to recipe hint if no config found - if recipe.package_root_var: - return recipe.package_root_var - return None - - for recipe in ordered: - resolved_ref = self.fetch_recipe_source(recipe) - self.apply_recipe_patches(recipe) - # Track recipe metadata - self.recipe_info[recipe.name] = recipe - root_var = detect_root_var(recipe) - if root_var: - self.package_roots[root_var] = recipe.install_dir - if self.options.skip_build: - continue - if self.is_recipe_up_to_date(recipe, resolved_ref) and not self.options.force: - self.ui.ok(f"[{recipe.name}] up to date; skipping build.") - continue - self.build_recipe(recipe) - self.write_recipe_stamp(recipe, resolved_ref) - root_var = detect_root_var(recipe) - if root_var: - self.package_roots[root_var] = recipe.install_dir - print(f"Default C++ build system: {self.compiler_info.get('CMAKE_GENERATOR', 'unknown')}") - def show_preset_summary(self): - """Display key details of the selected CMake user preset.""" - path = os.path.join(self.options.source_dir, "CMakeUserPresets.json") - try: - data = json.load(open(path, "r", encoding="utf-8")) - except Exception as exc: - self.ui.warn(f"Could not read {self.ui.shorten_path(path)}: {exc}") - return - preset = None - for p in data.get("configurePresets", []): - if p.get("name") == self.options.preset: - preset = p - break - if not preset: - self.ui.warn(f"Preset '{self.options.preset}' not found in {self.ui.shorten_path(path)}") - return - cache = preset.get("cacheVariables", {}) - roots = {k: v for k, v in cache.items() if k.endswith("_ROOT")} - summary = [ - ("Preset file", self.ui.shorten_path(path)), - ("Preset name", preset.get("name", "")), - ("Generator", preset.get("generator", "")), - ("Binary dir", preset.get("binaryDir", "")), - ] - if roots: - for k, v in sorted(roots.items()): - summary.append((k, v)) - if "CMAKE_MAKE_PROGRAM" in cache: - summary.append(("CMAKE_MAKE_PROGRAM", cache["CMAKE_MAKE_PROGRAM"])) - self.ui.kv_block(None, summary, indent=4) - @lru_cache(maxsize=1) def probe_msvc_dev_env(self): if not self.is_windows(): @@ -1768,61 +1001,22 @@ def probe_msvc_dev_env(self): self.env[key] = value print("MSVC development environment variables extracted successfully.") - def _inject_clang_toolchain_flags(self, config_args: List[str], cc_flags: str, cxx_flags: str): - """ - For clang/LLVM toolchains, prefer colocated binutils/linker/libc++ if available. - Works for Homebrew or any LLVM install that keeps tools together. - """ + @lru_cache(maxsize=1) + def is_homebrew_clang(self): self.probe_compilers() - compiler_id = self.compiler_info.get("CMAKE_CXX_COMPILER_ID", "").lower() - if compiler_id not in ("clang", "appleclang"): - return cc_flags, cxx_flags - - cxx_path = self.options.cxx or self.compiler_info.get("CMAKE_CXX_COMPILER", "") - if not cxx_path: - return cc_flags, cxx_flags - - tool_root = os.path.abspath(os.path.join(os.path.dirname(cxx_path), os.pardir)) - bin_dir = os.path.join(tool_root, "bin") - - def maybe_append(flag_var, tool_name): - tool_path = os.path.join(bin_dir, tool_name) - if self.is_executable(tool_path): - config_args.append(f"-D{flag_var}={tool_path}") - - for var, tool in [ - ("CMAKE_AR", "llvm-ar"), - ("CMAKE_CXX_COMPILER_AR", "llvm-ar"), - ("CMAKE_C_COMPILER_AR", "llvm-ar"), - ("CMAKE_RANLIB", "llvm-ranlib"), - ]: - maybe_append(var, tool) - - for linker in ["ld.lld", "lld"]: - ld_path = os.path.join(bin_dir, linker) - if self.is_executable(ld_path): - config_args.append(f"-DCMAKE_C_COMPILER_LINKER={ld_path}") - config_args.append(f"-DCMAKE_CXX_COMPILER_LINKER={ld_path}") - break - - libcxx_include = os.path.join(tool_root, "include", "c++", "v1") - libcxx_lib = os.path.join(tool_root, "lib", "c++") - libunwind = os.path.join(tool_root, "lib", "unwind") - if os.path.exists(libcxx_include) and os.path.exists(libcxx_lib): - cxx_flags += f" -stdlib=libc++ -I{libcxx_include}" - ld_flags = f"-L{libcxx_lib}" - if os.path.exists(libunwind): - ld_flags += f" -L{libunwind} -lunwind" - if self.options.sanitizer: - ld_flags += f" -fsanitize={self.sanitizer_flag_name(self.options.sanitizer)}" - for var in ["CMAKE_EXE_LINKER_FLAGS", "CMAKE_SHARED_LINKER_FLAGS", "CMAKE_MODULE_LINKER_FLAGS"]: - config_args.append(f"-D{var}={ld_flags}") - - return cc_flags, cxx_flags + if not self.is_macos(): + return False + if not self.compiler_info: + return False + if self.compiler_info["CMAKE_CXX_COMPILER_ID"].lower() != "clang": + return False + out = subprocess.run([self.options.cxx, "--version"], capture_output=True, text=True) + version = out.stdout.strip() + return "Homebrew clang" in version def install_ninja(self): # 1. Check if the user has set a ninja_path option - if self.prompt_option("ninja_path", "ninja"): + if self.prompt_option("ninja_path"): if not os.path.isabs(self.options.ninja_path): self.options.ninja_path = self.find_tool(self.options.ninja_path) if not self.is_executable(self.options.ninja_path): @@ -1832,26 +1026,17 @@ def install_ninja(self): # 2. If ninja_path is not set, but does the user have it available in PATH? ninja_path = self.find_tool("ninja") if ninja_path: - self.ui.info(f"Ninja found in PATH at {ninja_path}. Using it.") + print(f"Ninja found in PATH at {ninja_path}. Using it.") self.options.ninja_path = ninja_path return # 3. Ninja path isn't set and not available in PATH, so we download it - tp_root = os.path.join(self.options.source_dir, "build", "third-party") - source_dir = os.path.join(tp_root, "source", "ninja") - install_dir = os.path.join(tp_root, "install", self.options.preset, "ninja") - self.ensure_dir(source_dir) - self.ensure_dir(install_dir) - ninja_dir = install_dir + destination_dir = self.options.third_party_src_dir + ninja_dir = os.path.join(destination_dir, "ninja") exe_name = 'ninja.exe' if platform.system().lower() == 'windows' else 'ninja' ninja_path = os.path.join(ninja_dir, exe_name) if os.path.exists(ninja_path) and self.is_executable(ninja_path): - try: - rel = os.path.relpath(ninja_path, self.options.source_dir) - display_path = "./" + rel if not rel.startswith("..") else ninja_path - except Exception: - display_path = ninja_path - self.ui.ok(f"[ninja] already available at {display_path}; reusing.") + print(f"Ninja already exists at {ninja_path}. Using it.") self.options.ninja_path = ninja_path return @@ -1873,13 +1058,8 @@ def install_ninja(self): else: return - destination_dir = source_dir # 3b. Find the download URL for the latest Ninja release asset api_url = 'https://api.github.com/repos/ninja-build/ninja/releases/latest' - if self.options.dry_run: - self.options.ninja_path = ninja_path - self.ui.info(f"dry-run: would fetch {api_url} and download {asset_name} -> {destination_dir}") - return with urllib.request.urlopen(api_url) as resp: data = json.load(resp) release_assets = data.get('assets', []) @@ -1894,13 +1074,13 @@ def install_ninja(self): # 3c. Download the asset to the third-party source directory tmpzip = os.path.join(destination_dir, asset_name) - self.ensure_dir(destination_dir) + os.makedirs(destination_dir, exist_ok=True) print(f'Downloading {asset_name} …') urllib.request.urlretrieve(download_url, tmpzip) # 3d. Extract the downloaded zip file into the ninja dir print('Extracting…') - self.ensure_dir(ninja_dir) + os.makedirs(ninja_dir, exist_ok=True) with zipfile.ZipFile(tmpzip, 'r') as z: z.extractall(ninja_dir) os.remove(tmpzip) @@ -1931,28 +1111,248 @@ def is_abi_compatible(self, build_type_a, build_type_b): if not self.is_windows(): return True # On Windows, Debug and Release builds are not ABI compatible - def _is_debug(bt): - return bt.lower() in ("debug", "debugfast", "debug-fast", "optimizeddebug") - build_type_a_is_debug = _is_debug(build_type_a) - build_type_b_is_debug = _is_debug(build_type_b) + build_type_a_is_debug = build_type_a.lower() == "debug" + build_type_b_is_debug = build_type_b.lower() == "debug" return build_type_a_is_debug == build_type_b_is_debug + def install_duktape(self): + self.prompt_dependency_path_option("duktape_src_dir") + if not os.path.exists(self.options.duktape_src_dir): + self.prompt_option("duktape_url") + archive_filename = os.path.basename(self.options.duktape_url) + archive_path = os.path.join(self.options.third_party_src_dir, archive_filename) + self.download_file(self.options.duktape_url, archive_path) + with tarfile.open(archive_path, "r:xz") as tar: + top_level = tar.getnames()[0].split('/')[0] + for member in tar.getmembers(): + # Remove the top-level directory from the path + member_path = os.path.relpath(member.name, top_level) + if member_path == '.': + continue + member.name = member_path + tar.extract(member, path=self.options.duktape_src_dir) + os.remove(archive_path) + duktape_patches = os.path.join(self.options.mrdocs_src_dir, 'third-party', 'duktape') + if os.path.exists(duktape_patches): + for patch_file in os.listdir(duktape_patches): + patch_path = os.path.join(duktape_patches, patch_file) + shutil.copy(patch_path, self.options.duktape_src_dir) + duk_config_path = os.path.join(self.options.duktape_src_dir, "src", "duk_config.h") + if os.path.exists(duk_config_path): + with open(duk_config_path, "r") as f: + content = f.read() + new_content = content.replace("#define DUK_F_DLL_BUILD", "#undef DUK_F_DLL_BUILD") + if new_content != content: + with open(duk_config_path, "w") as f: + f.write(new_content) + else: + print(f"Warning: {duk_config_path} does not exist. Skipping patch.") + self.prompt_build_type_option("duktape_build_type") + if not self.is_abi_compatible(self.options.mrdocs_build_type, self.options.duktape_build_type): + if self.options.mrdocs_build_type.lower() == "debug": + # User asked for Release dependency, so we do the best we can and change it to + # an optimized debug build. + self.options.duktape_build_type = "OptimizedDebug" + else: + # User asked for a Debug dependency with Release build type for MrDocs. + # The dependency should just copy the release type here. Other options wouldn't make sense + # because we can't even debug it. + self.options.duktape_build_type = self.options.mrdocs_build_type + self.prompt_dependency_path_option("duktape_build_dir") + self.prompt_dependency_path_option("duktape_install_dir") + extra_args = [] + if self.options.sanitizer: + flag_name = self.sanitizer_flag_name(self.options.sanitizer) + for arg in ["CMAKE_C_FLAGS", "CMAKE_CXX_FLAGS"]: + extra_args.append( + f"-D{arg}=-fsanitize={flag_name} -fno-sanitize-recover={flag_name} -fno-omit-frame-pointer") + + self.cmake_workflow( + self.options.duktape_src_dir, + self.options.duktape_build_type, + self.options.duktape_build_dir, + self.options.duktape_install_dir, + extra_args) + + def install_lua(self): + # Resolve paths/values + self.prompt_dependency_path_option("lua_src_dir") + if not os.path.exists(self.options.lua_src_dir): + self.prompt_option("lua_url") + os.makedirs(self.options.lua_src_dir, exist_ok=True) + archive_filename = os.path.basename(self.options.lua_url) + archive_path = os.path.join(self.options.third_party_src_dir, archive_filename) + self.download_file(self.options.lua_url, archive_path) + + # Extract lua-5.4.8.tar.gz, flatten top-level dir into lua_src_dir + mode = "r:gz" if archive_filename.endswith(".gz") else "r:*" + with tarfile.open(archive_path, mode) as tar: + top_level = tar.getmembers()[0].name.split('/')[0] + for member in tar.getmembers(): + rel = os.path.relpath(member.name, top_level) + if rel == '.' or rel.startswith('..'): + continue + member.name = rel + tar.extract(member, path=self.options.lua_src_dir) + os.remove(archive_path) + + # Copy our tiny CMake patch files (like we do for Duktape) + lua_patches = os.path.join(self.options.mrdocs_src_dir, 'third-party', 'lua') + if os.path.exists(lua_patches): + for fname in os.listdir(lua_patches): + src = os.path.join(lua_patches, fname) + dst = os.path.join(self.options.lua_src_dir, fname) + shutil.copy(src, dst) + + # Lua’s own tree puts sources under src/; our CMakeLists handles that. + self.prompt_build_type_option("lua_build_type") + # align ABI expectations like we do for Duktape: + if not self.is_abi_compatible(self.options.mrdocs_build_type, self.options.lua_build_type): + if self.options.mrdocs_build_type.lower() == "debug": + self.options.lua_build_type = "OptimizedDebug" + else: + self.options.lua_build_type = self.options.mrdocs_build_type + + self.prompt_dependency_path_option("lua_build_dir") + self.prompt_dependency_path_option("lua_install_dir") + + extra_args = [] + if self.options.sanitizer: + flag = self.sanitizer_flag_name(self.options.sanitizer) + for arg in ("CMAKE_C_FLAGS", "CMAKE_CXX_FLAGS"): + extra_args.append(f"-D{arg}=-fsanitize={flag} -fno-sanitize-recover={flag} -fno-omit-frame-pointer") + + # Standard cmake_workflow like Duktape + self.cmake_workflow( + self.options.lua_src_dir, + self.options.lua_build_type, + self.options.lua_build_dir, + self.options.lua_install_dir, + extra_args + ) + + def install_libxml2(self): + self.prompt_dependency_path_option("libxml2_src_dir") + if not os.path.exists(self.options.libxml2_src_dir): + self.prompt_option("libxml2_repo") + self.prompt_option("libxml2_branch") + self.clone_repo(self.options.libxml2_repo, self.options.libxml2_src_dir, branch=self.options.libxml2_branch, + depth=1) + self.prompt_build_type_option("libxml2_build_type") + self.prompt_dependency_path_option("libxml2_build_dir") + self.prompt_dependency_path_option("libxml2_install_dir") + extra_args = [ + "-DBUILD_SHARED_LIBS=OFF", + "-DLIBXML2_WITH_PROGRAMS=ON", + "-DLIBXML2_WITH_FTP=OFF", + "-DLIBXML2_WITH_HTTP=OFF", + "-DLIBXML2_WITH_ICONV=OFF", + "-DLIBXML2_WITH_LEGACY=OFF", + "-DLIBXML2_WITH_LZMA=OFF", + "-DLIBXML2_WITH_ZLIB=OFF", + "-DLIBXML2_WITH_ICU=OFF", + "-DLIBXML2_WITH_TESTS=OFF", + "-DLIBXML2_WITH_HTML=ON", + "-DLIBXML2_WITH_C14N=ON", + "-DLIBXML2_WITH_CATALOG=ON", + "-DLIBXML2_WITH_DEBUG=ON", + "-DLIBXML2_WITH_ISO8859X=ON", + "-DLIBXML2_WITH_MEM_DEBUG=OFF", + "-DLIBXML2_WITH_MODULES=ON", + "-DLIBXML2_WITH_OUTPUT=ON", + "-DLIBXML2_WITH_PATTERN=ON", + "-DLIBXML2_WITH_PUSH=ON", + "-DLIBXML2_WITH_PYTHON=OFF", + "-DLIBXML2_WITH_READER=ON", + "-DLIBXML2_WITH_REGEXPS=ON", + "-DLIBXML2_WITH_SAX1=ON", + "-DLIBXML2_WITH_SCHEMAS=ON", + "-DLIBXML2_WITH_SCHEMATRON=ON", + "-DLIBXML2_WITH_THREADS=ON", + "-DLIBXML2_WITH_THREAD_ALLOC=OFF", + "-DLIBXML2_WITH_TREE=ON", + "-DLIBXML2_WITH_VALID=ON", + "-DLIBXML2_WITH_WRITER=ON", + "-DLIBXML2_WITH_XINCLUDE=ON", + "-DLIBXML2_WITH_XPATH=ON", + "-DLIBXML2_WITH_XPTR=ON" + ] + self.cmake_workflow(self.options.libxml2_src_dir, self.options.libxml2_build_type, + self.options.libxml2_build_dir, self.options.libxml2_install_dir, extra_args) + + def install_llvm(self): + self.prompt_dependency_path_option("llvm_src_dir") + if not os.path.exists(self.options.llvm_src_dir): + self.prompt_option("llvm_repo") + self.prompt_option("llvm_commit") + os.makedirs(self.options.llvm_src_dir, exist_ok=True) + self.run_cmd([self.options.git_path, "init"], self.options.llvm_src_dir) + self.run_cmd([self.options.git_path, "remote", "add", "origin", self.options.llvm_repo], + self.options.llvm_src_dir) + self.run_cmd([self.options.git_path, "fetch", "--depth", "1", "origin", self.options.llvm_commit], + self.options.llvm_src_dir) + self.run_cmd([self.options.git_path, "checkout", "FETCH_HEAD"], self.options.llvm_src_dir) + + llvm_subproject_dir = os.path.join(self.options.llvm_src_dir, "llvm") + llvm_patches = os.path.join(self.options.mrdocs_src_dir, 'third-party', 'llvm') + if os.path.exists(llvm_patches): + for patch_file in os.listdir(llvm_patches): + patch_path = os.path.join(llvm_patches, patch_file) + shutil.copy(patch_path, llvm_subproject_dir) + self.prompt_build_type_option("llvm_build_type") + # Same logic as for Duktape + if not self.is_abi_compatible(self.options.mrdocs_build_type, self.options.llvm_build_type): + if self.options.mrdocs_build_type.lower() == "debug": + self.options.llvm_build_type = "OptimizedDebug" + else: + self.options.llvm_build_type = self.options.mrdocs_build_type + self.prompt_dependency_path_option("llvm_build_dir") + self.prompt_dependency_path_option("llvm_install_dir") + cmake_preset = f"{self.options.llvm_build_type.lower()}-win" if self.is_windows() else f"{self.options.llvm_build_type.lower()}-unix" + cmake_extra_args = [f"--preset={cmake_preset}"] + if self.options.sanitizer: + if self.options.sanitizer.lower() == "asan": + cmake_extra_args.append("-DLLVM_USE_SANITIZER=Address") + elif self.options.sanitizer.lower() == "ubsan": + cmake_extra_args.append("-DLLVM_USE_SANITIZER=Undefined") + elif self.options.sanitizer.lower() == "msan": + cmake_extra_args.append("-DLLVM_USE_SANITIZER=Memory") + elif self.options.sanitizer.lower() == "tsan": + cmake_extra_args.append("-DLLVM_USE_SANITIZER=Thread") + else: + raise ValueError(f"Unknown LLVM sanitizer '{self.options.sanitizer}'.") + self.cmake_workflow( + llvm_subproject_dir, + self.options.llvm_build_type, + self.options.llvm_build_dir, + self.options.llvm_install_dir, + cmake_extra_args) def create_cmake_presets(self): - # Generate or update CMakeUserPresets.json directly - user_presets_path = os.path.join(self.options.source_dir, "CMakeUserPresets.json") - if os.path.exists(user_presets_path): - with open(user_presets_path, "r") as f: - user_presets = json.load(f) - else: - user_presets = { - "version": 6, - "cmakeMinimumRequired": {"major": 3, "minor": 21, "patch": 0}, - "configurePresets": [] - } + # Ask the user if they want to create CMake User presets referencing the installed dependencies + # Otherwise, we skip this step and pass the directories as command line arguments to the CMake build command + if not self.prompt_option("mrdocs_use_user_presets"): + print("Skipping CMake User presets creation as per user preference.") + return + + # If they choose to create presets, we either generate or update the CMakeUserPresets.json file + user_presets_path = os.path.join(self.options.mrdocs_src_dir, "CMakeUserPresets.json") + if not os.path.exists(user_presets_path): + user_presets_example_path = os.path.join(self.options.mrdocs_src_dir, "CMakeUserPresets.json.example") + if not os.path.exists(user_presets_example_path): + raise FileNotFoundError(f"Cannot find CMakeUserPresets.json.example in {self.options.mrdocs_src_dir}.") + shutil.copy(user_presets_example_path, user_presets_path) + + # Now that we know the file exists, we can read it and update the paths + # Read the file as json + with open(user_presets_path, "r") as f: + user_presets = json.load(f) # Come up with a nice user preset name - self.prompt_option("preset", "CMake preset") + is_debug_fast = self.options.mrdocs_build_type.lower() == "debug" and self.options.llvm_build_type != self.options.mrdocs_build_type + if is_debug_fast: + self.default_options.mrdocs_preset_name += "-fast" + self.prompt_option("mrdocs_preset_name") # Upsert the preset in the "configurePresets" array of objects # If preset with the same name already exists, we update it @@ -1969,16 +1369,15 @@ def create_cmake_presets(self): # Preset inherits from the parent preset based on the build type parent_preset_name = "debug" - bt_lower = self.options.build_type.lower() - if bt_lower not in ("debug", "debugfast", "debug-fast"): + if self.options.mrdocs_build_type.lower() != "debug": parent_preset_name = "release" - if bt_lower == "relwithdebinfo": + if self.options.mrdocs_build_type.lower() == "relwithdebinfo": parent_preset_name = "relwithdebinfo" # Nice display name for the preset - display_name = f"{self.options.build_type}" - if bt_lower in ("debugfast", "debug-fast"): - display_name = "Debug (fast)" + display_name = f"{self.options.mrdocs_build_type}" + if self.options.mrdocs_build_type.lower() == "debug" and self.options.llvm_build_type != self.options.mrdocs_build_type: + display_name += " with Optimized Dependencies" display_name += f" ({OSDisplayName}" if self.options.cc: display_name += f": {os.path.basename(self.options.cc)}" @@ -1993,41 +1392,28 @@ def create_cmake_presets(self): elif "CMAKE_GENERATOR" in self.compiler_info: generator = self.compiler_info["CMAKE_GENERATOR"] - main_cmake_build_type = "Debug" if self.options.build_type.lower() in ("debugfast", "debug-fast") else self.options.build_type - cache_vars = { - "CMAKE_BUILD_TYPE": main_cmake_build_type, - "MRDOCS_BUILD_DOCS": False, - "MRDOCS_GENERATE_REFERENCE": False, - "MRDOCS_GENERATE_ANTORA_REFERENCE": False - } - # Rebuild package roots strictly from recipe metadata for this run - self.package_roots = {} - for rec in self.recipe_info.values(): - if rec.package_root_var: - self.package_roots[rec.package_root_var] = rec.install_dir - - # Only set explicit *_ROOT cache variables; avoid CMAKE_PREFIX_PATH to prevent regex issues - dedup_roots: Dict[str, Tuple[str, str]] = {} - for var, path in self.package_roots.items(): - k = var.lower() - # Prefer lowercase variable name if both forms exist - if k not in dedup_roots or var.islower(): - dedup_roots[k] = (var, path) - # rewrite package_roots to the deduped, preferred casing - self.package_roots = {var: path for (_, (var, path)) in dedup_roots.items()} - for var, path in self.package_roots.items(): - cache_vars[var] = path - # Ensure no stray prefix path sneaks in - cache_vars.pop("CMAKE_PREFIX_PATH", None) - new_preset = { - "name": self.options.preset, + "name": self.options.mrdocs_preset_name, "generator": generator, "displayName": display_name, - "description": f"Preset for building MrDocs in {self.options.build_type} mode with the {os.path.basename(self.options.cc) if self.options.cc else 'default'} compiler in {OSDisplayName}.", + "description": f"Preset for building MrDocs in {self.options.mrdocs_build_type} mode with the {os.path.basename(self.options.cc) if self.options.cc else 'default'} compiler in {OSDisplayName}.", "inherits": parent_preset_name, "binaryDir": "${sourceDir}/build/${presetName}", - "cacheVariables": cache_vars, + "cacheVariables": { + "CMAKE_BUILD_TYPE": self.options.mrdocs_build_type, + "LLVM_ROOT": self.options.llvm_install_dir, + "Clang_ROOT": self.options.llvm_install_dir, + "duktape_ROOT": self.options.duktape_install_dir, + "Duktape_ROOT": self.options.duktape_install_dir, + "libxml2_ROOT": self.options.libxml2_install_dir, + "LibXml2_ROOT": self.options.libxml2_install_dir, + "LUA_ROOT": self.options.lua_install_dir, + "Lua_ROOT": self.options.lua_install_dir, + "lua_ROOT": self.options.lua_install_dir, + "MRDOCS_BUILD_DOCS": False, + "MRDOCS_GENERATE_REFERENCE": False, + "MRDOCS_GENERATE_ANTORA_REFERENCE": False + }, "warnings": { "unusedCli": False }, @@ -2047,7 +1433,6 @@ def create_cmake_presets(self): new_preset["cacheVariables"]["CMAKE_CXX_COMPILER"] = self.options.cxx if self.options.ninja_path: new_preset["cacheVariables"]["CMAKE_MAKE_PROGRAM"] = self.options.ninja_path - new_preset["generator"] = "Ninja" cc_flags = '' cxx_flags = '' @@ -2056,12 +1441,43 @@ def create_cmake_presets(self): cc_flags = f"-fsanitize={flag_name} -fno-sanitize-recover={flag_name} -fno-omit-frame-pointer" cxx_flags = f"-fsanitize={flag_name} -fno-sanitize-recover={flag_name} -fno-omit-frame-pointer" - cache_config_args: List[str] = [] - cc_flags, cxx_flags = self._inject_clang_toolchain_flags(cache_config_args, cc_flags, cxx_flags) - for arg in cache_config_args: - key, value = arg.split("=", 1) - key = key.replace("-D", "", 1) - new_preset["cacheVariables"][key] = value + if self.is_homebrew_clang(): + homebrew_clang_root = os.path.dirname(os.path.dirname(self.options.cxx)) + ar_path = os.path.join(homebrew_clang_root, "bin", "llvm-ar") + if self.is_executable(ar_path): + for cxx_flag_var in [ + "CMAKE_AR", + "CMAKE_CXX_COMPILER_AR", + "CMAKE_C_COMPILER_AR" + ]: + new_preset["cacheVariables"][cxx_flag_var] = ar_path + runlib_path = os.path.join(homebrew_clang_root, "bin", "llvm-ranlib") + if self.is_executable(runlib_path): + new_preset["cacheVariables"]['CMAKE_RANLIB'] = runlib_path + ld_path = os.path.join(homebrew_clang_root, "bin", "ld.lld") + if self.is_executable(ld_path): + new_preset["cacheVariables"]['CMAKE_C_COMPILER_LINKER'] = ld_path + new_preset["cacheVariables"]['CMAKE_CXX_COMPILER_LINKER'] = ld_path + else: + ld_path = '/opt/homebrew/bin/ld.lld' + if self.is_executable(ld_path): + new_preset["cacheVariables"]['CMAKE_C_COMPILER_LINKER'] = ld_path + new_preset["cacheVariables"]['CMAKE_CXX_COMPILER_LINKER'] = ld_path + libcxx_include = os.path.join(homebrew_clang_root, "include", "c++", "v1") + libcxx_lib = os.path.join(homebrew_clang_root, "lib", "c++") + libunwind = os.path.join(homebrew_clang_root, "lib", "unwind") + if os.path.exists(libcxx_include) and os.path.exists(libcxx_lib) and os.path.exists(libunwind): + cxx_flags += f' -stdlib=libc++ -I{libcxx_include}' + ld_flags = f'-L{libcxx_lib} -L{libunwind} -lunwind' + if self.options.sanitizer: + ld_flags += f' -fsanitize={self.sanitizer_flag_name(self.options.sanitizer)}' + for cxx_linker_flag_var in [ + "CMAKE_EXE_LINKER_FLAGS", + "CMAKE_SHARED_LINKER_FLAGS", + "CMAKE_MODULE_LINKER_FLAGS" + ]: + new_preset["cacheVariables"][cxx_linker_flag_var] = ld_flags + if cc_flags: new_preset["cacheVariables"]['CMAKE_C_FLAGS'] = cc_flags.strip() if cxx_flags: @@ -2070,7 +1486,7 @@ def create_cmake_presets(self): # if build type is debug and compiler is clang (default macos or explicitly clang), # add "CMAKE_CXX_FLAGS": "-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE" # or append it to existing CMAKE_CXX_FLAGS - if self.options.build_type.lower() == "debug": + if self.options.mrdocs_build_type.lower() == "debug": is_clang = False if self.options.cxx and "clang" in os.path.basename(self.options.cxx).lower(): is_clang = True @@ -2099,36 +1515,31 @@ def create_cmake_presets(self): } } - # Update cache variables path prefixes with their relative equivalents (semicolon-safe) - source_dir_parent = os.path.dirname(self.options.source_dir) - if source_dir_parent == self.options.source_dir: - source_dir_parent = '' + # Update cache variables path prefixes with their relative equivalents + mrdocs_src_dir_parent = os.path.dirname(self.options.mrdocs_src_dir) + if mrdocs_src_dir_parent == self.options.mrdocs_src_dir: + mrdocs_src_dir_parent = '' home_dir = os.path.expanduser("~") - - def normalize_value(val: str) -> str: - if not isinstance(val, str): - return val - parts = val.split(";") - out_parts = [] - for part in parts: - p = part - if self.options.source_dir and p.startswith(self.options.source_dir): - p = "${sourceDir}" + p[len(self.options.source_dir):] - elif source_dir_parent and p.startswith(source_dir_parent): - p = "${sourceParentDir}" + p[len(source_dir_parent):] - elif home_dir and p.startswith(home_dir): - p = "$env{HOME}" + p[len(home_dir):] - out_parts.append(p) - return ";".join(out_parts) - - for key, value in list(new_preset["cacheVariables"].items()): - if isinstance(value, str): - new_preset["cacheVariables"][key] = normalize_value(value) + for key, value in new_preset["cacheVariables"].items(): + if not isinstance(value, str): + continue + # Replace mrdocs-src-dir with ${sourceDir} + if self.options.mrdocs_src_dir and value.startswith(self.options.mrdocs_src_dir): + new_value = "${sourceDir}" + value[len(self.options.mrdocs_src_dir):] + new_preset["cacheVariables"][key] = new_value + # Replace mrdocs-src-dir parent with ${sourceParentDir} + elif mrdocs_src_dir_parent and value.startswith(mrdocs_src_dir_parent): + new_value = "${sourceParentDir}" + value[len(mrdocs_src_dir_parent):] + new_preset["cacheVariables"][key] = new_value + # Replace $HOME with $env{HOME} + elif home_dir and value.startswith(home_dir): + new_value = "$env{HOME}" + value[len(home_dir):] + new_preset["cacheVariables"][key] = new_value # Upsert preset preset_exists = False for preset in user_presets.get("configurePresets", []): - if preset.get("name") == self.options.preset: + if preset.get("name") == self.options.mrdocs_preset_name: preset_exists = True # Update the existing preset preset.update(new_preset) @@ -2138,7 +1549,8 @@ def normalize_value(val: str) -> str: user_presets.setdefault("configurePresets", []).append(new_preset) # Write the updated presets back to the file - self.write_text(user_presets_path, json.dumps(user_presets, indent=4)) + with open(user_presets_path, "w") as f: + json.dump(user_presets, f, indent=4) def _git_symlink_entries(self, repo_dir): """ @@ -2184,20 +1596,13 @@ def _make_symlink_or_fallback(self, file_path, intended_target, repo_dir): Falls back to hardlink/copy on Windows if symlinks aren’t permitted. Returns: 'symlink' | 'hardlink' | 'copy' """ - if self.options.dry_run: - self.ui.info(f"dry-run: would ensure symlink {file_path} -> {intended_target}") - return "dry-run" - parent = os.path.dirname(file_path) if parent and not os.path.isdir(parent): - self.ensure_dir(parent) + os.makedirs(parent, exist_ok=True) # Remove existing non-symlink file if os.path.exists(file_path) and not os.path.islink(file_path): - if self.options.dry_run: - self.ui.info(f"dry-run: would remove file {file_path}") - else: - os.remove(file_path) + os.remove(file_path) # Git stores POSIX-style link text; translate to native separators for the OS call native_target = intended_target.replace("/", os.sep) @@ -2210,15 +1615,9 @@ def _make_symlink_or_fallback(self, file_path, intended_target, repo_dir): try: # On Windows, target_is_directory must be correct for directory links if os.name == "nt": - if self.options.dry_run: - self.ui.info(f"dry-run: would create symlink {file_path} -> {native_target}") - else: - os.symlink(native_target, file_path, target_is_directory=target_is_dir) + os.symlink(native_target, file_path, target_is_directory=target_is_dir) else: - if self.options.dry_run: - self.ui.info(f"dry-run: would create symlink {file_path} -> {native_target}") - else: - os.symlink(native_target, file_path) + os.symlink(native_target, file_path) return "symlink" except (NotImplementedError, OSError, PermissionError): pass @@ -2226,24 +1625,19 @@ def _make_symlink_or_fallback(self, file_path, intended_target, repo_dir): # Fallback: hardlink (files only, same volume) try: if os.path.isfile(resolved_target): - if self.options.dry_run: - self.ui.info(f"dry-run: would create hardlink {file_path} -> {resolved_target}") - else: - os.link(resolved_target, file_path) + os.link(resolved_target, file_path) return "hardlink" except OSError: pass # Last resort: copy the file contents if it exists if os.path.isfile(resolved_target): - if self.options.dry_run: - self.ui.info(f"dry-run: would copy {resolved_target} -> {file_path}") - else: - shutil.copyfile(resolved_target, file_path) + shutil.copyfile(resolved_target, file_path) return "copy" # If the target doesn’t exist in WT, write the intended link text so state is explicit - self.write_text(file_path, intended_target, encoding="utf-8") + with open(file_path, "w", encoding="utf-8") as f: + f.write(intended_target) return "copy" def _is_git_repo(self, repo_dir): @@ -2310,26 +1704,54 @@ def check_git_symlinks(self, repo_dir): ) def install_mrdocs(self): - self.check_git_symlinks(self.options.source_dir) + self.check_git_symlinks(self.options.mrdocs_src_dir) + + if not self.options.mrdocs_use_user_presets: + self.prompt_option("mrdocs_build_dir") + else: + self.options.mrdocs_build_dir = os.path.join(self.options.mrdocs_src_dir, "build", + self.options.mrdocs_preset_name) + self.default_options.mrdocs_build_dir = self.options.mrdocs_build_dir - # build_dir/install_dir already collected; ensure they are set relative to preset if empty - if not self.options.build_dir: - self.options.build_dir = os.path.join(self.options.source_dir, "build", self.options.preset) - if not self.options.system_install and not self.options.install_dir: - self.options.install_dir = os.path.join(self.options.source_dir, "install", self.options.preset) + if not self.prompt_option("mrdocs_system_install"): + if self.options.mrdocs_use_user_presets: + self.default_options.mrdocs_install_dir = os.path.join(self.options.mrdocs_src_dir, "install", + self.options.mrdocs_preset_name) + self.prompt_option("mrdocs_install_dir") extra_args = [] - if not self.options.system_install and self.options.install_dir: - extra_args.extend(["-D", f"CMAKE_INSTALL_PREFIX={self.options.install_dir}"]) + if not self.options.mrdocs_system_install and self.options.mrdocs_install_dir: + extra_args.extend(["-D", f"CMAKE_INSTALL_PREFIX={self.options.mrdocs_install_dir}"]) - extra_args.append(f"--preset={self.options.preset}") + if self.options.mrdocs_use_user_presets: + extra_args.append(f"--preset={self.options.mrdocs_preset_name}") + else: + # If not using user presets, we pass the directories as command line arguments + extra_args.extend([ + "-D", f"LLVM_ROOT={self.options.llvm_install_dir}", + "-D", f"Clang_ROOT={self.options.llvm_install_dir}", + "-D", f"duktape_ROOT={self.options.duktape_install_dir}", + "-D", f"Duktape_ROOT={self.options.duktape_install_dir}", + ]) + if self.options.mrdocs_build_tests: + extra_args.extend([ + "-D", f"libxml2_ROOT={self.options.libxml2_install_dir}", + "-D", f"LibXml2_ROOT={self.options.libxml2_install_dir}" + ]) + extra_args.extend(["-D", "MRDOCS_BUILD_TESTS=ON"]) + extra_args.extend(["-DMRDOCS_BUILD_DOCS=OFF", "-DMRDOCS_GENERATE_REFERENCE=OFF", + "-DMRDOCS_GENERATE_ANTORA_REFERENCE=OFF"]) + + if self.options.sanitizer: + flag_name = self.sanitizer_flag_name(self.options.sanitizer) + for arg in ["CMAKE_C_FLAGS", "CMAKE_CXX_FLAGS"]: + extra_args.append( + f"-D{arg}=-fsanitize={flag_name} -fno-sanitize-recover={flag_name} -fno-omit-frame-pointer") - main_build_type = "Debug" if self.options.build_type.lower() in ("debugfast", "debug-fast") else self.options.build_type - self.cmake_workflow(self.options.source_dir, main_build_type, self.options.build_dir, - self.options.install_dir, extra_args, force_rebuild=False, - remove_build_dir=False, allow_skip=False) + self.cmake_workflow(self.options.mrdocs_src_dir, self.options.mrdocs_build_type, self.options.mrdocs_build_dir, + self.options.mrdocs_install_dir, extra_args, force_rebuild=False, remove_build_dir=False) - if self.options.build_dir and self.prompt_option("run_tests", "Run tests after build"): + if self.options.mrdocs_build_dir and self.prompt_option("mrdocs_run_tests"): # Look for ctest path relative to the cmake path ctest_path = os.path.join(os.path.dirname(self.options.cmake_path), "ctest") if self.is_windows(): @@ -2337,27 +1759,36 @@ def install_mrdocs(self): if not os.path.exists(ctest_path): raise FileNotFoundError( f"ctest executable not found at {ctest_path}. Please ensure CMake is installed correctly.") - test_args = [ctest_path, "--test-dir", self.options.build_dir, "--output-on-failure", "--progress", + test_args = [ctest_path, "--test-dir", self.options.mrdocs_build_dir, "--output-on-failure", "--progress", "--no-tests=error", "--output-on-failure", "--parallel", str(os.cpu_count() or 1)] self.run_cmd(test_args) - self.ui.ok(f"MrDocs has been successfully installed in {self.options.install_dir}.") + YELLOW = "\033[93m" + RESET = "\033[0m" + if self.supports_ansi(): + print(f"{YELLOW}MrDocs has been successfully installed in {self.options.mrdocs_install_dir}.{RESET}") + else: + print(f"\nMrDocs has been successfully installed in {self.options.mrdocs_install_dir}.\n") @lru_cache(maxsize=1) - def libxml2_root_dir(self): - for key, path in self.package_roots.items(): - if "libxml2" in key.lower(): - return path - return None + def find_latest_clang_include_dir(self): + parent = os.path.join(self.options.llvm_install_dir, "lib", "clang") + subdirs = [d for d in os.listdir(parent) if os.path.isdir(os.path.join(parent, d))] + numeric_subdirs = [d for d in subdirs if d.isdigit()] + if not numeric_subdirs: + raise RuntimeError(f"No numeric directories found in {parent}") + latest_numeric_subdir = max(numeric_subdirs, key=lambda d: int(d)) + + return os.path.join(parent, latest_numeric_subdir, "include") def generate_clion_run_configs(self, configs): import xml.etree.ElementTree as ET # Generate CLion run configurations for MrDocs - # For each configuration, we create an XML file in /.run + # For each configuration, we create an XML file in /.run # named .run.xml - run_dir = os.path.join(self.options.source_dir, ".run") - self.ensure_dir(run_dir) + run_dir = os.path.join(self.options.mrdocs_src_dir, ".run") + os.makedirs(run_dir, exist_ok=True) for config in configs: config_name = config["name"] run_config_path = os.path.join(run_dir, f"{config_name}.run.xml") @@ -2376,7 +1807,7 @@ def generate_clion_run_configs(self, configs): "PASS_PARENT_ENVS_2": "true", "PROJECT_NAME": "MrDocs", "TARGET_NAME": config["target"], - "CONFIG_NAME": self.options.preset or "debug", + "CONFIG_NAME": self.options.mrdocs_preset_name or "debug", "RUN_TARGET_PROJECT_NAME": "MrDocs", "RUN_TARGET_NAME": config["target"] } @@ -2410,7 +1841,7 @@ def generate_clion_run_configs(self, configs): envs = ET.SubElement(clion_config, "envs") ET.SubElement(envs, "env", name="PYTHONUNBUFFERED", value="1") ET.SubElement(clion_config, "option", name="SDK_HOME", value="") - if 'cwd' in config and config["cwd"] != self.options.source_dir: + if 'cwd' in config and config["cwd"] != self.options.mrdocs_src_dir: ET.SubElement(clion_config, "option", name="WORKING_DIRECTORY", value=config["cwd"]) else: ET.SubElement(clion_config, "option", name="WORKING_DIRECTORY", value="$PROJECT_DIR$") @@ -2441,7 +1872,7 @@ def generate_clion_run_configs(self, configs): ET.SubElement(clion_config, "option", name="SCRIPT_PATH", value=config["script"]) ET.SubElement(clion_config, "option", name="SCRIPT_OPTIONS", value="") ET.SubElement(clion_config, "option", name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY", value="true") - if 'cwd' in config and config["cwd"] != self.options.source_dir: + if 'cwd' in config and config["cwd"] != self.options.mrdocs_src_dir: ET.SubElement(clion_config, "option", name="SCRIPT_WORKING_DIRECTORY", value=config["cwd"]) else: ET.SubElement(clion_config, "option", name="SCRIPT_WORKING_DIRECTORY", value="$PROJECT_DIR$") @@ -2501,7 +1932,7 @@ def generate_clion_run_configs(self, configs): ET.SubElement(clion_config, "option", name="SCRIPT_PATH", value=config["script"]) ET.SubElement(clion_config, "option", name="SCRIPT_OPTIONS", value="") ET.SubElement(clion_config, "option", name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY", value="true") - if 'cwd' in config and config["cwd"] != self.options.source_dir: + if 'cwd' in config and config["cwd"] != self.options.mrdocs_src_dir: ET.SubElement(clion_config, "option", name="SCRIPT_WORKING_DIRECTORY", value=config["cwd"]) else: ET.SubElement(clion_config, "option", name="SCRIPT_WORKING_DIRECTORY", value="$PROJECT_DIR$") @@ -2514,18 +1945,15 @@ def generate_clion_run_configs(self, configs): ET.SubElement(clion_config, "method", v="2") tree = ET.ElementTree(root) - if self.options.dry_run: - self.ui.info(f"dry-run: would write CLion run configuration {run_config_path}") - else: - tree.write(run_config_path, encoding="utf-8", xml_declaration=False) + tree.write(run_config_path, encoding="utf-8", xml_declaration=False) def generate_visual_studio_run_configs(self, configs): # https://learn.microsoft.com/en-us/visualstudio/ide/customize-build-and-debug-tasks-in-visual-studio?view=vs-2022 # https://learn.microsoft.com/en-us/cpp/build/launch-vs-schema-reference-cpp?view=msvc-170 # https://learn.microsoft.com/en-us/cpp/build/tasks-vs-json-schema-reference-cpp?view=msvc-170 # Visual Studio launch configs are stored in .vs/launch.vs.json - vs_dir = os.path.join(self.options.source_dir, ".vs") - self.ensure_dir(vs_dir) + vs_dir = os.path.join(self.options.mrdocs_src_dir, ".vs") + os.makedirs(vs_dir, exist_ok=True) launch_path = os.path.join(vs_dir, "launch.vs.json") tasks_path = os.path.join(vs_dir, "tasks.vs.json") @@ -2558,10 +1986,10 @@ def vs_config_type(config): return "default" def rel_to_mrdocs_dir(script_path): - is_subdir_of_source_dir = script_path.replace('\\', '/').rstrip('/').startswith( - self.options.source_dir.replace('\\', '/').rstrip('/')) - if is_subdir_of_source_dir: - return os.path.relpath(script_path, self.options.source_dir) + is_subdir_of_mrdocs_src_dir = script_path.replace('\\', '/').rstrip('/').startswith( + self.options.mrdocs_src_dir.replace('\\', '/').rstrip('/')) + if is_subdir_of_mrdocs_src_dir: + return os.path.relpath(script_path, self.options.mrdocs_src_dir) return script_path def vs_config_project(config): @@ -2639,18 +2067,20 @@ def vs_config_project_target(config): # Write back all configs launch_data["configurations"] = list(vs_configs_by_name.values()) - self.write_text(launch_path, json.dumps(launch_data, indent=4)) + with open(launch_path, "w") as f: + json.dump(launch_data, f, indent=4) tasks_data["tasks"] = list(vs_tasks_by_name.values()) - self.write_text(tasks_path, json.dumps(tasks_data, indent=4)) + with open(tasks_path, "w") as f: + json.dump(tasks_data, f, indent=4) def generate_vscode_run_configs(self, configs): - if not self.prompt_option("generate_run_configs", "Generate run configs"): + if not self.prompt_option("generate_run_configs"): return # Visual Studio launch configs are stored in .vs/launch.vs.json - vscode_dir = os.path.join(self.options.source_dir, ".vscode") - self.ensure_dir(vscode_dir) + vscode_dir = os.path.join(self.options.mrdocs_src_dir, ".vscode") + os.makedirs(vscode_dir, exist_ok=True) launch_path = os.path.join(vscode_dir, "launch.json") tasks_path = os.path.join(vscode_dir, "tasks.json") @@ -2675,17 +2105,17 @@ def generate_vscode_run_configs(self, configs): def replace_with_placeholders(new_config): for key, value in new_config.items(): if isinstance(value, str): - new_config[key] = value.replace(self.options.source_dir, "${workspaceFolder}") + new_config[key] = value.replace(self.options.mrdocs_src_dir, "${workspaceFolder}") elif isinstance(value, list): for i in range(len(value)): if isinstance(value[i], str): - value[i] = value[i].replace(self.options.source_dir, "${workspaceFolder}") + value[i] = value[i].replace(self.options.mrdocs_src_dir, "${workspaceFolder}") elif isinstance(value, dict): for sub_key, sub_value in value.items(): if isinstance(sub_value, str): - value[sub_key] = sub_value.replace(self.options.source_dir, "${workspaceFolder}") + value[sub_key] = sub_value.replace(self.options.mrdocs_src_dir, "${workspaceFolder}") - bootstrap_refresh_config_name = self.options.preset or self.options.build_type or "debug" + bootstrap_refresh_config_name = self.options.mrdocs_preset_name or self.options.mrdocs_build_type or "debug" for config in configs: is_python_script = 'script' in config and config['script'].endswith('.py') is_js_script = 'script' in config and config['script'].endswith('.js') @@ -2697,7 +2127,7 @@ def replace_with_placeholders(new_config): "request": "launch", "program": config.get("script", "") or config.get("target", ""), "args": config["args"].copy(), - "cwd": config.get('cwd', self.options.build_dir) + "cwd": config.get('cwd', self.options.mrdocs_build_dir) } if 'target' in config: @@ -2707,7 +2137,7 @@ def replace_with_placeholders(new_config): if 'program' in config: new_cfg["program"] = config["program"] else: - new_cfg["program"] = os.path.join(self.options.build_dir, config["target"]) + new_cfg["program"] = os.path.join(self.options.mrdocs_build_dir, config["target"]) new_cfg["environment"] = [] new_cfg["stopAtEntry"] = False new_cfg["externalConsole"] = False @@ -2758,7 +2188,7 @@ def replace_with_placeholders(new_config): "Only Python (.py) and JavaScript (.js) scripts are supported." ) - # Any property that begins with the value of source_dir is replaced with ${workspaceFolder} + # Any property that begins with the value of mrdocs_src_dir is replaced with ${workspaceFolder} replace_with_placeholders(new_cfg) # Replace or add @@ -2779,10 +2209,10 @@ def to_task_args(config): "options": {}, "problemMatcher": [], } - if 'cwd' in config and config["cwd"] != self.options.source_dir: + if 'cwd' in config and config["cwd"] != self.options.mrdocs_src_dir: new_task["options"]["cwd"] = config["cwd"] - # Any property that begins with the value of source_dir is replaced with ${workspaceFolder} + # Any property that begins with the value of mrdocs_src_dir is replaced with ${workspaceFolder} replace_with_placeholders(new_task) # Replace or add @@ -2792,10 +2222,10 @@ def to_task_args(config): cmake_config_args = [ "-S", "${workspaceFolder}" ] - if self.options.preset: - cmake_config_args.extend(["--preset", self.options.preset]) + if self.options.mrdocs_preset_name: + cmake_config_args.extend(["--preset", self.options.mrdocs_preset_name]) else: - cmake_config_args.extend(["-B", self.options.build_dir]) + cmake_config_args.extend(["-B", self.options.mrdocs_build_dir]) if self.options.ninja_path: cmake_config_args.extend(["-G", "Ninja"]) cmake_config_task = { @@ -2816,7 +2246,7 @@ def to_task_args(config): unique_targets.add(config['target']) for target in unique_targets: build_args = [ - "--build", self.options.build_dir, + "--build", self.options.mrdocs_build_dir, "--target", target ] cmake_build_task = { @@ -2836,88 +2266,136 @@ def to_task_args(config): # Write back all configs launch_data["configurations"] = list(vs_configs_by_name.values()) - self.write_text(launch_path, json.dumps(launch_data, indent=4)) + with open(launch_path, "w") as f: + json.dump(launch_data, f, indent=4) tasks_data["tasks"] = list(vs_tasks_by_name.values()) - self.write_text(tasks_path, json.dumps(tasks_data, indent=4)) + with open(tasks_path, "w") as f: + json.dump(tasks_data, f, indent=4) def generate_run_configs(self): - if self.options.dry_run: - self.ui.info("dry-run: skipping IDE run configuration generation") - return + # Configurations using MrDocs executable + configs = [{ + "name": "MrDocs Version", + "target": "mrdocs", + "program": os.path.join(self.options.mrdocs_build_dir, "mrdocs"), + "args": ["--version"] + }, { + "name": "MrDocs Help", + "target": "mrdocs", + "program": os.path.join(self.options.mrdocs_build_dir, "mrdocs"), + "args": ["--help"] + }] + + # Configuration to run unit tests + if self.options.mrdocs_build_tests: + configs.append({ + "name": "MrDocs Unit Tests", + "target": "mrdocs-test", + "program": os.path.join(self.options.mrdocs_build_dir, "mrdocs-test"), + "args": [ + '--unit=true' + ] + }) - var_pattern = re.compile(r"\$(\w+)|\${([^}]+)}") - - def expand_with(s: str, mapping: Dict[str, Any]) -> str: - def repl(m): - key = m.group(1) or m.group(2) - return str(mapping.get(key, m.group(0))) - return var_pattern.sub(repl, s) - - def format_values(obj, tokens): - if isinstance(obj, str): - return expand_with(obj, tokens) - if isinstance(obj, list): - return [format_values(x, tokens) for x in obj] - if isinstance(obj, dict): - return {k: format_values(v, tokens) for k, v in obj.items()} - return obj - - defaults_path = os.path.join(self.options.source_dir, "share", "run_configs.json") - defaults = self._load_json_file(defaults_path) or {} - - configs: List[Dict[str, Any]] = defaults.get("configs", []) - - if not configs: - raise RuntimeError("No run configurations found in share/run_configs.json; add configs to proceed.") - - tokens = { - "build_dir": self.options.build_dir, - "source_dir": self.options.source_dir, - "install_dir": self.options.install_dir, - "docs_script_ext": "bat" if self.is_windows() else "sh", - "num_cores": os.cpu_count() or 1, - } - configs = [format_values(cfg, tokens) for cfg in configs] - filtered = [] - for cfg in configs: - req = cfg.get("requires", []) - include = True - if "build_tests" in req and not self.options.build_tests: - include = False - if "java" in req and not self.options.java_path: - include = False - if include: - cfg.pop("requires", None) - filtered.append(cfg) - configs = filtered - - # Append dynamic configs that must be computed (bootstrap helpers, boost docs, schema lint) - configs.extend(self._dynamic_run_configs()) - - target_vscode = bool(defaults.get("vscode", True)) - target_clion = bool(defaults.get("clion", True)) - target_vs = bool(defaults.get("vs", True)) - - if target_clion and self.prompt_option("generate_clion_run_configs", "CLion"): - self.ui.info("Generating CLion run configurations...") - self.generate_clion_run_configs(configs) - if target_vscode and self.prompt_option("generate_vscode_run_configs", "VS Code"): - self.ui.info("Generating Visual Studio Code run configurations...") - self.generate_vscode_run_configs(configs) - if target_vs and self.prompt_option("generate_vs_run_configs", "Visual Studio"): - self.ui.info("Generating Visual Studio run configurations...") - self.generate_visual_studio_run_configs(configs) + # Configurations to Update/Test/Create test fixtures + for verb in ["update", "test", "create"]: + for generator in ["adoc", "html", "xml"]: + configs.append({ + "name": f"MrDocs {verb.title()} Test Fixtures ({generator.upper()})", + "target": "mrdocs-test", + "program": os.path.join(self.options.mrdocs_build_dir, "mrdocs-test"), + "folder": "MrDocs Test Fixtures", + "args": [ + os.path.join(self.options.mrdocs_src_dir, 'test-files', 'golden-tests'), + '--unit=false', + f'--action={verb}', + f'--generator={generator}', + f'--addons={os.path.join(self.options.mrdocs_src_dir, "share", "mrdocs", "addons")}', + f'--stdlib-includes={os.path.join(self.options.llvm_install_dir, "include", "c++", "v1")}', + f'--stdlib-includes={self.find_latest_clang_include_dir()}', + f'--libc-includes={os.path.join(self.options.mrdocs_src_dir, "share", "mrdocs", "headers", "libc-stubs")}', + '--log-level=warn' + ] + }) + + num_cores = os.cpu_count() or 1 + self.prompt_option("boost_src_dir") + if self.options.boost_src_dir and os.path.exists(self.options.boost_src_dir): + boost_libs = os.path.join(self.options.boost_src_dir, 'libs') + if os.path.exists(boost_libs): + for lib in os.listdir(boost_libs): + mrdocs_config = os.path.join(boost_libs, lib, 'doc', 'mrdocs.yml') + if os.path.exists(mrdocs_config): + print(f"Generating run configuration for Boost library '{lib}'") + configs.append({ + "name": f"Boost.{lib.title()} Documentation", + "target": "mrdocs", + "folder": "Boost Documentation", + "program": os.path.join(self.options.mrdocs_build_dir, "mrdocs"), + "args": [ + '../CMakeLists.txt', + f'--config={os.path.join(self.options.boost_src_dir, "libs", lib, "doc", "mrdocs.yml")}', + f'--output={os.path.join(self.options.boost_src_dir, "libs", lib, "doc", "modules", "reference", "pages")}', + f'--generator=adoc', + f'--addons={os.path.join(self.options.mrdocs_src_dir, "share", "mrdocs", "addons")}', + f'--stdlib-includes={os.path.join(self.options.llvm_install_dir, "include", "c++", "v1")}', + f'--stdlib-includes={self.find_latest_clang_include_dir()}', + f'--libc-includes={os.path.join(self.options.mrdocs_src_dir, "share", "mrdocs", "headers", "libc-stubs")}', + f'--tagfile=reference.tag.xml', + '--multipage=true', + f'--concurrency={num_cores}', + '--log-level=debug' + ] + }) + else: + print( + f"Warning: Boost source directory '{self.options.boost_src_dir}' does not contain 'libs' directory. Skipping Boost documentation target generation.") + + # Target to generate the documentation for MrDocs itself + configs.append({ + "name": f"MrDocs Self-Reference", + "target": "mrdocs", + "program": os.path.join(self.options.mrdocs_build_dir, "mrdocs"), + "args": [ + '../CMakeLists.txt', + f'--config={os.path.join(self.options.mrdocs_src_dir, "docs", "mrdocs.yml")}', + f'--output={os.path.join(self.options.mrdocs_src_dir, "docs", "modules", "reference", "pages")}', + f'--generator=adoc', + f'--addons={os.path.join(self.options.mrdocs_src_dir, "share", "mrdocs", "addons")}', + f'--stdlib-includes={os.path.join(self.options.llvm_install_dir, "include", "c++", "v1")}', + f'--stdlib-includes={self.find_latest_clang_include_dir()}', + f'--libc-includes={os.path.join(self.options.mrdocs_src_dir, "share", "mrdocs", "headers", "libc-stubs")}', + f'--tagfile=reference.tag.xml', + '--multipage=true', + f'--concurrency={num_cores}', + '--log-level=debug' + ], + "env": { + "LLVM_ROOT": self.options.llvm_install_dir, + "Clang_ROOT": self.options.llvm_install_dir, + "duktape_ROOT": self.options.duktape_install_dir, + "Duktape_ROOT": self.options.duktape_install_dir, + "libxml2_ROOT": self.options.libxml2_install_dir, + "LibXml2_ROOT": self.options.libxml2_install_dir + } + }) + + # bootstrap.py targets + configs.append({ + "name": f"MrDocs Bootstrap Help", + "script": os.path.join(self.options.mrdocs_src_dir, "bootstrap.py"), + "args": ["--help"], + "cwd": self.options.mrdocs_src_dir + }) - def _dynamic_run_configs(self) -> List[Dict[str, Any]]: - configs: List[Dict[str, Any]] = [] - # Bootstrap helper targets - bootstrap_args: List[str] = [] + bootstrap_args = [] for field in dataclasses.fields(InstallOptions): value = getattr(self.options, field.name) default_value = getattr(self.default_options, field.name, None) - if value is not None and (value != default_value or field.name == "build_type"): - if field.name == "non_interactive": + if value is not None and (value != default_value or field.name == 'mrdocs_build_type'): + if field.name == 'non_interactive': + # Skip non_interactive as it is handled separately, continue if field.type is bool: if value: @@ -2925,384 +2403,272 @@ def _dynamic_run_configs(self) -> List[Dict[str, Any]]: else: bootstrap_args.append(f"--no-{field.name.replace('_', '-')}") elif field.type is str: - if value != "": + if value != '': bootstrap_args.append(f"--{field.name.replace('_', '-')}") bootstrap_args.append(value) else: raise TypeError(f"Unsupported type {field.type} for field '{field.name}' in InstallOptions.") - - bootstrap_refresh_config_name = self.options.preset or self.options.build_type or "debug" - configs.extend([ - {"name": "MrDocs Bootstrap Help", "script": os.path.join(self.options.source_dir, "bootstrap.py"), "args": ["--help"], "cwd": self.options.source_dir}, - {"name": f"MrDocs Bootstrap Update ({bootstrap_refresh_config_name})", "script": os.path.join(self.options.source_dir, "bootstrap.py"), "folder": "MrDocs Bootstrap Update", "args": bootstrap_args, "cwd": self.options.source_dir}, - {"name": f"MrDocs Bootstrap Refresh ({bootstrap_refresh_config_name})", "script": os.path.join(self.options.source_dir, "bootstrap.py"), "folder": "MrDocs Bootstrap Refresh", "args": bootstrap_args + ["--non-interactive"], "cwd": self.options.source_dir}, - {"name": "MrDocs Bootstrap Refresh All", "script": os.path.join(self.options.source_dir, "bootstrap.py"), "folder": "MrDocs Bootstrap Refresh", "args": ["--refresh-all"], "cwd": self.options.source_dir}, - {"name": f"MrDocs Generate Config Info ({bootstrap_refresh_config_name})", "script": os.path.join(self.options.source_dir, "util", "generate-config-info.py"), "folder": "MrDocs Generate Config Info", "args": [os.path.join(self.options.source_dir, "src", "lib", "ConfigOptions.json"), os.path.join(self.options.build_dir)], "cwd": self.options.source_dir}, - {"name": "MrDocs Generate Config Info (docs)", "script": os.path.join(self.options.source_dir, "util", "generate-config-info.py"), "folder": "MrDocs Generate Config Info", "args": [os.path.join(self.options.source_dir, "src", "lib", "ConfigOptions.json"), os.path.join(self.options.source_dir, "docs", "config-headers")], "cwd": self.options.source_dir}, - {"name": "MrDocs Generate YAML Schema", "script": os.path.join(self.options.source_dir, "util", "generate-yaml-schema.py"), "args": [], "cwd": self.options.source_dir}, - {"name": "MrDocs Reformat Source Files", "script": os.path.join(self.options.source_dir, "util", "reformat.py"), "args": [], "cwd": self.options.source_dir}, - ]) - - # Boost documentation targets (dynamic scan) - self.prompt_option("boost_src_dir", "Boost source") - num_cores = os.cpu_count() or 1 - if self.options.boost_src_dir and os.path.exists(self.options.boost_src_dir): - boost_libs = os.path.join(self.options.boost_src_dir, "libs") - if os.path.exists(boost_libs): - for lib in os.listdir(boost_libs): - mrdocs_config = os.path.join(boost_libs, lib, "doc", "mrdocs.yml") - if os.path.exists(mrdocs_config): - configs.append({ - "name": f"Boost.{lib.title()} Documentation", - "target": "mrdocs", - "folder": "Boost Documentation", - "program": os.path.join(self.options.build_dir, "mrdocs"), - "args": [ - "../CMakeLists.txt", - f"--config={mrdocs_config}", - f"--output={os.path.join(self.options.boost_src_dir, 'libs', lib, 'doc', 'modules', 'reference', 'pages')}", - "--generator=adoc", - f"--addons={os.path.join(self.options.source_dir, 'share', 'mrdocs', 'addons')}", - f"--libc-includes={os.path.join(self.options.source_dir, 'share', 'mrdocs', 'headers', 'libc-stubs')}", - "--tagfile=reference.tag.xml", - "--multipage=true", - f"--concurrency={num_cores}", - "--log-level=debug", - ], - }) - - # XML / RelaxNG tasks requiring Java and libxml2 + bootstrap_refresh_config_name = self.options.mrdocs_preset_name or self.options.mrdocs_build_type or "debug" + configs.append({ + "name": f"MrDocs Bootstrap Update ({bootstrap_refresh_config_name})", + "script": os.path.join(self.options.mrdocs_src_dir, "bootstrap.py"), + "folder": "MrDocs Bootstrap Update", + "args": bootstrap_args, + "cwd": self.options.mrdocs_src_dir + }) + bootstrap_refresh_args = bootstrap_args.copy() + bootstrap_refresh_args.append("--non-interactive") + configs.append({ + "name": f"MrDocs Bootstrap Refresh ({bootstrap_refresh_config_name})", + "script": os.path.join(self.options.mrdocs_src_dir, "bootstrap.py"), + "folder": "MrDocs Bootstrap Refresh", + "args": bootstrap_refresh_args, + "cwd": self.options.mrdocs_src_dir + }) + configs.append({ + "name": f"MrDocs Bootstrap Refresh All", + "script": os.path.join(self.options.mrdocs_src_dir, "bootstrap.py"), + "folder": "MrDocs Bootstrap Refresh", + "args": ["--refresh-all"], + "cwd": self.options.mrdocs_src_dir + }) + + # Targets for the pre-build steps + configs.append({ + "name": f"MrDocs Generate Config Info ({bootstrap_refresh_config_name})", + "script": os.path.join(self.options.mrdocs_src_dir, 'util', 'generate-config-info.py'), + "folder": "MrDocs Generate Config Info", + "args": [os.path.join(self.options.mrdocs_src_dir, 'src', 'lib', 'ConfigOptions.json'), + os.path.join(self.options.mrdocs_build_dir)], + "cwd": self.options.mrdocs_src_dir + }) + configs.append({ + "name": f"MrDocs Generate Config Info (docs)", + "script": os.path.join(self.options.mrdocs_src_dir, 'util', 'generate-config-info.py'), + "folder": "MrDocs Generate Config Info", + "args": [os.path.join(self.options.mrdocs_src_dir, 'src', 'lib', 'ConfigOptions.json'), + os.path.join(self.options.mrdocs_src_dir, 'docs', 'config-headers')], + "cwd": self.options.mrdocs_src_dir + }) + configs.append({ + "name": f"MrDocs Generate YAML Schema", + "script": os.path.join(self.options.mrdocs_src_dir, 'util', 'generate-yaml-schema.py'), + "args": [], + "cwd": self.options.mrdocs_src_dir + }) + configs.append({ + "name": f"MrDocs Reformat Source Files", + "script": os.path.join(self.options.mrdocs_src_dir, 'util', 'reformat.py'), + "args": [], + "cwd": self.options.mrdocs_src_dir + }) + + # Documentation generation targets + mrdocs_docs_dir = os.path.join(self.options.mrdocs_src_dir, "docs") + mrdocs_docs_ui_dir = os.path.join(mrdocs_docs_dir, "ui") + mrdocs_docs_script_ext = "bat" if self.is_windows() else "sh" + configs.append({ + "name": "MrDocs Build Local Docs", + "script": os.path.join(mrdocs_docs_dir, f"build_local_docs.{mrdocs_docs_script_ext}"), + "args": [], + "cwd": mrdocs_docs_dir, + "env": { + "MRDOCS_ROOT": self.options.mrdocs_install_dir + } + }) + configs.append({ + "name": "MrDocs Build Docs", + "script": os.path.join(mrdocs_docs_dir, f"build_docs.{mrdocs_docs_script_ext}"), + "args": [], + "cwd": mrdocs_docs_dir, + "env": { + "MRDOCS_ROOT": self.options.mrdocs_install_dir + } + }) + configs.append({ + "name": "MrDocs Build UI Bundle", + "script": os.path.join(mrdocs_docs_ui_dir, f"build.{mrdocs_docs_script_ext}"), + "args": [], + "cwd": mrdocs_docs_ui_dir + }) + + # Remove bad test files + test_files_dir = os.path.join(self.options.mrdocs_src_dir, "test-files", "golden-tests") + configs.append({ + "name": "MrDocs Remove Bad Test Files", + "script": os.path.join(test_files_dir, f"remove_bad_files.{mrdocs_docs_script_ext}"), + "args": [], + "cwd": test_files_dir + }) + + # Render landing page + mrdocs_website_dir = os.path.join(mrdocs_docs_dir, "website") + configs.append({ + "name": f"MrDocs Render Landing Page ({bootstrap_refresh_config_name})", + "script": os.path.join(mrdocs_website_dir, "render.js"), + "folder": "MrDocs Render Landing Page", + "args": [], + "cwd": mrdocs_website_dir, + "env": { + "NODE_ENV": "production", + "MRDOCS_ROOT": self.options.mrdocs_install_dir + } + }) + configs.append({ + "name": f"MrDocs Clean Install Website Dependencies", + "script": "npm", + "args": ["ci"], + "cwd": mrdocs_website_dir + }) + configs.append({ + "name": f"MrDocs Install Website Dependencies", + "script": "npm", + "args": ["install"], + "cwd": mrdocs_website_dir + }) + + # XML schema tests if self.options.java_path: configs.append({ "name": "MrDocs Generate RelaxNG Schema", "script": self.options.java_path, "args": [ "-jar", - os.path.join(self.options.source_dir, "util", "trang.jar"), - os.path.join(self.options.source_dir, "mrdocs.rnc"), - os.path.join(self.options.build_dir, "mrdocs.rng"), + os.path.join(self.options.mrdocs_src_dir, "util", "trang.jar"), + os.path.join(self.options.mrdocs_src_dir, "mrdocs.rnc"), + os.path.join(self.options.mrdocs_build_dir, "mrdocs.rng") ], - "cwd": self.options.source_dir, + "cwd": self.options.mrdocs_src_dir }) - libxml2_root = self.libxml2_root_dir() - if libxml2_root: - libxml2_xmllint_executable = os.path.join(libxml2_root, "bin", "xmllint") - xml_sources_dir = os.path.join(self.options.source_dir, "test-files", "golden-tests") - if self.is_windows(): - xml_sources = [] - for root, _, files in os.walk(xml_sources_dir): - for file in files: - if file.endswith(".xml") and not file.endswith(".bad.xml"): - xml_sources.append(os.path.join(root, file)) - configs.append({ - "name": "MrDocs XML Lint with RelaxNG Schema", - "script": libxml2_xmllint_executable, - "args": [ - "--dropdtd", - "--noout", - "--relaxng", - os.path.join(self.options.build_dir, "mrdocs.rng"), - *xml_sources, - ], - "cwd": self.options.source_dir, - }) - else: - configs.append({ - "name": "MrDocs XML Lint with RelaxNG Schema", - "script": "find", - "args": [ - xml_sources_dir, - "-type", - "f", - "-name", - "*.xml", - "!", - "-name", - "*.bad.xml", - "-exec", - libxml2_xmllint_executable, - "--dropdtd", - "--noout", - "--relaxng", - os.path.join(self.options.build_dir, "mrdocs.rng"), - "{}", - "+", - ], - "cwd": self.options.source_dir, - }) - return configs - def generate_pretty_printer_configs(self): - config_path = os.path.join(self.options.source_dir, "share", "pretty_printers.json") - overrides = self._load_json_file(config_path) or {} + libxml2_xmllint_executable = os.path.join(self.options.libxml2_install_dir, "bin", "xmllint") + xml_sources_dir = os.path.join(self.options.mrdocs_src_dir, "test-files", "golden-tests") - if self.options.dry_run: - if overrides: - self.ui.info("dry-run: would generate debugger pretty printer configuration from share/pretty_printers.json") + if self.is_windows(): + xml_sources = [] + for root, _, files in os.walk(xml_sources_dir): + for file in files: + if file.endswith(".xml") and not file.endswith(".bad.xml"): + xml_sources.append(os.path.join(root, file)) + new_config = { + "name": "MrDocs XML Lint with RelaxNG Schema", + "script": libxml2_xmllint_executable, + "args": [ + "--dropdtd", + "--noout", + "--relaxng", + os.path.join(self.options.mrdocs_build_dir, "mrdocs.rng") + ], + "cwd": self.options.mrdocs_src_dir + } + new_config["args"] += xml_sources + configs.append(new_config) else: - self.ui.info("dry-run: skipping debugger pretty printer generation (no config found)") - return - - if not overrides: - self.ui.info("No debugger pretty printer configuration found in share/pretty_printers.json; skipping generation.") - return - - project_label = overrides.get("project", "MrDocs") - - def _resolve_paths(paths): - resolved = [] - for p in paths: - resolved.append(p if os.path.isabs(p) else os.path.abspath(os.path.join(self.options.source_dir, p))) - return resolved - - lldb_scripts = _resolve_paths(overrides.get("lldb", [])) - gdb_scripts = _resolve_paths(overrides.get("gdb", [])) - - if not lldb_scripts and not gdb_scripts: - self.ui.info("No debugger pretty printer scripts listed in local/pretty_printers.json; skipping generation.") - return + configs.append({ + "name": "MrDocs XML Lint with RelaxNG Schema", + "script": "find", + "args": [ + xml_sources_dir, + "-type", "f", + "-name", "*.xml", + "!", "-name", "*.bad.xml", + "-exec", libxml2_xmllint_executable, + "--dropdtd", "--noout", + "--relaxng", os.path.join(self.options.mrdocs_build_dir, "mrdocs.rng"), + "{}", "+" + ], + "cwd": self.options.mrdocs_src_dir + }) + + if self.prompt_option("generate_clion_run_configs"): + print("Generating CLion run configurations for MrDocs...") + self.generate_clion_run_configs(configs) + if self.prompt_option("generate_vscode_run_configs"): + print("Generating Visual Studio Code run configurations for MrDocs...") + self.generate_vscode_run_configs(configs) + if self.prompt_option("generate_vs_run_configs"): + print("Generating Visual Studio run configurations for MrDocs...") + self.generate_visual_studio_run_configs(configs) - lldbinit_path = os.path.join(self.options.source_dir, ".lldbinit") - if lldb_scripts: - if os.path.exists(lldbinit_path): - self.ui.info(f"LLDB pretty printer configuration already exists at '{lldbinit_path}', skipping generation.") - else: - lldb_lines = [ - f"# LLDB pretty printers for {project_label}", - "# Generated by bootstrap.py", - "# Enable LLDB to load this file with: echo 'settings set target.load-cwd-lldbinit true' >> ~/.lldbinit", - ] - for script in lldb_scripts: - lldb_lines.append(f"command script import {script.replace(os.sep, '/')}") - self.write_text(lldbinit_path, "\n".join(lldb_lines) + "\n") - self.ui.ok(f"Generated LLDB pretty printer configuration at '{lldbinit_path}'") + def generate_pretty_printer_configs(self): + # Generate a .lldbinit file (if it doesn't exist) for LLDB pretty printers + lldbinit_path = os.path.join(self.options.mrdocs_src_dir, ".lldbinit") + if not os.path.exists(lldbinit_path): + home_lldbinit_path = os.path.join(os.path.expanduser("~"), ".lldbinit") + lldbinit_enabled = False + if os.path.exists(home_lldbinit_path): + with open(home_lldbinit_path, "r") as f: + home_lldbinit_content = f.read() + if "settings set target.load-cwd-lldbinit true" in home_lldbinit_content: + lldbinit_enabled = True + # The content of the file should be: + # # echo 'settings set target.load-cwd-lldbinit true' >> ~/.lldbinit + # command script import /Users/alandefreitas/Documents/Code/C++/mrdocs/build/third-party/llvm-project/llvm/utils/lldbDataFormatters.py + lldbinit_content = f"# LLDB pretty printers for MrDocs\n" + lldbinit_content += f"# Generated by bootstrap.py\n" + lldbinit_content += f"# \n" + if not lldbinit_enabled: + lldbinit_content += f"# To enable this file, also add this to your ~/.lldbinit file:\n" + lldbinit_content += f"# settings set target.load-cwd-lldbinit true\n" + lldbinit_content += f"# \n" + lldbinit_content += f"# Or run the following bash command:\n" + lldbinit_content += f"# echo 'settings set target.load-cwd-lldbinit true' >> ~/.lldbinit\n" + lldbinit_content += f"# \n" + lldbinit_content += f"command script import {os.path.join(self.options.llvm_src_dir, 'llvm', 'utils', 'lldbDataFormatters.py').replace(os.sep, '/')}\n" + lldbinit_content += f"command script import {os.path.join(self.options.mrdocs_src_dir, 'share', 'lldb', 'mrdocs_formatters.py').replace(os.sep, '/')}\n" + lldbinit_content += f"command script import {os.path.join(self.options.mrdocs_src_dir, 'share', 'lldb', 'clang_ast_formatters.py').replace(os.sep, '/')}\n" + with open(lldbinit_path, "w") as f: + f.write(lldbinit_content) + print(f"Generated LLDB pretty printer configuration at '{lldbinit_path}'") else: - self.ui.info("No LLDB pretty printer scripts provided; skipping LLDB configuration.") - - gdbinit_path = os.path.join(self.options.source_dir, ".gdbinit") - if gdb_scripts: - if os.path.exists(gdbinit_path): - self.ui.info(f"GDB pretty printer configuration already exists at '{gdbinit_path}', skipping generation.") - else: - gdb_lines = [ - f"# GDB pretty printers for {project_label}", - "# Generated by bootstrap.py", - "python", - "import sys", - ] - for script in gdb_scripts: - script_dir = os.path.dirname(script) - gdb_lines.append(f"sys.path.insert(0, '{script_dir.replace(os.sep, '/')}')") - gdb_lines.extend([ - "try:", - f" import {Path(script).stem} as _bootstrap_pretty", - " _bootstrap_pretty.register_pretty_printers(gdb)", - "except Exception as exc:", - " print('warning: failed to register pretty printers:', exc)", - ]) - gdb_lines.append("end") - self.write_text(gdbinit_path, "\n".join(gdb_lines) + "\n") - self.ui.ok(f"Generated GDB pretty printer configuration at '{gdbinit_path}'") + print(f"LLDB pretty printer configuration already exists at '{lldbinit_path}', skipping generation.") + + # Do the same logic for GDB pretty printers, generating a .gdbinit file + # The pretty printer is at: .../third-party/llvm-project/llvm/utils/gdb-scripts/prettyprinters.py + gdbinit_path = os.path.join(self.options.mrdocs_src_dir, ".gdbinit") + if not os.path.exists(gdbinit_path): + gdbinit_content = f"# GDB pretty printers for MrDocs\n" + gdbinit_content += f"# Generated by bootstrap.py\n" + gdbinit_content += f"# \n" + gdbinit_content += f"python\n" + gdbinit_content += f"import sys\n" + gdbinit_content += f"sys.path.insert(0, '{os.path.join(self.options.llvm_src_dir, 'llvm', 'utils', 'gdb-scripts', 'prettyprinters.py').replace(os.sep, '/')}')\n" + gdbinit_content += f"from prettyprinters import register_pretty_printers\n" + gdbinit_content += f"register_pretty_printers(gdb)\n" + gdbinit_content += f"end\n" + with open(gdbinit_path, "w") as f: + f.write(gdbinit_content) + print(f"Generated GDB pretty printer configuration at '{gdbinit_path}'") else: - self.ui.info("No GDB pretty printer scripts provided; skipping GDB configuration.") - - def validate_cli_compatibility(self): - """ - Smoke-test a handful of legacy/expected CLI invocations to ensure parsing still works. - """ - parser = _build_arg_parser() - samples = [ - [], - ["--no-generate-run-configs"], - ["--dry-run"], - ["--skip-build"], - ["--clean"], - ["--force"], - ["--plain-ui"], - ["--recipe", "sample"], - ] - for argv in samples: - try: - parser.parse_args(argv) - except SystemExit as exc: - raise RuntimeError(f"Legacy CLI invocation {' '.join(argv) or ''} failed: exit {exc.code}") from exc - except Exception as exc: - raise RuntimeError(f"Legacy CLI invocation {' '.join(argv) or ''} failed: {exc}") from exc - self.ui.ok("CLI backward compatibility parse check passed.") - - def collect_user_inputs(self): - """ - Phase 1: ask all questions up front for a two-phase flow. - This keeps prompts grouped before any work begins. - """ - self.ui.section("MrDocs Bootstrap", icon="πŸš€") - - # Seed tool path defaults so prompts (or non-interactive runs) don't get empty values - for tool in ["git", "cmake", "python", "java", "ninja"]: - found = self.find_tool(tool) - if found: - setattr(self.default_options, f"{tool}_path", found) - - # Toolchain early so later steps don't re-prompt - self.ui.subsection("Toolchain", icon="🧰") - self.prompt_option("cc", "C compiler") - self.prompt_option("cxx", "C++ compiler") - self.prompt_option("sanitizer", "Sanitizer (asan/ubsan/msan/tsan/none)") - self.prompt_option("git_path", "git") - self.prompt_option("cmake_path", "cmake") - self.prompt_option("python_path", "python") - self.prompt_option("java_path", "java") - self.prompt_option("ninja_path", "ninja") - - # Layout / presets - self.ui.subsection("Source & build", icon="πŸ“‚") - self.prompt_option("build_type", "Build type") - self.prompt_option("preset", "CMake preset") - self.prompt_option("build_dir", "Build dir") - self.prompt_option("system_install", "Install to system dirs") - self.prompt_option("install_dir", "Install dir") - self.prompt_option("third_party_src_dir", "3rd-party root (src/build/install)") - - # Testing toggles - self.ui.subsection("Testing", icon="πŸ§ͺ") - self.prompt_option("build_tests", "Build tests") - self.prompt_option("run_tests", "Run tests after build") - self.prompt_option("boost_src_dir", "Boost source") - - # IDE / debugger choices - self.ui.subsection("Run configs & debuggers", icon="πŸ’»") - self.prompt_option("generate_run_configs", "Generate run configs") - self.prompt_option("generate_clion_run_configs", "CLion") - self.prompt_option("generate_vscode_run_configs", "VS Code") - self.prompt_option("generate_vs_run_configs", "Visual Studio") - self.prompt_option("generate_pretty_printer_configs", "Pretty printers") - - # Housekeeping toggles - self.ui.subsection("Maintenance", icon="🧹") - self.prompt_option("force_rebuild", "Force rebuild deps") - self.prompt_option("remove_build_dir", "Remove dep build dir") - + print(f"GDB pretty printer configuration already exists at '{gdbinit_path}', skipping generation.") def install_all(self): - # Gather inputs first (two-phase flow) - self.collect_user_inputs() - - # compute total steps dynamically based on toggles - total_steps = 4 - if self.options.generate_run_configs: - total_steps += 1 - if self.options.generate_pretty_printer_configs: - total_steps += 1 - current_step = 1 - - if self.options.list_recipes: - recipes = self.load_recipe_files() - if not recipes: - self.ui.warn(f"No recipes found in {self.recipes_dir}") - else: - self.ui.section("Available recipes", icon="πŸ“¦") - for r in recipes: - tags = f" [{', '.join(r.tags)}]" if r.tags else "" - self.ui.info(f"- {r.name}{tags} (version {r.version})") - return - if self.options.skip_build: - self.ui.info("Skip-build requested; build and install steps will be skipped after initial checks.") - - self.ui.section("Toolchain and environment checks", icon="🧰") - self.ui.info("Checking compilers, environment, and required tools...") self.check_compilers() self.probe_msvc_dev_env() self.check_tools() - self.ui.subsection("Toolchain summary", icon="🧾") - toolchain = [ - ("C compiler", self.options.cc or self.compiler_info.get("CMAKE_C_COMPILER", "auto")), - ("C++ compiler", self.options.cxx or self.compiler_info.get("CMAKE_CXX_COMPILER", "auto")), - ("git", self.options.git_path), - ("cmake", self.options.cmake_path), - ("python", self.options.python_path), - ] - self.ui.kv_block(None, toolchain, indent=4) - self.ui.info("Toolchain ready.") - - current_step += 1 - self.ui.section("Source and build layout", icon="πŸ“‚") - self.setup_source_dir() + self.setup_mrdocs_src_dir() self.setup_third_party_dir() self.probe_compilers() - # Ensure preset name is resolved early - self.prompt_option("build_type", "Build type") - self.prompt_option("preset", "CMake preset") - self.ensure_dir(self.options.third_party_src_dir) - - # Summary block - summary = [ - ("Build type", self.options.build_type), - ("Preset", self.options.preset), - ("Build dir", self.ui.shorten_path(self.options.build_dir)), - ("Install dir", self.ui.shorten_path(self.options.install_dir)), - ("3rd-party root", self.ui.shorten_path(self.options.third_party_src_dir)), - ] - self.ui.subsection("Configuration summary", icon="πŸ“‹") - self.ui.kv_block(None, summary, indent=4) - - current_step += 1 - self.ui.section("Third-party dependencies", icon="πŸ“¦") - # Ninja is treated like any other dependency now - self.ui.subsection("ninja", icon="πŸ“œ") self.install_ninja() - # Recipes bundled into the same section - recipe_list = self.load_recipe_files() - if recipe_list: - for recipe in self._topo_sort_recipes(recipe_list): - self.ui.subsection(f"{recipe.name}", icon="πŸ“œ") - resolved_ref = self.fetch_recipe_source(recipe) - self.apply_recipe_patches(recipe) - self.recipe_info[recipe.name] = recipe - if self.options.skip_build: - continue - if self.is_recipe_up_to_date(recipe, resolved_ref) and not self.options.force: - self.ui.ok(f"[{recipe.name}] up to date; skipping build.") - continue - self.build_recipe(recipe) - self.write_recipe_stamp(recipe, resolved_ref) - if recipe.package_root_var: - self.package_roots[recipe.package_root_var] = recipe.install_dir - else: - raise RuntimeError(f"No recipes found in {self.recipes_dir}. Add recipe JSON files to proceed.") - - current_step += 1 - self.ui.section("MrDocs build", icon="βš™οΈ") - self.ui.subsection("CMake presets") + self.install_duktape() + self.install_lua() + self.install_llvm() + if self.prompt_option("mrdocs_build_tests"): + self.install_libxml2() self.create_cmake_presets() - self.show_preset_summary() - self.ui.subsection("Build and install MrDocs") self.install_mrdocs() - if self.prompt_option("generate_run_configs", "Generate run configs"): - current_step += 1 - self.ui.section("IDE run configurations", icon="πŸ’»") - self.generate_run_configs() - if self.prompt_option("generate_pretty_printer_configs", "Pretty printers"): - current_step += 1 - self.ui.section("Debugger pretty printers", icon="🐞") - self.generate_pretty_printer_configs() - - # Success footer - generator = "Ninja" if self.options.ninja_path else self.compiler_info.get("CMAKE_GENERATOR", "unknown") - footer = [ - ("Preset", self.options.preset), - ("Build dir", self.ui.shorten_path(self.options.build_dir)), - ("Install dir", self.ui.shorten_path(self.options.install_dir)), - ("Generator", generator), - ] - self.ui.kv_block("Bootstrap complete", footer, icon="βœ”οΈ", indent=2) + if self.prompt_option("generate_run_configs"): + self.generate_run_configs() + if self.prompt_option("generate_pretty_printer_configs"): + self.generate_pretty_printer_configs() def refresh_all(self): # 1. Read all configurations in .vscode/launch.json current_python_interpreter_path = sys.executable this_script_path = os.path.abspath(__file__) - source_dir = os.path.dirname(this_script_path) - vscode_launch_path = os.path.join(source_dir, ".vscode", "launch.json") - vs_launch_path = os.path.join(source_dir, ".vs", "launch.vs.json") + mrdocs_src_dir = os.path.dirname(this_script_path) + vscode_launch_path = os.path.join(mrdocs_src_dir, ".vscode", "launch.json") + vs_launch_path = os.path.join(mrdocs_src_dir, ".vs", "launch.vs.json") use_vscode = os.path.exists(vscode_launch_path) use_vs = os.path.exists(vs_launch_path) if not use_vscode and not use_vs: @@ -3330,7 +2696,7 @@ def refresh_all(self): for config in bootstrap_refresh_configs: config_name = config['name'] if use_vscode: - args = [arg.replace("${workspaceFolder}", source_dir) for arg in config.get("args", [])] + args = [arg.replace("${workspaceFolder}", mrdocs_src_dir) for arg in config.get("args", [])] else: args = shlex.split(config.get("scriptArguments", "")) @@ -3340,27 +2706,24 @@ def refresh_all(self): subprocess.run([current_python_interpreter_path, this_script_path] + args, check=True) -def _build_arg_parser() -> argparse.ArgumentParser: +def get_command_line_args(): + """ + Parses command line arguments and returns them as a dictionary. + + Every field in the InstallOptions dataclass is converted to a + valid command line argument description. + + :return: dict: Dictionary of command line arguments. + """ parser = argparse.ArgumentParser( - description="Bootstrap MrDocs using recipe-driven third-party deps, presets, and IDE/debugger configs.", + description="Download and install MrDocs from source.", formatter_class=argparse.RawTextHelpFormatter ) - skip_cli = {"source_dir"} # internal-only; not configurable via CLI - # Preferred flag names for key options (we intentionally drop the old long names). - custom_flags: Dict[str, List[str]] = { - "build_type": ["--build-type"], - "preset": ["--preset"], - "build_dir": ["--build-dir"], - "install_dir": ["--install-dir"], - "third_party_src_dir": ["--third-party-root"], - "non_interactive": ["-y", "--yes"], - } - for field in dataclasses.fields(InstallOptions): - if field.name in skip_cli: - continue - flag_names = custom_flags.get(field.name, [f"--{field.name.replace('_', '-')}"]) - help_text = field.name.replace("_", " ") + arg_name = f"--{field.name.replace('_', '-')}" + help_text = INSTALL_OPTION_DESCRIPTIONS.get(field.name) + if help_text is None: + raise ValueError(f"Missing description for option '{field.name}' in INSTALL_OPTION_DESCRIPTIONS.") if field.default is not dataclasses.MISSING and field.default is not None: if isinstance(field.default, str) and field.default: help_text += f" (default: '{field.default}')" @@ -3371,34 +2734,14 @@ def _build_arg_parser() -> argparse.ArgumentParser: else: help_text += f" (default: {field.default})" if field.type is bool: - if field.name == "non_interactive": - parser.add_argument(*flag_names, dest=field.name, action='store_true', help=help_text, default=None) - else: - primary = flag_names[0] - parser.add_argument(*flag_names, dest=field.name, action='store_true', help=help_text, default=None) - # Provide a no- form for toggling off - no_flag = primary.replace("--", "--no-", 1) if primary.startswith("--") else f"--no-{field.name}" - parser.add_argument(no_flag, dest=field.name, action='store_false', - help=f"Set {primary} to false", default=None) + parser.add_argument(arg_name, dest=field.name, action='store_true', help=help_text, default=None) + parser.add_argument(f"--no-{field.name.replace('_', '-')}", dest=field.name, action='store_false', + help=f'Set {arg_name} to false', default=None) elif field.type is str: - parser.add_argument(*flag_names, type=field.type, dest=field.name, help=help_text, default=None) + parser.add_argument(arg_name, type=field.type, help=help_text, default=None) else: raise TypeError(f"Unsupported type {field.type} for field '{field.name}' in InstallOptions.") - return parser - - -def get_command_line_args(argv=None): - """ - Parses command line arguments and returns them as a dictionary. - - Every field in the InstallOptions dataclass is converted to a - valid command line argument description. - - :return: dict: Dictionary of command line arguments. - """ - parser = _build_arg_parser() - parsed = vars(parser.parse_args(argv)) - return {k: v for k, v in parsed.items() if v is not None} + return {k: v for k, v in vars(parser.parse_args()).items() if v is not None} def main(): @@ -3411,12 +2754,4 @@ def main(): if __name__ == "__main__": - try: - main() - except KeyboardInterrupt: - # Graceful exit when the user hits Ctrl+C/Cmd+C during a prompt - try: - ui.ok("πŸ›‘ Aborted by user.") - except Exception: - print("Aborted by user.") - sys.exit(130) + main() diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc index 5b459928ba..a0c3266aaf 100644 --- a/docs/modules/ROOT/nav.adoc +++ b/docs/modules/ROOT/nav.adoc @@ -7,11 +7,5 @@ * xref:generators.adoc[] * xref:design-notes.adoc[] * xref:reference:index.adoc[Library Reference] -* Contribute -** xref:contribute/quickstart.adoc[] -** xref:contribute/workflow.adoc[] -** xref:contribute/testing.adoc[] -** xref:contribute/options.adoc[] -** xref:contribute/codebase-tour.adoc[] -** xref:contribute/docs.adoc[] +* xref:contribute.adoc[] * xref:license.adoc[] diff --git a/docs/modules/ROOT/pages/contribute/options.adoc b/docs/modules/ROOT/pages/contribute.adoc similarity index 61% rename from docs/modules/ROOT/pages/contribute/options.adoc rename to docs/modules/ROOT/pages/contribute.adoc index e2f2c0d938..a674e1254c 100644 --- a/docs/modules/ROOT/pages/contribute/options.adoc +++ b/docs/modules/ROOT/pages/contribute.adoc @@ -1,7 +1,23 @@ -= Options & architecture += Contributor's Guide + +This page contains information for contributors to the Mr.Docs project. +It is intended to provide an overview of the codebase and the process of adding new features. + +Before sending changes, run `python util/run_all_tests.py`. +This script is treated as a β€œsource of truth” pass that configures the preferred preset, builds, runs golden + unit + lint/schema/self-doc checks, installs into a local `install/` prefix, and (by default) builds docs using that fresh install. +Not every policy can be enforced programmatically, but this script covers the checks that are automated; prefer it over ad-hoc command sequences. +Use `--skip-docs` to omit docs or `--no-strict` to relax strict warning handling when needed. + +== Codebase Overview + +The Mr.Docs codebase is divided into several modules: + +include::partial$workflow.adoc[] + +This section provides an overview of each module and how they interact with each other in the Mr.Docs codebase. [#options] -== Parsing options +=== Parsing options Mr.Docs options affect the behavior of the compilation database, how symbols are extracted, and how the documentation is generated. They are parsed from the command line and configuration file. @@ -10,12 +26,12 @@ The main entry point of Mr.Docs is the `DoGenerateAction` function in `src/tool/ It loads the options, creates the compilation database, and runs the extraction and generation steps. The options are formed from a combination of command line arguments and configuration file settings. -=== Command Line Options +==== Command Line Options Command line and common options are defined in `src/tool/ToolArgs.hpp`. The `ToolArgs` class uses the `llvm::cl` library to define and parse the command line arguments. -=== Configuration File +==== Configuration File Common options are defined in `mrdocs/Config.hpp`. The `Config` class represents all public options that could be defined in a configuration file. @@ -25,7 +41,7 @@ The function `mrdocs::loadConfig` is also provided to parse all public options f Internally, Mr.Docs uses the derived `mrdocs::ConfigImpl` class (`src/lib/Lib/ConfigImpl.hpp`) to also store the private representation of parsed options, such as filters. -=== Finalizing Options +==== Finalizing Options Common options are stored in the `Config` class, while the `ToolArgs` class stores common options and the command line options. For instance, the `config` option can only be set from the command line, as it would be illogical to expect the location of the configuration file to be defined in the configuration file itself. @@ -156,4 +172,122 @@ Documentation generators are responsible for traversing the corpus and generatin The API for documentation generators is defined in `mrdocs/Generator.hpp`. +=== Directory Layout + +The MrDocs codebase is organized as follows: + +==== `include/`β€”The main include directory + +This directory contains the public headers for the MrDocs library. + +* `include/mrdocs/`β€”The core library headers +** `include/mrdocs/ADT`β€”Data Structures +** `include/mrdocs/Dom`β€”The Document Object Model for Abstract Trees +** `include/mrdocs/Metadata`β€”`Symbol` nodes and metadata classes +** `include/mrdocs/Support`β€”Various utility classes + +==== `src/`β€”The main source directory + +This directory contains the source code for the MrDocs library and private headers. + +* `src/lib/`β€”The core library +** `src/lib/AST/`β€”The AST traversal code +** `src/lib/Dom/`β€”The Document Object Model for Abstract Trees +** `src/lib/Gen/`β€”Generators +** `src/lib/Lib/`β€”The core library classes +** `src/lib/Metadata/`β€”`Symbol` nodes and metadata classes +** `src/lib/Support/`β€”Various utility classes +* `src/test/`β€”The test directory +* `src/test_suite/`β€”The library used for testing +* `src/tool/`β€”The main program + +==== `share/`β€”Shared resources + +This directory contains shared resources for the documentation generators and utilities for developers. +Its subdirectories are installed in the `share` directory of the installation. + +* `share/`β€”Shared resources for the documentation generators +* `share/cmake/`β€”CMake modules to generate the documentation +* `share/gdb/`β€”GDB pretty printers +* `share/mrdocs/`β€”Shared resources for the documentation generators + +==== `docs`β€”Documentation + +This directory contains the documentation for the MrDocs project. +The documentation is written in AsciiDoc and can be built using the Antora tool. + +* `docs/`β€”Documentation configuration files and scripts +** `docs/modules/`β€”The documentation asciidoc files +** `docs/extensions`β€”Antora extensions for the documentation + +==== `third-party/`β€”Helpers for third-party libraries + +This directory contains build scripts and configuration files for third-party libraries. + +* `third-party/`β€”Third-party libraries +** `third-party/llvm/`β€”CMake Presets for LLVM +** `third-party/duktape/`β€”CMake scripts for Duktape +** `third-party/lua/`β€”A bundled Lua interpreter + == Polymorphism + +== Coding Standards + +=== Paths + +The AST visitor and metadata all use forward slashes to represent file pathnames, even on Windows. +This is so the generated reference documentation does not vary based on the platform. + +=== Exceptions + +Errors thrown by the program should always have type `Exception`. +Objects of this type are capable of transporting an `Error` object. +This is important for the scripting to work; exceptions are used to propagate errors from library code to scripts and back to the invoking code. +For exceptional cases, these thrown exceptions should be uncaught. +The tool installs an uncaught exception handler that prints a stack trace and exits the process immediately. + +=== Testing + +All new features should be accompanied by tests. +The `mrdocs-test` target is used to run the test suites. +This target has its entry point in `src/test/TestMain.cpp`, which can take two paths: + +* Golden testing: When input paths are provided to the test executable via the command line, the test suite will run the `DoTestAction()` that iterates all files in `test-files` comparing the input source files with the expected XML output files. +* Unit testing: When no input paths are provided, all unit tests will be run via `unit_test_main()`, defined by our test-suite library in `src/test_suite/test_suite.cpp`. + +The fixtures for golden testing are defined in `test-files/golden-tests`, where files in each directory have the following format: + +* `mrdocs.yml`: Basic configuration options for all files in this directory. +* `.cpp`: The input source file to extract symbols from. +* `.xml`: The expected XML output file generated with the XML generator. +* `.bad.xml`: The test output file generated when the test fails. +* `.yml`: Extra configuration options for this specific file. + +== Style Guide + +This project follows informal formatting conventions established by previous Boost projects. +To help contributors, we provide a `.clang-format` file that encodes these rules. + +* Do *not* apply clang-format across entire files or the whole project. +* Use the config only as a *reference* for your IDE/editor, or to format the code you **personally add or modify** in a commit. +* Always check the surrounding code and keep consistent with it. +* Do not create style-only commits that introduce large diffs without functional changes. + +Why This Approach: + +* Keeps history clean: avoids large, style-only commits. +* Ensures new contributors are not lost when adapting to project style. +* Encourages consistency without rigid automation. + +General Advice: When in doubt, copy the style of the surrounding code. +The `.clang-format` file is a tool to help you, not a rule to enforce blindly. + +The utility script `./util/reformat.sh` can also be used to check a few project invariants, such as header guards and include order. + +== Contributing + +If you find a bug or have a feature request, please open an issue on the MrDocs GitHub repository: https://github.com/cppalliance/mrdocs/issues + +If you would like to contribute a feature or bug fix, please open a pull request on the MrDocs GitHub repository: https://github.com/cppalliance/mrdocs/pulls + +If you would like to discuss a feature or bug fix before opening a pull request, discussing happen in the `#mrdocs` channel on the Cpplang Slack: https://cpplang.slack.com/ diff --git a/docs/modules/ROOT/pages/contribute/codebase-tour.adoc b/docs/modules/ROOT/pages/contribute/codebase-tour.adoc deleted file mode 100644 index 3a379c25af..0000000000 --- a/docs/modules/ROOT/pages/contribute/codebase-tour.adoc +++ /dev/null @@ -1,66 +0,0 @@ -= Codebase tour - -== Codebase Overview - -The Mr.Docs codebase is divided into several modules: - -include::partial$workflow.adoc[] - -This section provides an overview of each module and how they interact with each other in the Mr.Docs codebase. - -=== Directory Layout - -The MrDocs codebase is organized as follows: - -==== `include/`β€”The main include directory - -This directory contains the public headers for the MrDocs library. - -* `include/mrdocs/`β€”The core library headers -** `include/mrdocs/ADT`β€”Data Structures -** `include/mrdocs/Dom`β€”The Document Object Model for Abstract Trees -** `include/mrdocs/Metadata`β€”`Symbol` nodes and metadata classes -** `include/mrdocs/Support`β€”Various utility classes - -==== `src/`β€”The main source directory - -This directory contains the source code for the MrDocs library and private headers. - -* `src/lib/`β€”The core library -** `src/lib/AST/`β€”The AST traversal code -** `src/lib/Dom/`β€”The Document Object Model for Abstract Trees -** `src/lib/Gen/`β€”Generators -** `src/lib/Lib/`β€”The core library classes -** `src/lib/Metadata/`β€”`Symbol` nodes and metadata classes -** `src/lib/Support/`β€”Various utility classes -* `src/test/`β€”The test directory -* `src/test_suite/`β€”The library used for testing -* `src/tool/`β€”The main program - -==== `share/`β€”Shared resources - -This directory contains shared resources for the documentation generators and utilities for developers. -Its subdirectories are installed in the `share` directory of the installation. - -* `share/`β€”Shared resources for the documentation generators -* `share/cmake/`β€”CMake modules to generate the documentation -* `share/gdb/`β€”GDB pretty printers -* `share/mrdocs/`β€”Shared resources for the documentation generators - -==== `docs`β€”Documentation - -This directory contains the documentation for the MrDocs project. -The documentation is written in AsciiDoc and can be built using the Antora tool. - -* `docs/`β€”Documentation configuration files and scripts -** `docs/modules/`β€”The documentation asciidoc files -** `docs/extensions`β€”Antora extensions for the documentation - -==== `third-party/`β€”Helpers for third-party libraries - -This directory contains build scripts and configuration files for third-party libraries. - -* `third-party/`β€”Third-party libraries -** `third-party/llvm/`β€”CMake Presets for LLVM -** `third-party/duktape/`β€”CMake scripts for Duktape -** `third-party/lua/`β€”A bundled Lua interpreter diff --git a/docs/modules/ROOT/pages/contribute/docs.adoc b/docs/modules/ROOT/pages/contribute/docs.adoc deleted file mode 100644 index 9afac5bd51..0000000000 --- a/docs/modules/ROOT/pages/contribute/docs.adoc +++ /dev/null @@ -1,10 +0,0 @@ -= Docs changes - -== `docs`β€”Documentation - -This directory contains the documentation for the MrDocs project. -The documentation is written in AsciiDoc and can be built using the Antora tool. - -* `docs/`β€”Documentation configuration files and scripts -** `docs/modules/`β€”The documentation asciidoc files -** `docs/extensions`β€”Antora extensions for the documentation diff --git a/docs/modules/ROOT/pages/contribute/quickstart.adoc b/docs/modules/ROOT/pages/contribute/quickstart.adoc deleted file mode 100644 index 16fb76239a..0000000000 --- a/docs/modules/ROOT/pages/contribute/quickstart.adoc +++ /dev/null @@ -1,9 +0,0 @@ -= Contributor Quickstart - -This page contains information for contributors to the Mr.Docs project. -It is intended to provide an overview of the codebase and the process of adding new features. - -Before sending changes, run `python util/run_all_tests.py`. -This script is treated as a β€œsource of truth” pass that configures the preferred preset, builds, runs golden + unit + lint/schema/self-doc checks, installs into a local `install/` prefix, and (by default) builds docs using that fresh install. -Not every policy can be enforced programmatically, but this script covers the checks that are automated; prefer it over ad-hoc command sequences. -Use `--skip-docs` to omit docs or `--no-strict` to relax strict warning handling when needed. diff --git a/docs/modules/ROOT/pages/contribute/testing.adoc b/docs/modules/ROOT/pages/contribute/testing.adoc deleted file mode 100644 index 93371a2a1b..0000000000 --- a/docs/modules/ROOT/pages/contribute/testing.adoc +++ /dev/null @@ -1,23 +0,0 @@ -= Testing & fixtures - -All new features should be accompanied by tests. -The `mrdocs-test` target is used to run the test suites. -This target has its entry point in `src/test/TestMain.cpp`, which can take two paths: - -* Golden testing: When input paths are provided to the test executable via the command line, the test suite will run the `DoTestAction()` that iterates all files in `test-files` comparing the input source files with the expected XML output files. -* Unit testing: When no input paths are provided, all unit tests will be run via `unit_test_main()`, defined by our test-suite library in `src/test_suite/test_suite.cpp`. - -The fixtures for golden testing are defined in `test-files/golden-tests`, where files in each directory have the following format: - -* `mrdocs.yml`: Basic configuration options for all files in this directory. -* `.cpp`: The input source file to extract symbols from. -* `.xml`: The expected XML output file generated with the XML generator. -* `.bad.xml`: The test output file generated when the test fails. -* `.yml`: Extra configuration options for this specific file. - -Multipage golden tests follow a snapshot-based layout: - -* The suite defaults to `multipage: false` in `test-files/golden-tests/mrdocs.yml`; a multipage test must provide a `.yml` that sets `multipage: true`. -* Expected output lives under `.multipage//...` (one directory per generator); single-page siblings like `.html`/`.xml` must be absent. -* The harness skips `.multipage/` directories during discovery and compares generated temp output trees to the snapshot (strict tree + content). -* Add a short comment in the `.cpp` explaining why multipage is requiredβ€”use it only when single-page output cannot validate the behavior (e.g., relative asset/link handling). diff --git a/docs/modules/ROOT/pages/contribute/workflow.adoc b/docs/modules/ROOT/pages/contribute/workflow.adoc deleted file mode 100644 index 77083067f2..0000000000 --- a/docs/modules/ROOT/pages/contribute/workflow.adoc +++ /dev/null @@ -1,45 +0,0 @@ -= Workflow & PR hygiene - -== Coding Standards - -=== Paths - -The AST visitor and metadata all use forward slashes to represent file pathnames, even on Windows. -This is so the generated reference documentation does not vary based on the platform. - -=== Exceptions - -Errors thrown by the program should always have type `Exception`. -Objects of this type are capable of transporting an `Error` object. -This is important for the scripting to work; exceptions are used to propagate errors from library code to scripts and back to the invoking code. -For exceptional cases, these thrown exceptions should be uncaught. -The tool installs an uncaught exception handler that prints a stack trace and exits the process immediately. - -== Style Guide - -This project follows informal formatting conventions established by previous Boost projects. -To help contributors, we provide a `.clang-format` file that encodes these rules. - -* Do *not* apply clang-format across entire files or the whole project. -* Use the config only as a *reference* for your IDE/editor, or to format the code you **personally add or modify** in a commit. -* Always check the surrounding code and keep consistent with it. -* Do not create style-only commits that introduce large diffs without functional changes. - -Why This Approach: - -* Keeps history clean: avoids large, style-only commits. -* Ensures new contributors are not lost when adapting to project style. -* Encourages consistency without rigid automation. - -General Advice: When in doubt, copy the style of the surrounding code. -The `.clang-format` file is a tool to help you, not a rule to enforce blindly. - -The utility script `./util/reformat.sh` can also be used to check a few project invariants, such as header guards and include order. - -== Contributing - -If you find a bug or have a feature request, please open an issue on the MrDocs GitHub repository: https://github.com/cppalliance/mrdocs/issues - -If you would like to contribute a feature or bug fix, please open a pull request on the MrDocs GitHub repository: https://github.com/cppalliance/mrdocs/pulls - -If you would like to discuss a feature or bug fix before opening a pull request, discussing happen in the `#mrdocs` channel on the Cpplang Slack: https://cpplang.slack.com/ diff --git a/docs/modules/ROOT/pages/generators.adoc b/docs/modules/ROOT/pages/generators.adoc index d3c0f92e90..4e6e5353c6 100644 --- a/docs/modules/ROOT/pages/generators.adoc +++ b/docs/modules/ROOT/pages/generators.adoc @@ -111,34 +111,6 @@ The layout template can include other partial templates to render the symbol dat The Document Object Model (DOM) for each symbol includes all information about the symbol.One advantage of custom templates over post-processing XML files is the ability to access symbols as a graph.If symbol `A` refers to symbol `B`, some properties of symbol `B` are likely to be required in the documentation of `A`.All templates and generators can access a reference to `B` by searching the symbol tree or simply by accessing the elements `A` refers to.All references to other symbols are resolved in the templates. -== Stylesheet Options - -The HTML and AsciiDoc generators ship a bundled stylesheet that is inlined by default. You can replace or layer styles with the following options (available in config files and on the CLI): - -- `stylesheets`: ordered list of stylesheet paths or URLs. If empty, the bundled CSS is used. Remote URLs require `linkcss: true`. -- `no-default-styles`: skip the bundled CSS entirely. -- `linkcss`: emit `` tags instead of inline ` -{{/each}} -{{/if}} -{{#if page.stylesheets}} -{{#each page.stylesheets }} - -{{/each}} -{{/if}} -{{#if page.inlineScripts}} -{{#each page.inlineScripts}} - -{{/each}} -{{/if}} {{! Title }} {{#if @root.config.multipage }} {{! Multipage documentation: symbol is available to the wrapper }} @@ -29,7 +10,6 @@ {{! Single page documentation: symbol is not available to the wrapper }} Reference {{/if}} -
@@ -43,25 +23,8 @@ {{! Content generated with index.hbs }} {{{contents}}}
- -{{#if page.hasDefaultStyles}} - -{{/if}} +
+

Created with MrDocs

+
-{{! Trim trailing newline ~}} + \ No newline at end of file diff --git a/share/mrdocs/addons/generator/html/partials/markup/code-block.html.hbs b/share/mrdocs/addons/generator/html/partials/markup/code-block.html.hbs index 981df49562..e1992ae29b 100644 --- a/share/mrdocs/addons/generator/html/partials/markup/code-block.html.hbs +++ b/share/mrdocs/addons/generator/html/partials/markup/code-block.html.hbs @@ -1 +1,3 @@ -
{{> @partial-block }}
+
+{{> @partial-block }}
+
\ No newline at end of file diff --git a/share/mrdocs/addons/generator/html/partials/markup/h.html.hbs b/share/mrdocs/addons/generator/html/partials/markup/h.html.hbs index c7fecaa29a..996a129cc1 100644 --- a/share/mrdocs/addons/generator/html/partials/markup/h.html.hbs +++ b/share/mrdocs/addons/generator/html/partials/markup/h.html.hbs @@ -1,6 +1 @@ - -{{> @partial-block }} -{{#if id}} -# -{{/if}} - +{{> @partial-block }} diff --git a/share/mrdocs/addons/generator/html/partials/symbol.html.hbs b/share/mrdocs/addons/generator/html/partials/symbol.html.hbs index 476a28988e..3f51a4f99e 100644 --- a/share/mrdocs/addons/generator/html/partials/symbol.html.hbs +++ b/share/mrdocs/addons/generator/html/partials/symbol.html.hbs @@ -35,20 +35,10 @@
{{>location/source dcl=(primary_location symbol)}}
-{{> symbol/signatures symbol ~}} - -{{/unless}} -{{! Description }} -{{#if symbol.doc.description}} -{{#unless traversing-global-namespace}} -
-{{#unless (eq (lookup (first symbol.doc.description) "kind") "heading") }} -{{#> markup/dynamic-level-h level=2 }}Description{{/markup/dynamic-level-h~}} -{{~/unless}} -{{> doc/block/document symbol.doc.description }} +{{> symbol/signatures symbol }} +
{{/unless}} -{{/if}} {{! Base classes }} {{#if (any_of_by symbol.bases "isPublic")}}
@@ -182,6 +172,17 @@
{{/if}} +{{! Description }} +{{#if symbol.doc.description}} +{{#unless traversing-global-namespace}} +
+{{#unless (eq (lookup (first symbol.doc.description) "kind") "heading") }} +{{#> markup/dynamic-level-h level=2 }}Description{{/markup/dynamic-level-h~}} +{{~/unless}} +{{> doc/block/document symbol.doc.description }} +
+{{/unless}} +{{/if}} {{! Using symbols }} {{#if symbol.shadows}}
diff --git a/share/run_configs.json b/share/run_configs.json deleted file mode 100644 index d95068f9a7..0000000000 --- a/share/run_configs.json +++ /dev/null @@ -1,144 +0,0 @@ -{ - "vscode": true, - "clion": true, - "vs": true, - "configs": [ - { - "name": "MrDocs Version", - "target": "mrdocs", - "program": "${mrdocs_build_dir}/mrdocs", - "args": ["--version"] - }, - { - "name": "MrDocs Help", - "target": "mrdocs", - "program": "${mrdocs_build_dir}/mrdocs", - "args": ["--help"] - }, - { - "name": "MrDocs Unit Tests", - "target": "mrdocs-test", - "program": "${mrdocs_build_dir}/mrdocs-test", - "args": ["--unit=true"], - "requires": ["build_tests"] - }, - { - "name": "MrDocs Update Test Fixtures (ADOC)", - "target": "mrdocs-test", - "folder": "MrDocs Test Fixtures", - "program": "${mrdocs_build_dir}/mrdocs-test", - "args": [ - "${mrdocs_src_dir}/test-files/golden-tests", - "--unit=false", - "--action=update", - "--generator=adoc", - "--addons=${mrdocs_src_dir}/share/mrdocs/addons", - "--libc-includes=${mrdocs_src_dir}/share/mrdocs/headers/libc-stubs", - "--log-level=warn" - ], - "requires": ["build_tests"] - }, - { - "name": "MrDocs Test Test Fixtures (ADOC)", - "target": "mrdocs-test", - "folder": "MrDocs Test Fixtures", - "program": "${mrdocs_build_dir}/mrdocs-test", - "args": [ - "${mrdocs_src_dir}/test-files/golden-tests", - "--unit=false", - "--action=test", - "--generator=adoc", - "--addons=${mrdocs_src_dir}/share/mrdocs/addons", - "--libc-includes=${mrdocs_src_dir}/share/mrdocs/headers/libc-stubs", - "--log-level=warn" - ], - "requires": ["build_tests"] - }, - { - "name": "MrDocs Create Test Fixtures (ADOC)", - "target": "mrdocs-test", - "folder": "MrDocs Test Fixtures", - "program": "${mrdocs_build_dir}/mrdocs-test", - "args": [ - "${mrdocs_src_dir}/test-files/golden-tests", - "--unit=false", - "--action=create", - "--generator=adoc", - "--addons=${mrdocs_src_dir}/share/mrdocs/addons", - "--libc-includes=${mrdocs_src_dir}/share/mrdocs/headers/libc-stubs", - "--log-level=warn" - ], - "requires": ["build_tests"] - }, - { - "name": "MrDocs Self-Reference", - "target": "mrdocs", - "program": "${mrdocs_build_dir}/mrdocs", - "args": [ - "../CMakeLists.txt", - "--config=${mrdocs_src_dir}/docs/mrdocs.yml", - "--output=${mrdocs_src_dir}/docs/modules/reference/pages", - "--generator=adoc", - "--addons=${mrdocs_src_dir}/share/mrdocs/addons", - "--libc-includes=${mrdocs_src_dir}/share/mrdocs/headers/libc-stubs", - "--tagfile=reference.tag.xml", - "--multipage=true", - "--concurrency=${num_cores}", - "--log-level=debug" - ] - }, - { - "name": "MrDocs Build Local Docs", - "script": "${mrdocs_src_dir}/docs/build_local_docs.${docs_script_ext}", - "args": [], - "cwd": "${mrdocs_src_dir}/docs", - "env": { - "MRDOCS_ROOT": "${mrdocs_install_dir}" - } - }, - { - "name": "MrDocs Build Docs", - "script": "${mrdocs_src_dir}/docs/build_docs.${docs_script_ext}", - "args": [], - "cwd": "${mrdocs_src_dir}/docs", - "env": { - "MRDOCS_ROOT": "${mrdocs_install_dir}" - } - }, - { - "name": "MrDocs Build UI Bundle", - "script": "${mrdocs_src_dir}/docs/ui/build.${docs_script_ext}", - "args": [], - "cwd": "${mrdocs_src_dir}/docs/ui" - }, - { - "name": "MrDocs Remove Bad Test Files", - "script": "${mrdocs_src_dir}/test-files/golden-tests/remove_bad_files.${docs_script_ext}", - "args": [], - "cwd": "${mrdocs_src_dir}/test-files/golden-tests" - }, - { - "name": "MrDocs Render Landing Page", - "script": "${mrdocs_src_dir}/docs/website/render.js", - "folder": "MrDocs Render Landing Page", - "args": [], - "cwd": "${mrdocs_src_dir}/docs/website", - "env": { - "NODE_ENV": "production", - "MRDOCS_ROOT": "${mrdocs_install_dir}" - } - }, - { - "name": "MrDocs Clean Install Website Dependencies", - "script": "npm", - "args": ["ci"], - "cwd": "${mrdocs_src_dir}/docs/website" - }, - { - "name": "MrDocs Install Website Dependencies", - "script": "npm", - "args": ["install"], - "cwd": "${mrdocs_src_dir}/docs/website" - } - ] -} diff --git a/src/lib/AST/ASTAction.hpp b/src/lib/AST/ASTAction.hpp index 2063c4b24f..fd87e63aa8 100644 --- a/src/lib/AST/ASTAction.hpp +++ b/src/lib/AST/ASTAction.hpp @@ -65,7 +65,7 @@ class ASTAction This `clang::ASTConsumer` then creates an @ref ASTVisitor that will convert the AST into a set of MrDocs Info objects. - */ + */ void ExecuteAction() override; @@ -81,7 +81,7 @@ class ASTAction The main function of the ASTVisitorConsumer is the `HandleTranslationUnit` function, which is called to traverse the AST with the @ref ASTVisitor. - */ + */ std::unique_ptr CreateASTConsumer( clang::CompilerInstance& Compiler, diff --git a/src/lib/AST/ASTVisitor.cpp b/src/lib/AST/ASTVisitor.cpp index 10f5703615..a73e29d067 100644 --- a/src/lib/AST/ASTVisitor.cpp +++ b/src/lib/AST/ASTVisitor.cpp @@ -753,7 +753,10 @@ populate( { for (clang::FriendDecl const* FD : D->friends()) { - // Skip meaningless builtin friend types + // Check if the friend is a fundamental type + // Declaring a fundamental type like `int` as a friend of a + // class or struct does not have any practical effect. Thus, + // it's not considered part of the public API. if (clang::TypeSourceInfo const* TSI = FD->getFriendType()) { clang::Type const* T = TSI->getType().getTypePtrOrNull(); @@ -1213,13 +1216,9 @@ populate( } else if (clang::NamedDecl const* ND = D->getFriendDecl()) { - // ND can be a function or a class; converge to the semantic owner - // (primary template or canonical decl) before traversing so friend - // graphs built from many instantiations collapse to a single node. - clang::Decl const* Target = canonicalFriendTarget(ND); - MRDOCS_CHECK_OR(Target); + // ND can be a function or a class ScopeExitRestore s(mode_, Dependency); - if (Symbol const* SI = findOrTraverse(Target)) + if (Symbol const* SI = traverse(dyn_cast(ND))) { I.id = SI->id; } @@ -3201,26 +3200,6 @@ checkSymbolFilters(clang::Decl const* D, bool const AllowParent) else if (AllowParent) { clang::Decl const* P = getParent(D); - while (P) - { - // Only propagate inclusion from meaningful scopes. Translation units - // (and other non-scope wrappers like linkage specs) should not cause - // otherwise-unmatched globals to be extracted. - if (isa(P) || - isa(P) || - isa(P)) - { - break; - } - - if (isa(P)) - { - P = nullptr; - break; - } - - P = getParent(P); - } if (P) { // 4) Parent symbols imply this symbol should be included @@ -3572,62 +3551,28 @@ checkUndocumented( SymbolID const& id, DeclTy const* D) { - // If the symbol is in the global namespace, it doesn't - // need documentation - MRDOCS_CHECK_OR(!isa(D), {}); - - // If `extract-all` is disabled, we don't need to - // warn for undocumented symbols because that's - // the expected behavior. We use this to fail early. - bool const hasDoc = isDocumented(D); - if (!config_->extractAll && - !hasDoc) - { - return Unexpected(Error("Undocumented")); - } - - // If `warn-if-undocumented` is disabled, we don't - // need to check for anything else because the - // logic below is only used to populate the - // set of undocumented symbols for warning purposes. - MRDOCS_CHECK_OR(config_->warnIfUndocumented, {}); - + // If `extract-all` is enabled, we don't need to + // check for undocumented symbols + MRDOCS_CHECK_OR(!config_->extractAll, {}); + // If the symbol is a namespace, the `extract-all` + // doesn't apply to it + MRDOCS_CHECK_OR((!std::same_as), {}); // If the symbol is not being extracted as a Regular // symbol, we don't need to check for undocumented symbols // These are expected to be potentially undocumented MRDOCS_CHECK_OR(mode_ == Regular, {}); - - if constexpr (std::same_as) - { - // Respect implementation-defined filters: symbols that match those patterns - // are intentionally kept undocumented. We re-check here to avoid emitting - // warnings even though extraction proceeds in regular mode for these - // namespaces to extract their children. - if (!config_->implementationDefined.empty()) - { - llvm::SmallString<256> const qn = qualifiedName(D); - auto qns = qn.str(); - if (checkSymbolFiltersImpl(config_->implementationDefined, qns) || - checkSymbolFiltersImpl(config_->implementationDefined, qns)) - { - return {}; - } - } - } - // Check if the symbol is documented, ensure this symbol is not in the set // of undocumented symbols in this translation unit and return // without an error if it is - if (hasDoc) + if (isDocumented(D)) { - auto const it = undocumented_.find(id); - if (it != undocumented_.end()) + if (config_->warnIfUndocumented) { + auto const it = undocumented_.find(id); undocumented_.erase(it); } return {}; } - // If the symbol is undocumented, check if we haven't seen a // documented version before. if (auto const infoIt = info_.find(id); @@ -3636,28 +3581,22 @@ checkUndocumented( { return {}; } - // If the symbol is undocumented, and we haven't seen a documented // version before, store this symbol in the set of undocumented // symbols we've seen so far in this translation unit. - auto undocIt = undocumented_.find(id); - if (undocIt == undocumented_.end()) + if (config_->warnIfUndocumented) { - SymbolKind const kind = InfoTy::kind_id; - auto [newIt, inserted] = undocumented_.insert(UndocumentedSymbol{id, extractName(D), kind}); - MRDOCS_ASSERT(inserted); - undocIt = newIt; - } - - // Populate the location - auto handle = undocumented_.extract(undocIt); - UndocumentedSymbol& UI = handle.value(); - populate(UI.Loc, D); - undocumented_.insert(std::move(handle)); - - if (config_->extractAll) - { - return {}; + auto const undocIt = undocumented_.find(id); + if (undocIt == undocumented_.end()) + { + SymbolKind const kind = InfoTy::kind_id; + undocumented_.insert(UndocumentedSymbol{id, extractName(D), kind}); + } + // Populate the location + auto handle = undocumented_.extract(undocIt); + UndocumentedSymbol& UI = handle.value(); + populate(UI.Loc, D); + undocumented_.insert(std::move(handle)); } return Unexpected(Error("Undocumented")); } diff --git a/src/lib/AST/ASTVisitor.hpp b/src/lib/AST/ASTVisitor.hpp index c36c87839c..1b8093a124 100644 --- a/src/lib/AST/ASTVisitor.hpp +++ b/src/lib/AST/ASTVisitor.hpp @@ -271,7 +271,7 @@ class ASTVisitor @param compiler The compiler instance. @param context The AST context. @param sema The clang::Sema object. - */ + */ ASTVisitor( ConfigImpl const& config, Diagnostics const& diags, @@ -298,7 +298,7 @@ class ASTVisitor is not set to `never`, a second pass is made to extract referenced declarations. The `buildDependencies` function is responsible for this second pass. - */ + */ void build(); @@ -308,7 +308,7 @@ class ASTVisitor declarations that have been extracted by the ASTVisitor. @return A reference to the SymbolSet containing the extracted Info declarations. - */ + */ SymbolSet& results() { @@ -321,7 +321,7 @@ class ASTVisitor declarations that have been extracted by the ASTVisitor. @return A reference to the SymbolSet containing the extracted Info declarations. - */ + */ UndocumentedSymbolSet& undocumented() { diff --git a/src/lib/AST/ASTVisitorConsumer.hpp b/src/lib/AST/ASTVisitorConsumer.hpp index ed13878725..8a15796e17 100644 --- a/src/lib/AST/ASTVisitorConsumer.hpp +++ b/src/lib/AST/ASTVisitorConsumer.hpp @@ -35,7 +35,7 @@ namespace mrdocs { `clang::SemaConsumer` class. The main function this class overrides is `HandleTranslationUnit`, which is called when the translation unit is complete. -*/ + */ class ASTVisitorConsumer : public clang::SemaConsumer { @@ -60,7 +60,7 @@ class ASTVisitorConsumer Initialize the semantic consumer with the Sema instance being used to perform semantic analysis on the abstract syntax tree. - */ + */ void InitializeSema(clang::Sema& S) override { @@ -72,7 +72,7 @@ class ASTVisitorConsumer /** Inform the semantic consumer that Sema is no longer available. This is called when the Sema instance is no longer available. - */ + */ void ForgetSema() override { @@ -91,7 +91,7 @@ class ASTVisitorConsumer All other `Handle*` methods called by when a specific type of declaration or definition is found is left as an empty stub. - */ + */ void HandleTranslationUnit(clang::ASTContext& Context) override; @@ -101,7 +101,7 @@ class ASTVisitorConsumer top-level Decl*. @returns `true` to always continue parsing - */ + */ bool HandleTopLevelDecl(clang::DeclGroupRef) override { @@ -121,7 +121,7 @@ class ASTVisitorConsumer returns false for these VarDecls, so we manually set it here. @param D The declaration of the static member variable - */ + */ void HandleCXXStaticMemberVarInstantiation(clang::VarDecl* D) override { @@ -145,7 +145,7 @@ class ASTVisitorConsumer false for these clang::FunctionDecls, so we manually set it here. @param D The declaration of the function - */ + */ void HandleCXXImplicitFunctionInstantiation(clang::FunctionDecl* D) override { @@ -160,7 +160,7 @@ class ASTVisitorConsumer The implementation is an empty stub. @param D The declaration of the function - */ + */ void HandleInlineFunctionDefinition(clang::FunctionDecl*) override { } /** Handle a tag declaration definition. @@ -171,7 +171,7 @@ class ASTVisitorConsumer The implementation is an empty stub. @param D The declaration of the tag - */ + */ void HandleTagDeclDefinition(clang::TagDecl*) override { } /** Handle a tag declaration required definition. @@ -182,7 +182,7 @@ class ASTVisitorConsumer The implementation is an empty stub. @param D The declaration of the tag - */ + */ void HandleTagDeclRequiredDefinition(clang::TagDecl const*) override { } /** Handle an interesting declaration. @@ -195,7 +195,7 @@ class ASTVisitorConsumer The implementation is an empty stub. @param D The declaration - */ + */ void HandleInterestingDecl(clang::DeclGroupRef) override { } /** Handle a tentative definition. @@ -205,7 +205,7 @@ class ASTVisitorConsumer The implementation is an empty stub. @param D The declaration - */ + */ void CompleteTentativeDefinition(clang::VarDecl*) override { } /** Handle a tentative definition. @@ -215,7 +215,7 @@ class ASTVisitorConsumer The implementation is an empty stub. @param D The declaration - */ + */ void CompleteExternalDeclaration(clang::DeclaratorDecl*) override { } /** Handle a vtable. @@ -225,7 +225,7 @@ class ASTVisitorConsumer The implementation is an empty stub. @param D The declaration - */ + */ void AssignInheritanceModel(clang::CXXRecordDecl*) override { } /** Handle an implicit import declaration. @@ -235,7 +235,7 @@ class ASTVisitorConsumer The implementation is an empty stub. @param D The declaration - */ + */ void HandleVTable(clang::CXXRecordDecl*) override { } /** Handle an implicit import declaration. @@ -245,7 +245,7 @@ class ASTVisitorConsumer The implementation is an empty stub. @param D The declaration - */ + */ void HandleImplicitImportDecl(clang::ImportDecl*) override { } /** Handle a top-level declaration in an Objective-C container. @@ -256,7 +256,7 @@ class ASTVisitorConsumer The implementation is an empty stub. @param D The declaration - */ + */ void HandleTopLevelDeclInObjCContainer(clang::DeclGroupRef) override { } }; diff --git a/src/lib/AST/ClangHelpers.cpp b/src/lib/AST/ClangHelpers.cpp index 0b72ce1dd4..f973ed25bc 100644 --- a/src/lib/AST/ClangHelpers.cpp +++ b/src/lib/AST/ClangHelpers.cpp @@ -87,45 +87,6 @@ SubstituteConstraintExpressionWithoutSatisfaction( return SubstConstr.get(); } -clang::Decl const* -canonicalFriendTarget(clang::NamedDecl const* ND) -{ - if (!ND) - return nullptr; - - if (auto const* CTSD = llvm::dyn_cast(ND)) - { - if (auto* T = CTSD->getSpecializedTemplate()) - return T->getTemplatedDecl()->getCanonicalDecl(); - } - - if (auto const* CRD = llvm::dyn_cast(ND)) - { - if (auto* CTD = CRD->getDescribedClassTemplate()) - return CTD->getTemplatedDecl()->getCanonicalDecl(); - } - - if (auto const* VTS = llvm::dyn_cast(ND)) - { - if (auto* VT = VTS->getSpecializedTemplate()) - return VT->getTemplatedDecl()->getCanonicalDecl(); - } - - if (auto const* VTD = llvm::dyn_cast(ND)) - return VTD->getTemplatedDecl()->getCanonicalDecl(); - - if (auto const* FD = llvm::dyn_cast(ND)) - { - if (auto const* PT = FD->getPrimaryTemplate()) - return PT->getTemplatedDecl()->getCanonicalDecl(); - } - - if (auto const* FTD = llvm::dyn_cast(ND)) - return FTD->getTemplatedDecl()->getCanonicalDecl(); - - return ND->getCanonicalDecl(); -} - clang::AccessSpecifier getAccess(clang::Decl const* D) { diff --git a/src/lib/AST/ClangHelpers.hpp b/src/lib/AST/ClangHelpers.hpp index 4a1edafb95..1b8554ac79 100644 --- a/src/lib/AST/ClangHelpers.hpp +++ b/src/lib/AST/ClangHelpers.hpp @@ -43,22 +43,13 @@ namespace mrdocs { @param DeclInfo The template comparison information for the new declaration. @param ConstrExpr The constraint expression to be substituted. @return The substituted constraint expression, or nullptr if an error occurs. -*/ + */ clang::Expr const* SubstituteConstraintExpressionWithoutSatisfaction( clang::Sema &S, const clang::Sema::TemplateCompareNewDeclInfo &DeclInfo, const clang::Expr *ConstrExpr); -/** Collapse a friend target (function/class/template) to its canonical owner. - - This resolves friend declarations that name template specializations or - redeclarations to the primary/canonical declaration so traversal and - symbol IDs converge on a single entity. -*/ -clang::Decl const* -canonicalFriendTarget(clang::NamedDecl const* ND); - /** Determine the MrDocs Info type for a Clang DeclType This trait associates a Clang Decl type with the corresponding @@ -74,7 +65,7 @@ canonicalFriendTarget(clang::NamedDecl const* ND); When there's no direct correspondence, this trait returns the base Info type. -*/ + */ template struct InfoTypeFor {}; @@ -212,7 +203,7 @@ template using InfoTypeFor_t = typename InfoTypeFor::type; /** Convert a Clang AccessSpecifier into a MrDocs AccessKind -*/ + */ inline AccessKind toAccessKind(clang::AccessSpecifier const spec) @@ -229,7 +220,7 @@ toAccessKind(clang::AccessSpecifier const spec) } /** Convert a Clang StorageClass into a MrDocs StorageClassKind -*/ + */ inline StorageClassKind toStorageClassKind(clang::StorageClass const spec) @@ -249,7 +240,7 @@ toStorageClassKind(clang::StorageClass const spec) } /** Convert a Clang ConstexprSpecKind into a MrDocs ConstexprKind -*/ + */ inline ConstexprKind toConstexprKind(clang::ConstexprSpecKind const spec) @@ -270,7 +261,7 @@ toConstexprKind(clang::ConstexprSpecKind const spec) } /** Convert a Clang ExplicitSpecKind into a MrDocs ExplicitKind -*/ + */ inline ExplicitKind toExplicitKind(clang::ExplicitSpecifier const& spec) @@ -292,7 +283,7 @@ toExplicitKind(clang::ExplicitSpecifier const& spec) } /** Convert a Clang ExceptionSpecificationType into a MrDocs NoexceptKind -*/ + */ inline NoexceptKind toNoexceptKind(clang::ExceptionSpecificationType const spec) @@ -324,7 +315,7 @@ toNoexceptKind(clang::ExceptionSpecificationType const spec) } /** Convert a Clang clang::OverloadedOperatorKind into a MrDocs OperatorKind -*/ + */ inline OperatorKind toOperatorKind(clang::OverloadedOperatorKind const kind) @@ -429,7 +420,7 @@ toOperatorKind(clang::OverloadedOperatorKind const kind) } /** Convert a Clang ReferenceKind into a MrDocs ReferenceKind -*/ + */ inline ReferenceKind toReferenceKind(clang::RefQualifierKind const kind) @@ -448,7 +439,7 @@ toReferenceKind(clang::RefQualifierKind const kind) } /** Convert a Clang clang::TagTypeKind into a MrDocs RecordKeyKind -*/ + */ inline RecordKeyKind toRecordKeyKind(clang::TagTypeKind const kind) @@ -465,7 +456,7 @@ toRecordKeyKind(clang::TagTypeKind const kind) } /** Convert a Clang unsigned qualifier kind into a MrDocs QualifierKind -*/ + */ inline QualifierKind toQualifierKind(unsigned const quals) @@ -484,7 +475,7 @@ toQualifierKind(unsigned const quals) } /** Convert a Clang Decl::Kind into a MrDocs FunctionClass -*/ + */ inline FunctionClass toFunctionClass(clang::Decl::Kind const kind) @@ -502,7 +493,7 @@ toFunctionClass(clang::Decl::Kind const kind) } /** Convert a Clang clang::AutoTypeKeyword into a MrDocs AutoKind -*/ + */ inline AutoKind toAutoKind(clang::AutoTypeKeyword const kind) @@ -520,7 +511,7 @@ toAutoKind(clang::AutoTypeKeyword const kind) } /** Convert a Clang clang::clang::BuiltinType into a MrDocs AutoKind -*/ + */ inline Optional toFundamentalTypeKind(clang::BuiltinType::Kind const kind) @@ -579,7 +570,7 @@ toFundamentalTypeKind(clang::BuiltinType::Kind const kind) // ---------------------------------------------------------------- /** Visit a Decl and call the appropriate visitor function. -*/ + */ template< typename DeclTy, typename Visitor, @@ -627,7 +618,7 @@ DeclToKindImpl() = delete; #include /** Get the clang::Decl::Kind for a type DeclTy derived from Decl. -*/ + */ template consteval clang::Decl::Kind @@ -640,7 +631,7 @@ DeclToKind() // ---------------------------------------------------------------- /** Visit a Type and call the appropriate visitor function. -*/ + */ template< typename TypeTy, typename Visitor, @@ -698,7 +689,7 @@ TypeToKind() // ---------------------------------------------------------------- /** Visit a TypeLoc and call the appropriate visitor function. -*/ + */ template< typename TypeLocTy, typename Visitor, @@ -745,7 +736,7 @@ TypeLocToKindImpl() = delete; #include /** Get the clang::TypeLoc::TypeLocClass for a type TypeLocTy derived from TypeLoc. -*/ + */ template consteval clang::TypeLoc::TypeLocClass @@ -827,7 +818,7 @@ getInstantiatedFrom(DeclTy const* D) Given a `Decl`, this function will analyze the parent context and return the access specifier for the declaration. -*/ + */ MRDOCS_DECL clang::AccessSpecifier getAccess(clang::Decl const* D); @@ -855,7 +846,7 @@ getDeclaratorType(clang::DeclaratorDecl const* DD); the function will return the clang::NonTypeTemplateParmDecl corresponding to `x`, which is the template parameter of the function `f`. -*/ + */ MRDOCS_DECL clang::NonTypeTemplateParmDecl const* getNTTPFromExpr(clang::Expr const* E, unsigned Depth); @@ -1095,7 +1086,7 @@ namespace detail { /** Determine whether the driver mode is ClangCL. @param cc The compilation command to insepct. -*/ + */ bool isClangCL(clang::tooling::CompileCommand const& cc); diff --git a/src/lib/AST/InstantiatedFromVisitor.hpp b/src/lib/AST/InstantiatedFromVisitor.hpp index 17e0e82386..2a7d9651a2 100644 --- a/src/lib/AST/InstantiatedFromVisitor.hpp +++ b/src/lib/AST/InstantiatedFromVisitor.hpp @@ -22,7 +22,7 @@ namespace mrdocs { This class provides methods to visit various template declarations and retrieve the original declarations from which they were instantiated. -*/ + */ class InstantiatedFromVisitor : public clang::ConstDeclVisitor { diff --git a/src/lib/AST/MrDocsFileSystem.hpp b/src/lib/AST/MrDocsFileSystem.hpp index 7e1323a4fb..5aa2a5535f 100644 --- a/src/lib/AST/MrDocsFileSystem.hpp +++ b/src/lib/AST/MrDocsFileSystem.hpp @@ -149,8 +149,7 @@ class MrDocsFileSystem : public llvm::vfs::FileSystem { if (!Mem->exists(Path)) { auto Buf = llvm::MemoryBuffer::getMemBufferCopy(Contents, Path); - Mem->addFile(Path, /*ModTime - */ 0, std::move(Buf)); + Mem->addFile(Path, /*ModTime*/ 0, std::move(Buf)); } } diff --git a/src/lib/AST/TerminalTypeVisitor.hpp b/src/lib/AST/TerminalTypeVisitor.hpp index 2ea358e40e..aad5faad71 100644 --- a/src/lib/AST/TerminalTypeVisitor.hpp +++ b/src/lib/AST/TerminalTypeVisitor.hpp @@ -68,7 +68,7 @@ namespace mrdocs { we reach a terminal type, such as `VisitPointerType`. @tparam Derived The derived class type. -*/ + */ template class TerminalTypeVisitor : public clang::TypeVisitor, bool> @@ -96,7 +96,7 @@ class TerminalTypeVisitor @param Visitor The ASTVisitor instance. @param NNS The optional NestedNameSpecifier. - */ + */ explicit TerminalTypeVisitor( ASTVisitor& Visitor) @@ -108,7 +108,7 @@ class TerminalTypeVisitor This function casts the given Type to the derived class type and calls the corresponding `VisitXXXType` function. - */ + */ using TerminalTypeVisitor::TypeVisitor::Visit; /** Visit a Qualified Type. @@ -120,7 +120,7 @@ class TerminalTypeVisitor Example: - Wrapped type: `const int` - Unwrapped type: `int` - */ + */ bool Visit(clang::QualType const QT) { @@ -136,7 +136,7 @@ class TerminalTypeVisitor This function returns a reference to the ASTVisitor instance. @return A reference to the ASTVisitor instance. - */ + */ ASTVisitor& getASTVisitor() const { @@ -147,7 +147,7 @@ class TerminalTypeVisitor This function is an empty placeholder for `buildPointer` when not defined by the `Derived` visitor. - */ + */ static void buildPointer @@ -160,7 +160,7 @@ class TerminalTypeVisitor This function is an empty placeholder for `buildLValueReference` when not defined by the `Derived` visitor. - */ + */ void buildLValueReference( clang::LValueReferenceType const*) @@ -171,7 +171,7 @@ class TerminalTypeVisitor This function is an empty placeholder for `buildRValueReference` when not defined by the `Derived` visitor. - */ + */ void buildRValueReference( clang::RValueReferenceType const*) @@ -182,7 +182,7 @@ class TerminalTypeVisitor This function is an empty placeholder for `buildMemberPointer` when not defined by the `Derived` visitor. - */ + */ void buildMemberPointer( clang::MemberPointerType const*, unsigned) @@ -193,7 +193,7 @@ class TerminalTypeVisitor This function is an empty placeholder for `buildArray` when not defined by the `Derived` visitor. - */ + */ void buildArray( clang::ArrayType const*) @@ -210,7 +210,7 @@ class TerminalTypeVisitor This function is an empty placeholder for `buildDecltype` when not defined by the `Derived` visitor. - */ + */ void buildDecltype( clang::DecltypeType const*, @@ -223,7 +223,7 @@ class TerminalTypeVisitor This function is an empty placeholder for `buildAuto` when not defined by the `Derived` visitor. - */ + */ void buildAuto( clang::AutoType const*, @@ -236,7 +236,7 @@ class TerminalTypeVisitor This function is an empty placeholder for `buildTerminal` when not defined by the `Derived` visitor. - */ + */ void buildTerminal( clang::NestedNameSpecifier, @@ -250,7 +250,7 @@ class TerminalTypeVisitor This function is an empty placeholder for `buildTerminal` when not defined by the `Derived` visitor. - */ + */ void buildTerminal( clang::NestedNameSpecifier, @@ -265,7 +265,7 @@ class TerminalTypeVisitor This function is an empty placeholder for `buildTerminal` when not defined by the `Derived` visitor. - */ + */ void buildTerminal( clang::NestedNameSpecifier, @@ -283,7 +283,7 @@ class TerminalTypeVisitor This function casts the current instance to the derived class type. @return A reference to the derived class instance. - */ + */ Derived& getDerived() { @@ -297,7 +297,7 @@ class TerminalTypeVisitor Example: - Wrapped type: `(int)` - Unwrapped type: `int` - */ + */ bool VisitParenType(clang::ParenType const* T) { @@ -312,7 +312,7 @@ class TerminalTypeVisitor Example: - Wrapped type: `MACRO_QUALIFIED(int)` - Unwrapped type: `int` - */ + */ bool VisitMacroQualified( clang::MacroQualifiedType const* T) @@ -328,7 +328,7 @@ class TerminalTypeVisitor Example: - Wrapped type: `[[attribute]] int` - Unwrapped type: `int` - */ + */ bool VisitAttributedType( clang::AttributedType const* T) @@ -344,7 +344,7 @@ class TerminalTypeVisitor Example: - Wrapped type: adjusted/decayed `int*` - Unwrapped type: original `int[4]` - */ + */ bool VisitAdjustedType(clang::AdjustedType const* T) { @@ -359,7 +359,7 @@ class TerminalTypeVisitor Example: - Wrapped type: `using TypeAlias = int` - Unwrapped type: `int` - */ + */ bool VisitUsingType(clang::UsingType const* T) { @@ -374,7 +374,7 @@ class TerminalTypeVisitor Example: - Wrapped type: `T` - Unwrapped type: `int` (if `T` is substituted with `int`) - */ + */ bool VisitSubstTemplateTypeParmType( clang::SubstTemplateTypeParmType const* T) @@ -392,7 +392,7 @@ class TerminalTypeVisitor Example: - Wrapped type: `int...` - Unwrapped type: `int` - */ + */ bool VisitPackExpansionType( clang::PackExpansionType const* T) @@ -411,7 +411,7 @@ class TerminalTypeVisitor Example: - Wrapped type: `int*` - Unwrapped type: `int` - */ + */ bool VisitPointerType( clang::PointerType const* T) @@ -428,7 +428,7 @@ class TerminalTypeVisitor Example: - Wrapped type: `int&` - Unwrapped type: `int` - */ + */ bool VisitLValueReferenceType( clang::LValueReferenceType const* T) @@ -446,7 +446,7 @@ class TerminalTypeVisitor Example: - Wrapped type: `int&&` - Unwrapped type: `int` - */ + */ bool VisitRValueReferenceType( clang::RValueReferenceType const* T) @@ -464,7 +464,7 @@ class TerminalTypeVisitor Example: - Wrapped type: `int Class::*` - Unwrapped type: `int` - */ + */ bool VisitMemberPointerType( clang::MemberPointerType const* T) @@ -490,7 +490,7 @@ class TerminalTypeVisitor Example: - Wrapped type: `int[10]` - Unwrapped type: `int` - */ + */ bool VisitArrayType( clang::ArrayType const* T) diff --git a/src/lib/AST/TypeBuilder.hpp b/src/lib/AST/TypeBuilder.hpp index 33ffdd7625..e868e0987f 100644 --- a/src/lib/AST/TypeBuilder.hpp +++ b/src/lib/AST/TypeBuilder.hpp @@ -30,7 +30,7 @@ namespace mrdocs { Builder.Visit(qt); std::unique_ptr typeInfo = Builder.result(); @endcode -*/ + */ class TypeBuilder : public TerminalTypeVisitor { @@ -72,7 +72,7 @@ class TypeBuilder as a unique pointer to the `Type` object. @return A unique pointer to the `Type` object. - */ + */ Polymorphic result() { @@ -86,7 +86,7 @@ class TypeBuilder @param T The pointer type to build. @param quals The qualifiers for the pointer type. - */ + */ void buildPointer(clang::PointerType const* T, unsigned quals); /** Build type information for a lvalue reference type. @@ -95,7 +95,7 @@ class TypeBuilder the pointee type. @param T The lvalue reference type to build. - */ + */ void buildLValueReference(clang::LValueReferenceType const* T); /** Build type information for an rvalue reference type. @@ -104,7 +104,7 @@ class TypeBuilder the pointee type. @param T The rvalue reference type to build. - */ + */ void buildRValueReference(clang::RValueReferenceType const* T); /** Build type information for a member pointer type. @@ -117,7 +117,7 @@ class TypeBuilder @param T The member pointer type to build. @param quals The qualifiers for the member pointer type. - */ + */ void buildMemberPointer(clang::MemberPointerType const* T, unsigned quals); /** Build type information for an array type. @@ -130,7 +130,7 @@ class TypeBuilder and the expression defining the array bounds. @param T The array type to build. - */ + */ void buildArray(clang::ArrayType const* T); /** Populate type information for a function type. @@ -142,7 +142,7 @@ class TypeBuilder It includes the return type and the parameter types. @param T The function type to populate. - */ + */ void populate(clang::FunctionType const* T); /** Build type information for a decltype type. @@ -156,7 +156,7 @@ class TypeBuilder @param T The decltype type to build. @param quals The qualifiers for the decltype type. @param pack Whether the decltype type is a pack. - */ + */ void buildDecltype(clang::DecltypeType const* T, unsigned quals, bool pack); /** Build type information for an auto type. @@ -171,7 +171,7 @@ class TypeBuilder @param T The auto type to build. @param quals The qualifiers for the auto type. @param pack Whether the auto type is a pack. - */ + */ void buildAuto(clang::AutoType const* T, unsigned quals, bool pack); /** Build type information for a terminal type. @@ -187,7 +187,7 @@ class TypeBuilder @param T The terminal type to build. @param quals The qualifiers for the terminal type. @param pack Whether the terminal type is a pack. - */ + */ void buildTerminal( clang::Type const* T, unsigned quals, @@ -207,7 +207,7 @@ class TypeBuilder @param TArgs The template arguments. @param quals The qualifiers for the terminal type. @param pack Whether the terminal type is a pack. - */ + */ void buildTerminal( clang::NestedNameSpecifier NNS, clang::IdentifierInfo const* II, @@ -229,7 +229,7 @@ class TypeBuilder @param TArgs The template arguments. @param quals The qualifiers for the terminal type. @param pack Whether the terminal type is a pack. - */ + */ void buildTerminal( clang::NestedNameSpecifier NNS, clang::NamedDecl* D, diff --git a/src/lib/ConfigImpl.hpp b/src/lib/ConfigImpl.hpp index 146c1e4022..05d8d0b6ed 100644 --- a/src/lib/ConfigImpl.hpp +++ b/src/lib/ConfigImpl.hpp @@ -74,7 +74,7 @@ class ConfigImpl settings are loaded or modified to update the DOM object representing the configuration keys. - */ + */ void updateConfigDom(); diff --git a/src/lib/ConfigOptions.json b/src/lib/ConfigOptions.json index 019b0ec176..dc8212890b 100644 --- a/src/lib/ConfigOptions.json +++ b/src/lib/ConfigOptions.json @@ -466,41 +466,6 @@ "details": "When set to true, the page for the global namespace will recursively list all symbols in the documentation, not just those in the global namespace. This makes the global namespace page act as an index for the entire project.", "type": "bool", "default": true - }, - { - "name": "stylesheets", - "brief": "Ordered list of stylesheets to apply to HTML output", - "details": "Ordered list of stylesheet names or paths. If empty, the bundled stylesheet is used. Entries can be local paths or remote URLs; remote URLs are only linked when `linkcss` is true. Inline mode embeds local styles; link mode emits `` tags for each entry and copies local files.", - "type": "list", - "default": [] - }, - { - "name": "no-default-styles", - "brief": "Disable the bundled default stylesheet", - "details": "When set to true, the bundled stylesheet is not applied. Combine with an empty `stylesheets` list to emit no styles at all.", - "type": "bool", - "default": false - }, - { - "name": "stylesdir", - "brief": "Directory for linked stylesheets", - "details": "Directory used to build the href for linked stylesheets when `linkcss` is true. Defaults to `css`. The directory is created under the output root when copying local styles (e.g. `css/mrdocs-default.css`).", - "type": "string", - "default": "css" - }, - { - "name": "linkcss", - "brief": "Link stylesheets instead of embedding them", - "details": "When set to true, stylesheets are linked with `` tags instead of being inlined. Links use `stylesdir` plus the stylesheet name (e.g. `css/custom.css`). Local styles are copied unless `copycss` is false; remote URLs are linked as-is.", - "type": "bool", - "default": false - }, - { - "name": "copycss", - "brief": "Copy local stylesheets when linking", - "details": "When `linkcss` is true, copy bundled and local stylesheet files into the output under `stylesdir`. Remote URLs are not copied. Set to false to skip copying.", - "type": "bool", - "default": true } ] }, @@ -707,4 +672,4 @@ } ] } -] +] \ No newline at end of file diff --git a/src/lib/CorpusImpl.hpp b/src/lib/CorpusImpl.hpp index f779d62699..571fb8fb37 100644 --- a/src/lib/CorpusImpl.hpp +++ b/src/lib/CorpusImpl.hpp @@ -96,7 +96,7 @@ class CorpusImpl final : public Corpus find(SymbolID const& id) const noexcept override; /** Return a range of Info objects for the specified Symbol IDs. - */ + */ template R> auto find(R&& range) @@ -120,7 +120,7 @@ class CorpusImpl final : public Corpus } /** Return a range of constant Info objects for the specified Symbol IDs. - */ + */ template R> auto find(R&& range) const diff --git a/src/lib/Gen/adoc/AdocEscape.hpp b/src/lib/Gen/adoc/AdocEscape.hpp index ef98bb133b..f01cfbdd8b 100644 --- a/src/lib/Gen/adoc/AdocEscape.hpp +++ b/src/lib/Gen/adoc/AdocEscape.hpp @@ -20,7 +20,7 @@ namespace mrdocs::adoc { /** Escape a string for use in AsciiDoc -*/ + */ MRDOCS_DECL void AdocEscape(OutputRef& os, std::string_view str); diff --git a/src/lib/Gen/hbs/Builder.cpp b/src/lib/Gen/hbs/Builder.cpp index 43d133800e..8cb40bf465 100644 --- a/src/lib/Gen/hbs/Builder.cpp +++ b/src/lib/Gen/hbs/Builder.cpp @@ -16,7 +16,6 @@ #include #include #include -#include namespace mrdocs { @@ -305,37 +304,11 @@ getRelPrefix(std::size_t depth) return rel_prefix; } -static std::string -makeRelfileprefix(std::string_view url) -{ - if (!url.starts_with('/')) - return {}; - - std::size_t const depth = static_cast( - std::ranges::count(url.substr(1), '/')); - - std::string prefix; - prefix.reserve(depth * 3); - for (std::size_t i = 0; i < depth; ++i) - prefix.append("../"); - return prefix; -} - dom::Object Builder:: createContext(Symbol const& I) { dom::Object ctx; - dom::Object page; - page.set("stylesheets", domCorpus.stylesheets); - page.set("inlineStyles", domCorpus.inlineStyles); - page.set("inlineScripts", domCorpus.inlineScripts); - page.set("hasDefaultStyles", domCorpus.hasDefaultStyles); - if (domCorpus->config->multipage) - { - page.set("relfileprefix", makeRelfileprefix(domCorpus.getURL(I))); - } - ctx.set("page", page); ctx.set("symbol", domCorpus.get(I.id)); ctx.set("config", domCorpus->config.object()); return ctx; @@ -386,13 +359,6 @@ renderWrapped( auto const wrapperFile = std::format("wrapper.{}.hbs", domCorpus.fileExtension); dom::Object ctx; - dom::Object page; - page.set("stylesheets", domCorpus.stylesheets); - page.set("inlineStyles", domCorpus.inlineStyles); - page.set("inlineScripts", domCorpus.inlineScripts); - page.set("hasDefaultStyles", domCorpus.hasDefaultStyles); - ctx.set("page", page); - ctx.set("config", domCorpus->config.object()); ctx.set("contents", dom::makeInvocable([&](dom::Value const &) -> Expected { MRDOCS_TRY(contentsCb()); @@ -469,3 +435,4 @@ commonTemplatesDir(std::string_view const subdir) const } // hbs } // mrdocs + diff --git a/src/lib/Gen/hbs/Builder.hpp b/src/lib/Gen/hbs/Builder.hpp index b1866aabdc..3f64e6f8ad 100644 --- a/src/lib/Gen/hbs/Builder.hpp +++ b/src/lib/Gen/hbs/Builder.hpp @@ -56,7 +56,7 @@ class Builder If the output is multi-page and not embedded, this function renders the wrapper template with the index template as the contents. - */ + */ template T> Expected operator()(std::ostream& os, T const&); @@ -71,7 +71,7 @@ class Builder will be executed to render the contents of the page. - */ + */ Expected renderWrapped( std::ostream& os, @@ -79,27 +79,27 @@ class Builder private: /** The directory with the all templates. - */ + */ std::string templatesDir() const; /** A subdirectory of the templates dir - */ + */ std::string templatesDir(std::string_view subdir) const; /** The directory with the common templates. - */ + */ std::string commonTemplatesDir() const; /** A subdirectory of the common templates dir - */ + */ std::string commonTemplatesDir(std::string_view subdir) const; /** The directory with the layout templates. - */ + */ std::string layoutDir() const; @@ -110,12 +110,12 @@ class Builder It also includes a sectionref helper that describes the section where the symbol is located. - */ + */ dom::Object createContext(Symbol const& I); /** Render a Handlebars template from the templates directory. - */ + */ Expected callTemplate( std::ostream& os, diff --git a/src/lib/Gen/hbs/HandlebarsCorpus.hpp b/src/lib/Gen/hbs/HandlebarsCorpus.hpp index 2d945593fa..4d11b5091a 100644 --- a/src/lib/Gen/hbs/HandlebarsCorpus.hpp +++ b/src/lib/Gen/hbs/HandlebarsCorpus.hpp @@ -30,36 +30,12 @@ namespace mrdocs::hbs { class HandlebarsCorpus final : public DomCorpus { public: - /** Legible names for the Handlebars corpus. - */ + /** Legible names for the Handlebars corpus. */ LegibleNames names_; - /** File extension for the markup files. - */ + /** File extension for the markup files. */ std::string fileExtension; - /** Stylesheets to load for the page. - - Array of objects with `path` (href or output-relative link) and - `external` (true for remote URLs). Populated by the generator with - resolved link targets, not source file paths. - */ - dom::Array stylesheets; - - /** Inline stylesheet contents (optional). - - Array of raw CSS strings that may be inlined into the wrapper. - */ - dom::Array inlineStyles; - - /** Inline scripts to inject into the page head (optional). - */ - dom::Array inlineScripts; - - /** True when the generator supplied the bundled default styles. - */ - bool hasDefaultStyles = false; - /** Constructor. Initializes the HandlebarsCorpus with the given corpus and options. diff --git a/src/lib/Gen/hbs/HandlebarsGenerator.cpp b/src/lib/Gen/hbs/HandlebarsGenerator.cpp index 28e47bd58f..7ba936a9a5 100644 --- a/src/lib/Gen/hbs/HandlebarsGenerator.cpp +++ b/src/lib/Gen/hbs/HandlebarsGenerator.cpp @@ -17,26 +17,17 @@ #include "SinglePageVisitor.hpp" #include "TagfileWriter.hpp" #include -#include #include #include #include #include #include -#include #include #include -#include -#include namespace mrdocs::hbs { namespace { -constexpr std::string_view defaultStylesheetName = "mrdocs-default.css"; -constexpr std::string_view defaultHighlightStylesheetName = "mrdocs-highlight.css"; -constexpr std::string_view highlightJsCdn = - "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"; - std::function createEscapeFn(HandlebarsGenerator const& gen) { @@ -66,6 +57,15 @@ createExecutors( } return group; } + +HandlebarsCorpus +createDomCorpus( + HandlebarsGenerator const& gen, + Corpus const& corpus) { + return { + corpus, + gen.fileExtension()}; +} } // (anon) //------------------------------------------------ @@ -89,8 +89,7 @@ build( } // Create corpus and executors - HandlebarsCorpus domCorpus{corpus, fileExtension()}; - prepareCorpus(domCorpus); + HandlebarsCorpus domCorpus = createDomCorpus(*this, corpus); MRDOCS_TRY(ExecutorGroup ex, createExecutors(*this, domCorpus)); // Visit the corpus @@ -113,8 +112,7 @@ buildTagfile( std::ostream& os, Corpus const& corpus) const { - HandlebarsCorpus domCorpus{corpus, fileExtension()}; - prepareCorpus(domCorpus); + HandlebarsCorpus domCorpus = createDomCorpus(*this, corpus); RawOstream raw_os(os); if (corpus.config->multipage) { @@ -176,8 +174,7 @@ buildOne( Corpus const& corpus) const { // Create corpus and executors - HandlebarsCorpus domCorpus{corpus, fileExtension()}; - prepareCorpus(domCorpus); + HandlebarsCorpus domCorpus = createDomCorpus(*this, corpus); MRDOCS_TRY(ExecutorGroup ex, createExecutors(*this, domCorpus)); // Embedded mode @@ -216,289 +213,4 @@ escape(OutputRef& out, std::string_view str) const out << str; } -std::string -HandlebarsGenerator:: -defaultStylesheetSource(Config const& config) const -{ - auto const htmlPath = files::appendPath( - config->addons, - "generator", - "html", - "layouts", - "style.css"); - if (files::exists(htmlPath)) - { - return htmlPath; - } - - auto const commonPath = files::appendPath( - config->addons, - "generator", - "common", - "layouts", - "style.css"); - if (files::exists(commonPath)) - { - return commonPath; - } - - return {}; -} - -std::string -HandlebarsGenerator:: -defaultStylesheetOutput(Config const& config) const -{ - return files::appendPath(config->stylesdir, defaultStylesheetName); -} - -std::string -HandlebarsGenerator:: -defaultHighlightStylesheetSource(Config const& config) const -{ - auto const commonPath = files::appendPath( - config->addons, - "generator", - "common", - "layouts", - "highlight.css"); - if (files::exists(commonPath)) - { - return commonPath; - } - return {}; -} - -std::string -HandlebarsGenerator:: -defaultHighlightStylesheetOutput(Config const& config) const -{ - return files::appendPath(config->stylesdir, defaultHighlightStylesheetName); -} - -std::string -HandlebarsGenerator:: -defaultHighlightScript() const -{ - return std::format( - R"(// Load highlight.js from CDN and apply to all code blocks -(function() {{ - if (document.querySelector('script[data-mrdocs-hljs]')) - return; - var script = document.createElement('script'); - script.src = '{}'; - script.async = true; - script.setAttribute('data-mrdocs-hljs', 'true'); - script.onload = function() {{ - var run = function() {{ - if (window.hljs) - hljs.highlightAll(); - }}; - if (document.readyState === 'loading') - document.addEventListener('DOMContentLoaded', run, {{ once: true }}); - else - run(); - }}; - document.head.appendChild(script); -}})();)", - highlightJsCdn); -} - -static bool -isRemote(std::string_view path) -{ - return path.starts_with("http://") || path.starts_with("https://"); -} - -Expected -HandlebarsGenerator:: -prepareStylesheets(Config const& config) const -{ - StylesData data; - - bool const linkMode = config->linkcss; - bool const copyCss = config->copycss; - - auto addInlineFromFile = [&](std::string const& path) -> Expected - { - MRDOCS_TRY(auto css, files::getFileText(path)); - data.inlineStyles.emplace_back(std::move(css)); - return {}; - }; - - auto addLocalLink = [&](std::string const& sourcePath, - std::string const& relPath) - { - StylesheetRef sheet; - sheet.sourcePath = sourcePath; - sheet.outputRelative = files::appendPath(config->stylesdir, relPath); - sheet.external = false; - data.stylesheets.push_back(std::move(sheet)); - }; - - std::vector entries = config->stylesheets; - if (entries.empty() && !config->noDefaultStyles) - { - data.hasDefaultStyles = true; - auto source = defaultStylesheetSource(config); - auto output = defaultStylesheetOutput(config); - if (!source.empty() && !output.empty()) - { - if (linkMode) - { - StylesheetRef sheet; - sheet.sourcePath = source; - sheet.outputRelative = output; - data.stylesheets.push_back(std::move(sheet)); - } - else - { - auto res = addInlineFromFile(source); - if (!res) - { - report::warn("Failed to read default stylesheet: {}", res.error()); - } - } - } - - auto highlightSource = defaultHighlightStylesheetSource(config); - auto highlightOutput = defaultHighlightStylesheetOutput(config); - if (!highlightSource.empty() && !highlightOutput.empty()) - { - if (linkMode) - { - addLocalLink(highlightSource, highlightOutput); - } - else - { - auto res = addInlineFromFile(highlightSource); - if (!res) - { - report::warn("Failed to read highlight stylesheet: {}", res.error()); - } - } - } - - data.inlineScripts.push_back(defaultHighlightScript()); - } - - auto const baseDir = config->configDir(); - - for (auto const& entry : entries) - { - if (entry.empty()) - continue; - - if (isRemote(entry)) - { - if (!linkMode) - { - return Unexpected( - formatError("Remote stylesheet \"{}\" requires linkcss=true", entry)); - } - StylesheetRef sheet; - sheet.outputRelative = entry; - sheet.external = true; - data.stylesheets.push_back(std::move(sheet)); - continue; - } - - std::string sourcePath = entry; - if (!files::isAbsolute(sourcePath)) - { - sourcePath = files::makeAbsolute(sourcePath, baseDir); - } - sourcePath = files::makePosixStyle(sourcePath); - - MRDOCS_CHECK( - files::exists(sourcePath), - formatError("Stylesheet path does not exist: {}", sourcePath)); - - if (linkMode) - { - std::string rel = files::isAbsolute(entry) - ? std::string(files::getFileName(entry)) - : files::makePosixStyle(entry); - addLocalLink(sourcePath, rel); - } - else - { - MRDOCS_TRY(addInlineFromFile(sourcePath)); - } - } - - for (auto& sheet : data.stylesheets) - { - if (!sheet.external) - { - sheet.outputRelative = files::makePosixStyle(sheet.outputRelative); - } - } - - if (linkMode && copyCss) - { - for (auto const& sheet : data.stylesheets) - { - if (sheet.external) - continue; - auto const targetPath = - files::appendPath(config->outputDir(), sheet.outputRelative); - MRDOCS_TRY(files::createDirectory(files::getParentDir(targetPath))); - std::error_code ec; - std::filesystem::copy_file( - sheet.sourcePath, - targetPath, - std::filesystem::copy_options::overwrite_existing, - ec); - MRDOCS_CHECK( - !ec, - formatError( - "Failed to copy stylesheet \"{}\" to \"{}\": {}", - sheet.sourcePath, - targetPath, - ec.message())); - } - } - - return data; -} - -void -HandlebarsGenerator:: -prepareCorpus(HandlebarsCorpus& domCorpus) const -{ - if (auto res = prepareStylesheets(domCorpus.getCorpus().config); res) - { - auto const& data = *res; - domCorpus.stylesheets = [&]() { - dom::Array arr; - for (auto const& sheet : data.stylesheets) - { - dom::Object obj; - obj.set("path", sheet.outputRelative); - obj.set("external", sheet.external); - arr.emplace_back(std::move(obj)); - } - return arr; - }(); - - dom::Array inlineArr; - for (auto const& css : data.inlineStyles) - inlineArr.emplace_back(css); - domCorpus.inlineStyles = inlineArr; - - dom::Array inlineScriptArr; - for (auto const& script : data.inlineScripts) - inlineScriptArr.emplace_back(script); - domCorpus.inlineScripts = inlineScriptArr; - domCorpus.hasDefaultStyles = data.hasDefaultStyles; - } - else - { - report::warn( - "Failed to prepare stylesheets for corpus: {}", - res.error()); - } -} - -} // mrdocs::hbs +} // mrdocs::hbs \ No newline at end of file diff --git a/src/lib/Gen/hbs/HandlebarsGenerator.hpp b/src/lib/Gen/hbs/HandlebarsGenerator.hpp index 3996e34135..f077f400ac 100644 --- a/src/lib/Gen/hbs/HandlebarsGenerator.hpp +++ b/src/lib/Gen/hbs/HandlebarsGenerator.hpp @@ -27,28 +27,6 @@ namespace hbs { class HandlebarsGenerator : public Generator { -public: - struct StylesheetRef - { - /** Absolute path to the source stylesheet on disk (empty for remote). */ - std::string sourcePath; - /** Href or output-relative path written to the HTML. */ - std::string outputRelative; - /** True when the stylesheet is remote and should not be copied. */ - bool external = false; - }; - - struct StylesData - { - std::vector stylesheets; - std::vector inlineStyles; - std::vector inlineScripts; - bool hasDefaultStyles = false; - }; - -private: - Expected prepareStylesheets(Config const& config) const; - public: Expected build( @@ -61,14 +39,14 @@ class HandlebarsGenerator Corpus const& corpus) const override; /** Build a tagfile for the corpus. - */ + */ Expected buildTagfile( std::ostream& os, Corpus const& corpus) const; /** Build a tagfile for the corpus and store the result in a file. - */ + */ Expected buildTagfile( std::string_view fileName, @@ -79,33 +57,6 @@ class HandlebarsGenerator virtual void escape(OutputRef& os, std::string_view str) const; - -protected: - /** Customize the Handlebars corpus before rendering. - - Subclasses can override this to inject additional data - into the corpus (e.g. precomputed template context). - The default implementation does nothing. - */ - virtual - void - prepareCorpus(HandlebarsCorpus&) const; - -protected: - /** Default stylesheet path on disk; empty means no default. */ - virtual std::string defaultStylesheetSource(Config const& config) const; - - /** Default stylesheet output relative path; empty means no default. */ - virtual std::string defaultStylesheetOutput(Config const& config) const; - - /** Default highlight stylesheet path on disk; empty means no default. */ - virtual std::string defaultHighlightStylesheetSource(Config const& config) const; - - /** Default highlight stylesheet output relative path; empty means no default. */ - virtual std::string defaultHighlightStylesheetOutput(Config const& config) const; - - /** Inline script used to load and run highlight.js from a CDN. */ - virtual std::string defaultHighlightScript() const; }; } // hbs diff --git a/src/lib/Gen/hbs/TagfileWriter.hpp b/src/lib/Gen/hbs/TagfileWriter.hpp index 2ac8d054e4..43b82ddc1e 100644 --- a/src/lib/Gen/hbs/TagfileWriter.hpp +++ b/src/lib/Gen/hbs/TagfileWriter.hpp @@ -59,7 +59,7 @@ class TagfileWriter is provided. Typically, the relative path to a single page output file. This parameter is ignored in multipage mode. @return An Expected object containing the TagfileWriter instance or an error. - */ + */ static Expected create( @@ -79,7 +79,7 @@ class TagfileWriter @param corpus The HandlebarsCorpus to use for the writer. @param os The output stream to write the tagfile to. @return An Expected object containing the TagfileWriter instance or an error. - */ + */ static Expected create( @@ -94,7 +94,7 @@ class TagfileWriter This function builds the tagfile by initializing the output, traversing the global namespace of the corpus, and finalizing the output. - */ + */ void build(); diff --git a/src/lib/Gen/hbs/VisitorHelpers.hpp b/src/lib/Gen/hbs/VisitorHelpers.hpp index 5597ff956a..48ba983b02 100644 --- a/src/lib/Gen/hbs/VisitorHelpers.hpp +++ b/src/lib/Gen/hbs/VisitorHelpers.hpp @@ -21,7 +21,7 @@ namespace mrdocs::hbs { This filters Info types for which the generator should not generate independent pages or sections. -*/ + */ MRDOCS_DECL bool shouldGenerate(Symbol const& I, Config const& config); @@ -39,7 +39,7 @@ shouldGenerate(Symbol const& I, Config const& config); template. For record and enum members, we look for the parent record or enum. For other Info types, we return nullptr. -*/ + */ MRDOCS_DECL Symbol const* findAlternativeURLInfo(Corpus const& c, Symbol const& I); diff --git a/src/lib/Metadata/Finalizers/BaseMembersFinalizer.cpp b/src/lib/Metadata/Finalizers/BaseMembersFinalizer.cpp index 7fd45175db..6054da83e3 100644 --- a/src/lib/Metadata/Finalizers/BaseMembersFinalizer.cpp +++ b/src/lib/Metadata/Finalizers/BaseMembersFinalizer.cpp @@ -172,7 +172,6 @@ inheritBaseMembers( otherCopy->id = SymbolID::createFromString( std::format("{}-{}", toBase16Str(otherCopy->Parent), toBase16Str(otherInfo.id))); - otherCopy->IsCopyFromInherited = true; derived.push_back(otherCopy->id); // Get the extraction mode from the derived class if (otherCopy->Extraction == ExtractionMode::Dependency || diff --git a/src/lib/Metadata/Finalizers/DocComment/Function.hpp b/src/lib/Metadata/Finalizers/DocComment/Function.hpp index 17e60423aa..dd01684724 100644 --- a/src/lib/Metadata/Finalizers/DocComment/Function.hpp +++ b/src/lib/Metadata/Finalizers/DocComment/Function.hpp @@ -15,8 +15,6 @@ #include #include #include -#include -#include #include namespace mrdocs { @@ -501,19 +499,17 @@ populateFunctionReturns(FunctionSymbol& I, CorpusImpl const& corpus) a list of parameters separated by commas. This function returns a list of all parameter names in the doc. */ -llvm::SmallVector +llvm::SmallVector getDocCommentParamNames(DocComment const& doc) { - llvm::SmallVector result; + llvm::SmallVector result; for (auto const& docParam: doc.params) { auto const& paramNamesStr = docParam.name; for (auto paramNames = std::views::split(paramNamesStr, ','); auto const& paramName: paramNames) { - auto const trimmed = - trim(std::string_view(paramName.begin(), paramName.end())); - result.emplace_back(trimmed); + result.push_back(trim(std::string_view(paramName.begin(), paramName.end()))); } } return result; @@ -776,7 +772,7 @@ populateFunctionParam( FunctionSymbol& I, Param& param, std::size_t const index, - llvm::SmallVector& documentedParams, + llvm::SmallVector& documentedParams, CorpusImpl const& corpus) { if (!param.Name) diff --git a/src/lib/Metadata/Finalizers/DocComment/parseInlines.hpp b/src/lib/Metadata/Finalizers/DocComment/parseInlines.hpp index cb24241273..36b76f165b 100644 --- a/src/lib/Metadata/Finalizers/DocComment/parseInlines.hpp +++ b/src/lib/Metadata/Finalizers/DocComment/parseInlines.hpp @@ -15,8 +15,6 @@ #include #include #include -#include -#include #include namespace mrdocs::doc { @@ -308,22 +306,11 @@ emit_text(doc::InlineContainer& out, std::string&& text) out.emplace_back(std::move(text)); } -// Emit without attempting to merge with a previous text node. -inline -void -emit_text_unmerged(doc::InlineContainer& out, std::string&& text) -{ - if (!text.empty()) - { - out.emplace_back(std::move(text)); - } -} - // Start a new inline container of kind k, appending it to out. // Returns a reference to the new container for appending children. inline doc::InlineContainer& -start_container(doc::InlineContainer& out, doc::InlineKind k, std::size_t reserve_hint) +start_container(doc::InlineContainer& out, doc::InlineKind k) { // Create k and return its child container. switch (k) @@ -354,10 +341,6 @@ start_container(doc::InlineContainer& out, doc::InlineKind k, std::size_t reserv } auto* ic = dynamic_cast(&*out.back()); MRDOCS_ASSERT(ic != nullptr); // container types must derive InlineContainer - if (reserve_hint) - { - ic->children.reserve(reserve_hint); - } return *ic; } @@ -385,7 +368,6 @@ start_link(doc::InlineContainer& out, std::string&& href) { link.href = std::move(href); auto* ic = dynamic_cast(&*out.back()); MRDOCS_ASSERT(ic != nullptr); - ic->children.reserve(href.size() + 8); return *ic; } @@ -399,7 +381,6 @@ emit_image(doc::InlineContainer& out, std::string&& src, std::string&& alt) img.alt = std::move(alt); auto* ic = dynamic_cast(&*out.back()); MRDOCS_ASSERT(ic != nullptr); - ic->children.reserve(8); return *ic; } @@ -446,7 +427,7 @@ struct Frame { // where the finished node will be inserted doc::InlineContainer* parent; // children collected while open - doc::InlineContainer* scratch; + doc::InlineContainer scratch; // literal open token (for fallback) std::string open_tok; }; @@ -457,38 +438,9 @@ struct Bracket { // where link/image will be emitted doc::InlineContainer* parent = nullptr; // label/alt children - doc::InlineContainer* label; + doc::InlineContainer label; }; -inline -bool -frame_has_ancestor( - Frame const& f, - doc::InlineContainer const* target, - std::vector const& frames) -{ - doc::InlineContainer const* ancestor = f.parent; - while (ancestor) - { - if (ancestor == target) - { - return true; - } - auto it = std::find_if( - frames.begin(), - frames.end(), - [ancestor](Frame const& candidate) { - return candidate.scratch == ancestor; - }); - if (it == frames.end()) - { - return false; - } - ancestor = it->parent; - } - return false; -} - // HTML parsing helpers --------------------------------------------------------- inline @@ -635,15 +587,9 @@ html_get_attr(std::string const& attrs, std::string_view key) } // Minimal state holder to replace lots of lambdas in parse() -inline constexpr std::size_t kMaxReserve = 1'000'000; - struct ParserState { // input std::string_view s; - // hint to reserve child storage - std::size_t reserve_hint = 0; - // arena to keep temporary containers alive for the full parse - std::vector> arena; // stack of open frames std::vector frames; // stack of open [label] or ![alt] @@ -655,13 +601,6 @@ struct ParserState { // whether the next char is escaped bool escape_next{ false }; - doc::InlineContainer* - make_container() - { - arena.push_back(std::make_unique()); - return arena.back().get(); - } - void flush_text() { @@ -682,24 +621,8 @@ struct ParserState { push_frame(TagRule const* r) { flush_text(); - if (reserve_hint) - { - // Keep the parent stable while this frame is open. - auto const desired = std::min( - cur->children.size() + reserve_hint, - kMaxReserve); - cur->children.reserve(desired); - } - auto* scratch = make_container(); - frames.push_back(Frame{ - r->kind, - r, - cur, - scratch, - std::string(r->open) - }); - scratch->children.reserve(reserve_hint); - cur = scratch; + frames.push_back(Frame{ r->kind, r, cur, {}, std::string(r->open) }); + cur = &frames.back().scratch; } // Emit the opening token + flattened contents as literal text into its @@ -707,26 +630,12 @@ struct ParserState { void fallback_unclosed(Frame& f) { - MRDOCS_ASSERT(f.scratch); std::string literal(f.open_tok); - for (auto& el: *f.scratch) + for (auto& el: f.scratch) { getAsPlainText(*el, literal); } - try - { - emit_text(*f.parent, std::move(literal)); - } - catch (std::length_error const&) - { - // Drop the fallback text if it would overflow the container; - // better to keep processing than terminate the doc build. - } - catch (std::bad_alloc const&) - { - // Drop the fallback text if it would overflow the container; - // better to keep processing than terminate the doc build. - } + emit_text(*f.parent, std::move(literal)); } // Materialize a finished frame to its parent @@ -734,7 +643,6 @@ struct ParserState { void materialize_and_pop(Frame f) { - MRDOCS_ASSERT(f.scratch); // Line breaks are leaf inlines if (f.kind == doc::InlineKind::LineBreak) { @@ -754,7 +662,7 @@ struct ParserState { { // We recorded its body into f.scratch (as Text children) while inside the barrier. // Flatten to a single string and emit a MathInline leaf. - std::string lit = flatten_text(*f.scratch); + std::string lit = flatten_text(f.scratch); f.parent->emplace_back(); f.parent->back()->asMath().literal = std::move(lit); cur = f.parent; @@ -766,14 +674,14 @@ struct ParserState { && has(f.rule->flags, RuleFlags::Html)) { doc::InlineContainer& outC = start_link(*f.parent, std::move(f.open_tok)); - move_children(outC, *f.scratch); + move_children(outC, f.scratch); cur = f.parent; return; } // All remaining supported formatting kinds are containers - doc::InlineContainer* outC = &start_container(*f.parent, f.kind, reserve_hint); - move_children(*outC, *f.scratch); + doc::InlineContainer* outC = &start_container(*f.parent, f.kind); + move_children(*outC, f.scratch); cur = f.parent; } @@ -834,7 +742,6 @@ struct ParserState { Bracket b = std::move(brackets.back()); brackets.pop_back(); - MRDOCS_ASSERT(b.label); // After ']', expect optional spaces then '(' dest [title] ')' std::size_t j = i + 1; @@ -843,9 +750,9 @@ struct ParserState { { // Not a link/image β€” emit literal "[...]" back to parent push_text_node(*b.parent, b.is_image ? "![" : "["); - if (!b.label->empty()) + if (!b.label.empty()) { - move_children(*b.parent, *b.label); + move_children(*b.parent, b.label); } push_text_node(*b.parent, "]"); cur = b.parent; @@ -902,9 +809,9 @@ struct ParserState { { // Invalid link β€” degrade to literal push_text_node(*b.parent, b.is_image ? "![" : "["); - if (!b.label->empty()) + if (!b.label.empty()) { - move_children(*b.parent, *b.label); + move_children(*b.parent, b.label); } push_text_node(*b.parent, "]"); cur = b.parent; @@ -915,12 +822,12 @@ struct ParserState { // Materialize if (b.is_image) { - emit_image(*b.parent, std::move(dest), flatten_text(*b.label)); + emit_image(*b.parent, std::move(dest), flatten_text(b.label)); } else { doc::InlineContainer& linkC = start_link(*b.parent, std::move(dest)); - move_children(linkC, *b.label); + move_children(linkC, b.label); } cur = b.parent; return j - i; @@ -969,12 +876,9 @@ ParseResult parse(char const* first, char const* last, doc::InlineContainer& out_root) { std::string_view s(first, static_cast(last - first)); - std::size_t const hint = std::min(s.size() + 8, kMaxReserve); ParserState st{ .s = s, - .reserve_hint = hint, - .arena = {}, .frames = {}, .brackets = {}, .cur = &out_root, @@ -984,7 +888,6 @@ parse(char const* first, char const* last, doc::InlineContainer& out_root) st.frames.reserve(8); st.brackets.reserve(4); st.text.reserve(64); - out_root.children.reserve(st.reserve_hint); for (std::size_t i = 0; i < s.size();) { // If inside a barrier (e.g. backticks), only look for its own closer @@ -1010,35 +913,21 @@ parse(char const* first, char const* last, doc::InlineContainer& out_root) char c = s[i]; // Backslash escape - if (st.escape_next) - { - st.text.push_back(c); - st.escape_next = (c == '\\'); - ++i; - continue; - } + if (st.escape_next) { st.text.push_back(c); st.escape_next = false; ++i; continue; } if (c == '\\') { st.escape_next = true; ++i; continue; } // Markdown link/image openers if (c == '!' && i + 1 < s.size() && s[i + 1] == '[') { st.flush_text(); - st.brackets.push_back(Bracket{ - true, - st.cur, - st.make_container() - }); - st.cur = st.brackets.back().label; + st.brackets.push_back(Bracket{ true, st.cur, {} }); + st.cur = &st.brackets.back().label; i += 2; continue; } if (c == '[') { st.flush_text(); - st.brackets.push_back(Bracket{ - false, - st.cur, - st.make_container() - }); - st.cur = st.brackets.back().label; + st.brackets.push_back(Bracket{ false, st.cur, {} }); + st.cur = &st.brackets.back().label; ++i; continue; } @@ -1082,15 +971,8 @@ parse(char const* first, char const* last, doc::InlineContainer& out_root) } else { auto href = html_get_attr(tag->attrs, "href").value_or(std::string{}); st.flush_text(); - auto* scratch = st.make_container(); - st.frames.push_back(Frame{ - doc::InlineKind::Link, - &kHtmlRule, - st.cur, - scratch, - std::string{} - }); - st.cur = scratch; + st.frames.push_back(Frame{ doc::InlineKind::Link, &kHtmlRule, st.cur, {}, std::string{} }); + st.cur = &st.frames.back().scratch; st.frames.back().open_tok = std::move(href); // own the href bytes } i = tag->end; @@ -1106,15 +988,8 @@ parse(char const* first, char const* last, doc::InlineContainer& out_root) } } else { st.flush_text(); - auto* scratch = st.make_container(); - st.frames.push_back(Frame{ - *kind, - &kHtmlRule, - st.cur, - scratch, - "" - }); - st.cur = scratch; + st.frames.push_back(Frame{ *kind, &kHtmlRule, st.cur, {}, "" }); + st.cur = &st.frames.back().scratch; } i = tag->end; continue; @@ -1157,29 +1032,9 @@ parse(char const* first, char const* last, doc::InlineContainer& out_root) while (!st.brackets.empty()) { Bracket b = std::move(st.brackets.back()); st.brackets.pop_back(); - MRDOCS_ASSERT(b.label); - - // Frames opened inside the dangling label still hold pointers into the - // label container; unwind them before we destroy the label to avoid - // writing to freed storage. Frames tied to this label form a suffix on - // the stack because we switched `cur` to the label when it opened. - auto const* label_ptr = static_cast(b.label); - while (!st.frames.empty() && frame_has_ancestor(st.frames.back(), label_ptr, st.frames)) { - Frame f = std::move(st.frames.back()); - st.frames.pop_back(); - if (f.rule && has(f.rule->flags, RuleFlags::Html)) - { - st.materialize_and_pop(std::move(f)); - } - else - { - st.fallback_unclosed(f); - st.cur = f.parent; - } - } ParserState::push_text_node(*b.parent, b.is_image ? "![" : "["); - if (!b.label->empty()) - move_children(*b.parent, *b.label); + if (!b.label.empty()) + move_children(*b.parent, b.label); ParserState::push_text_node(*b.parent, "]"); st.cur = b.parent; } diff --git a/src/lib/Metadata/Finalizers/DocCommentFinalizer.cpp b/src/lib/Metadata/Finalizers/DocCommentFinalizer.cpp index 53bd465773..68d7414102 100644 --- a/src/lib/Metadata/Finalizers/DocCommentFinalizer.cpp +++ b/src/lib/Metadata/Finalizers/DocCommentFinalizer.cpp @@ -989,7 +989,6 @@ setAutoRelates(Symbol& ctx) auto toRecordOrEnum = [&](Polymorphic const& type) -> Symbol* { MRDOCS_CHECK_OR(type, nullptr); - MRDOCS_CHECK_OR(!type.valueless_after_move(), nullptr); auto& innermost = innermostType(type); MRDOCS_CHECK_OR(innermost, nullptr); MRDOCS_CHECK_OR(innermost->isNamed(), nullptr); @@ -1330,25 +1329,6 @@ parseInlines(DocComment& doc) bottomUpTraverse(doc, [] NodeTy>(NodeTy& node) { if constexpr (requires { { node.children } -> range_of>; }) { - // Reserve enough capacity up-front so child inserts during parsing - // cannot reallocate and invalidate InlineContainer pointers held - // by the parser state. - std::size_t extra = 0; - for (auto const& child : node.children) - { - if (child->isText()) - { - extra += child->asText().literal.size(); - } - } - if (extra > 0) - { - // Over-reserve generously to avoid any reallocation while the - // parser keeps pointers into these containers. - node.children.reserve( - node.children.size() + 2 * extra + 16); - } - auto it = node.children.begin(); while (it != node.children.end()) { @@ -1362,18 +1342,7 @@ parseInlines(DocComment& doc) auto& textEl = el->asText(); doc::InlineContainer v; - ParseResult r; - try - { - r = parse(textEl.literal, v); - } - catch (std::bad_alloc const&) - { - // Skip parsing this text node if it explodes memory; - // leave the raw text in place. - ++it; - continue; - } + ParseResult r = parse(textEl.literal, v); // advance on parse failure if (!r) @@ -1731,16 +1700,14 @@ DocCommentFinalizer::warnUndocumented() if (Symbol const* I = corpus_.find(undocI.id)) { MRDOCS_CHECK_OR( - !I->doc || I->Extraction == ExtractionMode::Regular - || I->IsCopyFromInherited == false); + !I->doc || I->Extraction == ExtractionMode::Regular); } bool const prefer_definition = is_one_of( undocI.kind, {SymbolKind::Record, SymbolKind::Enum}); this->warn( *getPrimaryLocation(undocI.Loc, prefer_definition), - "{}: {} is undocumented", - undocI.name, - toString(undocI.kind)); + "{}: Symbol is undocumented", + undocI.name); } corpus_.undocumented_.clear(); } @@ -1753,7 +1720,6 @@ warnDocErrors() for (auto const& I : corpus_.info_) { MRDOCS_CHECK_OR_CONTINUE(I->Extraction == ExtractionMode::Regular); - MRDOCS_CHECK_OR_CONTINUE(I->IsCopyFromInherited == false); MRDOCS_CHECK_OR_CONTINUE(I->isFunction()); warnParamErrors(dynamic_cast(*I)); } @@ -1809,7 +1775,6 @@ warnNoParamDocs() for (auto const& I : corpus_.info_) { MRDOCS_CHECK_OR_CONTINUE(I->Extraction == ExtractionMode::Regular); - MRDOCS_CHECK_OR_CONTINUE(I->IsCopyFromInherited == false); MRDOCS_CHECK_OR_CONTINUE(I->isFunction()); MRDOCS_CHECK_OR_CONTINUE(I->doc); warnNoParamDocs(dynamic_cast(*I)); @@ -1872,7 +1837,6 @@ warnUndocEnumValues() { MRDOCS_CHECK_OR_CONTINUE(I->isEnumConstant()); MRDOCS_CHECK_OR_CONTINUE(I->Extraction == ExtractionMode::Regular); - MRDOCS_CHECK_OR_CONTINUE(I->IsCopyFromInherited == false); MRDOCS_CHECK_OR_CONTINUE(!I->doc); this->warn( *getPrimaryLocation(*I), @@ -1890,7 +1854,6 @@ warnUnnamedParams() { MRDOCS_CHECK_OR_CONTINUE(I->isFunction()); MRDOCS_CHECK_OR_CONTINUE(I->Extraction == ExtractionMode::Regular); - MRDOCS_CHECK_OR_CONTINUE(I->IsCopyFromInherited == false); MRDOCS_CHECK_OR_CONTINUE(I->doc); warnUnnamedParams(dynamic_cast(*I)); } diff --git a/src/lib/Metadata/Finalizers/DocCommentFinalizer.hpp b/src/lib/Metadata/Finalizers/DocCommentFinalizer.hpp index f203487fe6..a80d87c54c 100644 --- a/src/lib/Metadata/Finalizers/DocCommentFinalizer.hpp +++ b/src/lib/Metadata/Finalizers/DocCommentFinalizer.hpp @@ -95,7 +95,7 @@ class DocCommentFinalizer { } /** Finalize the doc for all symbols - */ + */ void build(); diff --git a/src/lib/Metadata/Type.cpp b/src/lib/Metadata/Type.cpp index e746ed4c30..6e8e48f0be 100644 --- a/src/lib/Metadata/Type.cpp +++ b/src/lib/Metadata/Type.cpp @@ -830,30 +830,38 @@ innerTypePtrImpl(TypeTy&& TI) noexcept return nullptr; } -// Walk to the deepest nested type, preserving constness. +// Get the innermost type +// If there's an internal type, return it +// If there's no internal type, return the current type template < - class PolyRef, - bool isMutable = !std::is_const_v>, + class PolymorphicTypeTy, + bool isMutable = !std::is_const_v>, class Ref = std::conditional_t&, Polymorphic const&>> -requires std::same_as, Polymorphic> +requires std::same_as, Polymorphic> Ref -innermostTypeImpl(PolyRef&& TI) noexcept +innermostTypeImpl(PolymorphicTypeTy&& TI) noexcept { - auto* current = std::addressof(TI); - Optional inner = innerTypeImpl(**current); + MRDOCS_ASSERT(!TI.valueless_after_move()); + Optional inner = innerTypeImpl(*TI); + if (!inner) + { + return TI; + } while (inner) { - current = std::addressof(*inner); - if (current->valueless_after_move()) - break; - if ((*current)->isNamed()) - break; - inner = innerTypeImpl(**current); + Ref ref = *inner; + MRDOCS_ASSERT(!ref.valueless_after_move()); + if (ref->isNamed()) + { + return ref; + } + inner = innerTypeImpl(*ref); } - return *current; + Ref ref = *inner; + return ref; } -} // namespace +} Optional const&> innerType(Type const& TI) noexcept diff --git a/src/lib/MrDocsCompilationDatabase.hpp b/src/lib/MrDocsCompilationDatabase.hpp index 786a9ccca5..8fd29414f4 100644 --- a/src/lib/MrDocsCompilationDatabase.hpp +++ b/src/lib/MrDocsCompilationDatabase.hpp @@ -53,7 +53,7 @@ class MrDocsCompilationDatabase * @param config The shared configuration object. * @param implicitIncludeDirectories A map from compiler executable paths to their respective * implicit include directories, as determined by the system's compiler. - */ + */ MrDocsCompilationDatabase( llvm::StringRef workingDir, CompilationDatabase const& inner, @@ -82,8 +82,7 @@ class MrDocsCompilationDatabase std::vector getAllCompileCommands() const override; - /** Whether the driver mode for the compilation database is ClangCL - */ + /** Whether the driver mode for the compilation database is ClangCL */ bool isClangCL() const noexcept { diff --git a/src/lib/SingleFileDB.hpp b/src/lib/SingleFileDB.hpp index 6ce8ca469c..2146b7b8bb 100644 --- a/src/lib/SingleFileDB.hpp +++ b/src/lib/SingleFileDB.hpp @@ -20,7 +20,7 @@ namespace mrdocs { /** Compilation database for a single file. -*/ + */ class SingleFileDB : public clang::tooling::CompilationDatabase { diff --git a/src/lib/Support/CMakeExecution.hpp b/src/lib/Support/CMakeExecution.hpp index 237475c93b..9d44394322 100644 --- a/src/lib/Support/CMakeExecution.hpp +++ b/src/lib/Support/CMakeExecution.hpp @@ -29,7 +29,7 @@ namespace mrdocs { * @param tempDir The path to the temporary directory to use for CMake execution. * @return An `Expected` object containing the path to the generated `compile_commands.json` file if successful. * Returns `Unexpected` if the project path is not found or if CMake execution fails. -*/ + */ Expected executeCmakeExportCompileCommands(llvm::StringRef projectPath, llvm::StringRef cmakeArgs, llvm::StringRef tempDir); diff --git a/src/lib/Support/Chrono.hpp b/src/lib/Support/Chrono.hpp index d04b32b65d..1ec6a9a1c9 100644 --- a/src/lib/Support/Chrono.hpp +++ b/src/lib/Support/Chrono.hpp @@ -28,7 +28,7 @@ namespace mrdocs { @param delta The duration to format. @return A string representing the formatted duration. -*/ + */ template std::string format_duration( diff --git a/src/lib/Support/ExecuteAndWaitWithLogging.hpp b/src/lib/Support/ExecuteAndWaitWithLogging.hpp index a39a3da102..1e9ddd68d5 100644 --- a/src/lib/Support/ExecuteAndWaitWithLogging.hpp +++ b/src/lib/Support/ExecuteAndWaitWithLogging.hpp @@ -24,7 +24,7 @@ namespace mrdocs { * * \par Preconditions * `args.size() >= 1`. -*/ + */ int ExecuteAndWaitWithLogging( llvm::StringRef program, llvm::ArrayRef args, diff --git a/src/lib/Support/ExecutionContext.hpp b/src/lib/Support/ExecutionContext.hpp index e9a11ae4cd..11ef036a6e 100644 --- a/src/lib/Support/ExecutionContext.hpp +++ b/src/lib/Support/ExecutionContext.hpp @@ -117,7 +117,7 @@ class ExecutionContext It stores the `SymbolSet` and `Diagnostics` objects, and returns them when `results` is called. -*/ + */ class InfoExecutionContext : public ExecutionContext { diff --git a/src/lib/Support/LegibleNames.hpp b/src/lib/Support/LegibleNames.hpp index 2e04887c06..1bd7babac4 100644 --- a/src/lib/Support/LegibleNames.hpp +++ b/src/lib/Support/LegibleNames.hpp @@ -47,11 +47,11 @@ class LegibleNames bool enabled); /** Destructor. - */ + */ ~LegibleNames() noexcept; /** Return the legible name for a symbol name. - */ + */ std::string getUnqualified(SymbolID const& id) const; diff --git a/src/lib/Support/Path.hpp b/src/lib/Support/Path.hpp index 9da73071d8..9781402c3d 100644 --- a/src/lib/Support/Path.hpp +++ b/src/lib/Support/Path.hpp @@ -52,7 +52,7 @@ class ScopedTempFile If a file was created, it is deleted. - */ + */ ~ScopedTempFile(); /** Constructor @@ -77,7 +77,7 @@ class ScopedTempFile operator bool() const { return ok_; } /** Returns the path to the temporary file. - */ + */ llvm::StringRef path() const { return path_; } }; @@ -100,7 +100,7 @@ class ScopedTempDirectory If a directory was created, it is deleted. - */ + */ ~ScopedTempDirectory(); /** Constructor @@ -151,15 +151,15 @@ class ScopedTempDirectory } /** Returns the path to the temporary directory. - */ + */ std::string_view path() const { return static_cast(path_); } /** Returns the error status of the directory. - */ + */ Error error() const; /** Convert temp directory to a std::string_view - */ + */ operator std::string_view() const { return path(); } }; diff --git a/src/test/Support/Comparison.cpp b/src/test/Support/Comparison.cpp deleted file mode 100644 index 109bd13f84..0000000000 --- a/src/test/Support/Comparison.cpp +++ /dev/null @@ -1,396 +0,0 @@ -// -// Licensed under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// - -#include "Comparison.hpp" -#include "TextNormalization.hpp" -#include "../TestRunner.hpp" -#include -#include -#include -#include -#include -#include "../TestArgs.hpp" -#include -#include -#include -#include -#include -#include - -namespace mrdocs::test_support { - -namespace { - -/** Strip cwd prefix to make error paths shorter. */ -std::string -relativeToCwd( - ReferenceDirectories const& dirs, - std::string_view path) -{ - std::string_view trimmed = path; - if (trimmed.starts_with(dirs.cwd)) - { - trimmed.remove_prefix(dirs.cwd.size()); - if (trimmed.starts_with("\\") || trimmed.starts_with("/")) - { - trimmed.remove_prefix(1); - } - } - return std::string(trimmed); -} - -bool -collectFiles( - std::string const& root, - std::unordered_map& files) -{ - namespace fs = std::filesystem; - - std::error_code ec; - fs::path const rootPath(root); - for (fs::recursive_directory_iterator it(rootPath, ec), end; it != end; it.increment(ec)) - { - if (ec) - { - report::error("{}: \"{}\"", Error(ec), root); - return false; - } - - if (!it->is_regular_file()) - continue; - - auto rel = fs::relative(it->path(), rootPath, ec); - if (ec) - { - report::error("{}: \"{}\"", Error(ec), it->path().string()); - return false; - } - - // Ignore hidden files (e.g. .DS_Store) to keep OS artifacts out of comparisons. - bool hidden = false; - for (auto const& part : rel) - { - auto const name = part.string(); - if (!name.empty() && name.front() == '.') - { - hidden = true; - break; - } - } - if (hidden) - continue; - - files.emplace(rel.generic_string(), it->path()); - } - return true; -} - -bool -copyDirectoryTree( - std::string const& from, - std::string const& to) -{ - namespace fs = std::filesystem; - - std::error_code ec; - fs::remove_all(to, ec); - ec.clear(); - fs::create_directories(fs::path(to).parent_path(), ec); - fs::create_directories(to, ec); - fs::copy(from, to, - fs::copy_options::recursive | - fs::copy_options::overwrite_existing, - ec); - if (ec) - { - report::error("{}: \"{}\"", Error(ec), to); - return false; - } - return true; -} - -Expected -writeFile( - llvm::StringRef filePath, - llvm::StringRef contents) -{ - std::error_code ec; - llvm::raw_fd_ostream os( - filePath, ec, llvm::sys::fs::OF_None); - MRDOCS_CHECK(!ec, ec); - os << contents; - MRDOCS_CHECK(!os.has_error(), os.error()); - return {}; -} - -} // (anon) - -Expected -compareSinglePage(SinglePageArgs const& args) -{ - namespace path = llvm::sys::path; - - report::debug("Generating documentation", args.filePath); - std::string generatedDocs; - if (auto exp = args.gen.buildOneString(generatedDocs, args.corpus); !exp) - { - return Unexpected(exp.error()); - } - - auto const format = guessOutputFormat(args.layout.expectedSinglePath); - std::string normalizedGenerated = normalizeForComparison( - generatedDocs, format); - - // Generate tagfile for Handlebars - if (auto hbsGen = dynamic_cast(&args.gen)) - { - report::debug("Generating tagfile", args.filePath); - std::stringstream ss; - if (auto exp = hbsGen->buildTagfile(ss, args.corpus); !exp) - { - return Unexpected(exp.error()); - } - } - - // Get expected documentation if it exists - std::unique_ptr expectedDocsBuf; - { - auto fileResult = llvm::MemoryBuffer::getFile(args.layout.expectedSinglePath, false, true, true); - if (fileResult) - { - expectedDocsBuf = std::move(fileResult.get()); - } else if (fileResult.getError() != std::errc::no_such_file_or_directory) - { - return Unexpected(Error(fileResult.getError())); - } - } - - // If no expected documentation file - if(!expectedDocsBuf) - { - if(args.action == Action::test) - { - return Unexpected(Error("missing test file")); - } - - if(args.action == Action::create || - args.action == Action::update) - { - if(auto exp = writeFile(args.layout.expectedSinglePath, generatedDocs); !exp) - { - return Unexpected(exp.error()); - } - report::info("\"{}\" created", args.layout.expectedSinglePath); - ++args.results.expectedDocsWritten; - return {}; - } - } - - std::string const expectedDocs = normalizeForComparison( - expectedDocsBuf->getBuffer(), format); - if (normalizedGenerated == expectedDocs) - { - report::info("\"{}\" passed", args.filePath); - ++args.results.expectedDocsMatching; - return {}; - } - - if( - args.action == Action::test || - args.action == Action::create) - { - auto relPath = relativeToCwd(args.dirs, args.filePath); - report::error("{}: \"{}\"", - Error("Incorrect results"), relPath); - auto res = test_suite::diffStrings(expectedDocs, normalizedGenerated); - report::error("{} lines added", res.added); - report::error("{} lines removed", res.removed); - - report::error("Diff:\n{}", res.diff); - - if(args.writeBad) - { - SmallPathString badPath(args.layout.expectedSinglePath); - path::replace_extension(badPath, llvm::Twine("bad.").concat(args.gen.fileExtension())); - if (auto exp = writeFile(badPath, generatedDocs); !exp) - { - return Unexpected(exp.error()); - } - report::info("\"{}\" written", badPath); - report::error("Bad file diff (internal):\n{}", res.diff); - } - } - else if(args.action == Action::update) - { - bool const differs = expectedDocs != normalizedGenerated; - if (!differs && !args.forceUpdate) - { - report::info("\"{}\" unchanged", args.layout.expectedSinglePath); - ++args.results.expectedDocsMatching; - return {}; - } - - if (auto exp = writeFile(args.layout.expectedSinglePath, generatedDocs); !exp) - { - return Unexpected(exp.error()); - } - report::info("\"{}\" {}", args.layout.expectedSinglePath, differs ? "updated" : "rewritten"); - ++args.results.expectedDocsWritten; - } - - return {}; -} - -Expected -compareMultipage(MultipageArgs const& args) -{ - if (args.layout.generatedOutputRoot.empty()) - { - return Unexpected(Error("missing output directory for multipage run")); - } - - // Prepare output directory - namespace fs = std::filesystem; - std::error_code ec; - fs::remove_all(args.layout.generatedOutputRoot, ec); - ec.clear(); - fs::create_directories(args.layout.generatedOutputRoot, ec); - if (ec) - { - return Unexpected(Error(ec)); - } - - report::debug("Generating multipage documentation", args.layout.generatedOutputRoot); - if (auto exp = args.gen.build(args.layout.generatedOutputRoot, args.corpus); !exp) - { - return Unexpected(exp.error()); - } - - auto expectedType = files::getFileType(args.layout.multipageFormatRoot); - if (!expectedType) - { - return Unexpected(expectedType.error()); - } - bool const expectedExists = - expectedType.value() == files::FileType::directory; - - if (!expectedExists) - { - if (args.action == Action::test) - { - return Unexpected(Error("missing multipage snapshot for generator")); - } - - if (copyDirectoryTree(args.layout.generatedOutputRoot, args.layout.multipageFormatRoot)) - { - report::info("\"{}\" created", args.layout.multipageFormatRoot); - ++args.results.expectedDocsWritten; - } - return {}; - } - - std::unordered_map expectedFiles; - std::unordered_map generatedFiles; - if (!collectFiles(args.layout.multipageFormatRoot, expectedFiles)) - return Unexpected(Error("failed to read expected multipage snapshot")); - if (!collectFiles(args.layout.generatedOutputRoot, generatedFiles)) - return Unexpected(Error("failed to read generated multipage output")); - - std::vector missing; - std::vector unexpected; - std::vector> changed; - - for (auto const& [rel, path] : expectedFiles) - { - if (!generatedFiles.contains(rel)) - missing.push_back(rel); - } - - for (auto const& [rel, path] : generatedFiles) - { - auto it = expectedFiles.find(rel); - if (it == expectedFiles.end()) - { - unexpected.push_back(rel); - continue; - } - - auto expectedBuf = llvm::MemoryBuffer::getFile(it->second.string(), false, true, true); - if (!expectedBuf) - { - report::error("{}: \"{}\"", expectedBuf.getError(), it->second.string()); - continue; - } - auto generatedBuf = llvm::MemoryBuffer::getFile(path.string(), false, true, true); - if (!generatedBuf) - { - report::error("{}: \"{}\"", generatedBuf.getError(), path.string()); - continue; - } - - auto const format = guessOutputFormat(rel); - auto expectedNormalized = normalizeForComparison( - expectedBuf.get()->getBuffer(), format); - auto generatedNormalized = normalizeForComparison( - generatedBuf.get()->getBuffer(), format); - if (expectedNormalized != generatedNormalized) - { - changed.emplace_back(rel, test_suite::diffStrings( - expectedNormalized, generatedNormalized)); - } - } - - bool const hasDiff = !missing.empty() || !unexpected.empty() || !changed.empty(); - - if (args.action == Action::update) - { - if (!hasDiff && !args.forceUpdate) - { - report::info("\"{}\" unchanged", args.layout.multipageFormatRoot); - ++args.results.expectedDocsMatching; - return {}; - } - - if (copyDirectoryTree(args.layout.generatedOutputRoot, args.layout.multipageFormatRoot)) - { - report::info("\"{}\" {}", args.layout.multipageFormatRoot, hasDiff ? "updated" : "rewritten"); - ++args.results.expectedDocsWritten; - } - return {}; - } - - if (!hasDiff) - { - ++args.results.expectedDocsMatching; - return {}; - } - - for (auto const& rel : missing) - { - report::error("{}: \"{}\"", - Error("missing expected file"), - files::appendPath(args.layout.multipageFormatRoot, rel)); - } - for (auto const& rel : unexpected) - { - report::error("{}: \"{}\"", - Error("unexpected generated file"), - files::appendPath(args.layout.generatedOutputRoot, rel)); - } - for (auto const& [rel, diff] : changed) - { - report::error("{}: \"{}\"", - Error("Incorrect results"), - files::appendPath(args.layout.multipageFormatRoot, rel)); - report::error("{} lines added", diff.added); - report::error("{} lines removed", diff.removed); - report::error("Diff:\n{}", diff.diff); - } - - return {}; -} - -} // namespace mrdocs::test_support diff --git a/src/test/Support/Comparison.hpp b/src/test/Support/Comparison.hpp deleted file mode 100644 index ca40e9afb9..0000000000 --- a/src/test/Support/Comparison.hpp +++ /dev/null @@ -1,61 +0,0 @@ -// -// Licensed under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// - -#ifndef MRDOCS_TEST_SUPPORT_COMPARISON_HPP -#define MRDOCS_TEST_SUPPORT_COMPARISON_HPP - -#include "TestLayout.hpp" -#include -#include -#include - -namespace mrdocs { - -enum Action : int; -struct TestResults; -class Generator; -class Corpus; -class ConfigImpl; - -namespace test_support { - -/** Arguments needed for single-page comparison flow. */ -struct SinglePageArgs -{ - TestLayout const& layout; - Generator const& gen; - Corpus const& corpus; - std::string_view filePath; - Action action; - bool writeBad; - bool forceUpdate; - ReferenceDirectories const& dirs; - TestResults& results; -}; - -/** Arguments needed for multipage comparison flow. */ -struct MultipageArgs -{ - TestLayout const& layout; - Generator const& gen; - Corpus const& corpus; - Action action; - bool forceUpdate; - TestResults& results; -}; - -/** Compare generated single-page output against expected file. */ -Expected -compareSinglePage(SinglePageArgs const& args); - -/** Compare generated multipage output directory against snapshot tree. */ -Expected -compareMultipage(MultipageArgs const& args); - -} // namespace test_support -} // namespace mrdocs - -#endif diff --git a/src/test/Support/TestLayout.cpp b/src/test/Support/TestLayout.cpp deleted file mode 100644 index fc0e3d7b69..0000000000 --- a/src/test/Support/TestLayout.cpp +++ /dev/null @@ -1,164 +0,0 @@ -// -// Licensed under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// - -#include "TestLayout.hpp" -#include -#include -#include -#include "../TestArgs.hpp" -#include - -namespace mrdocs { - -namespace { - -/** Replace the extension on a path and return the new small string. */ -SmallPathString -pathWithExtension( - llvm::StringRef path, - llvm::StringRef ext) -{ - SmallPathString result(path); - llvm::sys::path::replace_extension(result, ext); - return result; -} - -} // (anon) - -/** Build the per-file layout and normalized settings with mode validation. */ -Expected -resolveTestLayout( - llvm::StringRef filePath, - Config::Settings const& dirSettings, - llvm::StringRef generatorExtension, - ReferenceDirectories const& dirs, - Action action) -{ - Config::Settings fileSettings = dirSettings; - auto configPath = files::withExtension(filePath, "yml"); - bool const hasFileConfig = files::exists(configPath); - if (hasFileConfig) - { - if (auto exp = Config::Settings::load_file(fileSettings, configPath, dirs); !exp) - { - return Unexpected(exp.error()); - } - } - - bool const hasTagfileOverride = !fileSettings.tagfile.empty(); - - TestLayout layout; - layout.hasFileConfig = hasFileConfig; - layout.expectedSinglePath = pathWithExtension(filePath, generatorExtension).str(); - layout.multipageRoot = pathWithExtension(filePath, "multipage").str(); - layout.multipageFormatRoot = files::appendPath(layout.multipageRoot, generatorExtension); - - if (fileSettings.multipage) - { - layout.mode = OutputMode::Multipage; - layout.tempDir = std::make_unique("mrdocs-multipage"); - if (layout.tempDir->failed()) - { - return Unexpected(layout.tempDir->error()); - } - layout.generatedOutputRoot = files::appendPath(layout.tempDir->path(), generatorExtension); - fileSettings.output = layout.generatedOutputRoot; - if (!fileSettings.tagfile.empty()) - { - if (!llvm::sys::path::is_absolute(fileSettings.tagfile)) - { - fileSettings.tagfile = files::appendPath( - layout.generatedOutputRoot, fileSettings.tagfile); - } - } - } - else - { - layout.mode = OutputMode::SinglePage; - } - - if (auto exp = fileSettings.normalize(dirs); !exp) - { - return Unexpected(exp.error()); - } - - // Only generate a tagfile when a test explicitly requests one. - if (!hasTagfileOverride) - { - fileSettings.tagfile.clear(); - } - - auto const singleType = files::getFileType(layout.expectedSinglePath); - if (!singleType) - { - return Unexpected(singleType.error()); - } - auto const multipageType = files::getFileType(layout.multipageRoot); - if (!multipageType) - { - return Unexpected(multipageType.error()); - } - auto const multipageFormatType = files::getFileType(layout.multipageFormatRoot); - if (!multipageFormatType) - { - return Unexpected(multipageFormatType.error()); - } - - auto const singleExpectedExists = singleType.value() == files::FileType::regular; - auto const multipageRootExists = multipageType.value() == files::FileType::directory; - auto const multipageFormatExists = multipageFormatType.value() == files::FileType::directory; - - if (layout.mode == OutputMode::Multipage) - { - if (!layout.hasFileConfig) - { - return Unexpected(Error("multipage tests require a per-file mrdocs.yml with multipage: true")); - } - - if (dirSettings.multipage) - { - return Unexpected(Error("multipage defaults must remain disabled at the directory level")); - } - - if (singleExpectedExists) - { - return Unexpected(Error("multipage test cannot have single-page expected outputs")); - } - - if (singleType.value() == files::FileType::directory) - { - return Unexpected(Error("unexpected directory where single-page expectation would be")); - } - - if (multipageType.value() == files::FileType::regular) - { - return Unexpected(Error("multipage snapshot path must be a directory")); - } - - if (action == Action::test && !multipageFormatExists) - { - return Unexpected(Error("missing multipage snapshot for generator")); - } - } - else - { - if (multipageRootExists || multipageFormatExists) - { - return Unexpected(Error("single-page test cannot have a .multipage snapshot")); - } - if (action == Action::test && !singleExpectedExists) - { - return Unexpected(Error("missing test file")); - } - } - - return ResolvedLayout{ - std::move(fileSettings), - std::move(layout) - }; -} - -} // namespace mrdocs diff --git a/src/test/Support/TestLayout.hpp b/src/test/Support/TestLayout.hpp deleted file mode 100644 index 6fab65b6b9..0000000000 --- a/src/test/Support/TestLayout.hpp +++ /dev/null @@ -1,57 +0,0 @@ -// -// Licensed under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// - -#ifndef MRDOCS_TEST_SUPPORT_TESTLAYOUT_HPP -#define MRDOCS_TEST_SUPPORT_TESTLAYOUT_HPP - -#include -#include -#include -#include -#include -#include - -namespace mrdocs { - -class ScopedTempDirectory; -enum Action : int; - -enum class OutputMode -{ - SinglePage, - Multipage -}; - -/** Expected output layout for a single test (single-page or multipage). */ -struct TestLayout -{ - OutputMode mode = OutputMode::SinglePage; - std::string expectedSinglePath; - std::string multipageRoot; - std::string multipageFormatRoot; - std::string generatedOutputRoot; - std::unique_ptr tempDir; - bool hasFileConfig = false; -}; - -struct ResolvedLayout -{ - Config::Settings settings; - TestLayout layout; -}; - -/** Resolve per-test settings + layout, enforcing single vs multipage rules. */ -Expected -resolveTestLayout( - llvm::StringRef filePath, - Config::Settings const& dirSettings, - llvm::StringRef generatorExtension, - ReferenceDirectories const& dirs, - Action action); - -} // namespace mrdocs - -#endif diff --git a/src/test/Support/TextNormalization.cpp b/src/test/Support/TextNormalization.cpp deleted file mode 100644 index 456d3cd80a..0000000000 --- a/src/test/Support/TextNormalization.cpp +++ /dev/null @@ -1,262 +0,0 @@ -// -// Licensed under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -// Copyright (c) 2024 Alan de Freitas (alandefreitas@gmail.com) -// -// Official repository: https://github.com/cppalliance/mrdocs -// - -#include "TextNormalization.hpp" -#include -#include -#include -#include -#include -#include -#include - -namespace mrdocs::test_support { -namespace { - -bool -isHorizontalSpace(char c) -{ - return c == ' ' || c == '\t'; -} - -void -normalizeNewlines(std::string& text) -{ - std::string normalized; - normalized.reserve(text.size()); - for (std::size_t i = 0; i < text.size(); ++i) - { - if (text[i] == '\r') - { - if (i + 1 < text.size() && text[i + 1] == '\n') - { - ++i; - } - normalized.push_back('\n'); - } - else - { - normalized.push_back(text[i]); - } - } - text.swap(normalized); -} - -void -rstripEachLine(std::string& text) -{ - std::string trimmed; - trimmed.reserve(text.size()); - std::size_t lineStart = 0; - for (std::size_t i = 0; i <= text.size(); ++i) - { - if (i == text.size() || text[i] == '\n') - { - std::size_t lineEnd = i; - while (lineEnd > lineStart && - (text[lineEnd - 1] == ' ' || - text[lineEnd - 1] == '\t' || - text[lineEnd - 1] == '\r')) - { - --lineEnd; - } - trimmed.append(text.data() + lineStart, lineEnd - lineStart); - if (i != text.size()) - { - trimmed.push_back('\n'); - } - lineStart = i + 1; - } - } - text.swap(trimmed); -} - -void -collapseBlankLines(std::string& text, std::size_t maxBlankLines) -{ - if (text.empty()) - return; - - std::string collapsed; - collapsed.reserve(text.size()); - std::size_t blankCount = 0; - std::size_t pos = 0; - while (pos < text.size()) - { - auto nextNewline = text.find('\n', pos); - bool hasNewline = nextNewline != std::string::npos; - std::size_t lineLength = - (hasNewline ? nextNewline : text.size()) - pos; - std::string_view line(text.data() + pos, lineLength); - bool isBlank = line.empty(); - - if (!isBlank || blankCount < maxBlankLines) - { - collapsed.append(line); - if (hasNewline) - { - collapsed.push_back('\n'); - } - } - - blankCount = isBlank ? blankCount + 1 : 0; - if (!hasNewline) - break; - pos = nextNewline + 1; - } - - text.swap(collapsed); -} - -std::string -collapseSpacesOutsideVerbatim( - std::string_view text, - std::initializer_list verbatimTags) -{ - std::vector verbatim; - verbatim.reserve(verbatimTags.size()); - for (auto const tag : verbatimTags) - { - verbatim.emplace_back(tag.lower()); - } - - std::vector verbatimStack; - std::string out; - out.reserve(text.size()); - - bool previousSpace = false; - std::size_t i = 0; - while (i < text.size()) - { - if (text[i] == '<') - { - auto close = text.find('>', i); - if (close == std::string::npos) - { - out.append(text.substr(i)); - break; - } - - llvm::StringRef tag(text.data() + i + 1, close - i - 1); - tag = tag.ltrim(); - bool isClosing = tag.consume_front("/"); - tag = tag.ltrim(); - llvm::StringRef tagBody = tag.rtrim(); - bool selfClosing = tagBody.ends_with("/"); - llvm::StringRef name = tag.take_while([](char c) { - return std::isalnum(static_cast(c)) || - c == '-' || c == ':'; - }); - std::string lowerName = name.lower(); - - if (isClosing) - { - if (!verbatimStack.empty() && - verbatimStack.back() == lowerName) - { - verbatimStack.pop_back(); - } - } - else - { - bool isVerbatim = std::find( - verbatim.begin(), verbatim.end(), lowerName) != verbatim.end(); - if (isVerbatim && !selfClosing) - { - verbatimStack.push_back(lowerName); - } - } - - out.append(text.substr(i, close - i + 1)); - previousSpace = false; - i = close + 1; - continue; - } - - char c = text[i]; - if (verbatimStack.empty() && isHorizontalSpace(c)) - { - if (!previousSpace) - { - out.push_back(' '); - } - previousSpace = true; - ++i; - continue; - } - - previousSpace = false; - out.push_back(c); - ++i; - } - - return out; -} - -} // namespace - -OutputFormat -guessOutputFormat(llvm::StringRef pathOrExtension) -{ - llvm::StringRef ext = llvm::sys::path::extension(pathOrExtension); - if (ext.empty()) - ext = pathOrExtension; - ext = ext.ltrim("."); - auto lower = ext.lower(); - llvm::StringRef extLower(lower); - - if (extLower == "html" || extLower == "htm") - return OutputFormat::html; - if (extLower == "adoc" || extLower == "asciidoc") - return OutputFormat::adoc; - if (extLower == "xml") - return OutputFormat::xml; - return OutputFormat::other; -} - -std::string -normalizeForComparison(std::string_view text, OutputFormat format) -{ - std::string normalized(text); - normalizeNewlines(normalized); - - switch (format) - { - case OutputFormat::html: - normalized = collapseSpacesOutsideVerbatim( - normalized, { "pre", "code", "textarea" }); - rstripEachLine(normalized); - break; - - case OutputFormat::xml: - rstripEachLine(normalized); - collapseBlankLines(normalized, 1); - break; - - case OutputFormat::adoc: - rstripEachLine(normalized); - collapseBlankLines(normalized, 1); - break; - - case OutputFormat::other: - rstripEachLine(normalized); - break; - } - - return normalized; -} - -std::string -normalizeForComparison(std::string_view text, llvm::StringRef pathOrExtension) -{ - return normalizeForComparison(text, guessOutputFormat(pathOrExtension)); -} - -} // namespace mrdocs::test_support diff --git a/src/test/Support/TextNormalization.hpp b/src/test/Support/TextNormalization.hpp deleted file mode 100644 index 7b85fb407b..0000000000 --- a/src/test/Support/TextNormalization.hpp +++ /dev/null @@ -1,43 +0,0 @@ -// -// Licensed under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -// Copyright (c) 2024 Alan de Freitas (alandefreitas@gmail.com) -// -// Official repository: https://github.com/cppalliance/mrdocs -// - -#ifndef MRDOCS_TEST_SUPPORT_TEXTNORMALIZATION_HPP -#define MRDOCS_TEST_SUPPORT_TEXTNORMALIZATION_HPP - -#include -#include -#include - -namespace mrdocs::test_support { - -/** File format classification used by test normalizers. */ -enum class OutputFormat -{ - html, - adoc, - xml, - other, -}; - -/** Deduce the output format from a path or extension. */ -OutputFormat -guessOutputFormat(llvm::StringRef pathOrExtension); - -/** Normalize text for comparison in tests based on the output format. */ -std::string -normalizeForComparison(std::string_view text, OutputFormat format); - -/** Convenience overload that accepts a path or extension directly. */ -std::string -normalizeForComparison(std::string_view text, llvm::StringRef pathOrExtension); - -} // namespace mrdocs::test_support - -#endif diff --git a/src/test/TestArgs.cpp b/src/test/TestArgs.cpp index 3dabba75f9..44e33bf59f 100644 --- a/src/test/TestArgs.cpp +++ b/src/test/TestArgs.cpp @@ -40,17 +40,12 @@ R"( llvm::cl::values( clEnumVal(test, "Compare output against expected."), clEnumVal(create, "Create missing expected documentation files."), - clEnumVal(update, "Update expected documentation files that differ (use --force to rewrite all)."))) + clEnumVal(update, "Update all expected documentation files."))) , badOption( "bad", - llvm::cl::desc("Write a .bad. file for each test failure."), - llvm::cl::init(false)) - -, forceOption( - "force", - llvm::cl::desc("When updating, rewrite expected files even if normalized contents already match."), - llvm::cl::init(false)) + llvm::cl::desc("Write a .bad.xml file for each test failure."), + llvm::cl::init(true)) , unitOption( "unit", @@ -70,7 +65,6 @@ hideForeignOptions() const std::vector ours({ &action, &badOption, - &forceOption, &unitOption }); diff --git a/src/test/TestArgs.hpp b/src/test/TestArgs.hpp index 716ef9eae3..d1480d4d83 100644 --- a/src/test/TestArgs.hpp +++ b/src/test/TestArgs.hpp @@ -40,7 +40,6 @@ class TestArgs : public PublicToolArgs // Test options llvm::cl::opt action; llvm::cl::opt badOption; - llvm::cl::opt forceOption; llvm::cl::opt unitOption; // Hide all options that don't belong to us diff --git a/src/test/TestMain.cpp b/src/test/TestMain.cpp index 0abc77115f..85fb91df31 100644 --- a/src/test/TestMain.cpp +++ b/src/test/TestMain.cpp @@ -111,11 +111,7 @@ int test_main(int argc, char const** argv) if (testArgs.unitOption.getValue()) { - int unitResult = test_suite::unit_test_main(argc, argv); - if (unitResult != EXIT_SUCCESS) - { - return unitResult; - } + test_suite::unit_test_main(argc, argv); } if (report::results.errorCount > 0 || diff --git a/src/test/TestRunner.cpp b/src/test/TestRunner.cpp index 3ad80a428f..847e5825d6 100644 --- a/src/test/TestRunner.cpp +++ b/src/test/TestRunner.cpp @@ -4,7 +4,6 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) -// Copyright (c) 2023 Alan de Freitas (alandefreitas@gmail.com) // // Official repository: https://github.com/cppalliance/mrdocs // @@ -12,11 +11,9 @@ #include #include "TestArgs.hpp" #include "TestRunner.hpp" -#include "Support/TextNormalization.hpp" -#include "Support/TestLayout.hpp" -#include "Support/Comparison.hpp" #include #include +#include #include #include #include @@ -29,22 +26,46 @@ #include #include #include +#include #include #include -#include namespace mrdocs { TestRunner:: TestRunner(std::string_view generator) - : gen_(getGenerators().find(generator)) + : diffCmdPath_(llvm::sys::findProgramByName("diff")) + , gen_(getGenerators().find(generator)) { MRDOCS_ASSERT(gen_ != nullptr); } +Expected +TestRunner:: +writeFile( + llvm::StringRef filePath, + llvm::StringRef contents) +{ + std::error_code ec; + llvm::raw_fd_ostream os( + filePath, ec, llvm::sys::fs::OF_None); + MRDOCS_CHECK(!ec, ec); + os << contents; + MRDOCS_CHECK(!os.has_error(), os.error()); + return {}; +} + namespace { +void +replaceCRLFWithLF(std::string &str) +{ + std::string::size_type pos = 0; + while ((pos = str.find("\r\n", pos)) != std::string::npos) { + str.replace(pos, 2, "\n"); + pos += 1; // Move past the '\n' character + } +} -/** Build a single-file compilation database with the provided command line. */ SingleFileDB makeSingleFileDB(llvm::StringRef pathName, std::vector cmds) { @@ -58,151 +79,94 @@ makeSingleFileDB(llvm::StringRef pathName, std::vector cmds) cc.Heuristic = "unit test"; return SingleFileDB(std::move(cc)); } +} // namespace -/** Ensure the given path refers to a regular .cpp file; report and fail otherwise. */ -bool -ensureRegularCpp(llvm::StringRef filePath) +void +TestRunner:: +handleFile( + llvm::StringRef filePath, + Config::Settings const& dirSettings) { + report::debug("Handling {}", filePath); + + namespace path = llvm::sys::path; + + MRDOCS_ASSERT(path::extension(filePath).compare_insensitive(".cpp") == 0); + + // Check the source file auto ft = files::getFileType(filePath); - if (!ft) - { - report::error("{}: \"{}\"", ft.error(), filePath); - return false; - } if (ft.value() == files::FileType::not_found) { - report::error("{}: \"{}\"", Error("file not found"), filePath); - return false; + return report::error("{}: \"{}\"", + Error("file not found"), filePath); } if(ft.value() != files::FileType::regular) { - report::error("{}: \"{}\"", Error("not a regular file"), filePath); - return false; + return report::error("{}: \"{}\"", + Error("not a regular file"), filePath); } - return true; -} -/** Load and normalize directory-level settings, applying any local mrdocs.yml. */ -Expected -loadDirSettings( - std::string const& dirPath, - Config::Settings dirSettings, - ReferenceDirectories const& dirs) -{ - dirSettings.sourceRoot = dirPath; - dirSettings.input = {dirPath}; - std::string const& configPath = files::appendPath(dirPath, "mrdocs.yml"); - bool const hasTagfileOverride = !dirSettings.tagfile.empty(); - if (files::exists(configPath)) - { - MRDOCS_TRY(Config::Settings::load_file(dirSettings, configPath, dirs)); - } - MRDOCS_TRY(dirSettings.normalize(dirs)); - // Golden tests shouldn't emit tagfiles unless a test explicitly requests one. - if (!hasTagfileOverride) - { - dirSettings.tagfile.clear(); + // File-specific config + report::debug("Loading Config"); + Config::Settings fileSettings = dirSettings; + auto configPath = files::withExtension(filePath, "yml"); + if (files::exists(configPath)) { + if (auto exp = Config::Settings::load_file(fileSettings, configPath, dirs_); !exp) + { + return report::error("Failed to load config file: {}: \"{}\"", exp.error(), configPath); + } + if (auto exp = fileSettings.normalize(dirs_); !exp) + { + return report::error("Failed to normalize config file: {}: \"{}\"", exp.error(), configPath); + } } - return dirSettings; -} -/** Build root settings from CLI args and the effective input directory. */ -Expected -makeRootSettings( - std::string const& inputDir, - char const** argv, - ReferenceDirectories& dirs) -{ - Config::Settings dirSettings; - testArgs.apply(dirSettings, dirs, argv); - dirSettings.multipage = false; - return loadDirSettings(inputDir, std::move(dirSettings), dirs); -} - -/** Bundles the normalized path, detected type, and root settings for an input. */ -struct PathContext -{ - files::FileType type; - std::string inputPath; - std::string inputDir; - Config::Settings dirSettings; -}; - -/** Build PathContext, normalizing the path and loading directory settings. */ -Expected -buildPathContext(std::string inputPath, char const** argv, ReferenceDirectories& dirs) -{ - inputPath = files::normalizePath(inputPath); - auto fileType = files::getFileType(inputPath); - if (!fileType) - return Unexpected(fileType.error()); - - std::string const inputDir = fileType == files::FileType::directory - ? inputPath - : files::getParentDir(inputPath); - dirs.cwd = inputDir; - - auto dirSettings = makeRootSettings(inputDir, argv, dirs); - if (!dirSettings) - return Unexpected(dirSettings.error()); - - return PathContext{ - *fileType, - std::move(inputPath), - inputDir, - *dirSettings - }; -} -} // (anon) - -void -TestRunner:: -handleFile( - llvm::StringRef filePath, - Config::Settings const& dirSettings) -{ - report::debug("Handling {}", filePath); + // Config Implementation + std::shared_ptr config = + ConfigImpl::load(fileSettings, dirs_, threadPool_).value(); - MRDOCS_ASSERT(llvm::sys::path::extension(filePath).compare_insensitive(".cpp") == 0); - if (!ensureRegularCpp(filePath)) - return; + auto parentDir = files::getParentDir(filePath); + std::unordered_map> + defaultIncludePaths; - auto resolved = resolveTestLayout( - filePath, dirSettings, gen_->fileExtension(), dirs_, testArgs.action); - if (!resolved) + // Test normally { - return report::error("{}: \"{}\"", resolved.error(), filePath); - } - Config::Settings fileSettings = std::move(resolved->settings); - TestLayout layout = std::move(resolved->layout); + auto const db = makeSingleFileDB(filePath, { "clang", "-std=c++23" }); - auto expConfig = ConfigImpl::load(fileSettings, dirs_, threadPool_); - if (!expConfig) - { - return report::error("{}: \"{}\"", expConfig.error(), filePath); + // Create an adjusted MrDocsDatabase + MrDocsCompilationDatabase compilations( + llvm::StringRef(parentDir), + db, + config, + defaultIncludePaths); + handleCompilationDatabase(filePath, compilations, config); } - std::shared_ptr config = *expConfig; - auto runWith = [&](std::vector command) + // Test again in clang-cl mode { - auto const db = makeSingleFileDB(filePath, std::move(command)); + auto const db + = makeSingleFileDB(filePath, { "clang-cl", "/std:c++23preview" }); + + // Create an adjusted MrDocsDatabase MrDocsCompilationDatabase compilations( - llvm::StringRef(files::getParentDir(filePath)), + llvm::StringRef(parentDir), db, config, - std::unordered_map>{}); - handleCompilationDatabase(filePath, compilations, config, layout); - }; - - runWith({ "clang", "-std=c++23" }); - runWith({ "clang-cl", "/std:c++23preview" }); + defaultIncludePaths); + handleCompilationDatabase(filePath, compilations, config); + } } void TestRunner::handleCompilationDatabase( llvm::StringRef filePath, MrDocsCompilationDatabase const& compilations, - std::shared_ptr const& config, - TestLayout const& layout) + std::shared_ptr const& config) { + namespace path = llvm::sys::path; + + // Path with the expected results + SmallPathString expectedPath = filePath; + path::replace_extension(expectedPath, gen_->fileExtension()); + report::debug("Building Corpus", filePath); auto corpus = CorpusImpl::build(config, compilations); if (!corpus) @@ -210,38 +174,129 @@ TestRunner::handleCompilationDatabase( return report::error("{}: \"{}\"", corpus.error(), filePath); } - if (layout.mode == OutputMode::SinglePage) + // Generate + report::debug("Generating documentation", filePath); + std::string generatedDocs; + if (auto exp = gen_->buildOneString(generatedDocs, **corpus); !exp) + { + return report::error("{}: \"{}\"", exp.error(), filePath); + } + replaceCRLFWithLF(generatedDocs); + + // Generate tagfile + if (auto hbsGen = dynamic_cast(gen_)) { - test_support::SinglePageArgs args{ - layout, - *gen_, - **corpus, - filePath, - testArgs.action, - testArgs.badOption.getValue(), - testArgs.forceOption.getValue(), - dirs_, - results - }; - if (auto exp = test_support::compareSinglePage(args); !exp) + report::debug("Generating tagfile", filePath); + std::stringstream ss; + if (auto exp = hbsGen->buildTagfile(ss, **corpus); !exp) { return report::error("{}: \"{}\"", exp.error(), filePath); } } - else + + // Get expected documentation if it exists + std::unique_ptr expectedDocsBuf; { - test_support::MultipageArgs args{ - layout, - *gen_, - **corpus, - testArgs.action, - testArgs.forceOption.getValue(), - results - }; - if (auto exp = test_support::compareMultipage(args); !exp) + auto fileResult = llvm::MemoryBuffer::getFile(expectedPath, false, true, true); + if (fileResult) { - return report::error("{}: \"{}\"", exp.error(), filePath); + expectedDocsBuf = std::move(fileResult.get()); + } else if (fileResult.getError() != std::errc::no_such_file_or_directory) + { + return report:: + error("{}: \"{}\"", fileResult.getError(), expectedPath); + } + } + + // If no expected documentation file + if(!expectedDocsBuf) + { + if(testArgs.action == Action::test) + { + // Can't test without expected documentation file + return report::error("{}: \"{}\"", + Error("missing test file"), expectedPath); } + + if(testArgs.action == Action::create || + testArgs.action == Action::update) + { + // Create expected documentation file + if(auto exp = writeFile(expectedPath, generatedDocs); + !exp) + { + return report::error("{}: \"{}\"", exp.error(), expectedPath); + } + report::info("\"{}\" created", expectedPath); + ++results.expectedDocsWritten; + return; + } + } + + // Analyse results + std::string expectedDocs = expectedDocsBuf->getBuffer().str(); + replaceCRLFWithLF(expectedDocs); + if (generatedDocs == expectedDocs) + { + report::info("\"{}\" passed", filePath); + ++results.expectedDocsMatching; + return; + } + + // Mismatch + if( + testArgs.action == Action::test || + testArgs.action == Action::create) + { + std::string_view filePathSv = filePath; + if (filePathSv.starts_with(dirs_.cwd)) + { + filePathSv.remove_prefix(dirs_.cwd.size()); + if (filePathSv.starts_with("\\") || filePathSv.starts_with("/")) + { + filePathSv.remove_prefix(1); + } + } + report::error("{}: \"{}\"", + Error("Incorrect results"), filePathSv); + auto res = test_suite::diffStrings(expectedDocs, generatedDocs); + report::error("{} lines added", res.added); + report::error("{} lines removed", res.removed); + + report::error("Diff:\n{}", res.diff); + + if(testArgs.badOption.getValue()) + { + // Write the .bad. file + auto badPath = expectedPath; + path::replace_extension(badPath, llvm::Twine("bad.").concat(gen_->fileExtension())); + if (auto exp = writeFile(badPath, generatedDocs); !exp) + { + return report::error("{}: \"{}\"", exp.error(), badPath); + } + report::info("\"{}\" written", badPath); + + // VFALCO We are calling this over and over again instead of once? + if(! diffCmdPath_.getError()) + { + path::replace_extension(badPath, gen_->fileExtension()); + std::array args { + diffCmdPath_.get(), "-u", "--color", expectedPath, badPath }; + ExecuteAndWaitWithLogging(diffCmdPath_.get(), args); + } + } + } + // update action + else if(testArgs.action == Action::update) + { + // Update the expected documentation + if (auto exp = writeFile(expectedPath, generatedDocs); !exp) + { + return report::error("{}: \"{}\"", exp.error(), expectedPath); + } + report::info("\"{}\" updated", expectedPath); + ++results.expectedDocsWritten; + return; } } @@ -258,25 +313,37 @@ handleDir( ++results.numberOfDirs; + // Visit each file in the directory std::error_code ec; fs::directory_iterator const end{}; fs::directory_iterator iter(dirPath, ec, false); if (ec) + { return report::error("{}: \"{}\"", dirPath, Error(ec)); - + } while(iter != end) { - auto const& entry = *iter; - if (entry.type() == fs::file_type::directory_file) + if (auto const& entry = *iter; + entry.type() == fs::file_type::directory_file) { + // Check for a subdirectory-wide config auto const& subdir = entry.path(); - if (!path::extension(subdir).equals_insensitive(".multipage")) + Config::Settings subdirSettings = dirSettings; + subdirSettings.sourceRoot = subdir; + subdirSettings.input = {subdir}; + std::string const& configPath = files::appendPath(subdir, "mrdocs.yml"); + if (files::exists(configPath)) { - auto subdirSettings = loadDirSettings(subdir, dirSettings, dirs_); - if (!subdirSettings) - return report::error("Failed to load config file: {}: \"{}\"", subdirSettings.error(), subdir); - handleDir(subdir, *subdirSettings); + if (auto exp = Config::Settings::load_file(subdirSettings, configPath, dirs_); !exp) + { + return report::error("Failed to load config file: {}: \"{}\"", exp.error(), configPath); + } + if (auto exp = subdirSettings.normalize(dirs_); !exp) + { + return report::error("Failed to normalize config file: {}: \"{}\"", exp.error(), configPath); + } } + handleDir(subdir, subdirSettings); } else if( entry.type() == fs::file_type::regular_file && @@ -290,7 +357,9 @@ handleDir( } iter.increment(ec); if (ec) + { return report::error("{}: \"{}\"", Error(ec), dirPath); + } } } @@ -300,26 +369,64 @@ checkPath( std::string inputPath, char const** argv) { - auto ctx = buildPathContext(std::move(inputPath), argv, dirs_); - if (!ctx) - return report::error("{}: \"{}\"", ctx.error(), inputPath); - + namespace fs = llvm::sys::fs; namespace path = llvm::sys::path; - switch(ctx->type) + + // See if inputPath references a file or directory + inputPath = files::normalizePath(inputPath); + auto fileType = files::getFileType(inputPath); + if (!fileType) + { + return report::error("{}: \"{}\"", fileType.error(), inputPath); + } + + // Set the reference directories for the test + std::string const inputDir = fileType == files::FileType::directory + ? inputPath + : files::getParentDir(inputPath); + dirs_.cwd = inputDir; + + // Check for a directory-wide config + Config::Settings dirSettings; + testArgs.apply(dirSettings, dirs_, argv); + dirSettings.multipage = false; + dirSettings.sourceRoot = inputDir; + dirSettings.input = {inputDir}; + std::string const& configPath = files::appendPath(inputDir, "mrdocs.yml"); + + if (files::exists(configPath)) + { + if (auto exp = Config::Settings::load_file(dirSettings, configPath, dirs_); !exp) + { + return report::error("Failed to load config file: {}: \"{}\"", exp.error(), configPath); + } + if (auto exp = dirSettings.normalize(dirs_); !exp) + { + return report::error("Failed to normalize config file: {}: \"{}\"", exp.error(), configPath); + } + } + + switch(fileType.value()) { case files::FileType::regular: { - if (!path::extension(ctx->inputPath).equals_insensitive(".cpp")) - return report::error("{}: \"{}\"", Error("not a .cpp file"), ctx->inputPath); + // Require a .cpp file + if (!path::extension(inputPath).equals_insensitive(".cpp")) + { + Error err("not a .cpp file"); + return report::error("{}: \"{}\"", + err, inputPath); + } - handleFile(ctx->inputPath, ctx->dirSettings); + handleFile(inputPath, dirSettings); threadPool_.wait(); return; } case files::FileType::directory: { - handleDir(ctx->inputPath, ctx->dirSettings); + // Iterate this directory and all its children + handleDir(inputPath, dirSettings); threadPool_.wait(); return; } diff --git a/src/test/TestRunner.hpp b/src/test/TestRunner.hpp index 6fcd7c0f3d..f05964c72f 100644 --- a/src/test/TestRunner.hpp +++ b/src/test/TestRunner.hpp @@ -4,7 +4,6 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) -// Copyright (c) 2023 Alan de Freitas (alandefreitas@gmail.com) // // Official repository: https://github.com/cppalliance/mrdocs // @@ -16,7 +15,6 @@ #include #include #include -#include "Support/TestLayout.hpp" #include #include #include @@ -24,7 +22,6 @@ #include #include #include -#include namespace mrdocs { @@ -56,16 +53,20 @@ struct TestResults class TestRunner { ThreadPool threadPool_; + llvm::ErrorOr diffCmdPath_; Generator const* gen_; ReferenceDirectories dirs_; - /** Run a single .cpp test file with inherited directory settings. */ + Expected + writeFile( + llvm::StringRef filePath, + llvm::StringRef contents); + void handleFile( llvm::StringRef filePath, Config::Settings const& dirSettings); - /** Traverse a directory, applying configs and enqueueing .cpp tests. */ void handleDir( std::string dirPath, @@ -74,16 +75,13 @@ class TestRunner public: TestResults results; - /** Construct a runner for the chosen generator id. */ TestRunner(std::string_view generator); - /** Execute a compilation/database run for one test input. */ void handleCompilationDatabase( llvm::StringRef filePath, MrDocsCompilationDatabase const& compilations, - std::shared_ptr const& config, - TestLayout const& layout); + std::shared_ptr const& config); /** Check a single file, or a directory recursively. diff --git a/src/test/lib/MrDocsCompilationDatabase.cpp b/src/test/lib/MrDocsCompilationDatabase.cpp index 444ec9de69..8bfad9b9a9 100644 --- a/src/test/lib/MrDocsCompilationDatabase.cpp +++ b/src/test/lib/MrDocsCompilationDatabase.cpp @@ -9,9 +9,9 @@ // Official repository: https://github.com/cppalliance/mrdocs // -#include -#include -#include +#include "lib/MrDocsCompilationDatabase.hpp" +#include "lib/ConfigImpl.hpp" +#include "lib/SingleFileDB.hpp" #include #include #include @@ -93,7 +93,7 @@ struct MrDocsCompilationDatabase_test { { auto adjusted = adjustCompileCommand({ programName }); - BOOST_TEST(has(adjusted, "-std=c++26")); + BOOST_TEST(has(adjusted, "-std=c++23")); } { auto adjusted = adjustCompileCommand({ programName, "-std=c++11" }); @@ -217,7 +217,7 @@ struct MrDocsCompilationDatabase_test { { auto adjusted = adjustCompileCommand({ programName }); - BOOST_TEST(has(adjusted, "-std:c++latest")); + BOOST_TEST(has(adjusted, "-std:c++23preview")); } { auto adjusted = adjustCompileCommand({ programName, "-std:c++11" }); @@ -238,7 +238,7 @@ struct MrDocsCompilationDatabase_test { { auto adjusted = adjustCompileCommand({ programName, "-x", "c" }); - BOOST_TEST(has(adjusted, "-std:clatest")); + BOOST_TEST(has(adjusted, "-std:c17")); } { auto adjusted = adjustCompileCommand( diff --git a/src/test_suite/diff.hpp b/src/test_suite/diff.hpp index 78f288a492..4af4e4c60d 100644 --- a/src/test_suite/diff.hpp +++ b/src/test_suite/diff.hpp @@ -15,7 +15,7 @@ namespace test_suite { /** Result of a diff between two strings -*/ + */ struct DiffStringsResult { /** The diff between the two strings @@ -24,7 +24,7 @@ struct DiffStringsResult * strings. * * New lines are prefixed with '+' and removed lines are prefixed with '-'. - */ + */ std::string diff; /// The number of lines added in the contents @@ -66,7 +66,7 @@ diffStrings( @param expected_contents_path The path to the expected contents file @param rendered_contents The rendered contents of the file @param error_output_path The path to the error output file -*/ + */ void BOOST_TEST_DIFF( std::string_view expected_contents, diff --git a/src/tool/ToolCompilationDatabase.cpp b/src/tool/ToolCompilationDatabase.cpp index 7c756cd2d7..6872f602bd 100644 --- a/src/tool/ToolCompilationDatabase.cpp +++ b/src/tool/ToolCompilationDatabase.cpp @@ -32,7 +32,7 @@ namespace { * @param cmakeArgs The arguments to pass to CMake when generating the compilation database. * @return An `Expected` object containing the path to the `compile_commands.json` file if the database is generated, or the provided path if it is already the `compile_commands.json` file. * Returns an `Unexpected` object in case of failure (e.g., file not found, CMake execution failure). -*/ + */ Expected generateCompileCommandsFile(llvm::StringRef inputPath, llvm::StringRef cmakeArgs, llvm::StringRef buildDir) { diff --git a/test-files/golden-tests/config/auto-brief/auto-brief.html b/test-files/golden-tests/config/auto-brief/auto-brief.html index 19f5c0e67d..4a363652e2 100644 --- a/test-files/golden-tests/config/auto-brief/auto-brief.html +++ b/test-files/golden-tests/config/auto-brief/auto-brief.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Functions

+

Functions

@@ -59,570 +55,531 @@

-

-copyBriefFromCopyBrief# -

+

copyBriefFromCopyBrief

This is the explicit brief.

-

-Synopsis

+

Synopsis

Declared in <auto-brief.cpp>
-
void
-copyBriefFromCopyBrief();
+
+void
+copyBriefFromCopyBrief();
+
-

-copyBriefFromExplicitBrief# -

+

copyBriefFromExplicitBrief

This is the explicit brief.

-

-Synopsis

+

Synopsis

Declared in <auto-brief.cpp>
-
void
-copyBriefFromExplicitBrief();
+
+void
+copyBriefFromExplicitBrief();
+
-

-copyBriefFromFirstSentenceAsBrief# -

+

copyBriefFromFirstSentenceAsBrief

This is the brief.

-

-Synopsis

+

Synopsis

Declared in <auto-brief.cpp>
-
void
-copyBriefFromFirstSentenceAsBrief();
+
+void
+copyBriefFromFirstSentenceAsBrief();
+
-

-copyBriefFromFirstValid# -

+

copyBriefFromFirstValid

This function has documentation but no brief.

-

-Synopsis

+

Synopsis

Declared in <auto-brief.cpp>
-
void
-copyBriefFromFirstValid();
+
+void
+copyBriefFromFirstValid();
+
-

-copyDetailsFromCopyBrief# -

+

copyDetailsFromCopyBrief

Details will be copied

-

-Synopsis

+

Synopsis

Declared in <auto-brief.cpp>
-
void
-copyDetailsFromCopyBrief();
+
+void
+copyDetailsFromCopyBrief();
+
-

-copyDetailsFromDocNoBrief# -

+

copyDetailsFromDocNoBrief

Custom brief

-

-Synopsis

+

Synopsis

Declared in <auto-brief.cpp>
-
void
-copyDetailsFromDocNoBrief();
+
+void
+copyDetailsFromDocNoBrief();
+
-

-copyDetailsFromExplicitBrief# -

+

copyDetailsFromExplicitBrief

-

-Synopsis

+

Synopsis

Declared in <auto-brief.cpp>
-
void
-copyDetailsFromExplicitBrief();
+
+void
+copyDetailsFromExplicitBrief();
+
-

-Description

+

Description

This description will never be copied as brief because it is an explicit brief.

-

-copyDetailsFromFirstSentenceAsBrief# -

+

copyDetailsFromFirstSentenceAsBrief

-

-Synopsis

+

Synopsis

Declared in <auto-brief.cpp>
-
void
-copyDetailsFromFirstSentenceAsBrief();
+
+void
+copyDetailsFromFirstSentenceAsBrief();
+
-

-Description

+

Description

This is more documentation.

-

-copyDetailsFromNoDoc# -

+

copyDetailsFromNoDoc

Custom brief

-

-Synopsis

+

Synopsis

Declared in <auto-brief.cpp>
-
void
-copyDetailsFromNoDoc();
+
+void
+copyDetailsFromNoDoc();
+
-

-copyDocFromCopyBrief# -

+

copyDocFromCopyBrief

This is the explicit brief.

-

-Synopsis

+

Synopsis

Declared in <auto-brief.cpp>
-
void
-copyDocFromCopyBrief();
+
+void
+copyDocFromCopyBrief();
+
-

-Description

+

Description

This description will never be copied as brief because it is an explicit brief.

-

-copyDocFromExplicitBrief# -

+

copyDocFromExplicitBrief

This is the explicit brief.

-

-Synopsis

+

Synopsis

Declared in <auto-brief.cpp>
-
void
-copyDocFromExplicitBrief();
+
+void
+copyDocFromExplicitBrief();
+
-

-Description

+

Description

This description will never be copied as brief because it is an explicit brief.

-

-copyDocFromFirstSentenceAsBrief# -

+

copyDocFromFirstSentenceAsBrief

This is the brief.

-

-Synopsis

+

Synopsis

Declared in <auto-brief.cpp>
-
void
-copyDocFromFirstSentenceAsBrief();
+
+void
+copyDocFromFirstSentenceAsBrief();
+
-

-Description

+

Description

This is more documentation.

-

-docNoBriefFunction# -

+

docNoBriefFunction

This function has documentation but no brief.

-

-Synopsis

+

Synopsis

Declared in <auto-brief.cpp>
-
void
-docNoBriefFunction();
+
+void
+docNoBriefFunction();
+
-

-explicitBriefFunction# -

+

explicitBriefFunction

This is the explicit brief.

-

-Synopsis

+

Synopsis

Declared in <auto-brief.cpp>
-
void
-explicitBriefFunction();
+
+void
+explicitBriefFunction();
+
-

-Description

+

Description

This description will never be copied as brief because it is an explicit brief.

-

-explicitBriefFunction2# -

+

explicitBriefFunction2

This is the explicit brief.

-

-Synopsis

+

Synopsis

Declared in <auto-brief.cpp>
-
void
-explicitBriefFunction2();
+
+void
+explicitBriefFunction2();
+
-

-Description

+

Description

This will not be copied as brief.

-

-failCircularReferenceCopyFunction# -

+

failCircularReferenceCopyFunction

-

-Synopsis

+

Synopsis

Declared in <auto-brief.cpp>
-
void
-failCircularReferenceCopyFunction();
+
+void
+failCircularReferenceCopyFunction();
+
-

-failCircularSourceFunctionA# -

+

failCircularSourceFunctionA

-

-Synopsis

+

Synopsis

Declared in <auto-brief.cpp>
-
void
-failCircularSourceFunctionA();
+
+void
+failCircularSourceFunctionA();
+
-

-failCircularSourceFunctionB# -

+

failCircularSourceFunctionB

-

-Synopsis

+

Synopsis

Declared in <auto-brief.cpp>
-
void
-failCircularSourceFunctionB();
+
+void
+failCircularSourceFunctionB();
+
-

-failCopyBriefFromDocNoBrief# -

+

failCopyBriefFromDocNoBrief

This function has documentation but no brief.

-

-Synopsis

+

Synopsis

Declared in <auto-brief.cpp>
-
void
-failCopyBriefFromDocNoBrief();
+
+void
+failCopyBriefFromDocNoBrief();
+
-

-failCopyBriefFromInvalidReference# -

+

failCopyBriefFromInvalidReference

-

-Synopsis

+

Synopsis

Declared in <auto-brief.cpp>
-
void
-failCopyBriefFromInvalidReference();
+
+void
+failCopyBriefFromInvalidReference();
+
-

-failCopyBriefFromNoDoc# -

+

failCopyBriefFromNoDoc

-

-Synopsis

+

Synopsis

Declared in <auto-brief.cpp>
-
void
-failCopyBriefFromNoDoc();
+
+void
+failCopyBriefFromNoDoc();
+
-

-failCopyDetailsFromInvalidReference# -

+

failCopyDetailsFromInvalidReference

-

-Synopsis

+

Synopsis

Declared in <auto-brief.cpp>
-
void
-failCopyDetailsFromInvalidReference();
+
+void
+failCopyDetailsFromInvalidReference();
+
-

-failCopyDocFromDocNoBrief# -

+

failCopyDocFromDocNoBrief

This function has documentation but no brief.

-

-Synopsis

+

Synopsis

Declared in <auto-brief.cpp>
-
void
-failCopyDocFromDocNoBrief();
+
+void
+failCopyDocFromDocNoBrief();
+
-

-failCopyDocFromInvalidReference# -

+

failCopyDocFromInvalidReference

-

-Synopsis

+

Synopsis

Declared in <auto-brief.cpp>
-
void
-failCopyDocFromInvalidReference();
+
+void
+failCopyDocFromInvalidReference();
+
-

-failCopyDocFromNoDoc# -

+

failCopyDocFromNoDoc

-

-Synopsis

+

Synopsis

Declared in <auto-brief.cpp>
-
void
-failCopyDocFromNoDoc();
+
+void
+failCopyDocFromNoDoc();
+
-

-failInvalidReferenceCopyFunctions# -

+

failInvalidReferenceCopyFunctions

-

-Synopsis

+

Synopsis

Declared in <auto-brief.cpp>
-
void
-failInvalidReferenceCopyFunctions();
+
+void
+failInvalidReferenceCopyFunctions();
+
-

-firstSentenceAsBriefFunction# -

+

firstSentenceAsBriefFunction

This is the brief.

-

-Synopsis

+

Synopsis

Declared in <auto-brief.cpp>
-
void
-firstSentenceAsBriefFunction();
+
+void
+firstSentenceAsBriefFunction();
+
-

-Description

+

Description

This is more documentation.

-

-noDocFunction# -

+

noDocFunction

-

-Synopsis

+

Synopsis

Declared in <auto-brief.cpp>
-
void
-noDocFunction();
+
+void
+noDocFunction();
+
-

-recursiveReferenceCopyFunction# -

+

recursiveReferenceCopyFunction

Final recursive brief

-

-Synopsis

+

Synopsis

Declared in <auto-brief.cpp>
-
void
-recursiveReferenceCopyFunction();
+
+void
+recursiveReferenceCopyFunction();
+
-

-recursiveSourceFunctionA# -

+

recursiveSourceFunctionA

Final recursive brief

-

-Synopsis

+

Synopsis

Declared in <auto-brief.cpp>
-
void
-recursiveSourceFunctionA();
+
+void
+recursiveSourceFunctionA();
+
-

-recursiveSourceFunctionB# -

+

recursiveSourceFunctionB

Final recursive brief

-

-Synopsis

+

Synopsis

Declared in <auto-brief.cpp>
-
void
-recursiveSourceFunctionB();
+
+void
+recursiveSourceFunctionB();
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/auto-brief/no-auto-brief.html b/test-files/golden-tests/config/auto-brief/no-auto-brief.html index dc1f82107f..3460c5f14a 100644 --- a/test-files/golden-tests/config/auto-brief/no-auto-brief.html +++ b/test-files/golden-tests/config/auto-brief/no-auto-brief.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Functions

+

Functions

@@ -59,565 +55,524 @@

-

-copyBriefFromCopyBrief# -

+

copyBriefFromCopyBrief

This is the explicit brief.

-

-Synopsis

+

Synopsis

Declared in <no-auto-brief.cpp>
-
void
-copyBriefFromCopyBrief();
+
+void
+copyBriefFromCopyBrief();
+
-

-copyBriefFromExplicitBrief# -

+

copyBriefFromExplicitBrief

This is the explicit brief.

-

-Synopsis

+

Synopsis

Declared in <no-auto-brief.cpp>
-
void
-copyBriefFromExplicitBrief();
+
+void
+copyBriefFromExplicitBrief();
+
-

-copyBriefFromFirstSentenceAsBrief# -

+

copyBriefFromFirstSentenceAsBrief

-

-Synopsis

+

Synopsis

Declared in <no-auto-brief.cpp>
-
void
-copyBriefFromFirstSentenceAsBrief();
+
+void
+copyBriefFromFirstSentenceAsBrief();
+
-

-copyBriefFromFirstValid# -

+

copyBriefFromFirstValid

This is the explicit brief.

-

-Synopsis

+

Synopsis

Declared in <no-auto-brief.cpp>
-
void
-copyBriefFromFirstValid();
+
+void
+copyBriefFromFirstValid();
+
-

-copyDetailsFromCopyBrief# -

+

copyDetailsFromCopyBrief

Details will be copied

-

-Synopsis

+

Synopsis

Declared in <no-auto-brief.cpp>
-
void
-copyDetailsFromCopyBrief();
+
+void
+copyDetailsFromCopyBrief();
+
-

-copyDetailsFromDocNoBrief# -

+

copyDetailsFromDocNoBrief

Custom brief

-

-Synopsis

+

Synopsis

Declared in <no-auto-brief.cpp>
-
void
-copyDetailsFromDocNoBrief();
+
+void
+copyDetailsFromDocNoBrief();
+
-

-copyDetailsFromExplicitBrief# -

+

copyDetailsFromExplicitBrief

-

-Synopsis

+

Synopsis

Declared in <no-auto-brief.cpp>
-
void
-copyDetailsFromExplicitBrief();
+
+void
+copyDetailsFromExplicitBrief();
+
-

-Description

+

Description

This will not be copied.

-

-copyDetailsFromFirstSentenceAsBrief# -

+

copyDetailsFromFirstSentenceAsBrief

-

-Synopsis

+

Synopsis

Declared in <no-auto-brief.cpp>
-
void
-copyDetailsFromFirstSentenceAsBrief();
+
+void
+copyDetailsFromFirstSentenceAsBrief();
+
-

-Description

+

Description

This is the brief.

This is more documentation.

-

-copyDetailsFromNoDoc# -

+

copyDetailsFromNoDoc

Custom brief

-

-Synopsis

+

Synopsis

Declared in <no-auto-brief.cpp>
-
void
-copyDetailsFromNoDoc();
+
+void
+copyDetailsFromNoDoc();
+
-

-copyDocFromCopyBrief# -

+

copyDocFromCopyBrief

This is the explicit brief.

-

-Synopsis

+

Synopsis

Declared in <no-auto-brief.cpp>
-
void
-copyDocFromCopyBrief();
+
+void
+copyDocFromCopyBrief();
+
-

-Description

+

Description

This will not be copied.

-

-copyDocFromExplicitBrief# -

+

copyDocFromExplicitBrief

This is the explicit brief.

-

-Synopsis

+

Synopsis

Declared in <no-auto-brief.cpp>
-
void
-copyDocFromExplicitBrief();
+
+void
+copyDocFromExplicitBrief();
+
-

-Description

+

Description

This will not be copied.

-

-copyDocFromFirstSentenceAsBrief# -

+

copyDocFromFirstSentenceAsBrief

-

-Synopsis

+

Synopsis

Declared in <no-auto-brief.cpp>
-
void
-copyDocFromFirstSentenceAsBrief();
+
+void
+copyDocFromFirstSentenceAsBrief();
+
-

-Description

+

Description

This is the brief.

This is more documentation.

-

-docNoBriefFunction# -

+

docNoBriefFunction

-

-Synopsis

+

Synopsis

Declared in <no-auto-brief.cpp>
-
void
-docNoBriefFunction();
+
+void
+docNoBriefFunction();
+
-

-Description

+

Description

This function has documentation but no brief.

-

-explicitBriefFunction# -

+

explicitBriefFunction

This is the explicit brief.

-

-Synopsis

+

Synopsis

Declared in <no-auto-brief.cpp>
-
void
-explicitBriefFunction();
+
+void
+explicitBriefFunction();
+
-

-Description

+

Description

This will not be copied.

-

-explicitBriefFunction2# -

+

explicitBriefFunction2

This is the explicit brief.

-

-Synopsis

+

Synopsis

Declared in <no-auto-brief.cpp>
-
void
-explicitBriefFunction2();
+
+void
+explicitBriefFunction2();
+
-

-Description

+

Description

This will not be copied.

-

-failCircularReferenceCopyFunction# -

+

failCircularReferenceCopyFunction

-

-Synopsis

+

Synopsis

Declared in <no-auto-brief.cpp>
-
void
-failCircularReferenceCopyFunction();
+
+void
+failCircularReferenceCopyFunction();
+
-

-failCircularSourceFunctionA# -

+

failCircularSourceFunctionA

-

-Synopsis

+

Synopsis

Declared in <no-auto-brief.cpp>
-
void
-failCircularSourceFunctionA();
+
+void
+failCircularSourceFunctionA();
+
-

-failCircularSourceFunctionB# -

+

failCircularSourceFunctionB

-

-Synopsis

+

Synopsis

Declared in <no-auto-brief.cpp>
-
void
-failCircularSourceFunctionB();
+
+void
+failCircularSourceFunctionB();
+
-

-failCopyBriefFromDocNoBrief# -

+

failCopyBriefFromDocNoBrief

-

-Synopsis

+

Synopsis

Declared in <no-auto-brief.cpp>
-
void
-failCopyBriefFromDocNoBrief();
+
+void
+failCopyBriefFromDocNoBrief();
+
-

-failCopyBriefFromInvalidReference# -

+

failCopyBriefFromInvalidReference

-

-Synopsis

+

Synopsis

Declared in <no-auto-brief.cpp>
-
void
-failCopyBriefFromInvalidReference();
+
+void
+failCopyBriefFromInvalidReference();
+
-

-failCopyBriefFromNoDoc# -

+

failCopyBriefFromNoDoc

-

-Synopsis

+

Synopsis

Declared in <no-auto-brief.cpp>
-
void
-failCopyBriefFromNoDoc();
+
+void
+failCopyBriefFromNoDoc();
+
-

-failCopyDetailsFromInvalidReference# -

+

failCopyDetailsFromInvalidReference

-

-Synopsis

+

Synopsis

Declared in <no-auto-brief.cpp>
-
void
-failCopyDetailsFromInvalidReference();
+
+void
+failCopyDetailsFromInvalidReference();
+
-

-failCopyDocFromDocNoBrief# -

+

failCopyDocFromDocNoBrief

-

-Synopsis

+

Synopsis

Declared in <no-auto-brief.cpp>
-
void
-failCopyDocFromDocNoBrief();
+
+void
+failCopyDocFromDocNoBrief();
+
-

-Description

+

Description

This function has documentation but no brief.

-

-failCopyDocFromInvalidReference# -

+

failCopyDocFromInvalidReference

-

-Synopsis

+

Synopsis

Declared in <no-auto-brief.cpp>
-
void
-failCopyDocFromInvalidReference();
+
+void
+failCopyDocFromInvalidReference();
+
-

-failCopyDocFromNoDoc# -

+

failCopyDocFromNoDoc

-

-Synopsis

+

Synopsis

Declared in <no-auto-brief.cpp>
-
void
-failCopyDocFromNoDoc();
+
+void
+failCopyDocFromNoDoc();
+
-

-failInvalidReferenceCopyFunctions# -

+

failInvalidReferenceCopyFunctions

-

-Synopsis

+

Synopsis

Declared in <no-auto-brief.cpp>
-
void
-failInvalidReferenceCopyFunctions();
+
+void
+failInvalidReferenceCopyFunctions();
+
-

-firstSentenceAsBriefFunction# -

+

firstSentenceAsBriefFunction

-

-Synopsis

+

Synopsis

Declared in <no-auto-brief.cpp>
-
void
-firstSentenceAsBriefFunction();
+
+void
+firstSentenceAsBriefFunction();
+
-

-Description

+

Description

This is the brief.

This is more documentation.

-

-noDocFunction# -

+

noDocFunction

-

-Synopsis

+

Synopsis

Declared in <no-auto-brief.cpp>
-
void
-noDocFunction();
+
+void
+noDocFunction();
+
-

-recursiveReferenceCopyFunction# -

+

recursiveReferenceCopyFunction

Final recursive brief

-

-Synopsis

+

Synopsis

Declared in <no-auto-brief.cpp>
-
void
-recursiveReferenceCopyFunction();
+
+void
+recursiveReferenceCopyFunction();
+
-

-recursiveSourceFunctionA# -

+

recursiveSourceFunctionA

Final recursive brief

-

-Synopsis

+

Synopsis

Declared in <no-auto-brief.cpp>
-
void
-recursiveSourceFunctionA();
+
+void
+recursiveSourceFunctionA();
+
-

-recursiveSourceFunctionB# -

+

recursiveSourceFunctionB

Final recursive brief

-

-Synopsis

+

Synopsis

Declared in <no-auto-brief.cpp>
-
void
-recursiveSourceFunctionB();
+
+void
+recursiveSourceFunctionB();
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/auto-function-metadata/brief-from-function-class.html b/test-files/golden-tests/config/auto-function-metadata/brief-from-function-class.html index 665e1cbc1c..8c2439389f 100644 --- a/test-files/golden-tests/config/auto-function-metadata/brief-from-function-class.html +++ b/test-files/golden-tests/config/auto-function-metadata/brief-from-function-class.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Types

+

Types

@@ -30,41 +26,38 @@

-

-A# -

+

A

A helper tag

-

-Synopsis

+

Synopsis

Declared in <brief-from-function-class.cpp>
-
struct A;
+
+struct A;
+
-

-X# -

+

X

Test class

-

-Synopsis

+

Synopsis

Declared in <brief-from-function-class.cpp>
-
struct X;
+
+struct X;
+
-

-Member Functions

+

Member Functions

@@ -85,85 +78,86 @@

-

-X::X# -

+

X::X

Constructors

-

-Synopses

+

Synopses

Declared in <brief-from-function-class.cpp>

Default constructor

-
constexpr
-X() = default;
-Β» more... +
+constexpr
+X() = default;
+
Β» more...

Copy constructor

-
constexpr
-X(X const& other) = default;
-Β» more... +
+constexpr
+X(X const& other) = default;
+
Β» more...

Move constructor

-
constexpr
-X(X&& other) = default;
-Β» more... +
+constexpr
+X(X&& other) = default;
+
Β» more...

Construct from int

-
X(int value);
-Β» more... +
+X(int value);
+
Β» more...

Construct from A

-
X(A const& value);
-Β» more... +
+X(A const& value);
+
Β» more...

Construct from A

-
X(A&& value);
-Β» more... +
+X(A&& value);
+
Β» more... +
-

-X::X# -

+

X::X

Default constructor

-

-Synopsis

+

Synopsis

Declared in <brief-from-function-class.cpp>
-
constexpr
-X() = default;
+
+constexpr
+X() = default;
+
-

-X::X# -

+

X::X

Copy constructor

-

-Synopsis

+

Synopsis

Declared in <brief-from-function-class.cpp>
-
constexpr
-X(X const& other) = default;
+
+constexpr
+X(X const& other) = default;
+
-

-Parameters

+

Parameters

@@ -182,24 +176,22 @@

-

-X::X# -

+

X::X

Move constructor

-

-Synopsis

+

Synopsis

Declared in <brief-from-function-class.cpp>
-
constexpr
-X(X&& other) = default;
+
+constexpr
+X(X&& other) = default;
+
-

-Parameters

+

Parameters

@@ -218,23 +210,21 @@

-

-X::X# -

+

X::X

Construct from int

-

-Synopsis

+

Synopsis

Declared in <brief-from-function-class.cpp>
-
X(int value);
+
+X(int value);
+
-

-Parameters

+

Parameters

@@ -253,23 +243,21 @@

-

-X::X# -

+

X::X

Construct from A

-

-Synopsis

+

Synopsis

Declared in <brief-from-function-class.cpp>
-
X(A const& value);
+
+X(A const& value);
+
-

-Parameters

+

Parameters

@@ -288,23 +276,21 @@

-

-X::X# -

+

X::X

Construct from A

-

-Synopsis

+

Synopsis

Declared in <brief-from-function-class.cpp>
-
X(A&& value);
+
+X(A&& value);
+
-

-Parameters

+

Parameters

@@ -323,69 +309,64 @@

-

-X::~X# -

+

X::~X

Destructor

-

-Synopsis

+

Synopsis

Declared in <brief-from-function-class.cpp>
-
~X();
+
+~X();
+
-

-X::operator A# -

+

X::operator A

Conversion to A

-

-Synopsis

+

Synopsis

Declared in <brief-from-function-class.cpp>
-
operator A() const;
+
+operator A() const;
+
-

-Return Value

+

Return Value

A helper tag
-

-X::operator int# -

+

X::operator int

Conversion to int

-

-Synopsis

+

Synopsis

Declared in <brief-from-function-class.cpp>
-
operator int() const;
+
+operator int() const;
+
-

-Return Value

+

Return Value

The object converted to int
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/auto-function-metadata/brief-from-operator.html b/test-files/golden-tests/config/auto-function-metadata/brief-from-operator.html index f9cfb9a03c..9b3f4e34b5 100644 --- a/test-files/golden-tests/config/auto-function-metadata/brief-from-operator.html +++ b/test-files/golden-tests/config/auto-function-metadata/brief-from-operator.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Types

+

Types

@@ -28,8 +24,7 @@

-

-Functions

+

Functions

@@ -45,41 +40,38 @@

-

-A# -

+

A

A helper tag

-

-Synopsis

+

Synopsis

Declared in <brief-from-operator.cpp>
-
struct A;
+
+struct A;
+
-

-X# -

+

X

Test class

-

-Synopsis

+

Synopsis

Declared in <brief-from-operator.cpp>
-
struct X;
+
+struct X;
+
-

-Member Functions

+

Member Functions

@@ -98,60 +90,58 @@

-

-X::operator=# -

+

X::operator=

Assignment operators

-

-Synopses

+

Synopses

Declared in <brief-from-operator.cpp>

Copy assignment operator

-
X&
-operator=(X const& other);
-Β» more... +
+X&
+operator=(X const& other);
+
Β» more...

Move assignment operator

-
X&
-operator=(X&& other);
-Β» more... +
+X&
+operator=(X&& other);
+
Β» more...

Assignment operator

-
X&
-operator=(A const& value);
-Β» more... +
+X&
+operator=(A const& value);
+
Β» more... +
-

-X::operator=# -

+

X::operator=

Copy assignment operator

-

-Synopsis

+

Synopsis

Declared in <brief-from-operator.cpp>
-
X&
-operator=(X const& other);
+
+X&
+operator=(X const& other);
+
-

-Return Value

+

Return Value

Reference to the current object
-

-Parameters

+

Parameters

@@ -170,29 +160,26 @@

-

-X::operator=# -

+

X::operator=

Move assignment operator

-

-Synopsis

+

Synopsis

Declared in <brief-from-operator.cpp>
-
X&
-operator=(X&& other);
+
+X&
+operator=(X&& other);
+
-

-Return Value

+

Return Value

Reference to the current object
-

-Parameters

+

Parameters

@@ -211,29 +198,26 @@

-

-X::operator=# -

+

X::operator=

Assignment operator

-

-Synopsis

+

Synopsis

Declared in <brief-from-operator.cpp>
-
X&
-operator=(A const& value);
+
+X&
+operator=(A const& value);
+
-

-Return Value

+

Return Value

Reference to the current object
-

-Parameters

+

Parameters

@@ -252,29 +236,26 @@

-

-X::operator+=# -

+

X::operator+=

Addition assignment operator

-

-Synopsis

+

Synopsis

Declared in <brief-from-operator.cpp>
-
X&
-operator+=(X const& rhs);
+
+X&
+operator+=(X const& rhs);
+
-

-Return Value

+

Return Value

Reference to the current object
-

-Parameters

+

Parameters

@@ -293,25 +274,23 @@

-

-ostream# -

+

ostream

A dumb ostream class

-

-Synopsis

+

Synopsis

Declared in <brief-from-operator.cpp>
-
struct ostream;
+
+struct ostream;
+
-

-Non-Member Functions

+

Non-Member Functions

@@ -327,31 +306,28 @@

-

-operator<<# -

+

operator<<

Stream insertion operator

-

-Synopsis

+

Synopsis

Declared in <brief-from-operator.cpp>
-
ostream&
+
+ostream&
 operator<<(
     ostream& os,
-    X const& x);
+ X const& x);
+
-

-Return Value

+

Return Value

Reference to the current output stream
-

-Parameters

+

Parameters

@@ -374,8 +350,8 @@

- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/auto-function-metadata/param-from-function-class.html b/test-files/golden-tests/config/auto-function-metadata/param-from-function-class.html index d61887e3b8..c3247d17fd 100644 --- a/test-files/golden-tests/config/auto-function-metadata/param-from-function-class.html +++ b/test-files/golden-tests/config/auto-function-metadata/param-from-function-class.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Types

+

Types

@@ -30,41 +26,38 @@

-

-A# -

+

A

A helper tag

-

-Synopsis

+

Synopsis

Declared in <param-from-function-class.cpp>
-
struct A;
+
+struct A;
+
-

-X# -

+

X

Test class

-

-Synopsis

+

Synopsis

Declared in <param-from-function-class.cpp>
-
struct X;
+
+struct X;
+
-

-Member Functions

+

Member Functions

@@ -83,59 +76,60 @@

-

-X::X# -

+

X::X

Constructors

-

-Synopses

+

Synopses

Declared in <param-from-function-class.cpp>

Copy constructor

-
X(X const& other);
-Β» more... +
+X(X const& other);
+
Β» more...

Move constructor

-
X(X&& other);
-Β» more... +
+X(X&& other);
+
Β» more...

Construct from int

-
X(int value);
-Β» more... +
+X(int value);
+
Β» more...

Construct from A

-
X(A const& value);
-Β» more... +
+X(A const& value);
+
Β» more...

Construct from A

-
X(A&& value);
-Β» more... +
+X(A&& value);
+
Β» more... +
-

-X::X# -

+

X::X

Copy constructor

-

-Synopsis

+

Synopsis

Declared in <param-from-function-class.cpp>
-
X(X const& other);
+
+X(X const& other);
+
-

-Parameters

+

Parameters

@@ -154,23 +148,21 @@

-

-X::X# -

+

X::X

Move constructor

-

-Synopsis

+

Synopsis

Declared in <param-from-function-class.cpp>
-
X(X&& other);
+
+X(X&& other);
+
-

-Parameters

+

Parameters

@@ -189,23 +181,21 @@

-

-X::X# -

+

X::X

Construct from int

-

-Synopsis

+

Synopsis

Declared in <param-from-function-class.cpp>
-
X(int value);
+
+X(int value);
+
-

-Parameters

+

Parameters

@@ -224,23 +214,21 @@

-

-X::X# -

+

X::X

Construct from A

-

-Synopsis

+

Synopsis

Declared in <param-from-function-class.cpp>
-
X(A const& value);
+
+X(A const& value);
+
-

-Parameters

+

Parameters

@@ -259,23 +247,21 @@

-

-X::X# -

+

X::X

Construct from A

-

-Synopsis

+

Synopsis

Declared in <param-from-function-class.cpp>
-
X(A&& value);
+
+X(A&& value);
+
-

-Parameters

+

Parameters

@@ -294,70 +280,70 @@

-

-X::operator=# -

+

X::operator=

Assignment operators

-

-Synopses

+

Synopses

Declared in <param-from-function-class.cpp>

Copy assignment operator

-
X&
-operator=(X const& other);
-Β» more... +
+X&
+operator=(X const& other);
+
Β» more...

Move assignment operator

-
X&
-operator=(X&& other);
-Β» more... +
+X&
+operator=(X&& other);
+
Β» more...

Assignment operator

-
X&
-operator=(int value);
-Β» more... +
+X&
+operator=(int value);
+
Β» more...

Assignment operator

-
X&
-operator=(A const& value);
-Β» more... +
+X&
+operator=(A const& value);
+
Β» more...

Assignment operator

-
X&
-operator=(A&& value);
-Β» more... +
+X&
+operator=(A&& value);
+
Β» more... +
-

-X::operator=# -

+

X::operator=

Copy assignment operator

-

-Synopsis

+

Synopsis

Declared in <param-from-function-class.cpp>
-
X&
-operator=(X const& other);
+
+X&
+operator=(X const& other);
+
-

-Return Value

+

Return Value

Reference to the current object
-

-Parameters

+

Parameters

@@ -376,29 +362,26 @@

-

-X::operator=# -

+

X::operator=

Move assignment operator

-

-Synopsis

+

Synopsis

Declared in <param-from-function-class.cpp>
-
X&
-operator=(X&& other);
+
+X&
+operator=(X&& other);
+
-

-Return Value

+

Return Value

Reference to the current object
-

-Parameters

+

Parameters

@@ -417,29 +400,26 @@

-

-X::operator=# -

+

X::operator=

Assignment operator

-

-Synopsis

+

Synopsis

Declared in <param-from-function-class.cpp>
-
X&
-operator=(int value);
+
+X&
+operator=(int value);
+
-

-Return Value

+

Return Value

Reference to the current object
-

-Parameters

+

Parameters

@@ -458,29 +438,26 @@

-

-X::operator=# -

+

X::operator=

Assignment operator

-

-Synopsis

+

Synopsis

Declared in <param-from-function-class.cpp>
-
X&
-operator=(A const& value);
+
+X&
+operator=(A const& value);
+
-

-Return Value

+

Return Value

Reference to the current object
-

-Parameters

+

Parameters

@@ -499,29 +476,26 @@

-

-X::operator=# -

+

X::operator=

Assignment operator

-

-Synopsis

+

Synopsis

Declared in <param-from-function-class.cpp>
-
X&
-operator=(A&& value);
+
+X&
+operator=(A&& value);
+
-

-Return Value

+

Return Value

Reference to the current object
-

-Parameters

+

Parameters

@@ -540,8 +514,8 @@

- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/auto-function-metadata/param-from-operator.html b/test-files/golden-tests/config/auto-function-metadata/param-from-operator.html index 3e3bd66e24..36ecc963fd 100644 --- a/test-files/golden-tests/config/auto-function-metadata/param-from-operator.html +++ b/test-files/golden-tests/config/auto-function-metadata/param-from-operator.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Types

+

Types

@@ -28,8 +24,7 @@

-

-Functions

+

Functions

@@ -47,41 +42,38 @@

-

-A# -

+

A

A helper tag

-

-Synopsis

+

Synopsis

Declared in <param-from-operator.cpp>
-
struct A;
+
+struct A;
+
-

-X# -

+

X

Test class

-

-Synopsis

+

Synopsis

Declared in <param-from-operator.cpp>
-
struct X;
+
+struct X;
+
-

-Member Functions

+

Member Functions

@@ -97,8 +89,7 @@

-

-Non-Member Functions

+

Non-Member Functions

@@ -115,29 +106,26 @@

-

-X::operator+# -

+

X::operator+

Addition operator

-

-Synopsis

+

Synopsis

Declared in <param-from-operator.cpp>
-
X
-operator+(X const& x) const;
+
+X
+operator+(X const& x) const;
+
-

-Return Value

+

Return Value

Another instance of the object
-

-Parameters

+

Parameters

@@ -156,25 +144,23 @@

-

-ostream# -

+

ostream

A dumb ostream class

-

-Synopsis

+

Synopsis

Declared in <param-from-operator.cpp>
-
struct ostream;
+
+struct ostream;
+
-

-Non-Member Functions

+

Non-Member Functions

@@ -190,31 +176,28 @@

-

-operator-# -

+

operator-

Subtraction operator

-

-Synopsis

+

Synopsis

Declared in <param-from-operator.cpp>
-
X
+
+X
 operator-(
     X const& x,
-    X const& y);
+ X const& y);
+
-

-Return Value

+

Return Value

Test class
-

-Parameters

+

Parameters

@@ -237,31 +220,28 @@

-

-operator<<# -

+

operator<<

Stream insertion operator

-

-Synopsis

+

Synopsis

Declared in <param-from-operator.cpp>
-
ostream&
+
+ostream&
 operator<<(
     ostream& os,
-    X const& x);
+ X const& x);
+
-

-Return Value

+

Return Value

Reference to the current output stream
-

-Parameters

+

Parameters

@@ -284,29 +264,26 @@

-

-operator!# -

+

operator!

Negation operator

-

-Synopsis

+

Synopsis

Declared in <param-from-operator.cpp>
-
X
-operator!(X const& x);
+
+X
+operator!(X const& x);
+
-

-Return Value

+

Return Value

Test class
-

-Parameters

+

Parameters

@@ -325,8 +302,8 @@

- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/auto-function-metadata/returns-from-brief.html b/test-files/golden-tests/config/auto-function-metadata/returns-from-brief.html index 2ff703a253..a3c4ff7488 100644 --- a/test-files/golden-tests/config/auto-function-metadata/returns-from-brief.html +++ b/test-files/golden-tests/config/auto-function-metadata/returns-from-brief.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Types

+

Types

@@ -29,22 +25,20 @@

-

-X# -

+

X

Test class

-

-Synopsis

+

Synopsis

Declared in <returns-from-brief.cpp>
-
struct X;
+
+struct X;
+
-

-Member Functions

+

Member Functions

@@ -64,77 +58,71 @@

-

-X::empty# -

+

X::empty

Determines whether the range is empty.

-

-Synopsis

+

Synopsis

Declared in <returns-from-brief.cpp>
-
bool
-empty();
+
+bool
+empty();
+
-

-Return Value

+

Return Value

whether the range is empty.
-

-X::front# -

+

X::front

Returns the first element of the range.

-

-Synopsis

+

Synopsis

Declared in <returns-from-brief.cpp>
-
int
-front() const;
+
+int
+front() const;
+
-

-Return Value

+

Return Value

the first element of the range.
-

-X::size# -

+

X::size

Get the range size.

-

-Synopsis

+

Synopsis

Declared in <returns-from-brief.cpp>
-
int
-size() const;
+
+int
+size() const;
+
-

-Return Value

+

Return Value

the range size.
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/auto-function-metadata/returns-from-return-brief.html b/test-files/golden-tests/config/auto-function-metadata/returns-from-return-brief.html index e2a6bc3ffe..e0ad994278 100644 --- a/test-files/golden-tests/config/auto-function-metadata/returns-from-return-brief.html +++ b/test-files/golden-tests/config/auto-function-metadata/returns-from-return-brief.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Types

+

Types

@@ -26,8 +22,7 @@

-

-Functions

+

Functions

@@ -43,25 +38,23 @@

-

-R# -

+

R

The return type of the function

-

-Synopsis

+

Synopsis

Declared in <returns-from-return-brief.cpp>
-
struct R;
+
+struct R;
+
-

-Non-Member Functions

+

Non-Member Functions

@@ -77,31 +70,29 @@

-

-getR# -

+

getR

Test function

-

-Synopsis

+

Synopsis

Declared in <returns-from-return-brief.cpp>
-
R
-getR();
+
+R
+getR();
+
-

-Return Value

+

Return Value

The return type of the function
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/auto-function-metadata/returns-from-special.html b/test-files/golden-tests/config/auto-function-metadata/returns-from-special.html index 26fd76f879..2f0a519798 100644 --- a/test-files/golden-tests/config/auto-function-metadata/returns-from-special.html +++ b/test-files/golden-tests/config/auto-function-metadata/returns-from-special.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Types

+

Types

@@ -29,8 +25,7 @@

-

-Functions

+

Functions

@@ -54,25 +49,23 @@

-

-A# -

+

A

A helper class

-

-Synopsis

+

Synopsis

Declared in <returns-from-special.cpp>
-
struct A;
+
+struct A;
+
-

-Non-Member Functions

+

Non-Member Functions

@@ -95,38 +88,35 @@

-

-Undoc# -

+

Undoc

-

-Synopsis

+

Synopsis

Declared in <returns-from-special.cpp>
-
struct Undoc;
+
+struct Undoc;
+
-

-X# -

+

X

Test class

-

-Synopsis

+

Synopsis

Declared in <returns-from-special.cpp>
-
struct X;
+
+struct X;
+
-

-Member Functions

+

Member Functions

@@ -156,55 +146,52 @@

-

-X::operator=# -

+

X::operator=

Assignment operators

-

-Synopses

+

Synopses

Declared in <returns-from-special.cpp>

Assignment operator

-
X&
-operator=(A const& value);
-Β» more... +
+X&
+operator=(A const& value);
+
Β» more...

Assignment operator

-
X&&
-operator=(A&& value);
-Β» more... +
+X&&
+operator=(A&& value);
+
Β» more... +
-

-X::operator=# -

+

X::operator=

Assignment operator

-

-Synopsis

+

Synopsis

Declared in <returns-from-special.cpp>
-
X&
-operator=(A const& value);
+
+X&
+operator=(A const& value);
+
-

-Return Value

+

Return Value

Reference to the current object
-

-Parameters

+

Parameters

@@ -223,29 +210,26 @@

-

-X::operator=# -

+

X::operator=

Assignment operator

-

-Synopsis

+

Synopsis

Declared in <returns-from-special.cpp>
-
X&&
-operator=(A&& value);
+
+X&&
+operator=(A&& value);
+
-

-Return Value

+

Return Value

Rvalue reference to the current object
-

-Parameters

+

Parameters

@@ -264,29 +248,26 @@

-

-X::operator+# -

+

X::operator+

Addition operator

-

-Synopsis

+

Synopsis

Declared in <returns-from-special.cpp>
-
X
-operator+(X const& rhs) const;
+
+X
+operator+(X const& rhs) const;
+
-

-Return Value

+

Return Value

Another instance of the object
-

-Parameters

+

Parameters

@@ -305,119 +286,108 @@

-

-X::operator-># -

+

X::operator->

Member access operator

-

-Synopsis

+

Synopsis

Declared in <returns-from-special.cpp>
-
X*
-operator->();
+
+X*
+operator->();
+
-

-Return Value

+

Return Value

Pointer to the current object
-

-X::operator A# -

+

X::operator A

Conversion to A

-

-Synopsis

+

Synopsis

Declared in <returns-from-special.cpp>
-
operator A() const;
+
+operator A() const;
+
-

-Return Value

+

Return Value

A helper class
-

-X::operator Undoc# -

+

X::operator Undoc

Conversion to Undoc

-

-Synopsis

+

Synopsis

Declared in <returns-from-special.cpp>
-
operator Undoc() const;
+
+operator Undoc() const;
+
-

-Return Value

+

Return Value

The object converted to Undoc
-

-X::operator!# -

+

X::operator!

Negation operator

-

-Synopsis

+

Synopsis

Declared in <returns-from-special.cpp>
-
bool
-operator!() const;
+
+bool
+operator!() const;
+
-

-Return Value

+

Return Value

true if the object is falsy, false otherwise
-

-X::operator==# -

+

X::operator==

Equality operator

-

-Synopsis

+

Synopsis

Declared in <returns-from-special.cpp>
-
bool
-operator==(X const& rhs) const;
+
+bool
+operator==(X const& rhs) const;
+
-

-Return Value

+

Return Value

true if the objects are equal, false otherwise
-

-Parameters

+

Parameters

@@ -436,29 +406,26 @@

-

-X::operator!=# -

+

X::operator!=

Inequality operator

-

-Synopsis

+

Synopsis

Declared in <returns-from-special.cpp>
-
bool
-operator!=(X const& rhs) const;
+
+bool
+operator!=(X const& rhs) const;
+
-

-Return Value

+

Return Value

true if the objects are not equal, false otherwise
-

-Parameters

+

Parameters

@@ -477,29 +444,26 @@

-

-X::operator<# -

+

X::operator<

Less-than operator

-

-Synopsis

+

Synopsis

Declared in <returns-from-special.cpp>
-
bool
-operator<(X const& rhs) const;
+
+bool
+operator<(X const& rhs) const;
+
-

-Return Value

+

Return Value

true if the left object is less than the right object, false otherwise
-

-Parameters

+

Parameters

@@ -518,29 +482,26 @@

-

-X::operator<=# -

+

X::operator<=

Less-than-or-equal operator

-

-Synopsis

+

Synopsis

Declared in <returns-from-special.cpp>
-
bool
-operator<=(X const& rhs) const;
+
+bool
+operator<=(X const& rhs) const;
+
-

-Return Value

+

Return Value

true if the left object is less than or equal to the right object, false otherwise
-

-Parameters

+

Parameters

@@ -559,29 +520,26 @@

-

-X::operator># -

+

X::operator>

Greater-than operator

-

-Synopsis

+

Synopsis

Declared in <returns-from-special.cpp>
-
bool
-operator>(X const& rhs) const;
+
+bool
+operator>(X const& rhs) const;
+
-

-Return Value

+

Return Value

true if the left object is greater than the right object, false otherwise
-

-Parameters

+

Parameters

@@ -600,29 +558,26 @@

-

-X::operator>=# -

+

X::operator>=

Greater-than-or-equal operator

-

-Synopsis

+

Synopsis

Declared in <returns-from-special.cpp>
-
bool
-operator>=(X const& rhs) const;
+
+bool
+operator>=(X const& rhs) const;
+
-

-Return Value

+

Return Value

true if the left object is greater than or equal to the right object, false otherwise
-

-Parameters

+

Parameters

@@ -641,29 +596,26 @@

-

-X::operator<=># -

+

X::operator<=>

Three-way comparison operator

-

-Synopsis

+

Synopsis

Declared in <returns-from-special.cpp>
-
auto
-operator<=>(X const& rhs) const;
+
+auto
+operator<=>(X const& rhs) const;
+
-

-Return Value

+

Return Value

The relative order of the objects
-

-Parameters

+

Parameters

@@ -682,25 +634,23 @@

-

-ostream# -

+

ostream

A fake output stream

-

-Synopsis

+

Synopsis

Declared in <returns-from-special.cpp>
-
struct ostream;
+
+struct ostream;
+
-

-Non-Member Functions

+

Non-Member Functions

@@ -716,31 +666,28 @@

-

-operator<<# -

+

operator<<

Stream insertion operator

-

-Synopsis

+

Synopsis

Declared in <returns-from-special.cpp>
-
ostream&
+
+ostream&
 operator<<(
     ostream& os,
-    A const& value);
+ A const& value);
+
-

-Return Value

+

Return Value

Reference to the current output stream
-

-Parameters

+

Parameters

@@ -763,29 +710,26 @@

-

-operator!# -

+

operator!

Negation operator

-

-Synopsis

+

Synopsis

Declared in <returns-from-special.cpp>
-
bool
-operator!(A const& value);
+
+bool
+operator!(A const& value);
+
-

-Return Value

+

Return Value

true if the object is falsy, false otherwise
-

-Parameters

+

Parameters

@@ -804,31 +748,28 @@

-

-operator==# -

+

operator==

Equality operator

-

-Synopsis

+

Synopsis

Declared in <returns-from-special.cpp>
-
bool
+
+bool
 operator==(
     A const& lhs,
-    A const& rhs);
+ A const& rhs);
+
-

-Return Value

+

Return Value

true if the objects are equal, false otherwise
-

-Parameters

+

Parameters

@@ -851,31 +792,28 @@

-

-operator!=# -

+

operator!=

Inequality operator

-

-Synopsis

+

Synopsis

Declared in <returns-from-special.cpp>
-
bool
+
+bool
 operator!=(
     A const& lhs,
-    A const& rhs);
+ A const& rhs);
+
-

-Return Value

+

Return Value

true if the objects are not equal, false otherwise
-

-Parameters

+

Parameters

@@ -898,31 +836,28 @@

-

-operator<# -

+

operator<

Less-than operator

-

-Synopsis

+

Synopsis

Declared in <returns-from-special.cpp>
-
bool
+
+bool
 operator<(
     A const& lhs,
-    A const& rhs);
+ A const& rhs);
+
-

-Return Value

+

Return Value

true if the left object is less than the right object, false otherwise
-

-Parameters

+

Parameters

@@ -945,31 +880,28 @@

-

-operator<=# -

+

operator<=

Less-than-or-equal operator

-

-Synopsis

+

Synopsis

Declared in <returns-from-special.cpp>
-
bool
+
+bool
 operator<=(
     A const& lhs,
-    A const& rhs);
+ A const& rhs);
+
-

-Return Value

+

Return Value

true if the left object is less than or equal to the right object, false otherwise
-

-Parameters

+

Parameters

@@ -992,31 +924,28 @@

-

-operator># -

+

operator>

Greater-than operator

-

-Synopsis

+

Synopsis

Declared in <returns-from-special.cpp>
-
bool
+
+bool
 operator>(
     A const& lhs,
-    A const& rhs);
+ A const& rhs);
+
-

-Return Value

+

Return Value

true if the left object is greater than the right object, false otherwise
-

-Parameters

+

Parameters

@@ -1039,31 +968,28 @@

-

-operator>=# -

+

operator>=

Greater-than-or-equal operator

-

-Synopsis

+

Synopsis

Declared in <returns-from-special.cpp>
-
bool
+
+bool
 operator>=(
     A const& lhs,
-    A const& rhs);
+ A const& rhs);
+
-

-Return Value

+

Return Value

true if the left object is greater than or equal to the right object, false otherwise
-

-Parameters

+

Parameters

@@ -1086,31 +1012,28 @@

-

-operator<=># -

+

operator<=>

Three-way comparison operator

-

-Synopsis

+

Synopsis

Declared in <returns-from-special.cpp>
-
auto
+
+auto
 operator<=>(
     A const& lhs,
-    A const& rhs);
+ A const& rhs);
+
-

-Return Value

+

Return Value

The relative order of the objects
-

-Parameters

+

Parameters

@@ -1133,8 +1056,8 @@

- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/auto-relates/auto-relates.html b/test-files/golden-tests/config/auto-relates/auto-relates.html index ea5ba7a62a..0b600d9858 100644 --- a/test-files/golden-tests/config/auto-relates/auto-relates.html +++ b/test-files/golden-tests/config/auto-relates/auto-relates.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Types

+

Types

@@ -26,8 +22,7 @@

-

-Functions

+

Functions

@@ -48,25 +43,23 @@

-

-A# -

+

A

A class with non-member functions

-

-Synopsis

+

Synopsis

Declared in <auto-relates.cpp>
-
class A;
+
+class A;
+
-

-Non-Member Functions

+

Non-Member Functions

@@ -87,116 +80,110 @@

-

-f1# -

+

f1

A non-member function of A

-

-Synopsis

+

Synopsis

Declared in <auto-relates.cpp>
-
void
-f1(A);
+
+void
+f1(A);
+
-

-f2# -

+

f2

A non-member function of A

-

-Synopsis

+

Synopsis

Declared in <auto-relates.cpp>
-
void
-f2(A&);
+
+void
+f2(A&);
+
-

-f3# -

+

f3

A non-member function of A

-

-Synopsis

+

Synopsis

Declared in <auto-relates.cpp>
-
void
-f3(A const&);
+
+void
+f3(A const&);
+
-

-f4# -

+

f4

A non-member function of A

-

-Synopsis

+

Synopsis

Declared in <auto-relates.cpp>
-
void
-f4(A*);
+
+void
+f4(A*);
+
-

-f5# -

+

f5

A non-member function of A

-

-Synopsis

+

Synopsis

Declared in <auto-relates.cpp>
-
void
-f5(A const*);
+
+void
+f5(A const*);
+
-

-f6# -

+

f6

A non-member function of A

-

-Synopsis

+

Synopsis

Declared in <auto-relates.cpp>
-
void
-f6(A const*);
+
+void
+f6(A const*);
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/auto-relates/derived.adoc b/test-files/golden-tests/config/auto-relates/derived.adoc index 8f9fa99816..64ae3d641f 100644 --- a/test-files/golden-tests/config/auto-relates/derived.adoc +++ b/test-files/golden-tests/config/auto-relates/derived.adoc @@ -195,10 +195,6 @@ struct AView2 : link:#AView[AView] ---- -=== Description - -Used to test indirect derived classes - === Base Classes [cols="1,4"] @@ -227,6 +223,10 @@ Used to test indirect derived classes | A non‐member function of ABase |=== +=== Description + +Used to test indirect derived classes + [#f1] == f1 diff --git a/test-files/golden-tests/config/auto-relates/derived.html b/test-files/golden-tests/config/auto-relates/derived.html index 5add280ac0..1575c041c4 100644 --- a/test-files/golden-tests/config/auto-relates/derived.html +++ b/test-files/golden-tests/config/auto-relates/derived.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Types

+

Types

@@ -29,8 +25,7 @@

-

-Functions

+

Functions

@@ -51,24 +46,22 @@

-

-A# -

+

A

A concrete implementation for ABase

-

-Synopsis

+

Synopsis

Declared in <derived.cpp>
-
struct A
-    : ABase
+
+struct A
+    : ABase
+
-

-Base Classes

+

Base Classes

@@ -84,8 +77,7 @@

-

-Non-Member Functions

+

Non-Member Functions

@@ -105,25 +97,23 @@

-

-ABase# -

+

ABase

A base class for non-member functions

-

-Synopsis

+

Synopsis

Declared in <derived.cpp>
-
struct ABase;
+
+struct ABase;
+
-

-Non-Member Functions

+

Non-Member Functions

@@ -142,8 +132,7 @@

-

-Derived Classes

+

Derived Classes

@@ -162,24 +151,22 @@

-

-AView# -

+

AView

A view of A

-

-Synopsis

+

Synopsis

Declared in <derived.cpp>
-
struct AView
-    : ABase
+
+struct AView
+    : ABase
+
-

-Base Classes

+

Base Classes

@@ -195,8 +182,7 @@

-

-Non-Member Functions

+

Non-Member Functions

@@ -214,8 +200,7 @@

-

-Derived Classes

+

Derived Classes

@@ -232,29 +217,22 @@

-

-AView2# -

+

AView2

Another view of A

-

-Synopsis

+

Synopsis

Declared in <derived.cpp>
-
struct AView2
-    : AView
+
+struct AView2
+    : AView
+
-

-Description

-

Used to test indirect derived classes

-
-
-

-Base Classes

+

Base Classes

@@ -270,8 +248,7 @@

-

-Non-Member Functions

+

Non-Member Functions

@@ -288,119 +265,117 @@

+
+

Description

+

Used to test indirect derived classes

+
-

-f1# -

+

f1

A non-member function of ABase

-

-Synopsis

+

Synopsis

Declared in <derived.cpp>
-
void
-f1(ABase const&);
+
+void
+f1(ABase const&);
+
-

-f2# -

+

f2

A non-member function of ABase

-

-Synopsis

+

Synopsis

Declared in <derived.cpp>
-
void
-f2(ABase&);
+
+void
+f2(ABase&);
+
-

-f3# -

+

f3

A non-member function of ABase

-

-Synopsis

+

Synopsis

Declared in <derived.cpp>
-
void
-f3(ABase const*);
+
+void
+f3(ABase const*);
+
-

-f4# -

+

f4

A non-member function of ABase

-

-Synopsis

+

Synopsis

Declared in <derived.cpp>
-
void
-f4(ABase*);
+
+void
+f4(ABase*);
+
-

-f5# -

+

f5

A non-member function of ABase

-

-Synopsis

+

Synopsis

Declared in <derived.cpp>
-
void
-f5(ABase const*);
+
+void
+f5(ABase const*);
+
-

-n# -

+

n

A non-member function of ABase only

-

-Synopsis

+

Synopsis

Declared in <derived.cpp>
-
void
-n(ABase);
+
+void
+n(ABase);
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/auto-relates/enum.html b/test-files/golden-tests/config/auto-relates/enum.html index 2190592a3b..f898e4b1f3 100644 --- a/test-files/golden-tests/config/auto-relates/enum.html +++ b/test-files/golden-tests/config/auto-relates/enum.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Types

+

Types

@@ -27,8 +23,7 @@

-

-Enums

+

Enums

@@ -41,8 +36,7 @@

-

-Functions

+

Functions

@@ -60,26 +54,24 @@

-

-Result# -

+

Result

Helper result class

-

-Synopsis

+

Synopsis

Declared in <enum.cpp>
-
template<class T>
-class Result;
+
+template<class T>
+class Result;
+
-

-Non-Member Functions

+

Non-Member Functions

@@ -95,28 +87,26 @@

-

-SmallVector# -

+

SmallVector

Helper result class

-

-Synopsis

+

Synopsis

Declared in <enum.cpp>
-
template<
+
+template<
     class T,
     unsigned long N>
-class SmallVector;
+class SmallVector;
+
-

-Non-Member Functions

+

Non-Member Functions

@@ -132,23 +122,21 @@

-

-E# -

+

E

An enum with non-member functions

-

-Synopsis

+

Synopsis

Declared in <enum.cpp>
-
enum class E : int;
+
+enum class E : int;
+
-

-Non-Member Functions

+

Non-Member Functions

@@ -166,77 +154,71 @@

-

-makeE# -

+

makeE

Function that returns A

-

-Synopsis

+

Synopsis

Declared in <enum.cpp>
-
E
-makeE();
+
+E
+makeE();
+
-

-Return Value

+

Return Value

An instance of A
-

-makeEs# -

+

makeEs

Function that returns template on A

-

-Synopsis

+

Synopsis

Declared in <enum.cpp>
-
SmallVector<E, 3>
-makeEs();
+
+SmallVector<E, 3>
+makeEs();
+
-

-Return Value

+

Return Value

A vector of As
-

-tryMakeE# -

+

tryMakeE

Function that returns template on A

-

-Synopsis

+

Synopsis

Declared in <enum.cpp>
-
Result<E>
-tryMakeE();
+
+Result<E>
+tryMakeE();
+
-

-Return Value

+

Return Value

An instance of A or an error
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/auto-relates/no-auto-relates.html b/test-files/golden-tests/config/auto-relates/no-auto-relates.html index d15789ff43..08bba0d164 100644 --- a/test-files/golden-tests/config/auto-relates/no-auto-relates.html +++ b/test-files/golden-tests/config/auto-relates/no-auto-relates.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Types

+

Types

@@ -26,8 +22,7 @@

-

-Functions

+

Functions

@@ -48,135 +43,128 @@

-

-A# -

+

A

A class with non-member functions

-

-Synopsis

+

Synopsis

Declared in <no-auto-relates.cpp>
-
class A;
+
+class A;
+
-

-f1# -

+

f1

A non-member function of A

-

-Synopsis

+

Synopsis

Declared in <no-auto-relates.cpp>
-
void
-f1(A);
+
+void
+f1(A);
+
-

-f2# -

+

f2

A non-member function of A

-

-Synopsis

+

Synopsis

Declared in <no-auto-relates.cpp>
-
void
-f2(A&);
+
+void
+f2(A&);
+
-

-f3# -

+

f3

A non-member function of A

-

-Synopsis

+

Synopsis

Declared in <no-auto-relates.cpp>
-
void
-f3(A const&);
+
+void
+f3(A const&);
+
-

-f4# -

+

f4

A non-member function of A

-

-Synopsis

+

Synopsis

Declared in <no-auto-relates.cpp>
-
void
-f4(A*);
+
+void
+f4(A*);
+
-

-f5# -

+

f5

A non-member function of A

-

-Synopsis

+

Synopsis

Declared in <no-auto-relates.cpp>
-
void
-f5(A const*);
+
+void
+f5(A const*);
+
-

-f6# -

+

f6

A non-member function of A

-

-Synopsis

+

Synopsis

Declared in <no-auto-relates.cpp>
-
void
-f6(A const*);
+
+void
+f6(A const*);
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/auto-relates/qualified.html b/test-files/golden-tests/config/auto-relates/qualified.html index e7137594f2..271fb582f1 100644 --- a/test-files/golden-tests/config/auto-relates/qualified.html +++ b/test-files/golden-tests/config/auto-relates/qualified.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Namespaces

+

Namespaces

@@ -27,8 +23,7 @@

-

-Types

+

Types

@@ -41,8 +36,7 @@

-

-Functions

+

Functions

@@ -59,12 +53,9 @@

-

-N# -

+

N

-

-Namespaces

+

Namespaces

@@ -77,8 +68,7 @@

-

-Types

+

Types

@@ -91,8 +81,7 @@

-

-Functions

+

Functions

@@ -109,12 +98,9 @@

-

-N::M# -

+

N::M

-

-Functions

+

Functions

@@ -130,43 +116,40 @@

-

-N::M::f4# -

+

N::M::f4

A non-member function of ::N::B

-

-Synopsis

+

Synopsis

Declared in <qualified.cpp>
-
void
-f4(N::B const&);
+
+void
+f4(N::B const&);
+
-

-N::B# -

+

N::B

A nested class with non-member functions

-

-Synopsis

+

Synopsis

Declared in <qualified.cpp>
-
struct B;
+
+struct B;
+
-

-Non-Member Functions

+

Non-Member Functions

@@ -185,48 +168,43 @@

-

-N::f2# -

+

N::f2

A non-member function of A

-

-Synopsis

+

Synopsis

Declared in <qualified.cpp>
-
void
-f2(A&);
+
+void
+f2(A&);
+
-

-N::f3# -

+

N::f3

A non-member function of B

-

-Synopsis

+

Synopsis

Declared in <qualified.cpp>
-
void
-f3(N::B const&);
+
+void
+f3(N::B const&);
+
-

-O# -

+

O

-

-Functions

+

Functions

@@ -242,43 +220,40 @@

-

-O::f6# -

+

O::f6

A non-member function of ::N::B

-

-Synopsis

+

Synopsis

Declared in <qualified.cpp>
-
void
-f6(N::B const&);
+
+void
+f6(N::B const&);
+
-

-A# -

+

A

A class with non-member functions

-

-Synopsis

+

Synopsis

Declared in <qualified.cpp>
-
struct A;
+
+struct A;
+
-

-Non-Member Functions

+

Non-Member Functions

@@ -295,44 +270,42 @@

-

-f1# -

+

f1

A non-member function of A

-

-Synopsis

+

Synopsis

Declared in <qualified.cpp>
-
void
-f1(A const&);
+
+void
+f1(A const&);
+
-

-f5# -

+

f5

A non-member function of ::N::B

-

-Synopsis

+

Synopsis

Declared in <qualified.cpp>
-
void
-f5(N::B const&);
+
+void
+f5(N::B const&);
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/auto-relates/remove-friend.html b/test-files/golden-tests/config/auto-relates/remove-friend.html index ae74d6c3e4..76a7d64f81 100644 --- a/test-files/golden-tests/config/auto-relates/remove-friend.html +++ b/test-files/golden-tests/config/auto-relates/remove-friend.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Types

+

Types

@@ -26,8 +22,7 @@

-

-Functions

+

Functions

@@ -44,25 +39,23 @@

-

-A# -

+

A

A record with non-member functions

-

-Synopsis

+

Synopsis

Declared in <remove-friend.cpp>
-
class A;
+
+class A;
+
-

-Friends

+

Friends

@@ -80,8 +73,7 @@

-

-Non-Member Functions

+

Non-Member Functions

@@ -97,29 +89,26 @@

-

-to_string# -

+

to_string

Non-member function of A

-

-Synopsis

+

Synopsis

Declared in <remove-friend.cpp>
-
char const*
-to_string(A const& a);
+
+char const*
+to_string(A const& a);
+
-

-Return Value

+

Return Value

The string representation of the object
-

-Parameters

+

Parameters

@@ -138,36 +127,32 @@

-

-operator==# -

+

operator==

Friend function not listed as non-member

-

-Synopsis

+

Synopsis

Declared in <remove-friend.cpp>
-
bool
+
+bool
 operator==(
     A const& lhs,
-    A const& rhs);
+ A const& rhs);
+
-

-Description

+

Description

Friends are already listed in the class definition.

-

-Return Value

+

Return Value

true if the objects are equal
-

-Parameters

+

Parameters

@@ -190,8 +175,8 @@

- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/auto-relates/return-type.html b/test-files/golden-tests/config/auto-relates/return-type.html index 6d46856177..ace0c99b14 100644 --- a/test-files/golden-tests/config/auto-relates/return-type.html +++ b/test-files/golden-tests/config/auto-relates/return-type.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Types

+

Types

@@ -28,8 +24,7 @@

-

-Functions

+

Functions

@@ -47,25 +42,23 @@

-

-A# -

+

A

A class with non-member functions

-

-Synopsis

+

Synopsis

Declared in <return-type.cpp>
-
class A;
+
+class A;
+
-

-Non-Member Functions

+

Non-Member Functions

@@ -83,26 +76,24 @@

-

-Result# -

+

Result

Helper result class

-

-Synopsis

+

Synopsis

Declared in <return-type.cpp>
-
template<class T>
-class Result;
+
+template<class T>
+class Result;
+
-

-Non-Member Functions

+

Non-Member Functions

@@ -118,28 +109,26 @@

-

-SmallVector# -

+

SmallVector

Helper result class

-

-Synopsis

+

Synopsis

Declared in <return-type.cpp>
-
template<
+
+template<
     class T,
     unsigned long N>
-class SmallVector;
+class SmallVector;
+
-

-Non-Member Functions

+

Non-Member Functions

@@ -155,77 +144,71 @@

-

-makeA# -

+

makeA

Function that returns A

-

-Synopsis

+

Synopsis

Declared in <return-type.cpp>
-
A
-makeA();
+
+A
+makeA();
+
-

-Return Value

+

Return Value

An instance of A
-

-makeAs# -

+

makeAs

Function that returns template on A

-

-Synopsis

+

Synopsis

Declared in <return-type.cpp>
-
SmallVector<A, 3>
-makeAs();
+
+SmallVector<A, 3>
+makeAs();
+
-

-Return Value

+

Return Value

A vector of As
-

-tryMakeA# -

+

tryMakeA

Function that returns template on A

-

-Synopsis

+

Synopsis

Declared in <return-type.cpp>
-
Result<A>
-tryMakeA();
+
+Result<A>
+tryMakeA();
+
-

-Return Value

+

Return Value

An instance of A or an error
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/extract-all/no-extract-all.html b/test-files/golden-tests/config/extract-all/no-extract-all.html index 5dd5a3c767..b065c31d51 100644 --- a/test-files/golden-tests/config/extract-all/no-extract-all.html +++ b/test-files/golden-tests/config/extract-all/no-extract-all.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Functions

+

Functions

@@ -30,44 +26,42 @@

-

-docFunction# -

+

docFunction

Documented function

-

-Synopsis

+

Synopsis

Declared in <no-extract-all.cpp>
-
void
-docFunction();
+
+void
+docFunction();
+
-

-sometimesDocFunction# -

+

sometimesDocFunction

Sometimes documented function

-

-Synopsis

+

Synopsis

Declared in <no-extract-all.cpp>
-
void
-sometimesDocFunction();
+
+void
+sometimesDocFunction();
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/extract-empty-namespaces/no-extract-empty-namespaces.html b/test-files/golden-tests/config/extract-empty-namespaces/no-extract-empty-namespaces.html index 62796308e6..3a38f8cf5e 100644 --- a/test-files/golden-tests/config/extract-empty-namespaces/no-extract-empty-namespaces.html +++ b/test-files/golden-tests/config/extract-empty-namespaces/no-extract-empty-namespaces.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Namespaces

+

Namespaces

@@ -30,8 +26,7 @@

-

-Namespace Aliases

+

Namespace Aliases

@@ -46,8 +41,7 @@

-

-Using Namespace Directives

+

Using Namespace Directives

@@ -66,9 +60,7 @@

-

-documented_ns# -

+

documented_ns

Namespace documentation

@@ -76,15 +68,12 @@

-

-mixed_ns# -

+

mixed_ns

Should decay to see-below

-

-Types

+

Types

@@ -100,31 +89,27 @@

-

-mixed_ns::SeeBelowStructA# -

+

mixed_ns::SeeBelowStructA

-

-Synopsis

+

Synopsis

Declared in <no-extract-empty-namespaces.cpp>
-
struct SeeBelowStructA { /* see-below */ };
+
+struct SeeBelowStructA { /* see-below */ };
+
-

-mixed_regular_ns# -

+

mixed_regular_ns

Should decay to regular

-

-Types

+

Types

@@ -141,47 +126,42 @@

-

-mixed_regular_ns::RegularStructA# -

+

mixed_regular_ns::RegularStructA

-

-Synopsis

+

Synopsis

Declared in <no-extract-empty-namespaces.cpp>
-
struct RegularStructA;
+
+struct RegularStructA;
+
-

-mixed_regular_ns::SeeBelowStructB# -

+

mixed_regular_ns::SeeBelowStructB

-

-Synopsis

+

Synopsis

Declared in <no-extract-empty-namespaces.cpp>
-
struct SeeBelowStructB { /* see-below */ };
+
+struct SeeBelowStructB { /* see-below */ };
+
-

-regular_ns# -

+

regular_ns

Regular namespace

-

-Types

+

Types

@@ -197,31 +177,27 @@

-

-regular_ns::A# -

+

regular_ns::A

-

-Synopsis

+

Synopsis

Declared in <no-extract-empty-namespaces.cpp>
-
struct A;
+
+struct A;
+
-

-see_below_ns# -

+

see_below_ns

Should decay to see-below

-

-Types

+

Types

@@ -238,74 +214,70 @@

-

-see_below_ns::SeeBelowStructA# -

+

see_below_ns::SeeBelowStructA

-

-Synopsis

+

Synopsis

Declared in <no-extract-empty-namespaces.cpp>
-
struct SeeBelowStructA { /* see-below */ };
+
+struct SeeBelowStructA { /* see-below */ };
+
-

-see_below_ns::SeeBelowStructB# -

+

see_below_ns::SeeBelowStructB

-

-Synopsis

+

Synopsis

Declared in <no-extract-empty-namespaces.cpp>
-
struct SeeBelowStructB { /* see-below */ };
+
+struct SeeBelowStructB { /* see-below */ };
+
-

-empty_ns_alias# -

+

empty_ns_alias

Should still work

-

-Synopsis

+

Synopsis

Declared in <no-extract-empty-namespaces.cpp>
-
namespace empty_ns_alias = empty_ns;
+
+namespace empty_ns_alias = empty_ns;
+
-

-regular_ns_alias# -

+

regular_ns_alias

Should work

-

-Synopsis

+

Synopsis

Declared in <no-extract-empty-namespaces.cpp>
-
namespace regular_ns_alias = regular_ns;
+
+namespace regular_ns_alias = regular_ns;
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/extract-friends/extract-friends.html b/test-files/golden-tests/config/extract-friends/extract-friends.html index a9eb01f377..adaeb360ff 100644 --- a/test-files/golden-tests/config/extract-friends/extract-friends.html +++ b/test-files/golden-tests/config/extract-friends/extract-friends.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Namespaces

+

Namespaces

@@ -26,8 +22,7 @@

-

-Types

+

Types

@@ -43,12 +38,9 @@

-

-std# -

+

std

-

-Types

+

Types

@@ -65,37 +57,34 @@

-

-std::hash# -

+

std::hash

-

-Synopsis

+

Synopsis

Declared in <extract-friends.cpp>
-
template<class T>
-class hash;
+
+template<class T>
+class hash;
+
-

-std::hash<A># -

+

std::hash<A>

-

-Synopsis

+

Synopsis

Declared in <extract-friends.cpp>
-
template<>
-class hash<A>;
+
+template<>
+class hash<A>;
+
-

-Member Functions

+

Member Functions

@@ -113,37 +102,34 @@

-

-std::hash<A>::operator()# -

+

std::hash<A>::operator()

-

-Synopsis

+

Synopsis

Declared in <extract-friends.cpp>
-
unsigned long long
-operator()(A const& rhs) const noexcept;
+
+unsigned long long
+operator()(A const& rhs) const noexcept;
+
-

-A# -

+

A

-

-Synopsis

+

Synopsis

Declared in <extract-friends.cpp>
-
class A;
+
+class A;
+
-

-Friends

+

Friends

@@ -163,8 +149,8 @@

- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/extract-friends/no-extract-friends.html b/test-files/golden-tests/config/extract-friends/no-extract-friends.html index c0f9e09e7d..3fd1f45eca 100644 --- a/test-files/golden-tests/config/extract-friends/no-extract-friends.html +++ b/test-files/golden-tests/config/extract-friends/no-extract-friends.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Namespaces

+

Namespaces

@@ -26,8 +22,7 @@

-

-Types

+

Types

@@ -43,12 +38,9 @@

-

-std# -

+

std

-

-Types

+

Types

@@ -65,37 +57,34 @@

-

-std::hash# -

+

std::hash

-

-Synopsis

+

Synopsis

Declared in <no-extract-friends.cpp>
-
template<class T>
-class hash;
+
+template<class T>
+class hash;
+
-

-std::hash<A># -

+

std::hash<A>

-

-Synopsis

+

Synopsis

Declared in <no-extract-friends.cpp>
-
template<>
-class hash<A>;
+
+template<>
+class hash<A>;
+
-

-Member Functions

+

Member Functions

@@ -113,39 +102,37 @@

-

-std::hash<A>::operator()# -

+

std::hash<A>::operator()

-

-Synopsis

+

Synopsis

Declared in <no-extract-friends.cpp>
-
unsigned long long
-operator()(A const& rhs) const noexcept;
+
+unsigned long long
+operator()(A const& rhs) const noexcept;
+
-

-A# -

+

A

-

-Synopsis

+

Synopsis

Declared in <no-extract-friends.cpp>
-
class A;
+
+class A;
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/extract-implicit-specializations/base.html b/test-files/golden-tests/config/extract-implicit-specializations/base.html index d0f3d74e4d..3e46df8843 100644 --- a/test-files/golden-tests/config/extract-implicit-specializations/base.html +++ b/test-files/golden-tests/config/extract-implicit-specializations/base.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Types

+

Types

@@ -30,21 +26,19 @@

-

-A# -

+

A

-

-Synopsis

+

Synopsis

Declared in <base.cpp>
-
struct A
-    : B
+
+struct A
+    : B
+
-

-Base Classes

+

Base Classes

@@ -57,8 +51,7 @@

-

-Member Functions

+

Member Functions

@@ -76,19 +69,17 @@

-

-B# -

+

B

-

-Synopsis

+

Synopsis

Declared in <base.cpp>
-
struct B;
+
+struct B;
+
-

-Member Functions

+

Member Functions

@@ -104,8 +95,7 @@

-

-Derived Classes

+

Derived Classes

@@ -122,23 +112,22 @@

-

-B::value# -

+

B::value

-

-Synopsis

+

Synopsis

Declared in <base.cpp>
-
int
-value();
+
+int
+value();
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/extract-implicit-specializations/extract-implicit-specializations.html b/test-files/golden-tests/config/extract-implicit-specializations/extract-implicit-specializations.html index 6b956b5f6b..6ab21a4969 100644 --- a/test-files/golden-tests/config/extract-implicit-specializations/extract-implicit-specializations.html +++ b/test-files/golden-tests/config/extract-implicit-specializations/extract-implicit-specializations.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Types

+

Types

@@ -30,21 +26,19 @@

-

-A# -

+

A

-

-Synopsis

+

Synopsis

Declared in <extract-implicit-specializations.cpp>
-
struct A
-    : B<int>
+
+struct A
+    : B<int>
+
-

-Base Classes

+

Base Classes

@@ -57,8 +51,7 @@

-

-Member Functions

+

Member Functions

@@ -76,35 +69,32 @@

-

-A::value# -

+

A::value

-

-Synopsis

+

Synopsis

Declared in <extract-implicit-specializations.cpp>
-
int&
-value();
+
+int&
+value();
+
-

-B# -

+

B

-

-Synopsis

+

Synopsis

Declared in <extract-implicit-specializations.cpp>
-
template<typename T>
-struct B;
+
+template<typename T>
+struct B;
+
-

-Member Functions

+

Member Functions

@@ -120,8 +110,7 @@

-

-Derived Classes

+

Derived Classes

@@ -138,23 +127,22 @@

-

-B::value# -

+

B::value

-

-Synopsis

+

Synopsis

Declared in <extract-implicit-specializations.cpp>
-
T&
-value();
+
+T&
+value();
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/extract-implicit-specializations/no-extract-implicit-specializations.html b/test-files/golden-tests/config/extract-implicit-specializations/no-extract-implicit-specializations.html index e4d985535d..643b47916a 100644 --- a/test-files/golden-tests/config/extract-implicit-specializations/no-extract-implicit-specializations.html +++ b/test-files/golden-tests/config/extract-implicit-specializations/no-extract-implicit-specializations.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Types

+

Types

@@ -30,21 +26,19 @@

-

-A# -

+

A

-

-Synopsis

+

Synopsis

Declared in <no-extract-implicit-specializations.cpp>
-
struct A
-    : B<int>
+
+struct A
+    : B<int>
+
-

-Base Classes

+

Base Classes

@@ -57,8 +51,7 @@

-

-Member Functions

+

Member Functions

@@ -76,20 +69,18 @@

-

-B# -

+

B

-

-Synopsis

+

Synopsis

Declared in <no-extract-implicit-specializations.cpp>
-
template<typename T>
-struct B;
+
+template<typename T>
+struct B;
+
-

-Member Functions

+

Member Functions

@@ -105,8 +96,7 @@

-

-Derived Classes

+

Derived Classes

@@ -123,23 +113,22 @@

-

-B::value# -

+

B::value

-

-Synopsis

+

Synopsis

Declared in <no-extract-implicit-specializations.cpp>
-
T&
-value();
+
+T&
+value();
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/extract-local-classes/extract-local-classes.html b/test-files/golden-tests/config/extract-local-classes/extract-local-classes.html index 6fd43b3a8a..3dc82446de 100644 --- a/test-files/golden-tests/config/extract-local-classes/extract-local-classes.html +++ b/test-files/golden-tests/config/extract-local-classes/extract-local-classes.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Types

+

Types

@@ -27,8 +23,7 @@

-

-Functions

+

Functions

@@ -44,55 +39,52 @@

-

-local_class# -

+

local_class

-

-Synopsis

+

Synopsis

Declared in <extract-local-classes.cpp>
-
class local_class;
+
+class local_class;
+
-

-local_struct# -

+

local_struct

-

-Synopsis

+

Synopsis

Declared in <extract-local-classes.cpp>
-
struct local_struct;
+
+struct local_struct;
+
-

-local_function# -

+

local_function

-

-Synopsis

+

Synopsis

Declared in <extract-local-classes.cpp>
-
void
-local_function();
+
+void
+local_function();
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/extract-local-classes/no-extract-local-classes.html b/test-files/golden-tests/config/extract-local-classes/no-extract-local-classes.html index 9daadb4d5c..9e4ff6f336 100644 --- a/test-files/golden-tests/config/extract-local-classes/no-extract-local-classes.html +++ b/test-files/golden-tests/config/extract-local-classes/no-extract-local-classes.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Functions

+

Functions

@@ -29,23 +25,22 @@

-

-local_function# -

+

local_function

-

-Synopsis

+

Synopsis

Declared in <no-extract-local-classes.cpp>
-
void
-local_function();
+
+void
+local_function();
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/extract-private-virtual/extract-private-virtual.html b/test-files/golden-tests/config/extract-private-virtual/extract-private-virtual.html index 703ea9267f..e74a6ff894 100644 --- a/test-files/golden-tests/config/extract-private-virtual/extract-private-virtual.html +++ b/test-files/golden-tests/config/extract-private-virtual/extract-private-virtual.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Types

+

Types

@@ -29,19 +25,17 @@

-

-A# -

+

A

-

-Synopsis

+

Synopsis

Declared in <extract-private-virtual.cpp>
-
class A;
+
+class A;
+
-

-Member Functions

+

Member Functions

@@ -56,8 +50,7 @@

-

-Private Member Functions

+

Private Member Functions

@@ -73,40 +66,38 @@

-

-A::f# -

+

A::f

-

-Synopsis

+

Synopsis

Declared in <extract-private-virtual.cpp>
-
virtual
+
+virtual
 void
-f();
+f();
+
-

-A::g# -

+

A::g

-

-Synopsis

+

Synopsis

Declared in <extract-private-virtual.cpp>
-
virtual
+
+virtual
 void
-g();
+g();
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/extract-private-virtual/no-extract-private-virtual.html b/test-files/golden-tests/config/extract-private-virtual/no-extract-private-virtual.html index 31e1f65db8..8bdd2cb9fa 100644 --- a/test-files/golden-tests/config/extract-private-virtual/no-extract-private-virtual.html +++ b/test-files/golden-tests/config/extract-private-virtual/no-extract-private-virtual.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Types

+

Types

@@ -29,19 +25,17 @@

-

-A# -

+

A

-

-Synopsis

+

Synopsis

Declared in <no-extract-private-virtual.cpp>
-
class A;
+
+class A;
+
-

-Member Functions

+

Member Functions

@@ -59,24 +53,23 @@

-

-A::f# -

+

A::f

-

-Synopsis

+

Synopsis

Declared in <no-extract-private-virtual.cpp>
-
virtual
+
+virtual
 void
-f();
+f();
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/include-symbols/global-symbol-excluded.adoc b/test-files/golden-tests/config/include-symbols/global-symbol-excluded.adoc deleted file mode 100644 index 4d145002a0..0000000000 --- a/test-files/golden-tests/config/include-symbols/global-symbol-excluded.adoc +++ /dev/null @@ -1,45 +0,0 @@ -= Reference -:mrdocs: - -[#index] -== Global namespace - -=== Namespaces - -[cols="1,4"] -|=== -| Name| Description -| link:#mrdocs[`mrdocs`] -| Included namespace -|=== - -[#mrdocs] -== mrdocs - -Included namespace - -=== Types - -[cols="1,4"] -|=== -| Name| Description -| link:#mrdocs-Foo[`Foo`] -| Included record -|=== - -[#mrdocs-Foo] -== link:#mrdocs[mrdocs]::Foo - -Included record - -=== Synopsis - -Declared in `<global‐symbol‐excluded.cpp>` - -[source,cpp,subs="verbatim,replacements,macros,-callouts"] ----- -struct Foo; ----- - - -[.small]#Created with https://www.mrdocs.com[MrDocs]# diff --git a/test-files/golden-tests/config/include-symbols/global-symbol-excluded.cpp b/test-files/golden-tests/config/include-symbols/global-symbol-excluded.cpp deleted file mode 100644 index 953d8d4874..0000000000 --- a/test-files/golden-tests/config/include-symbols/global-symbol-excluded.cpp +++ /dev/null @@ -1,9 +0,0 @@ -// Regression test for #1121: limiting include-symbols to a namespace should -// not extract global symbols that do not match the pattern. -struct Baz {}; - -/// Included namespace -namespace mrdocs { -/// Included record -struct Foo {}; -} // namespace mrdocs diff --git a/test-files/golden-tests/config/include-symbols/global-symbol-excluded.html b/test-files/golden-tests/config/include-symbols/global-symbol-excluded.html deleted file mode 100644 index 0d079f174f..0000000000 --- a/test-files/golden-tests/config/include-symbols/global-symbol-excluded.html +++ /dev/null @@ -1,79 +0,0 @@ - - -Reference - - - -
-

Reference

-
-
-

-Global Namespace# -

-
-

-Namespaces

-

- - - - - - - - - -
NameDescription
mrdocs Included namespace
- - -
-
-

-mrdocs# -

-
-

Included namespace

-
-
-

-Types

- - - - - - - - - - -
NameDescription
Foo Included record
- -
-
-
-

-mrdocs::Foo# -

-
-

Included record

-
-
-
-

-Synopsis

-
-Declared in <global-symbol-excluded.cpp>
-
struct Foo;
-
- - -
- - - - - \ No newline at end of file diff --git a/test-files/golden-tests/config/include-symbols/global-symbol-excluded.xml b/test-files/golden-tests/config/include-symbols/global-symbol-excluded.xml deleted file mode 100644 index c7cc9199c0..0000000000 --- a/test-files/golden-tests/config/include-symbols/global-symbol-excluded.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - Included namespace - - - - - - - Included record - - - - - - diff --git a/test-files/golden-tests/config/include-symbols/global-symbol-excluded.yml b/test-files/golden-tests/config/include-symbols/global-symbol-excluded.yml deleted file mode 100644 index 57d9c56db4..0000000000 --- a/test-files/golden-tests/config/include-symbols/global-symbol-excluded.yml +++ /dev/null @@ -1,2 +0,0 @@ -include-symbols: - - 'mrdocs::**' diff --git a/test-files/golden-tests/config/include-symbols/using-external-base-docs.adoc b/test-files/golden-tests/config/include-symbols/using-external-base-docs.adoc deleted file mode 100644 index fff40cfa14..0000000000 --- a/test-files/golden-tests/config/include-symbols/using-external-base-docs.adoc +++ /dev/null @@ -1,8 +0,0 @@ -= Reference -:mrdocs: - -[#index] -== Global namespace - - -[.small]#Created with https://www.mrdocs.com[MrDocs]# diff --git a/test-files/golden-tests/config/include-symbols/using-external-base-docs.cpp b/test-files/golden-tests/config/include-symbols/using-external-base-docs.cpp deleted file mode 100644 index c972158553..0000000000 --- a/test-files/golden-tests/config/include-symbols/using-external-base-docs.cpp +++ /dev/null @@ -1,17 +0,0 @@ -// Regression test for #1119: inheriting from an excluded/external base class -// must not emit missing-documentation diagnostics for the base members. -// The YAML config for this fixture only includes an unrelated namespace, so -// `ns::Foo` is external; Baz inherits it and should not trigger diagnostics. -namespace ns { -struct Foo { - /// bar - int - bar(); -}; -} // namespace ns - -/// project namespace -namespace mrdocs { -/// Baz -struct Baz : ns::Foo {}; -} // namespace mrdocs diff --git a/test-files/golden-tests/config/include-symbols/using-external-base-docs.html b/test-files/golden-tests/config/include-symbols/using-external-base-docs.html deleted file mode 100644 index e583553dba..0000000000 --- a/test-files/golden-tests/config/include-symbols/using-external-base-docs.html +++ /dev/null @@ -1,22 +0,0 @@ - - -Reference - - - -
-

Reference

-
-
-

-Global Namespace# -

-
-
- -
- - - \ No newline at end of file diff --git a/test-files/golden-tests/config/include-symbols/using-external-base-docs.xml b/test-files/golden-tests/config/include-symbols/using-external-base-docs.xml deleted file mode 100644 index fd4dc6e6d5..0000000000 --- a/test-files/golden-tests/config/include-symbols/using-external-base-docs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - diff --git a/test-files/golden-tests/config/include-symbols/using-external-base-docs.yml b/test-files/golden-tests/config/include-symbols/using-external-base-docs.yml deleted file mode 100644 index d640148ac0..0000000000 --- a/test-files/golden-tests/config/include-symbols/using-external-base-docs.yml +++ /dev/null @@ -1,2 +0,0 @@ -include-symbols: - - 'foobar::**' diff --git a/test-files/golden-tests/config/inherit-base-members/base-overload-set.html b/test-files/golden-tests/config/inherit-base-members/base-overload-set.html index c182ed9b7a..cafd1e0298 100644 --- a/test-files/golden-tests/config/inherit-base-members/base-overload-set.html +++ b/test-files/golden-tests/config/inherit-base-members/base-overload-set.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Types

+

Types

@@ -31,21 +27,19 @@

-

-Base# -

+

Base

-

-Synopsis

+

Synopsis

Declared in <base-overload-set.cpp>
-
class Base
-    : public ConstBase
+
+class Base
+    : public ConstBase
+
-

-Base Classes

+

Base Classes

@@ -58,8 +52,7 @@

-

-Member Functions

+

Member Functions

@@ -75,8 +68,7 @@

-

-Derived Classes

+

Derived Classes

@@ -93,74 +85,70 @@

-

-Base::foo# -

+

Base::foo

-

-Synopses

+

Synopses

Declared in <base-overload-set.cpp>
-
int&
-foo();
-Β» more... +
+int&
+foo();
+
Β» more... -
int&
-foo() const;
-Β» more... +
+int&
+foo() const;
+
Β» more... +
-

-Base::foo# -

+

Base::foo

-

-Synopsis

+

Synopsis

Declared in <base-overload-set.cpp>
-
int&
-foo();
+
+int&
+foo();
+
-

-Base::foo# -

+

Base::foo

-

-Synopsis

+

Synopsis

Declared in <base-overload-set.cpp>
-
int&
-foo() const;
+
+int&
+foo() const;
+
-

-C# -

+

C

-

-Synopsis

+

Synopsis

Declared in <base-overload-set.cpp>
-
class C
-    : public Base
+
+class C
+    : public Base
+
-

-Base Classes

+

Base Classes

@@ -173,8 +161,7 @@

-

-Member Functions

+

Member Functions

@@ -192,19 +179,17 @@

-

-ConstBase# -

+

ConstBase

-

-Synopsis

+

Synopsis

Declared in <base-overload-set.cpp>
-
class ConstBase;
+
+class ConstBase;
+
-

-Member Functions

+

Member Functions

@@ -220,8 +205,7 @@

-

-Derived Classes

+

Derived Classes

@@ -238,23 +222,22 @@

-

-ConstBase::foo# -

+

ConstBase::foo

-

-Synopsis

+

Synopsis

Declared in <base-overload-set.cpp>
-
int&
-foo() const;
+
+int&
+foo() const;
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/inherit-base-members/copy-dependencies.html b/test-files/golden-tests/config/inherit-base-members/copy-dependencies.html index dea4960669..c5e2b01c25 100644 --- a/test-files/golden-tests/config/inherit-base-members/copy-dependencies.html +++ b/test-files/golden-tests/config/inherit-base-members/copy-dependencies.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Types

+

Types

@@ -33,24 +29,22 @@

-

-base# -

+

base

A base class to test inheritance and shadowing

-

-Synopsis

+

Synopsis

Declared in <copy-dependencies.cpp>
-
class base
-    : public base_base
+
+class base
+    : public base_base
+
-

-Base Classes

+

Base Classes

@@ -63,8 +57,7 @@

-

-Member Functions

+

Member Functions

@@ -82,8 +75,7 @@

-

-Protected Member Functions

+

Protected Member Functions

@@ -100,8 +92,7 @@

-

-Derived Classes

+

Derived Classes

@@ -118,160 +109,146 @@

-

-base::base_inherited# -

+

base::base_inherited

This function should be inherited by derived classes.

-

-Synopsis

+

Synopsis

Declared in <copy-dependencies.cpp>
-
base&
-base_inherited();
+
+base&
+base_inherited();
+
-

-Return Value

+

Return Value

A base class to test inheritance and shadowing
-

-base::base_shadowed# -

+

base::base_shadowed

This function should shadow the excluded_base function.

-

-Synopsis

+

Synopsis

Declared in <copy-dependencies.cpp>
-
base&
-base_shadowed();
+
+base&
+base_shadowed();
+
-

-Return Value

+

Return Value

A base class to test inheritance and shadowing
-

-base::derived_shadowed# -

+

base::derived_shadowed

This function should be shadowed by derived classes.

-

-Synopsis

+

Synopsis

Declared in <copy-dependencies.cpp>
-
base&
-derived_shadowed();
+
+base&
+derived_shadowed();
+
-

-Return Value

+

Return Value

A base class to test inheritance and shadowing
-

-base::do_base_inherited# -

+

base::do_base_inherited

This function should be inherited by derived classes.

-

-Synopsis

+

Synopsis

Declared in <copy-dependencies.cpp>
-
base&
-do_base_inherited();
+
+base&
+do_base_inherited();
+
-

-Return Value

+

Return Value

A base class to test inheritance and shadowing
-

-base::do_base_shadowed# -

+

base::do_base_shadowed

This function should shadow the excluded_base function.

-

-Synopsis

+

Synopsis

Declared in <copy-dependencies.cpp>
-
base&
-do_base_shadowed();
+
+base&
+do_base_shadowed();
+
-

-Return Value

+

Return Value

A base class to test inheritance and shadowing
-

-base::do_derived_shadowed# -

+

base::do_derived_shadowed

This function should be shadowed by derived classes.

-

-Synopsis

+

Synopsis

Declared in <copy-dependencies.cpp>
-
base&
-do_derived_shadowed();
+
+base&
+do_derived_shadowed();
+
-

-Return Value

+

Return Value

A base class to test inheritance and shadowing
-

-base_base# -

+

base_base

A second-order base class to test indirect inheritance

-

-Synopsis

+

Synopsis

Declared in <copy-dependencies.cpp>
-
class base_base;
+
+class base_base;
+
-

-Member Functions

+

Member Functions

@@ -288,8 +265,7 @@

-

-Derived Classes

+

Derived Classes

@@ -306,71 +282,65 @@

-

-base_base::base_base_inherited# -

+

base_base::base_base_inherited

This function should be indirectly inherited by derived classes.

-

-Synopsis

+

Synopsis

Declared in <copy-dependencies.cpp>
-
base_base&
-base_base_inherited();
+
+base_base&
+base_base_inherited();
+
-

-Return Value

+

Return Value

A second-order base class to test indirect inheritance
-

-base_base::do_base_base_inherited# -

+

base_base::do_base_base_inherited

This function should be indirectly inherited by derived classes.

-

-Synopsis

+

Synopsis

Declared in <copy-dependencies.cpp>
-
base_base&
-do_base_base_inherited();
+
+base_base&
+do_base_base_inherited();
+
-

-Return Value

+

Return Value

A second-order base class to test indirect inheritance
-

-derived# -

+

derived

A class that derives from base and excluded_base

-

-Synopsis

+

Synopsis

Declared in <copy-dependencies.cpp>
-
class derived
+
+class derived
     : public base
-    , public excluded_base
+ , public excluded_base
+
-

-Base Classes

+

Base Classes

@@ -384,8 +354,7 @@

-

-Member Functions

+

Member Functions

@@ -405,8 +374,7 @@

-

-Protected Member Functions

+

Protected Member Functions

@@ -427,124 +395,115 @@

-

-derived::derived_shadowed# -

+

derived::derived_shadowed

This function should shadow the base class function.

-

-Synopsis

+

Synopsis

Declared in <copy-dependencies.cpp>
-
derived&
-derived_shadowed();
+
+derived&
+derived_shadowed();
+
-

-Return Value

+

Return Value

A class that derives from base and excluded_base
-

-derived::do_derived_shadowed# -

+

derived::do_derived_shadowed

This function should shadow the base class function.

-

-Synopsis

+

Synopsis

Declared in <copy-dependencies.cpp>
-
derived&
-do_derived_shadowed();
+
+derived&
+do_derived_shadowed();
+
-

-Return Value

+

Return Value

A class that derives from base and excluded_base
-

-derived::excluded_inherited# -

+

derived::excluded_inherited

This function should be inherited by derived classes.

-

-Synopsis

+

Synopsis

Declared in <copy-dependencies.cpp>
-
excluded_base&
-excluded_inherited();
+
+excluded_base&
+excluded_inherited();
+
-

-derived::do_excluded_inherited# -

+

derived::do_excluded_inherited

This function should be inherited by derived classes.

-

-Synopsis

+

Synopsis

Declared in <copy-dependencies.cpp>
-
excluded_base&
-do_excluded_inherited();
+
+excluded_base&
+do_excluded_inherited();
+
-

-derived::do_shadowed# -

+

derived::do_shadowed

This function should be shadowed by derived classes.

-

-Synopsis

+

Synopsis

Declared in <copy-dependencies.cpp>
-
excluded_base&
-do_shadowed();
+
+excluded_base&
+do_shadowed();
+
-

-private_derived# -

+

private_derived

A class that uses private inheritance only

-

-Synopsis

+

Synopsis

Declared in <copy-dependencies.cpp>
-
class private_derived
+
+class private_derived
     : base
-    , excluded_base
+ , excluded_base
+
-

-Member Functions

+

Member Functions

@@ -563,71 +522,65 @@

-

-private_derived::derived_shadowed# -

+

private_derived::derived_shadowed

This function should shadow the base class function.

-

-Synopsis

+

Synopsis

Declared in <copy-dependencies.cpp>
-
private_derived&
-derived_shadowed();
+
+private_derived&
+derived_shadowed();
+
-

-Return Value

+

Return Value

A class that uses private inheritance only
-

-private_derived::do_derived_shadowed# -

+

private_derived::do_derived_shadowed

This function should shadow the base class function.

-

-Synopsis

+

Synopsis

Declared in <copy-dependencies.cpp>
-
private_derived&
-do_derived_shadowed();
+
+private_derived&
+do_derived_shadowed();
+
-

-Return Value

+

Return Value

A class that uses private inheritance only
-

-protected_derived# -

+

protected_derived

A class that should inherit functions as protected.

-

-Synopsis

+

Synopsis

Declared in <copy-dependencies.cpp>
-
class protected_derived
+
+class protected_derived
     : protected base
-    , protected excluded_base
+ , protected excluded_base
+
-

-Protected Base Classes

+

Protected Base Classes

@@ -641,8 +594,7 @@

-

-Member Functions

+

Member Functions

@@ -657,8 +609,7 @@

-

-Protected Member Functions

+

Protected Member Functions

@@ -685,108 +636,101 @@

-

-protected_derived::derived_shadowed# -

+

protected_derived::derived_shadowed

This function should shadow the base class function.

-

-Synopsis

+

Synopsis

Declared in <copy-dependencies.cpp>
-
protected_derived&
-derived_shadowed();
+
+protected_derived&
+derived_shadowed();
+
-

-Return Value

+

Return Value

A class that should inherit functions as protected.
-

-protected_derived::do_derived_shadowed# -

+

protected_derived::do_derived_shadowed

This function should shadow the base class function.

-

-Synopsis

+

Synopsis

Declared in <copy-dependencies.cpp>
-
protected_derived&
-do_derived_shadowed();
+
+protected_derived&
+do_derived_shadowed();
+
-

-Return Value

+

Return Value

A class that should inherit functions as protected.
-

-protected_derived::do_excluded_inherited# -

+

protected_derived::do_excluded_inherited

This function should be inherited by derived classes.

-

-Synopsis

+

Synopsis

Declared in <copy-dependencies.cpp>
-
excluded_base&
-do_excluded_inherited();
+
+excluded_base&
+do_excluded_inherited();
+
-

-protected_derived::do_shadowed# -

+

protected_derived::do_shadowed

This function should be shadowed by derived classes.

-

-Synopsis

+

Synopsis

Declared in <copy-dependencies.cpp>
-
excluded_base&
-do_shadowed();
+
+excluded_base&
+do_shadowed();
+
-

-protected_derived::excluded_inherited# -

+

protected_derived::excluded_inherited

This function should be inherited by derived classes.

-

-Synopsis

+

Synopsis

Declared in <copy-dependencies.cpp>
-
excluded_base&
-excluded_inherited();
+
+excluded_base&
+excluded_inherited();
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/inherit-base-members/copy.html b/test-files/golden-tests/config/inherit-base-members/copy.html index 4a54b92469..21d5fcf162 100644 --- a/test-files/golden-tests/config/inherit-base-members/copy.html +++ b/test-files/golden-tests/config/inherit-base-members/copy.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Types

+

Types

@@ -33,24 +29,22 @@

-

-base# -

+

base

A base class to test inheritance and shadowing

-

-Synopsis

+

Synopsis

Declared in <copy.cpp>
-
class base
-    : public base_base
+
+class base
+    : public base_base
+
-

-Base Classes

+

Base Classes

@@ -63,8 +57,7 @@

-

-Member Functions

+

Member Functions

@@ -82,8 +75,7 @@

-

-Protected Member Functions

+

Protected Member Functions

@@ -100,8 +92,7 @@

-

-Derived Classes

+

Derived Classes

@@ -118,206 +109,188 @@

-

-base::base_base_inherited# -

+

base::base_base_inherited

This function should be indirectly inherited by derived classes.

-

-Synopsis

+

Synopsis

Declared in <copy.cpp>
-
base_base&
-base_base_inherited();
+
+base_base&
+base_base_inherited();
+
-

-Return Value

+

Return Value

A second-order base class to test indirect inheritance
-

-base::base_inherited# -

+

base::base_inherited

This function should be inherited by derived classes.

-

-Synopsis

+

Synopsis

Declared in <copy.cpp>
-
base&
-base_inherited();
+
+base&
+base_inherited();
+
-

-Return Value

+

Return Value

A base class to test inheritance and shadowing
-

-base::base_shadowed# -

+

base::base_shadowed

This function should shadow the excluded_base function.

-

-Synopsis

+

Synopsis

Declared in <copy.cpp>
-
base&
-base_shadowed();
+
+base&
+base_shadowed();
+
-

-Return Value

+

Return Value

A base class to test inheritance and shadowing
-

-base::derived_shadowed# -

+

base::derived_shadowed

This function should be shadowed by derived classes.

-

-Synopsis

+

Synopsis

Declared in <copy.cpp>
-
base&
-derived_shadowed();
+
+base&
+derived_shadowed();
+
-

-Return Value

+

Return Value

A base class to test inheritance and shadowing
-

-base::do_base_base_inherited# -

+

base::do_base_base_inherited

This function should be indirectly inherited by derived classes.

-

-Synopsis

+

Synopsis

Declared in <copy.cpp>
-
base_base&
-do_base_base_inherited();
+
+base_base&
+do_base_base_inherited();
+
-

-Return Value

+

Return Value

A second-order base class to test indirect inheritance
-

-base::do_base_inherited# -

+

base::do_base_inherited

This function should be inherited by derived classes.

-

-Synopsis

+

Synopsis

Declared in <copy.cpp>
-
base&
-do_base_inherited();
+
+base&
+do_base_inherited();
+
-

-Return Value

+

Return Value

A base class to test inheritance and shadowing
-

-base::do_base_shadowed# -

+

base::do_base_shadowed

This function should shadow the excluded_base function.

-

-Synopsis

+

Synopsis

Declared in <copy.cpp>
-
base&
-do_base_shadowed();
+
+base&
+do_base_shadowed();
+
-

-Return Value

+

Return Value

A base class to test inheritance and shadowing
-

-base::do_derived_shadowed# -

+

base::do_derived_shadowed

This function should be shadowed by derived classes.

-

-Synopsis

+

Synopsis

Declared in <copy.cpp>
-
base&
-do_derived_shadowed();
+
+base&
+do_derived_shadowed();
+
-

-Return Value

+

Return Value

A base class to test inheritance and shadowing
-

-base_base# -

+

base_base

A second-order base class to test indirect inheritance

-

-Synopsis

+

Synopsis

Declared in <copy.cpp>
-
class base_base;
+
+class base_base;
+
-

-Member Functions

+

Member Functions

@@ -334,8 +307,7 @@

-

-Derived Classes

+

Derived Classes

@@ -352,71 +324,65 @@

-

-base_base::base_base_inherited# -

+

base_base::base_base_inherited

This function should be indirectly inherited by derived classes.

-

-Synopsis

+

Synopsis

Declared in <copy.cpp>
-
base_base&
-base_base_inherited();
+
+base_base&
+base_base_inherited();
+
-

-Return Value

+

Return Value

A second-order base class to test indirect inheritance
-

-base_base::do_base_base_inherited# -

+

base_base::do_base_base_inherited

This function should be indirectly inherited by derived classes.

-

-Synopsis

+

Synopsis

Declared in <copy.cpp>
-
base_base&
-do_base_base_inherited();
+
+base_base&
+do_base_base_inherited();
+
-

-Return Value

+

Return Value

A second-order base class to test indirect inheritance
-

-derived# -

+

derived

A class that derives from base and excluded_base

-

-Synopsis

+

Synopsis

Declared in <copy.cpp>
-
class derived
+
+class derived
     : public base
-    , public excluded_base
+ , public excluded_base
+
-

-Base Classes

+

Base Classes

@@ -430,8 +396,7 @@

-

-Member Functions

+

Member Functions

@@ -451,8 +416,7 @@

-

-Protected Member Functions

+

Protected Member Functions

@@ -473,285 +437,262 @@

-

-derived::base_base_inherited# -

+

derived::base_base_inherited

This function should be indirectly inherited by derived classes.

-

-Synopsis

+

Synopsis

Declared in <copy.cpp>
-
base_base&
-base_base_inherited();
+
+base_base&
+base_base_inherited();
+
-

-Return Value

+

Return Value

A second-order base class to test indirect inheritance
-

-derived::base_inherited# -

+

derived::base_inherited

This function should be inherited by derived classes.

-

-Synopsis

+

Synopsis

Declared in <copy.cpp>
-
base&
-base_inherited();
+
+base&
+base_inherited();
+
-

-Return Value

+

Return Value

A base class to test inheritance and shadowing
-

-derived::base_shadowed# -

+

derived::base_shadowed

This function should shadow the excluded_base function.

-

-Synopsis

+

Synopsis

Declared in <copy.cpp>
-
base&
-base_shadowed();
+
+base&
+base_shadowed();
+
-

-Return Value

+

Return Value

A base class to test inheritance and shadowing
-

-derived::derived_shadowed# -

+

derived::derived_shadowed

This function should shadow the base class function.

-

-Synopsis

+

Synopsis

Declared in <copy.cpp>
-
derived&
-derived_shadowed();
+
+derived&
+derived_shadowed();
+
-

-Return Value

+

Return Value

A class that derives from base and excluded_base
-

-derived::do_base_base_inherited# -

+

derived::do_base_base_inherited

This function should be indirectly inherited by derived classes.

-

-Synopsis

+

Synopsis

Declared in <copy.cpp>
-
base_base&
-do_base_base_inherited();
+
+base_base&
+do_base_base_inherited();
+
-

-Return Value

+

Return Value

A second-order base class to test indirect inheritance
-

-derived::do_derived_shadowed# -

+

derived::do_derived_shadowed

This function should shadow the base class function.

-

-Synopsis

+

Synopsis

Declared in <copy.cpp>
-
derived&
-do_derived_shadowed();
+
+derived&
+do_derived_shadowed();
+
-

-Return Value

+

Return Value

A class that derives from base and excluded_base
-

-derived::excluded_inherited# -

+

derived::excluded_inherited

This function should be inherited by derived classes.

-

-Synopsis

+

Synopsis

Declared in <copy.cpp>
-
excluded_base&
-excluded_inherited();
+
+excluded_base&
+excluded_inherited();
+
-

-derived::do_base_inherited# -

+

derived::do_base_inherited

This function should be inherited by derived classes.

-

-Synopsis

+

Synopsis

Declared in <copy.cpp>
-
base&
-do_base_inherited();
+
+base&
+do_base_inherited();
+
-

-Return Value

+

Return Value

A base class to test inheritance and shadowing
-

-derived::do_base_shadowed# -

+

derived::do_base_shadowed

This function should shadow the excluded_base function.

-

-Synopsis

+

Synopsis

Declared in <copy.cpp>
-
base&
-do_base_shadowed();
+
+base&
+do_base_shadowed();
+
-

-Return Value

+

Return Value

A base class to test inheritance and shadowing
-

-derived::do_derived_shadowed# -

+

derived::do_derived_shadowed

This function should be shadowed by derived classes.

-

-Synopsis

+

Synopsis

Declared in <copy.cpp>
-
base&
-do_derived_shadowed();
+
+base&
+do_derived_shadowed();
+
-

-Return Value

+

Return Value

A base class to test inheritance and shadowing
-

-derived::do_excluded_inherited# -

+

derived::do_excluded_inherited

This function should be inherited by derived classes.

-

-Synopsis

+

Synopsis

Declared in <copy.cpp>
-
excluded_base&
-do_excluded_inherited();
+
+excluded_base&
+do_excluded_inherited();
+
-

-derived::do_shadowed# -

+

derived::do_shadowed

This function should be shadowed by derived classes.

-

-Synopsis

+

Synopsis

Declared in <copy.cpp>
-
excluded_base&
-do_shadowed();
+
+excluded_base&
+do_shadowed();
+
-

-private_derived# -

+

private_derived

A class that uses private inheritance only

-

-Synopsis

+

Synopsis

Declared in <copy.cpp>
-
class private_derived
+
+class private_derived
     : base
-    , excluded_base
+ , excluded_base
+
-

-Member Functions

+

Member Functions

@@ -770,71 +711,65 @@

-

-private_derived::derived_shadowed# -

+

private_derived::derived_shadowed

This function should shadow the base class function.

-

-Synopsis

+

Synopsis

Declared in <copy.cpp>
-
private_derived&
-derived_shadowed();
+
+private_derived&
+derived_shadowed();
+
-

-Return Value

+

Return Value

A class that uses private inheritance only
-

-private_derived::do_derived_shadowed# -

+

private_derived::do_derived_shadowed

This function should shadow the base class function.

-

-Synopsis

+

Synopsis

Declared in <copy.cpp>
-
private_derived&
-do_derived_shadowed();
+
+private_derived&
+do_derived_shadowed();
+
-

-Return Value

+

Return Value

A class that uses private inheritance only
-

-protected_derived# -

+

protected_derived

A class that should inherit functions as protected.

-

-Synopsis

+

Synopsis

Declared in <copy.cpp>
-
class protected_derived
+
+class protected_derived
     : protected base
-    , protected excluded_base
+ , protected excluded_base
+
-

-Protected Base Classes

+

Protected Base Classes

@@ -848,8 +783,7 @@

-

-Member Functions

+

Member Functions

@@ -864,8 +798,7 @@

-

-Protected Member Functions

+

Protected Member Functions

@@ -892,292 +825,269 @@

-

-protected_derived::derived_shadowed# -

+

protected_derived::derived_shadowed

This function should shadow the base class function.

-

-Synopsis

+

Synopsis

Declared in <copy.cpp>
-
protected_derived&
-derived_shadowed();
+
+protected_derived&
+derived_shadowed();
+
-

-Return Value

+

Return Value

A class that should inherit functions as protected.
-

-protected_derived::do_derived_shadowed# -

+

protected_derived::do_derived_shadowed

This function should shadow the base class function.

-

-Synopsis

+

Synopsis

Declared in <copy.cpp>
-
protected_derived&
-do_derived_shadowed();
+
+protected_derived&
+do_derived_shadowed();
+
-

-Return Value

+

Return Value

A class that should inherit functions as protected.
-

-protected_derived::base_base_inherited# -

+

protected_derived::base_base_inherited

This function should be indirectly inherited by derived classes.

-

-Synopsis

+

Synopsis

Declared in <copy.cpp>
-
base_base&
-base_base_inherited();
+
+base_base&
+base_base_inherited();
+
-

-Return Value

+

Return Value

A second-order base class to test indirect inheritance
-

-protected_derived::base_inherited# -

+

protected_derived::base_inherited

This function should be inherited by derived classes.

-

-Synopsis

+

Synopsis

Declared in <copy.cpp>
-
base&
-base_inherited();
+
+base&
+base_inherited();
+
-

-Return Value

+

Return Value

A base class to test inheritance and shadowing
-

-protected_derived::base_shadowed# -

+

protected_derived::base_shadowed

This function should shadow the excluded_base function.

-

-Synopsis

+

Synopsis

Declared in <copy.cpp>
-
base&
-base_shadowed();
+
+base&
+base_shadowed();
+
-

-Return Value

+

Return Value

A base class to test inheritance and shadowing
-

-protected_derived::derived_shadowed# -

+

protected_derived::derived_shadowed

This function should be shadowed by derived classes.

-

-Synopsis

+

Synopsis

Declared in <copy.cpp>
-
base&
-derived_shadowed();
+
+base&
+derived_shadowed();
+
-

-Return Value

+

Return Value

A base class to test inheritance and shadowing
-

-protected_derived::do_base_base_inherited# -

+

protected_derived::do_base_base_inherited

This function should be indirectly inherited by derived classes.

-

-Synopsis

+

Synopsis

Declared in <copy.cpp>
-
base_base&
-do_base_base_inherited();
+
+base_base&
+do_base_base_inherited();
+
-

-Return Value

+

Return Value

A second-order base class to test indirect inheritance
-

-protected_derived::do_base_inherited# -

+

protected_derived::do_base_inherited

This function should be inherited by derived classes.

-

-Synopsis

+

Synopsis

Declared in <copy.cpp>
-
base&
-do_base_inherited();
+
+base&
+do_base_inherited();
+
-

-Return Value

+

Return Value

A base class to test inheritance and shadowing
-

-protected_derived::do_base_shadowed# -

+

protected_derived::do_base_shadowed

This function should shadow the excluded_base function.

-

-Synopsis

+

Synopsis

Declared in <copy.cpp>
-
base&
-do_base_shadowed();
+
+base&
+do_base_shadowed();
+
-

-Return Value

+

Return Value

A base class to test inheritance and shadowing
-

-protected_derived::do_derived_shadowed# -

+

protected_derived::do_derived_shadowed

This function should be shadowed by derived classes.

-

-Synopsis

+

Synopsis

Declared in <copy.cpp>
-
base&
-do_derived_shadowed();
+
+base&
+do_derived_shadowed();
+
-

-Return Value

+

Return Value

A base class to test inheritance and shadowing
-

-protected_derived::do_excluded_inherited# -

+

protected_derived::do_excluded_inherited

This function should be inherited by derived classes.

-

-Synopsis

+

Synopsis

Declared in <copy.cpp>
-
excluded_base&
-do_excluded_inherited();
+
+excluded_base&
+do_excluded_inherited();
+
-

-protected_derived::do_shadowed# -

+

protected_derived::do_shadowed

This function should be shadowed by derived classes.

-

-Synopsis

+

Synopsis

Declared in <copy.cpp>
-
excluded_base&
-do_shadowed();
+
+excluded_base&
+do_shadowed();
+
-

-protected_derived::excluded_inherited# -

+

protected_derived::excluded_inherited

This function should be inherited by derived classes.

-

-Synopsis

+

Synopsis

Declared in <copy.cpp>
-
excluded_base&
-excluded_inherited();
+
+excluded_base&
+excluded_inherited();
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/inherit-base-members/impl-defined-base.html b/test-files/golden-tests/config/inherit-base-members/impl-defined-base.html index 561f64f0b4..e59b1e0f25 100644 --- a/test-files/golden-tests/config/inherit-base-members/impl-defined-base.html +++ b/test-files/golden-tests/config/inherit-base-members/impl-defined-base.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Types

+

Types

@@ -29,21 +25,19 @@

-

-derived# -

+

derived

-

-Synopsis

+

Synopsis

Declared in <impl-defined-base.cpp>
-
struct derived
-    : /* implementation-defined */
+
+struct derived
+    : /* implementation-defined */
+
-

-Base Classes

+

Base Classes

@@ -56,8 +50,7 @@

-

-Member Functions

+

Member Functions

@@ -76,41 +69,39 @@

-

-derived::do_it# -

+

derived::do_it

Do the thing

-

-Synopsis

+

Synopsis

Declared in <impl-defined-base.cpp>
-
void
-do_it();
+
+void
+do_it();
+
-

-derived::own# -

+

derived::own

-

-Synopsis

+

Synopsis

Declared in <impl-defined-base.cpp>
-
void
-own();
+
+void
+own();
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/inherit-base-members/never.html b/test-files/golden-tests/config/inherit-base-members/never.html index dcf90b1ab6..43a045136d 100644 --- a/test-files/golden-tests/config/inherit-base-members/never.html +++ b/test-files/golden-tests/config/inherit-base-members/never.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Types

+

Types

@@ -33,24 +29,22 @@

-

-base# -

+

base

A base class to test inheritance and shadowing

-

-Synopsis

+

Synopsis

Declared in <never.cpp>
-
class base
-    : public base_base
+
+class base
+    : public base_base
+
-

-Base Classes

+

Base Classes

@@ -63,8 +57,7 @@

-

-Member Functions

+

Member Functions

@@ -80,8 +73,7 @@

-

-Protected Member Functions

+

Protected Member Functions

@@ -98,8 +90,7 @@

-

-Derived Classes

+

Derived Classes

@@ -116,160 +107,146 @@

-

-base::base_inherited# -

+

base::base_inherited

This function should be inherited by derived classes.

-

-Synopsis

+

Synopsis

Declared in <never.cpp>
-
base&
-base_inherited();
+
+base&
+base_inherited();
+
-

-Return Value

+

Return Value

A base class to test inheritance and shadowing
-

-base::base_shadowed# -

+

base::base_shadowed

This function should shadow the excluded_base function.

-

-Synopsis

+

Synopsis

Declared in <never.cpp>
-
base&
-base_shadowed();
+
+base&
+base_shadowed();
+
-

-Return Value

+

Return Value

A base class to test inheritance and shadowing
-

-base::derived_shadowed# -

+

base::derived_shadowed

This function should be shadowed by derived classes.

-

-Synopsis

+

Synopsis

Declared in <never.cpp>
-
base&
-derived_shadowed();
+
+base&
+derived_shadowed();
+
-

-Return Value

+

Return Value

A base class to test inheritance and shadowing
-

-base::do_base_inherited# -

+

base::do_base_inherited

This function should be inherited by derived classes.

-

-Synopsis

+

Synopsis

Declared in <never.cpp>
-
base&
-do_base_inherited();
+
+base&
+do_base_inherited();
+
-

-Return Value

+

Return Value

A base class to test inheritance and shadowing
-

-base::do_base_shadowed# -

+

base::do_base_shadowed

This function should shadow the excluded_base function.

-

-Synopsis

+

Synopsis

Declared in <never.cpp>
-
base&
-do_base_shadowed();
+
+base&
+do_base_shadowed();
+
-

-Return Value

+

Return Value

A base class to test inheritance and shadowing
-

-base::do_derived_shadowed# -

+

base::do_derived_shadowed

This function should be shadowed by derived classes.

-

-Synopsis

+

Synopsis

Declared in <never.cpp>
-
base&
-do_derived_shadowed();
+
+base&
+do_derived_shadowed();
+
-

-Return Value

+

Return Value

A base class to test inheritance and shadowing
-

-base_base# -

+

base_base

A second-order base class to test indirect inheritance

-

-Synopsis

+

Synopsis

Declared in <never.cpp>
-
class base_base;
+
+class base_base;
+
-

-Member Functions

+

Member Functions

@@ -286,8 +263,7 @@

-

-Derived Classes

+

Derived Classes

@@ -304,71 +280,65 @@

-

-base_base::base_base_inherited# -

+

base_base::base_base_inherited

This function should be indirectly inherited by derived classes.

-

-Synopsis

+

Synopsis

Declared in <never.cpp>
-
base_base&
-base_base_inherited();
+
+base_base&
+base_base_inherited();
+
-

-Return Value

+

Return Value

A second-order base class to test indirect inheritance
-

-base_base::do_base_base_inherited# -

+

base_base::do_base_base_inherited

This function should be indirectly inherited by derived classes.

-

-Synopsis

+

Synopsis

Declared in <never.cpp>
-
base_base&
-do_base_base_inherited();
+
+base_base&
+do_base_base_inherited();
+
-

-Return Value

+

Return Value

A second-order base class to test indirect inheritance
-

-derived# -

+

derived

A class that derives from base and excluded_base

-

-Synopsis

+

Synopsis

Declared in <never.cpp>
-
class derived
+
+class derived
     : public base
-    , public excluded_base
+ , public excluded_base
+
-

-Base Classes

+

Base Classes

@@ -382,8 +352,7 @@

-

-Member Functions

+

Member Functions

@@ -402,70 +371,64 @@

-

-derived::derived_shadowed# -

+

derived::derived_shadowed

This function should shadow the base class function.

-

-Synopsis

+

Synopsis

Declared in <never.cpp>
-
derived&
-derived_shadowed();
+
+derived&
+derived_shadowed();
+
-

-Return Value

+

Return Value

A class that derives from base and excluded_base
-

-derived::do_derived_shadowed# -

+

derived::do_derived_shadowed

This function should shadow the base class function.

-

-Synopsis

+

Synopsis

Declared in <never.cpp>
-
derived&
-do_derived_shadowed();
+
+derived&
+do_derived_shadowed();
+
-

-Return Value

+

Return Value

A class that derives from base and excluded_base
-

-private_derived# -

+

private_derived

A class that uses private inheritance only

-

-Synopsis

+

Synopsis

Declared in <never.cpp>
-
class private_derived
+
+class private_derived
     : base
-    , excluded_base
+ , excluded_base
+
-

-Member Functions

+

Member Functions

@@ -484,71 +447,65 @@

-

-private_derived::derived_shadowed# -

+

private_derived::derived_shadowed

This function should shadow the base class function.

-

-Synopsis

+

Synopsis

Declared in <never.cpp>
-
private_derived&
-derived_shadowed();
+
+private_derived&
+derived_shadowed();
+
-

-Return Value

+

Return Value

A class that uses private inheritance only
-

-private_derived::do_derived_shadowed# -

+

private_derived::do_derived_shadowed

This function should shadow the base class function.

-

-Synopsis

+

Synopsis

Declared in <never.cpp>
-
private_derived&
-do_derived_shadowed();
+
+private_derived&
+do_derived_shadowed();
+
-

-Return Value

+

Return Value

A class that uses private inheritance only
-

-protected_derived# -

+

protected_derived

A class that should inherit functions as protected.

-

-Synopsis

+

Synopsis

Declared in <never.cpp>
-
class protected_derived
+
+class protected_derived
     : protected base
-    , protected excluded_base
+ , protected excluded_base
+
-

-Protected Base Classes

+

Protected Base Classes

@@ -562,8 +519,7 @@

-

-Member Functions

+

Member Functions

@@ -582,54 +538,50 @@

-

-protected_derived::derived_shadowed# -

+

protected_derived::derived_shadowed

This function should shadow the base class function.

-

-Synopsis

+

Synopsis

Declared in <never.cpp>
-
protected_derived&
-derived_shadowed();
+
+protected_derived&
+derived_shadowed();
+
-

-Return Value

+

Return Value

A class that should inherit functions as protected.
-

-protected_derived::do_derived_shadowed# -

+

protected_derived::do_derived_shadowed

This function should shadow the base class function.

-

-Synopsis

+

Synopsis

Declared in <never.cpp>
-
protected_derived&
-do_derived_shadowed();
+
+protected_derived&
+do_derived_shadowed();
+
-

-Return Value

+

Return Value

A class that should inherit functions as protected.
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/inherit-base-members/reference.html b/test-files/golden-tests/config/inherit-base-members/reference.html index f10e6786c9..3fdca1f3f4 100644 --- a/test-files/golden-tests/config/inherit-base-members/reference.html +++ b/test-files/golden-tests/config/inherit-base-members/reference.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Types

+

Types

@@ -33,24 +29,22 @@

-

-base# -

+

base

A base class to test inheritance and shadowing

-

-Synopsis

+

Synopsis

Declared in <reference.cpp>
-
class base
-    : public base_base
+
+class base
+    : public base_base
+
-

-Base Classes

+

Base Classes

@@ -63,8 +57,7 @@

-

-Member Functions

+

Member Functions

@@ -82,8 +75,7 @@

-

-Protected Member Functions

+

Protected Member Functions

@@ -100,8 +92,7 @@

-

-Derived Classes

+

Derived Classes

@@ -118,160 +109,146 @@

-

-base::base_inherited# -

+

base::base_inherited

This function should be inherited by derived classes.

-

-Synopsis

+

Synopsis

Declared in <reference.cpp>
-
base&
-base_inherited();
+
+base&
+base_inherited();
+
-

-Return Value

+

Return Value

A base class to test inheritance and shadowing
-

-base::base_shadowed# -

+

base::base_shadowed

This function should shadow the excluded_base function.

-

-Synopsis

+

Synopsis

Declared in <reference.cpp>
-
base&
-base_shadowed();
+
+base&
+base_shadowed();
+
-

-Return Value

+

Return Value

A base class to test inheritance and shadowing
-

-base::derived_shadowed# -

+

base::derived_shadowed

This function should be shadowed by derived classes.

-

-Synopsis

+

Synopsis

Declared in <reference.cpp>
-
base&
-derived_shadowed();
+
+base&
+derived_shadowed();
+
-

-Return Value

+

Return Value

A base class to test inheritance and shadowing
-

-base::do_base_inherited# -

+

base::do_base_inherited

This function should be inherited by derived classes.

-

-Synopsis

+

Synopsis

Declared in <reference.cpp>
-
base&
-do_base_inherited();
+
+base&
+do_base_inherited();
+
-

-Return Value

+

Return Value

A base class to test inheritance and shadowing
-

-base::do_base_shadowed# -

+

base::do_base_shadowed

This function should shadow the excluded_base function.

-

-Synopsis

+

Synopsis

Declared in <reference.cpp>
-
base&
-do_base_shadowed();
+
+base&
+do_base_shadowed();
+
-

-Return Value

+

Return Value

A base class to test inheritance and shadowing
-

-base::do_derived_shadowed# -

+

base::do_derived_shadowed

This function should be shadowed by derived classes.

-

-Synopsis

+

Synopsis

Declared in <reference.cpp>
-
base&
-do_derived_shadowed();
+
+base&
+do_derived_shadowed();
+
-

-Return Value

+

Return Value

A base class to test inheritance and shadowing
-

-base_base# -

+

base_base

A second-order base class to test indirect inheritance

-

-Synopsis

+

Synopsis

Declared in <reference.cpp>
-
class base_base;
+
+class base_base;
+
-

-Member Functions

+

Member Functions

@@ -288,8 +265,7 @@

-

-Derived Classes

+

Derived Classes

@@ -306,71 +282,65 @@

-

-base_base::base_base_inherited# -

+

base_base::base_base_inherited

This function should be indirectly inherited by derived classes.

-

-Synopsis

+

Synopsis

Declared in <reference.cpp>
-
base_base&
-base_base_inherited();
+
+base_base&
+base_base_inherited();
+
-

-Return Value

+

Return Value

A second-order base class to test indirect inheritance
-

-base_base::do_base_base_inherited# -

+

base_base::do_base_base_inherited

This function should be indirectly inherited by derived classes.

-

-Synopsis

+

Synopsis

Declared in <reference.cpp>
-
base_base&
-do_base_base_inherited();
+
+base_base&
+do_base_base_inherited();
+
-

-Return Value

+

Return Value

A second-order base class to test indirect inheritance
-

-derived# -

+

derived

A class that derives from base and excluded_base

-

-Synopsis

+

Synopsis

Declared in <reference.cpp>
-
class derived
+
+class derived
     : public base
-    , public excluded_base
+ , public excluded_base
+
-

-Base Classes

+

Base Classes

@@ -384,8 +354,7 @@

-

-Member Functions

+

Member Functions

@@ -404,8 +373,7 @@

-

-Protected Member Functions

+

Protected Member Functions

@@ -424,70 +392,64 @@

-

-derived::derived_shadowed# -

+

derived::derived_shadowed

This function should shadow the base class function.

-

-Synopsis

+

Synopsis

Declared in <reference.cpp>
-
derived&
-derived_shadowed();
+
+derived&
+derived_shadowed();
+
-

-Return Value

+

Return Value

A class that derives from base and excluded_base
-

-derived::do_derived_shadowed# -

+

derived::do_derived_shadowed

This function should shadow the base class function.

-

-Synopsis

+

Synopsis

Declared in <reference.cpp>
-
derived&
-do_derived_shadowed();
+
+derived&
+do_derived_shadowed();
+
-

-Return Value

+

Return Value

A class that derives from base and excluded_base
-

-private_derived# -

+

private_derived

A class that uses private inheritance only

-

-Synopsis

+

Synopsis

Declared in <reference.cpp>
-
class private_derived
+
+class private_derived
     : base
-    , excluded_base
+ , excluded_base
+
-

-Member Functions

+

Member Functions

@@ -506,71 +468,65 @@

-

-private_derived::derived_shadowed# -

+

private_derived::derived_shadowed

This function should shadow the base class function.

-

-Synopsis

+

Synopsis

Declared in <reference.cpp>
-
private_derived&
-derived_shadowed();
+
+private_derived&
+derived_shadowed();
+
-

-Return Value

+

Return Value

A class that uses private inheritance only
-

-private_derived::do_derived_shadowed# -

+

private_derived::do_derived_shadowed

This function should shadow the base class function.

-

-Synopsis

+

Synopsis

Declared in <reference.cpp>
-
private_derived&
-do_derived_shadowed();
+
+private_derived&
+do_derived_shadowed();
+
-

-Return Value

+

Return Value

A class that uses private inheritance only
-

-protected_derived# -

+

protected_derived

A class that should inherit functions as protected.

-

-Synopsis

+

Synopsis

Declared in <reference.cpp>
-
class protected_derived
+
+class protected_derived
     : protected base
-    , protected excluded_base
+ , protected excluded_base
+
-

-Protected Base Classes

+

Protected Base Classes

@@ -584,8 +540,7 @@

-

-Member Functions

+

Member Functions

@@ -600,8 +555,7 @@

-

-Protected Member Functions

+

Protected Member Functions

@@ -625,54 +579,50 @@

-

-protected_derived::derived_shadowed# -

+

protected_derived::derived_shadowed

This function should shadow the base class function.

-

-Synopsis

+

Synopsis

Declared in <reference.cpp>
-
protected_derived&
-derived_shadowed();
+
+protected_derived&
+derived_shadowed();
+
-

-Return Value

+

Return Value

A class that should inherit functions as protected.
-

-protected_derived::do_derived_shadowed# -

+

protected_derived::do_derived_shadowed

This function should shadow the base class function.

-

-Synopsis

+

Synopsis

Declared in <reference.cpp>
-
protected_derived&
-do_derived_shadowed();
+
+protected_derived&
+do_derived_shadowed();
+
-

-Return Value

+

Return Value

A class that should inherit functions as protected.
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/inherit-base-members/see-below-base.html b/test-files/golden-tests/config/inherit-base-members/see-below-base.html index c89cff28da..e6a3baa51a 100644 --- a/test-files/golden-tests/config/inherit-base-members/see-below-base.html +++ b/test-files/golden-tests/config/inherit-base-members/see-below-base.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Namespaces

+

Namespaces

@@ -26,8 +22,7 @@

-

-Types

+

Types

@@ -43,12 +38,9 @@

-

-see_below_ns# -

+

see_below_ns

-

-Types

+

Types

@@ -64,37 +56,34 @@

-

-see_below_ns::base_see# -

+

see_below_ns::base_see

-

-Synopsis

+

Synopsis

Declared in <see-below-base.cpp>
-
struct base_see { /* see-below */ };
+
+struct base_see { /* see-below */ };
+
-

-derived_see# -

+

derived_see

-

-Synopsis

+

Synopsis

Declared in <see-below-base.cpp>
-
struct derived_see
-    : see_below_ns::base_see
+
+struct derived_see
+    : see_below_ns::base_see
+
-

-Base Classes

+

Base Classes

@@ -107,8 +96,7 @@

-

-Member Functions

+

Member Functions

@@ -127,41 +115,39 @@

-

-derived_see::do_other# -

+

derived_see::do_other

Describes the see-below member

-

-Synopsis

+

Synopsis

Declared in <see-below-base.cpp>
-
void
-do_other();
+
+void
+do_other();
+
-

-derived_see::own# -

+

derived_see::own

-

-Synopsis

+

Synopsis

Declared in <see-below-base.cpp>
-
void
-own();
+
+void
+own();
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/inherit-base-members/skip-special.html b/test-files/golden-tests/config/inherit-base-members/skip-special.html index 012de0aaf8..9dc0a99ae8 100644 --- a/test-files/golden-tests/config/inherit-base-members/skip-special.html +++ b/test-files/golden-tests/config/inherit-base-members/skip-special.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Types

+

Types

@@ -33,21 +29,19 @@

-

-base# -

+

base

-

-Synopsis

+

Synopsis

Declared in <skip-special.cpp>
-
class base
-    : public base_base
+
+class base
+    : public base_base
+
-

-Base Classes

+

Base Classes

@@ -60,8 +54,7 @@

-

-Member Functions

+

Member Functions

@@ -81,8 +74,7 @@

-

-Protected Member Functions

+

Protected Member Functions

@@ -99,8 +91,7 @@

-

-Derived Classes

+

Derived Classes

@@ -117,161 +108,151 @@

-

-base::base# -

+

base::base

Constructor should not be inherited

-

-Synopsis

+

Synopsis

Declared in <skip-special.cpp>
-
base();
+
+base();
+
-

-base::~base# -

+

base::~base

Destructor should not be inherited

-

-Synopsis

+

Synopsis

Declared in <skip-special.cpp>
-
~base();
+
+~base();
+
-

-base::base_inherited# -

+

base::base_inherited

This function should be inherited by derived classes.

-

-Synopsis

+

Synopsis

Declared in <skip-special.cpp>
-
base&
-base_inherited();
+
+base&
+base_inherited();
+
-

-base::base_shadowed# -

+

base::base_shadowed

This function should shadow the excluded_base function.

-

-Synopsis

+

Synopsis

Declared in <skip-special.cpp>
-
base&
-base_shadowed();
+
+base&
+base_shadowed();
+
-

-base::derived_shadowed# -

+

base::derived_shadowed

This function should be shadowed by derived classes.

-

-Synopsis

+

Synopsis

Declared in <skip-special.cpp>
-
base&
-derived_shadowed();
+
+base&
+derived_shadowed();
+
-

-base::do_base_inherited# -

+

base::do_base_inherited

This function should be inherited by derived classes.

-

-Synopsis

+

Synopsis

Declared in <skip-special.cpp>
-
base&
-do_base_inherited();
+
+base&
+do_base_inherited();
+
-

-base::do_base_shadowed# -

+

base::do_base_shadowed

This function should shadow the excluded_base function.

-

-Synopsis

+

Synopsis

Declared in <skip-special.cpp>
-
base&
-do_base_shadowed();
+
+base&
+do_base_shadowed();
+
-

-base::do_derived_shadowed# -

+

base::do_derived_shadowed

This function should be shadowed by derived classes.

-

-Synopsis

+

Synopsis

Declared in <skip-special.cpp>
-
base&
-do_derived_shadowed();
+
+base&
+do_derived_shadowed();
+
-

-base_base# -

+

base_base

-

-Synopsis

+

Synopsis

Declared in <skip-special.cpp>
-
class base_base;
+
+class base_base;
+
-

-Member Functions

+

Member Functions

@@ -290,8 +271,7 @@

-

-Derived Classes

+

Derived Classes

@@ -308,92 +288,86 @@

-

-base_base::base_base# -

+

base_base::base_base

Constructor should not be inherited

-

-Synopsis

+

Synopsis

Declared in <skip-special.cpp>
-
base_base();
+
+base_base();
+
-

-base_base::~base_base# -

+

base_base::~base_base

Destructor should not be inherited

-

-Synopsis

+

Synopsis

Declared in <skip-special.cpp>
-
~base_base();
+
+~base_base();
+
-

-base_base::base_base_inherited# -

+

base_base::base_base_inherited

This function should be indirectly inherited by derived classes.

-

-Synopsis

+

Synopsis

Declared in <skip-special.cpp>
-
base_base&
-base_base_inherited();
+
+base_base&
+base_base_inherited();
+
-

-base_base::do_base_base_inherited# -

+

base_base::do_base_base_inherited

This function should be indirectly inherited by derived classes.

-

-Synopsis

+

Synopsis

Declared in <skip-special.cpp>
-
base_base&
-do_base_base_inherited();
+
+base_base&
+do_base_base_inherited();
+
-

-derived# -

+

derived

-

-Synopsis

+

Synopsis

Declared in <skip-special.cpp>
-
class derived
+
+class derived
     : public base
-    , public excluded_base
+ , public excluded_base
+
-

-Base Classes

+

Base Classes

@@ -407,8 +381,7 @@

-

-Member Functions

+

Member Functions

@@ -430,8 +403,7 @@

-

-Protected Member Functions

+

Protected Member Functions

@@ -452,145 +424,136 @@

-

-derived::derived# -

+

derived::derived

Constructor should not be inherited

-

-Synopsis

+

Synopsis

Declared in <skip-special.cpp>
-
derived();
+
+derived();
+
-

-derived::~derived# -

+

derived::~derived

Destructor should not be inherited

-

-Synopsis

+

Synopsis

Declared in <skip-special.cpp>
-
~derived();
+
+~derived();
+
-

-derived::derived_shadowed# -

+

derived::derived_shadowed

This function should shadow the base class function.

-

-Synopsis

+

Synopsis

Declared in <skip-special.cpp>
-
derived&
-derived_shadowed();
+
+derived&
+derived_shadowed();
+
-

-derived::do_derived_shadowed# -

+

derived::do_derived_shadowed

This function should shadow the base class function.

-

-Synopsis

+

Synopsis

Declared in <skip-special.cpp>
-
derived&
-do_derived_shadowed();
+
+derived&
+do_derived_shadowed();
+
-

-derived::excluded_inherited# -

+

derived::excluded_inherited

This function should be inherited by derived classes.

-

-Synopsis

+

Synopsis

Declared in <skip-special.cpp>
-
excluded_base&
-excluded_inherited();
+
+excluded_base&
+excluded_inherited();
+
-

-derived::do_excluded_inherited# -

+

derived::do_excluded_inherited

This function should be inherited by derived classes.

-

-Synopsis

+

Synopsis

Declared in <skip-special.cpp>
-
excluded_base&
-do_excluded_inherited();
+
+excluded_base&
+do_excluded_inherited();
+
-

-derived::do_shadowed# -

+

derived::do_shadowed

This function should be shadowed by derived classes.

-

-Synopsis

+

Synopsis

Declared in <skip-special.cpp>
-
excluded_base&
-do_shadowed();
+
+excluded_base&
+do_shadowed();
+
-

-private_derived# -

+

private_derived

-

-Synopsis

+

Synopsis

Declared in <skip-special.cpp>
-
class private_derived
+
+class private_derived
     : base
-    , excluded_base
+ , excluded_base
+
-

-Member Functions

+

Member Functions

@@ -611,95 +574,89 @@

-

-private_derived::private_derived# -

+

private_derived::private_derived

Constructor should not be inherited

-

-Synopsis

+

Synopsis

Declared in <skip-special.cpp>
-
private_derived();
+
+private_derived();
+
-

-private_derived::~private_derived# -

+

private_derived::~private_derived

Destructor should not be inherited

-

-Synopsis

+

Synopsis

Declared in <skip-special.cpp>
-
~private_derived();
+
+~private_derived();
+
-

-private_derived::derived_shadowed# -

+

private_derived::derived_shadowed

This function should shadow the base class function.

-

-Synopsis

+

Synopsis

Declared in <skip-special.cpp>
-
private_derived&
-derived_shadowed();
+
+private_derived&
+derived_shadowed();
+
-

-private_derived::do_derived_shadowed# -

+

private_derived::do_derived_shadowed

This function should shadow the base class function.

-

-Synopsis

+

Synopsis

Declared in <skip-special.cpp>
-
private_derived&
-do_derived_shadowed();
+
+private_derived&
+do_derived_shadowed();
+
-

-protected_derived# -

+

protected_derived

Should inherit functions as protected.

-

-Synopsis

+

Synopsis

Declared in <skip-special.cpp>
-
class protected_derived
+
+class protected_derived
     : protected base
-    , protected excluded_base
+ , protected excluded_base
+
-

-Protected Base Classes

+

Protected Base Classes

@@ -713,8 +670,7 @@

-

-Member Functions

+

Member Functions

@@ -731,8 +687,7 @@

-

-Protected Member Functions

+

Protected Member Functions

@@ -759,142 +714,133 @@

-

-protected_derived::protected_derived# -

+

protected_derived::protected_derived

Constructor should not be inherited

-

-Synopsis

+

Synopsis

Declared in <skip-special.cpp>
-
protected_derived();
+
+protected_derived();
+
-

-protected_derived::~protected_derived# -

+

protected_derived::~protected_derived

Destructor should not be inherited

-

-Synopsis

+

Synopsis

Declared in <skip-special.cpp>
-
~protected_derived();
+
+~protected_derived();
+
-

-protected_derived::derived_shadowed# -

+

protected_derived::derived_shadowed

This function should shadow the base class function.

-

-Synopsis

+

Synopsis

Declared in <skip-special.cpp>
-
protected_derived&
-derived_shadowed();
+
+protected_derived&
+derived_shadowed();
+
-

-Return Value

+

Return Value

Should inherit functions as protected.
-

-protected_derived::do_derived_shadowed# -

+

protected_derived::do_derived_shadowed

This function should shadow the base class function.

-

-Synopsis

+

Synopsis

Declared in <skip-special.cpp>
-
protected_derived&
-do_derived_shadowed();
+
+protected_derived&
+do_derived_shadowed();
+
-

-Return Value

+

Return Value

Should inherit functions as protected.
-

-protected_derived::do_excluded_inherited# -

+

protected_derived::do_excluded_inherited

This function should be inherited by derived classes.

-

-Synopsis

+

Synopsis

Declared in <skip-special.cpp>
-
excluded_base&
-do_excluded_inherited();
+
+excluded_base&
+do_excluded_inherited();
+
-

-protected_derived::do_shadowed# -

+

protected_derived::do_shadowed

This function should be shadowed by derived classes.

-

-Synopsis

+

Synopsis

Declared in <skip-special.cpp>
-
excluded_base&
-do_shadowed();
+
+excluded_base&
+do_shadowed();
+
-

-protected_derived::excluded_inherited# -

+

protected_derived::excluded_inherited

This function should be inherited by derived classes.

-

-Synopsis

+

Synopsis

Declared in <skip-special.cpp>
-
excluded_base&
-excluded_inherited();
+
+excluded_base&
+excluded_inherited();
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/legible-names/constructor.html b/test-files/golden-tests/config/legible-names/constructor.html index 67be9ce176..41dd753415 100644 --- a/test-files/golden-tests/config/legible-names/constructor.html +++ b/test-files/golden-tests/config/legible-names/constructor.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Types

+

Types

@@ -29,19 +25,17 @@

-

-X# -

+

X

-

-Synopsis

+

Synopsis

Declared in <constructor.cpp>
-
struct X;
+
+struct X;
+
-

-Member Functions

+

Member Functions

@@ -59,76 +53,76 @@

-

-X::X# -

+

X::X

Constructors

-

-Synopses

+

Synopses

Declared in <constructor.cpp>

Default constructor

-
X();
-Β» more... +
+X();
+
Β» more...

Copy constructor

-
X(X const& other);
-Β» more... +
+X(X const& other);
+
Β» more...

Move constructor

-
X(X&& other);
-Β» more... +
+X(X&& other);
+
Β» more...

Construct from int

-
X(int value);
-Β» more... +
+X(int value);
+
Β» more...

Construct from double

-
X(double value);
-Β» more... +
+X(double value);
+
Β» more... +
-

-X::X# -

+

X::X

Default constructor

-

-Synopsis

+

Synopsis

Declared in <constructor.cpp>
-
X();
+
+X();
+
-

-X::X# -

+

X::X

Copy constructor

-

-Synopsis

+

Synopsis

Declared in <constructor.cpp>
-
X(X const& other);
+
+X(X const& other);
+
-

-Parameters

+

Parameters

@@ -147,23 +141,21 @@

-

-X::X# -

+

X::X

Move constructor

-

-Synopsis

+

Synopsis

Declared in <constructor.cpp>
-
X(X&& other);
+
+X(X&& other);
+
-

-Parameters

+

Parameters

@@ -182,23 +174,21 @@

-

-X::X# -

+

X::X

Construct from int

-

-Synopsis

+

Synopsis

Declared in <constructor.cpp>
-
X(int value);
+
+X(int value);
+
-

-Parameters

+

Parameters

@@ -217,23 +207,21 @@

-

-X::X# -

+

X::X

Construct from double

-

-Synopsis

+

Synopsis

Declared in <constructor.cpp>
-
X(double value);
+
+X(double value);
+
-

-Parameters

+

Parameters

@@ -252,8 +240,8 @@

- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/missing-include-prefixes/main.html b/test-files/golden-tests/config/missing-include-prefixes/main.html index 5b2fe9bb49..90febb9211 100644 --- a/test-files/golden-tests/config/missing-include-prefixes/main.html +++ b/test-files/golden-tests/config/missing-include-prefixes/main.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Functions

+

Functions

@@ -30,38 +26,36 @@

-

-f# -

+

f

-

-Synopsis

+

Synopsis

Declared in <main.cpp>
-
unknown_type
-f();
+
+unknown_type
+f();
+
-

-g# -

+

g

-

-Synopsis

+

Synopsis

Declared in <main.cpp>
-
unknown_ns::unknown_type
-g();
+
+unknown_ns::unknown_type
+g();
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/missing-include-shims/main.html b/test-files/golden-tests/config/missing-include-shims/main.html index e91fca74cb..3a521c8857 100644 --- a/test-files/golden-tests/config/missing-include-shims/main.html +++ b/test-files/golden-tests/config/missing-include-shims/main.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Functions

+

Functions

@@ -29,31 +25,29 @@

-

-f# -

+

f

Function satisfied by missing-include-shims

-

-Synopsis

+

Synopsis

Declared in <main.cpp>
-
llvm::StringRef
-f();
+
+llvm::StringRef
+f();
+
-

-Return Value

+

Return Value

An empty string of a type defined in the shims.
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/overloads/const-mutable.html b/test-files/golden-tests/config/overloads/const-mutable.html index 58c6bec177..476d9fae33 100644 --- a/test-files/golden-tests/config/overloads/const-mutable.html +++ b/test-files/golden-tests/config/overloads/const-mutable.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Types

+

Types

@@ -29,19 +25,17 @@

-

-C# -

+

C

-

-Synopsis

+

Synopsis

Declared in <const-mutable.cpp>
-
class C;
+
+class C;
+
-

-Member Functions

+

Member Functions

@@ -59,61 +53,59 @@

-

-C::foo# -

+

C::foo

-

-Synopses

+

Synopses

Declared in <const-mutable.cpp>
-
int&
-foo();
-Β» more... +
+int&
+foo();
+
Β» more... -
int&
-foo() const;
-Β» more... +
+int&
+foo() const;
+
Β» more... +
-

-C::foo# -

+

C::foo

-

-Synopsis

+

Synopsis

Declared in <const-mutable.cpp>
-
int&
-foo();
+
+int&
+foo();
+
-

-C::foo# -

+

C::foo

-

-Synopsis

+

Synopsis

Declared in <const-mutable.cpp>
-
int&
-foo() const;
+
+int&
+foo() const;
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/overloads/visibility.html b/test-files/golden-tests/config/overloads/visibility.html index c7824c7570..9cf60cc672 100644 --- a/test-files/golden-tests/config/overloads/visibility.html +++ b/test-files/golden-tests/config/overloads/visibility.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Types

+

Types

@@ -29,19 +25,17 @@

-

-C# -

+

C

-

-Synopsis

+

Synopsis

Declared in <visibility.cpp>
-
class C;
+
+class C;
+
-

-Member Functions

+

Member Functions

@@ -54,8 +48,7 @@

-

-Static Member Functions

+

Static Member Functions

@@ -69,8 +62,7 @@

-

-Protected Member Functions

+

Protected Member Functions

@@ -83,8 +75,7 @@

-

-Protected Static Member Functions

+

Protected Static Member Functions

@@ -101,256 +92,248 @@

-

-C::foo# -

+

C::foo

-

-Synopses

+

Synopses

Declared in <visibility.cpp>
-
int
-foo();
-Β» more... +
+int
+foo();
+
Β» more... -
int
-foo(bool);
-Β» more... +
+int
+foo(bool);
+
Β» more... +
-

-C::foo# -

+

C::foo

-

-Synopsis

+

Synopsis

Declared in <visibility.cpp>
-
int
-foo();
+
+int
+foo();
+
-

-C::foo# -

+

C::foo

-

-Synopsis

+

Synopsis

Declared in <visibility.cpp>
-
int
-foo(bool);
+
+int
+foo(bool);
+
-

-C::foo# -

+

C::foo

-

-Synopses

+

Synopses

Declared in <visibility.cpp>
-
static
+
+static
 int
-foo(int);
-Β» more... +foo(int);
+
Β» more... -
static
+
+static
 int
 foo(
     int,
-    bool);
-Β» more... + bool);
+
Β» more... +
-

-C::foo# -

+

C::foo

-

-Synopsis

+

Synopsis

Declared in <visibility.cpp>
-
static
+
+static
 int
-foo(int);
+foo(int);
+
-

-C::foo# -

+

C::foo

-

-Synopsis

+

Synopsis

Declared in <visibility.cpp>
-
static
+
+static
 int
 foo(
     int,
-    bool);
+ bool);
+
-

-C::foo# -

+

C::foo

-

-Synopses

+

Synopses

Declared in <visibility.cpp>
-
int
+
+int
 foo(
     int,
-    int);
-Β» more... + int);
+
Β» more... -
int
+
+int
 foo(
     int,
     int,
-    bool);
-Β» more... + bool);
+
Β» more... +
-

-C::foo# -

+

C::foo

-

-Synopsis

+

Synopsis

Declared in <visibility.cpp>
-
int
+
+int
 foo(
     int,
-    int);
+ int);
+
-

-C::foo# -

+

C::foo

-

-Synopsis

+

Synopsis

Declared in <visibility.cpp>
-
int
+
+int
 foo(
     int,
     int,
-    bool);
+ bool);
+
-

-C::foo# -

+

C::foo

-

-Synopses

+

Synopses

Declared in <visibility.cpp>
-
static
+
+static
 int
 foo(
     int,
     int,
-    int);
-Β» more... + int);
+
Β» more... -
static
+
+static
 int
 foo(
     int,
     int,
     int,
-    bool);
-Β» more... + bool);
+
Β» more... +
-

-C::foo# -

+

C::foo

-

-Synopsis

+

Synopsis

Declared in <visibility.cpp>
-
static
+
+static
 int
 foo(
     int,
     int,
-    int);
+ int);
+
-

-C::foo# -

+

C::foo

-

-Synopsis

+

Synopsis

Declared in <visibility.cpp>
-
static
+
+static
 int
 foo(
     int,
     int,
     int,
-    bool);
+ bool);
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/sfinae/alias.html b/test-files/golden-tests/config/sfinae/alias.html index 000e2e8900..186e444745 100644 --- a/test-files/golden-tests/config/sfinae/alias.html +++ b/test-files/golden-tests/config/sfinae/alias.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Types

+

Types

@@ -27,8 +23,7 @@

-

-Functions

+

Functions

@@ -45,76 +40,72 @@

-

-enable_if_t# -

+

enable_if_t

-

-Synopsis

+

Synopsis

Declared in <alias.cpp>
-
template<
+
+template<
     bool C,
     typename T>
-using enable_if_t = T;
+using enable_if_t = T;
+
-

-if_enable_t# -

+

if_enable_t

-

-Synopsis

+

Synopsis

Declared in <alias.cpp>
-
template<
+
+template<
     typename T,
     bool C>
-using if_enable_t = T;
+using if_enable_t = T;
+
-

-f1# -

+

f1

-

-Synopsis

+

Synopsis

Declared in <alias.cpp>
-
template<typename T>
+
+template<typename T>
 T
 f1()
-requires std::is_class_v<T>;
+requires std::is_class_v<T>;
+
-

-f2# -

+

f2

-

-Synopsis

+

Synopsis

Declared in <alias.cpp>
-
template<typename T>
+
+template<typename T>
 T
 f2()
-requires std::is_class_v<T>;
+requires std::is_class_v<T>;
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/sfinae/redeclare.html b/test-files/golden-tests/config/sfinae/redeclare.html index 08df51acc0..84a6ac37d9 100644 --- a/test-files/golden-tests/config/sfinae/redeclare.html +++ b/test-files/golden-tests/config/sfinae/redeclare.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Functions

+

Functions

@@ -29,25 +25,24 @@

-

-f# -

+

f

-

-Synopsis

+

Synopsis

Declared in <redeclare.cpp>
-
template<typename T>
+
+template<typename T>
 void
 f(void)
-requires std::is_class_v<T>;
+requires std::is_class_v<T>;
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/sfinae/return-based.html b/test-files/golden-tests/config/sfinae/return-based.html index 7fd7580162..bab64f561e 100644 --- a/test-files/golden-tests/config/sfinae/return-based.html +++ b/test-files/golden-tests/config/sfinae/return-based.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Functions

+

Functions

@@ -29,25 +25,24 @@

-

-f# -

+

f

-

-Synopsis

+

Synopsis

Declared in <return-based.cpp>
-
template<typename T>
+
+template<typename T>
 int
 f()
-requires std::is_class_v<T>;
+requires std::is_class_v<T>;
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/show-enum-constants/show-enum-constants-false.html b/test-files/golden-tests/config/show-enum-constants/show-enum-constants-false.html index 7fde655bdc..373967c432 100644 --- a/test-files/golden-tests/config/show-enum-constants/show-enum-constants-false.html +++ b/test-files/golden-tests/config/show-enum-constants/show-enum-constants-false.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Enums

+

Enums

@@ -29,22 +25,20 @@

-

-Color# -

+

Color

A simple enum

-

-Synopsis

+

Synopsis

Declared in <show-enum-constants-false.cpp>
-
enum class Color : int;
+
+enum class Color : int;
+
-

-Members

+

Members

@@ -62,8 +56,8 @@

- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/show-enum-constants/show-enum-constants-true.html b/test-files/golden-tests/config/show-enum-constants/show-enum-constants-true.html index 1d4f662645..82958df22d 100644 --- a/test-files/golden-tests/config/show-enum-constants/show-enum-constants-true.html +++ b/test-files/golden-tests/config/show-enum-constants/show-enum-constants-true.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Enums

+

Enums

@@ -29,22 +25,20 @@

-

-Color# -

+

Color

A simple enum

-

-Synopsis

+

Synopsis

Declared in <show-enum-constants-true.cpp>
-
enum class Color : int;
+
+enum class Color : int;
+
-

-Members

+

Members

@@ -62,59 +56,56 @@

-

-Color::Red# -

+

Color::Red

The color red

-

-Synopsis

+

Synopsis

Declared in <show-enum-constants-true.cpp>
-
Red
+
+Red
+
-

-Color::Green# -

+

Color::Green

The color green

-

-Synopsis

+

Synopsis

Declared in <show-enum-constants-true.cpp>
-
Green
+
+Green
+
-

-Color::Blue# -

+

Color::Blue

The color blue

-

-Synopsis

+

Synopsis

Declared in <show-enum-constants-true.cpp>
-
Blue
+
+Blue
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/show-namespaces/show-namespaces.html b/test-files/golden-tests/config/show-namespaces/show-namespaces.html index f756434370..d158a60b82 100644 --- a/test-files/golden-tests/config/show-namespaces/show-namespaces.html +++ b/test-files/golden-tests/config/show-namespaces/show-namespaces.html @@ -1,60 +1,56 @@ Reference -

Reference

-

-A::B::c# -

+

A::B::c

-

-Synopsis

+

Synopsis

Declared in <show-namespaces.cpp>
-
void
-c();
+
+void
+c();
+
-

-A::b# -

+

A::b

-

-Synopsis

+

Synopsis

Declared in <show-namespaces.cpp>
-
void
-b();
+
+void
+b();
+
-

-a# -

+

a

-

-Synopsis

+

Synopsis

Declared in <show-namespaces.cpp>
-
void
-a();
+
+void
+a();
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/sort-members-by/sort-members-by-location.html b/test-files/golden-tests/config/sort-members-by/sort-members-by-location.html index a3b8ff32ef..fd850bdd6b 100644 --- a/test-files/golden-tests/config/sort-members-by/sort-members-by-location.html +++ b/test-files/golden-tests/config/sort-members-by/sort-members-by-location.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Types

+

Types

@@ -29,19 +25,17 @@

-

-Z# -

+

Z

-

-Synopsis

+

Synopsis

Declared in <sort-members-by-location.cpp>
-
struct Z;
+
+struct Z;
+
-

-Member Functions

+

Member Functions

@@ -67,47 +61,45 @@

-

-Z::Z# -

+

Z::Z

Constructors

-

-Synopses

+

Synopses

Declared in <sort-members-by-location.cpp>

Construct from int

-
Z(int value);
-Β» more... +
+Z(int value);
+
Β» more...

Default constructor

-
Z();
-Β» more... +
+Z();
+
Β» more... +
-

-Z::Z# -

+

Z::Z

Construct from int

-

-Synopsis

+

Synopsis

Declared in <sort-members-by-location.cpp>
-
Z(int value);
+
+Z(int value);
+
-

-Parameters

+

Parameters

@@ -126,138 +118,127 @@

-

-Z::Z# -

+

Z::Z

Default constructor

-

-Synopsis

+

Synopsis

Declared in <sort-members-by-location.cpp>
-
Z();
+
+Z();
+
-

-Z::~Z# -

+

Z::~Z

Destructor

-

-Synopsis

+

Synopsis

Declared in <sort-members-by-location.cpp>
-
~Z();
+
+~Z();
+
-

-Z::foo# -

+

Z::foo

-

-Synopsis

+

Synopsis

Declared in <sort-members-by-location.cpp>
-
void
-foo() const;
+
+void
+foo() const;
+
-

-Z::bar# -

+

Z::bar

-

-Synopsis

+

Synopsis

Declared in <sort-members-by-location.cpp>
-
void
-bar() const;
+
+void
+bar() const;
+
-

-Z::operator bool# -

+

Z::operator bool

Conversion to bool

-

-Synopsis

+

Synopsis

Declared in <sort-members-by-location.cpp>
-
operator bool() const;
+
+operator bool() const;
+
-

-Return Value

+

Return Value

The object converted to bool
-

-Z::operator!# -

+

Z::operator!

Negation operator

-

-Synopsis

+

Synopsis

Declared in <sort-members-by-location.cpp>
-
bool
-operator!() const;
+
+bool
+operator!() const;
+
-

-Return Value

+

Return Value

true if the object is falsy, false otherwise
-

-Z::operator==# -

+

Z::operator==

Equality operator

-

-Synopsis

+

Synopsis

Declared in <sort-members-by-location.cpp>
-
bool
-operator==(Z const& rhs) const;
+
+bool
+operator==(Z const& rhs) const;
+
-

-Return Value

+

Return Value

true if the objects are equal, false otherwise
-

-Parameters

+

Parameters

@@ -276,29 +257,26 @@

-

-Z::operator!=# -

+

Z::operator!=

Inequality operator

-

-Synopsis

+

Synopsis

Declared in <sort-members-by-location.cpp>
-
bool
-operator!=(Z const& rhs) const;
+
+bool
+operator!=(Z const& rhs) const;
+
-

-Return Value

+

Return Value

true if the objects are not equal, false otherwise
-

-Parameters

+

Parameters

@@ -317,29 +295,26 @@

-

-Z::operator<=># -

+

Z::operator<=>

Three-way comparison operator

-

-Synopsis

+

Synopsis

Declared in <sort-members-by-location.cpp>
-
auto
-operator<=>(Z const& rhs) const;
+
+auto
+operator<=>(Z const& rhs) const;
+
-

-Return Value

+

Return Value

The relative order of the objects
-

-Parameters

+

Parameters

@@ -358,8 +333,8 @@

- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/sort-members-by/sort-members-by-name.html b/test-files/golden-tests/config/sort-members-by/sort-members-by-name.html index 1d8744bf99..3bb75aa170 100644 --- a/test-files/golden-tests/config/sort-members-by/sort-members-by-name.html +++ b/test-files/golden-tests/config/sort-members-by/sort-members-by-name.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Types

+

Types

@@ -29,19 +25,17 @@

-

-Z# -

+

Z

-

-Synopsis

+

Synopsis

Declared in <sort-members-by-name.cpp>
-
struct Z;
+
+struct Z;
+
-

-Member Functions

+

Member Functions

@@ -67,64 +61,61 @@

-

-Z::Z# -

+

Z::Z

Constructors

-

-Synopses

+

Synopses

Declared in <sort-members-by-name.cpp>

Default constructor

-
Z();
-Β» more... +
+Z();
+
Β» more...

Construct from int

-
Z(int value);
-Β» more... +
+Z(int value);
+
Β» more... +
-

-Z::Z# -

+

Z::Z

Default constructor

-

-Synopsis

+

Synopsis

Declared in <sort-members-by-name.cpp>
-
Z();
+
+Z();
+
-

-Z::Z# -

+

Z::Z

Construct from int

-

-Synopsis

+

Synopsis

Declared in <sort-members-by-name.cpp>
-
Z(int value);
+
+Z(int value);
+
-

-Parameters

+

Parameters

@@ -143,121 +134,111 @@

-

-Z::~Z# -

+

Z::~Z

Destructor

-

-Synopsis

+

Synopsis

Declared in <sort-members-by-name.cpp>
-
~Z();
+
+~Z();
+
-

-Z::bar# -

+

Z::bar

-

-Synopsis

+

Synopsis

Declared in <sort-members-by-name.cpp>
-
void
-bar() const;
+
+void
+bar() const;
+
-

-Z::foo# -

+

Z::foo

-

-Synopsis

+

Synopsis

Declared in <sort-members-by-name.cpp>
-
void
-foo() const;
+
+void
+foo() const;
+
-

-Z::operator bool# -

+

Z::operator bool

Conversion to bool

-

-Synopsis

+

Synopsis

Declared in <sort-members-by-name.cpp>
-
operator bool() const;
+
+operator bool() const;
+
-

-Return Value

+

Return Value

The object converted to bool
-

-Z::operator!# -

+

Z::operator!

Negation operator

-

-Synopsis

+

Synopsis

Declared in <sort-members-by-name.cpp>
-
bool
-operator!() const;
+
+bool
+operator!() const;
+
-

-Return Value

+

Return Value

true if the object is falsy, false otherwise
-

-Z::operator==# -

+

Z::operator==

Equality operator

-

-Synopsis

+

Synopsis

Declared in <sort-members-by-name.cpp>
-
bool
-operator==(Z const& rhs) const;
+
+bool
+operator==(Z const& rhs) const;
+
-

-Return Value

+

Return Value

true if the objects are equal, false otherwise
-

-Parameters

+

Parameters

@@ -276,29 +257,26 @@

-

-Z::operator!=# -

+

Z::operator!=

Inequality operator

-

-Synopsis

+

Synopsis

Declared in <sort-members-by-name.cpp>
-
bool
-operator!=(Z const& rhs) const;
+
+bool
+operator!=(Z const& rhs) const;
+
-

-Return Value

+

Return Value

true if the objects are not equal, false otherwise
-

-Parameters

+

Parameters

@@ -317,29 +295,26 @@

-

-Z::operator<=># -

+

Z::operator<=>

Three-way comparison operator

-

-Synopsis

+

Synopsis

Declared in <sort-members-by-name.cpp>
-
auto
-operator<=>(Z const& rhs) const;
+
+auto
+operator<=>(Z const& rhs) const;
+
-

-Return Value

+

Return Value

The relative order of the objects
-

-Parameters

+

Parameters

@@ -358,8 +333,8 @@

- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/sort-namespace-members-by/sort-namespace-members-by-location.html b/test-files/golden-tests/config/sort-namespace-members-by/sort-namespace-members-by-location.html index 50dafbdbb2..3176ff6a7b 100644 --- a/test-files/golden-tests/config/sort-namespace-members-by/sort-namespace-members-by-location.html +++ b/test-files/golden-tests/config/sort-namespace-members-by/sort-namespace-members-by-location.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Types

+

Types

@@ -34,8 +30,7 @@

-

-Functions

+

Functions

@@ -56,144 +51,135 @@

-

-D# -

+

D

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-location.cpp>
-
struct D;
+
+struct D;
+
-

-C# -

+

C

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-location.cpp>
-
template<
+
+template<
     class T,
     class U = void>
-struct C;
+struct C;
+
-

-C<int, char># -

+

C<int, char>

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-location.cpp>
-
template<>
-struct C<int, char>;
+
+template<>
+struct C<int, char>;
+
-

-C<int># -

+

C<int>

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-location.cpp>
-
template<>
-struct C<int>;
+
+template<>
+struct C<int>;
+
-

-B# -

+

B

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-location.cpp>
-
template<
+
+template<
     class T,
     class U>
-struct B;
+struct B;
+
-

-B<int, char># -

+

B<int, char>

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-location.cpp>
-
template<>
-struct B<int, char>;
+
+template<>
+struct B<int, char>;
+
-

-B<int, U># -

+

B<int, U>

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-location.cpp>
-
template<class U>
-struct B<int, U>;
+
+template<class U>
+struct B<int, U>;
+
-

-A# -

+

A

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-location.cpp>
-
struct A;
+
+struct A;
+
-

-Non-Member Functions

+

Non-Member Functions

@@ -211,19 +197,17 @@

-

-Z# -

+

Z

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-location.cpp>
-
struct Z;
+
+struct Z;
+
-

-Member Functions

+

Member Functions

@@ -248,64 +232,61 @@

-

-Z::Z# -

+

Z::Z

Constructors

-

-Synopses

+

Synopses

Declared in <sort-namespace-members-by-location.cpp>

Default constructor

-
Z();
-Β» more... +
+Z();
+
Β» more...

Construct from int

-
Z(int value);
-Β» more... +
+Z(int value);
+
Β» more... +
-

-Z::Z# -

+

Z::Z

Default constructor

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-location.cpp>
-
Z();
+
+Z();
+
-

-Z::Z# -

+

Z::Z

Construct from int

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-location.cpp>
-
Z(int value);
+
+Z(int value);
+
-

-Parameters

+

Parameters

@@ -324,106 +305,97 @@

-

-Z::~Z# -

+

Z::~Z

Destructor

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-location.cpp>
-
~Z();
+
+~Z();
+
-

-Z::foo# -

+

Z::foo

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-location.cpp>
-
void
-foo() const;
+
+void
+foo() const;
+
-

-Z::operator bool# -

+

Z::operator bool

Conversion to bool

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-location.cpp>
-
operator bool() const;
+
+operator bool() const;
+
-

-Return Value

+

Return Value

The object converted to bool
-

-Z::operator!# -

+

Z::operator!

Negation operator

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-location.cpp>
-
bool
-operator!() const;
+
+bool
+operator!() const;
+
-

-Return Value

+

Return Value

true if the object is falsy, false otherwise
-

-Z::operator==# -

+

Z::operator==

Equality operator

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-location.cpp>
-
bool
-operator==(Z const& rhs) const;
+
+bool
+operator==(Z const& rhs) const;
+
-

-Return Value

+

Return Value

true if the objects are equal, false otherwise
-

-Parameters

+

Parameters

@@ -442,29 +414,26 @@

-

-Z::operator!=# -

+

Z::operator!=

Inequality operator

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-location.cpp>
-
bool
-operator!=(Z const& rhs) const;
+
+bool
+operator!=(Z const& rhs) const;
+
-

-Return Value

+

Return Value

true if the objects are not equal, false otherwise
-

-Parameters

+

Parameters

@@ -483,29 +452,26 @@

-

-Z::operator<=># -

+

Z::operator<=>

Three-way comparison operator

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-location.cpp>
-
auto
-operator<=>(Z const& rhs) const;
+
+auto
+operator<=>(Z const& rhs) const;
+
-

-Return Value

+

Return Value

The relative order of the objects
-

-Parameters

+

Parameters

@@ -524,238 +490,231 @@

-

-h# -

+

h

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-location.cpp>
-
void
-h();
+
+void
+h();
+
-

-g# -

+

g

-

-Synopses

+

Synopses

Declared in <sort-namespace-members-by-location.cpp>
-
template<class T>
+
+template<class T>
 char
 g(
     T,
     T,
-    T);
-Β» more... + T);
+
Β» more... -
template<>
+
+template<>
 char
 g<int>(
     int,
     int,
-    int);
-Β» more... + int);
+
Β» more... -
char
+
+char
 g(
     char,
     char,
-    char);
-Β» more... + char);
+
Β» more... -
char
+
+char
 g(
     double,
-    char);
-Β» more... + char);
+
Β» more... + +
+char
+g(double);
+
Β» more... -
char
-g(double);
-Β» more... +
+char
+g(int);
+
Β» more... -
char
-g(int);
-Β» more... +
+void
+g();
+
Β» more... -
void
-g();
-Β» more...
-

-g# -

+

g

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-location.cpp>
-
template<class T>
+
+template<class T>
 char
 g(
     T,
     T,
-    T);
+ T);
+
-

-g<int># -

+

g<int>

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-location.cpp>
-
template<>
+
+template<>
 char
 g<int>(
     int,
     int,
-    int);
+ int);
+
-

-g# -

+

g

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-location.cpp>
-
char
+
+char
 g(
     char,
     char,
-    char);
+ char);
+
-

-g# -

+

g

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-location.cpp>
-
char
+
+char
 g(
     double,
-    char);
+ char);
+
-

-g# -

+

g

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-location.cpp>
-
char
-g(double);
+
+char
+g(double);
+
-

-g# -

+

g

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-location.cpp>
-
char
-g(int);
+
+char
+g(int);
+
-

-g# -

+

g

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-location.cpp>
-
void
-g();
+
+void
+g();
+
-

-f# -

+

f

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-location.cpp>
-
void
-f();
+
+void
+f();
+
-

-operator!# -

+

operator!

Negation operator

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-location.cpp>
-
bool
-operator!(A const& v);
+
+bool
+operator!(A const& v);
+
-

-Return Value

+

Return Value

true if the object is falsy, false otherwise
-

-Parameters

+

Parameters

@@ -774,31 +733,28 @@

-

-operator==# -

+

operator==

Equality operator

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-location.cpp>
-
bool
+
+bool
 operator==(
     A const& lhs,
-    A const& rhs);
+ A const& rhs);
+
-

-Return Value

+

Return Value

true if the objects are equal, false otherwise
-

-Parameters

+

Parameters

@@ -821,31 +777,28 @@

-

-operator!=# -

+

operator!=

Inequality operator

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-location.cpp>
-
bool
+
+bool
 operator!=(
     A const& lhs,
-    A const& rhs);
+ A const& rhs);
+
-

-Return Value

+

Return Value

true if the objects are not equal, false otherwise
-

-Parameters

+

Parameters

@@ -868,8 +821,8 @@

- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/sort-namespace-members-by/sort-namespace-members-by-name.html b/test-files/golden-tests/config/sort-namespace-members-by/sort-namespace-members-by-name.html index cca2b485ba..e468b6fbdc 100644 --- a/test-files/golden-tests/config/sort-namespace-members-by/sort-namespace-members-by-name.html +++ b/test-files/golden-tests/config/sort-namespace-members-by/sort-namespace-members-by-name.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Types

+

Types

@@ -34,8 +30,7 @@

-

-Functions

+

Functions

@@ -56,22 +51,20 @@

-

-A# -

+

A

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-name.cpp>
-
struct A;
+
+struct A;
+
-

-Non-Member Functions

+

Non-Member Functions

@@ -89,141 +82,132 @@

-

-B# -

+

B

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-name.cpp>
-
template<
+
+template<
     class T,
     class U>
-struct B;
+struct B;
+
-

-B<int, char># -

+

B<int, char>

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-name.cpp>
-
template<>
-struct B<int, char>;
+
+template<>
+struct B<int, char>;
+
-

-B<int, U># -

+

B<int, U>

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-name.cpp>
-
template<class U>
-struct B<int, U>;
+
+template<class U>
+struct B<int, U>;
+
-

-C# -

+

C

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-name.cpp>
-
template<
+
+template<
     class T,
     class U = void>
-struct C;
+struct C;
+
-

-C<int># -

+

C<int>

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-name.cpp>
-
template<>
-struct C<int>;
+
+template<>
+struct C<int>;
+
-

-C<int, char># -

+

C<int, char>

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-name.cpp>
-
template<>
-struct C<int, char>;
+
+template<>
+struct C<int, char>;
+
-

-D# -

+

D

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-name.cpp>
-
struct D;
+
+struct D;
+
-

-Z# -

+

Z

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-name.cpp>
-
struct Z;
+
+struct Z;
+
-

-Member Functions

+

Member Functions

@@ -248,64 +232,61 @@

-

-Z::Z# -

+

Z::Z

Constructors

-

-Synopses

+

Synopses

Declared in <sort-namespace-members-by-name.cpp>

Default constructor

-
Z();
-Β» more... +
+Z();
+
Β» more...

Construct from int

-
Z(int value);
-Β» more... +
+Z(int value);
+
Β» more... +
-

-Z::Z# -

+

Z::Z

Default constructor

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-name.cpp>
-
Z();
+
+Z();
+
-

-Z::Z# -

+

Z::Z

Construct from int

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-name.cpp>
-
Z(int value);
+
+Z(int value);
+
-

-Parameters

+

Parameters

@@ -324,106 +305,97 @@

-

-Z::~Z# -

+

Z::~Z

Destructor

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-name.cpp>
-
~Z();
+
+~Z();
+
-

-Z::foo# -

+

Z::foo

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-name.cpp>
-
void
-foo() const;
+
+void
+foo() const;
+
-

-Z::operator bool# -

+

Z::operator bool

Conversion to bool

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-name.cpp>
-
operator bool() const;
+
+operator bool() const;
+
-

-Return Value

+

Return Value

The object converted to bool
-

-Z::operator!# -

+

Z::operator!

Negation operator

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-name.cpp>
-
bool
-operator!() const;
+
+bool
+operator!() const;
+
-

-Return Value

+

Return Value

true if the object is falsy, false otherwise
-

-Z::operator==# -

+

Z::operator==

Equality operator

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-name.cpp>
-
bool
-operator==(Z const& rhs) const;
+
+bool
+operator==(Z const& rhs) const;
+
-

-Return Value

+

Return Value

true if the objects are equal, false otherwise
-

-Parameters

+

Parameters

@@ -442,29 +414,26 @@

-

-Z::operator!=# -

+

Z::operator!=

Inequality operator

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-name.cpp>
-
bool
-operator!=(Z const& rhs) const;
+
+bool
+operator!=(Z const& rhs) const;
+
-

-Return Value

+

Return Value

true if the objects are not equal, false otherwise
-

-Parameters

+

Parameters

@@ -483,29 +452,26 @@

-

-Z::operator<=># -

+

Z::operator<=>

Three-way comparison operator

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-name.cpp>
-
auto
-operator<=>(Z const& rhs) const;
+
+auto
+operator<=>(Z const& rhs) const;
+
-

-Return Value

+

Return Value

The relative order of the objects
-

-Parameters

+

Parameters

@@ -524,238 +490,231 @@

-

-f# -

+

f

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-name.cpp>
-
void
-f();
+
+void
+f();
+
-

-g# -

+

g

-

-Synopses

+

Synopses

Declared in <sort-namespace-members-by-name.cpp>
-
void
-g();
-Β» more... +
+void
+g();
+
Β» more... -
char
-g(int);
-Β» more... +
+char
+g(int);
+
Β» more... -
char
-g(double);
-Β» more... +
+char
+g(double);
+
Β» more... -
char
+
+char
 g(
     double,
-    char);
-Β» more... + char);
+
Β» more... -
char
+
+char
 g(
     char,
     char,
-    char);
-Β» more... + char);
+
Β» more... -
template<class T>
+
+template<class T>
 char
 g(
     T,
     T,
-    T);
-Β» more... + T);
+
Β» more... -
template<>
+
+template<>
 char
 g<int>(
     int,
     int,
-    int);
-Β» more... + int);
+
Β» more... +
-

-g# -

+

g

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-name.cpp>
-
void
-g();
+
+void
+g();
+
-

-g# -

+

g

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-name.cpp>
-
char
-g(int);
+
+char
+g(int);
+
-

-g# -

+

g

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-name.cpp>
-
char
-g(double);
+
+char
+g(double);
+
-

-g# -

+

g

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-name.cpp>
-
char
+
+char
 g(
     double,
-    char);
+ char);
+
-

-g# -

+

g

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-name.cpp>
-
char
+
+char
 g(
     char,
     char,
-    char);
+ char);
+
-

-g# -

+

g

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-name.cpp>
-
template<class T>
+
+template<class T>
 char
 g(
     T,
     T,
-    T);
+ T);
+
-

-g<int># -

+

g<int>

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-name.cpp>
-
template<>
+
+template<>
 char
 g<int>(
     int,
     int,
-    int);
+ int);
+
-

-h# -

+

h

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-name.cpp>
-
void
-h();
+
+void
+h();
+
-

-operator!# -

+

operator!

Negation operator

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-name.cpp>
-
bool
-operator!(A const& v);
+
+bool
+operator!(A const& v);
+
-

-Return Value

+

Return Value

true if the object is falsy, false otherwise
-

-Parameters

+

Parameters

@@ -774,31 +733,28 @@

-

-operator==# -

+

operator==

Equality operator

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-name.cpp>
-
bool
+
+bool
 operator==(
     A const& lhs,
-    A const& rhs);
+ A const& rhs);
+
-

-Return Value

+

Return Value

true if the objects are equal, false otherwise
-

-Parameters

+

Parameters

@@ -821,31 +777,28 @@

-

-operator!=# -

+

operator!=

Inequality operator

-

-Synopsis

+

Synopsis

Declared in <sort-namespace-members-by-name.cpp>
-
bool
+
+bool
 operator!=(
     A const& lhs,
-    A const& rhs);
+ A const& rhs);
+
-

-Return Value

+

Return Value

true if the objects are not equal, false otherwise
-

-Parameters

+

Parameters

@@ -868,8 +821,8 @@

- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/sort/sort-members.html b/test-files/golden-tests/config/sort/sort-members.html index 6c879a2d42..5df0de8cec 100644 --- a/test-files/golden-tests/config/sort/sort-members.html +++ b/test-files/golden-tests/config/sort/sort-members.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Types

+

Types

@@ -34,8 +30,7 @@

-

-Functions

+

Functions

@@ -56,22 +51,20 @@

-

-A# -

+

A

-

-Synopsis

+

Synopsis

Declared in <sort-members.cpp>
-
struct A;
+
+struct A;
+
-

-Non-Member Functions

+

Non-Member Functions

@@ -89,141 +82,132 @@

-

-B# -

+

B

-

-Synopsis

+

Synopsis

Declared in <sort-members.cpp>
-
template<
+
+template<
     class T,
     class U>
-struct B;
+struct B;
+
-

-B<int, char># -

+

B<int, char>

-

-Synopsis

+

Synopsis

Declared in <sort-members.cpp>
-
template<>
-struct B<int, char>;
+
+template<>
+struct B<int, char>;
+
-

-B<int, U># -

+

B<int, U>

-

-Synopsis

+

Synopsis

Declared in <sort-members.cpp>
-
template<class U>
-struct B<int, U>;
+
+template<class U>
+struct B<int, U>;
+
-

-C# -

+

C

-

-Synopsis

+

Synopsis

Declared in <sort-members.cpp>
-
template<
+
+template<
     class T,
     class U = void>
-struct C;
+struct C;
+
-

-C<int># -

+

C<int>

-

-Synopsis

+

Synopsis

Declared in <sort-members.cpp>
-
template<>
-struct C<int>;
+
+template<>
+struct C<int>;
+
-

-C<int, char># -

+

C<int, char>

-

-Synopsis

+

Synopsis

Declared in <sort-members.cpp>
-
template<>
-struct C<int, char>;
+
+template<>
+struct C<int, char>;
+
-

-D# -

+

D

-

-Synopsis

+

Synopsis

Declared in <sort-members.cpp>
-
struct D;
+
+struct D;
+
-

-Z# -

+

Z

-

-Synopsis

+

Synopsis

Declared in <sort-members.cpp>
-
struct Z;
+
+struct Z;
+
-

-Member Functions

+

Member Functions

@@ -248,64 +232,61 @@

-

-Z::Z# -

+

Z::Z

Constructors

-

-Synopses

+

Synopses

Declared in <sort-members.cpp>

Default constructor

-
Z();
-Β» more... +
+Z();
+
Β» more...

Construct from int

-
Z(int value);
-Β» more... +
+Z(int value);
+
Β» more... +
-

-Z::Z# -

+

Z::Z

Default constructor

-

-Synopsis

+

Synopsis

Declared in <sort-members.cpp>
-
Z();
+
+Z();
+
-

-Z::Z# -

+

Z::Z

Construct from int

-

-Synopsis

+

Synopsis

Declared in <sort-members.cpp>
-
Z(int value);
+
+Z(int value);
+
-

-Parameters

+

Parameters

@@ -324,106 +305,97 @@

-

-Z::~Z# -

+

Z::~Z

Destructor

-

-Synopsis

+

Synopsis

Declared in <sort-members.cpp>
-
~Z();
+
+~Z();
+
-

-Z::foo# -

+

Z::foo

-

-Synopsis

+

Synopsis

Declared in <sort-members.cpp>
-
void
-foo() const;
+
+void
+foo() const;
+
-

-Z::operator bool# -

+

Z::operator bool

Conversion to bool

-

-Synopsis

+

Synopsis

Declared in <sort-members.cpp>
-
operator bool() const;
+
+operator bool() const;
+
-

-Return Value

+

Return Value

The object converted to bool
-

-Z::operator!# -

+

Z::operator!

Negation operator

-

-Synopsis

+

Synopsis

Declared in <sort-members.cpp>
-
bool
-operator!() const;
+
+bool
+operator!() const;
+
-

-Return Value

+

Return Value

true if the object is falsy, false otherwise
-

-Z::operator==# -

+

Z::operator==

Equality operator

-

-Synopsis

+

Synopsis

Declared in <sort-members.cpp>
-
bool
-operator==(Z const& rhs) const;
+
+bool
+operator==(Z const& rhs) const;
+
-

-Return Value

+

Return Value

true if the objects are equal, false otherwise
-

-Parameters

+

Parameters

@@ -442,29 +414,26 @@

-

-Z::operator!=# -

+

Z::operator!=

Inequality operator

-

-Synopsis

+

Synopsis

Declared in <sort-members.cpp>
-
bool
-operator!=(Z const& rhs) const;
+
+bool
+operator!=(Z const& rhs) const;
+
-

-Return Value

+

Return Value

true if the objects are not equal, false otherwise
-

-Parameters

+

Parameters

@@ -483,29 +452,26 @@

-

-Z::operator<=># -

+

Z::operator<=>

Three-way comparison operator

-

-Synopsis

+

Synopsis

Declared in <sort-members.cpp>
-
auto
-operator<=>(Z const& rhs) const;
+
+auto
+operator<=>(Z const& rhs) const;
+
-

-Return Value

+

Return Value

The relative order of the objects
-

-Parameters

+

Parameters

@@ -524,238 +490,231 @@

-

-f# -

+

f

-

-Synopsis

+

Synopsis

Declared in <sort-members.cpp>
-
void
-f();
+
+void
+f();
+
-

-g# -

+

g

-

-Synopses

+

Synopses

Declared in <sort-members.cpp>
-
void
-g();
-Β» more... +
+void
+g();
+
Β» more... -
char
-g(int);
-Β» more... +
+char
+g(int);
+
Β» more... -
char
-g(double);
-Β» more... +
+char
+g(double);
+
Β» more... -
char
+
+char
 g(
     double,
-    char);
-Β» more... + char);
+
Β» more... -
char
+
+char
 g(
     char,
     char,
-    char);
-Β» more... + char);
+
Β» more... -
template<class T>
+
+template<class T>
 char
 g(
     T,
     T,
-    T);
-Β» more... + T);
+
Β» more... -
template<>
+
+template<>
 char
 g<int>(
     int,
     int,
-    int);
-Β» more... + int);
+
Β» more... +
-

-g# -

+

g

-

-Synopsis

+

Synopsis

Declared in <sort-members.cpp>
-
void
-g();
+
+void
+g();
+
-

-g# -

+

g

-

-Synopsis

+

Synopsis

Declared in <sort-members.cpp>
-
char
-g(int);
+
+char
+g(int);
+
-

-g# -

+

g

-

-Synopsis

+

Synopsis

Declared in <sort-members.cpp>
-
char
-g(double);
+
+char
+g(double);
+
-

-g# -

+

g

-

-Synopsis

+

Synopsis

Declared in <sort-members.cpp>
-
char
+
+char
 g(
     double,
-    char);
+ char);
+
-

-g# -

+

g

-

-Synopsis

+

Synopsis

Declared in <sort-members.cpp>
-
char
+
+char
 g(
     char,
     char,
-    char);
+ char);
+
-

-g# -

+

g

-

-Synopsis

+

Synopsis

Declared in <sort-members.cpp>
-
template<class T>
+
+template<class T>
 char
 g(
     T,
     T,
-    T);
+ T);
+
-

-g<int># -

+

g<int>

-

-Synopsis

+

Synopsis

Declared in <sort-members.cpp>
-
template<>
+
+template<>
 char
 g<int>(
     int,
     int,
-    int);
+ int);
+
-

-h# -

+

h

-

-Synopsis

+

Synopsis

Declared in <sort-members.cpp>
-
void
-h();
+
+void
+h();
+
-

-operator!# -

+

operator!

Negation operator

-

-Synopsis

+

Synopsis

Declared in <sort-members.cpp>
-
bool
-operator!(A const& v);
+
+bool
+operator!(A const& v);
+
-

-Return Value

+

Return Value

true if the object is falsy, false otherwise
-

-Parameters

+

Parameters

@@ -774,31 +733,28 @@

-

-operator==# -

+

operator==

Equality operator

-

-Synopsis

+

Synopsis

Declared in <sort-members.cpp>
-
bool
+
+bool
 operator==(
     A const& lhs,
-    A const& rhs);
+ A const& rhs);
+
-

-Return Value

+

Return Value

true if the objects are equal, false otherwise
-

-Parameters

+

Parameters

@@ -821,31 +777,28 @@

-

-operator!=# -

+

operator!=

Inequality operator

-

-Synopsis

+

Synopsis

Declared in <sort-members.cpp>
-
bool
+
+bool
 operator!=(
     A const& lhs,
-    A const& rhs);
+ A const& rhs);
+
-

-Return Value

+

Return Value

true if the objects are not equal, false otherwise
-

-Parameters

+

Parameters

@@ -868,8 +821,8 @@

- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/sort/unordered.html b/test-files/golden-tests/config/sort/unordered.html index c3b013aba7..838f12f00d 100644 --- a/test-files/golden-tests/config/sort/unordered.html +++ b/test-files/golden-tests/config/sort/unordered.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Types

+

Types

@@ -34,8 +30,7 @@

-

-Functions

+

Functions

@@ -56,144 +51,135 @@

-

-D# -

+

D

-

-Synopsis

+

Synopsis

Declared in <unordered.cpp>
-
struct D;
+
+struct D;
+
-

-C# -

+

C

-

-Synopsis

+

Synopsis

Declared in <unordered.cpp>
-
template<
+
+template<
     class T,
     class U = void>
-struct C;
+struct C;
+
-

-C<int, char># -

+

C<int, char>

-

-Synopsis

+

Synopsis

Declared in <unordered.cpp>
-
template<>
-struct C<int, char>;
+
+template<>
+struct C<int, char>;
+
-

-C<int># -

+

C<int>

-

-Synopsis

+

Synopsis

Declared in <unordered.cpp>
-
template<>
-struct C<int>;
+
+template<>
+struct C<int>;
+
-

-B# -

+

B

-

-Synopsis

+

Synopsis

Declared in <unordered.cpp>
-
template<
+
+template<
     class T,
     class U>
-struct B;
+struct B;
+
-

-B<int, char># -

+

B<int, char>

-

-Synopsis

+

Synopsis

Declared in <unordered.cpp>
-
template<>
-struct B<int, char>;
+
+template<>
+struct B<int, char>;
+
-

-B<int, U># -

+

B<int, U>

-

-Synopsis

+

Synopsis

Declared in <unordered.cpp>
-
template<class U>
-struct B<int, U>;
+
+template<class U>
+struct B<int, U>;
+
-

-A# -

+

A

-

-Synopsis

+

Synopsis

Declared in <unordered.cpp>
-
struct A;
+
+struct A;
+
-

-Non-Member Functions

+

Non-Member Functions

@@ -211,19 +197,17 @@

-

-Z# -

+

Z

-

-Synopsis

+

Synopsis

Declared in <unordered.cpp>
-
struct Z;
+
+struct Z;
+
-

-Member Functions

+

Member Functions

@@ -248,29 +232,26 @@

-

-Z::operator<=># -

+

Z::operator<=>

Three-way comparison operator

-

-Synopsis

+

Synopsis

Declared in <unordered.cpp>
-
auto
-operator<=>(Z const& rhs) const;
+
+auto
+operator<=>(Z const& rhs) const;
+
-

-Return Value

+

Return Value

The relative order of the objects
-

-Parameters

+

Parameters

@@ -289,29 +270,26 @@

-

-Z::operator!=# -

+

Z::operator!=

Inequality operator

-

-Synopsis

+

Synopsis

Declared in <unordered.cpp>
-
bool
-operator!=(Z const& rhs) const;
+
+bool
+operator!=(Z const& rhs) const;
+
-

-Return Value

+

Return Value

true if the objects are not equal, false otherwise
-

-Parameters

+

Parameters

@@ -330,29 +308,26 @@

-

-Z::operator==# -

+

Z::operator==

Equality operator

-

-Synopsis

+

Synopsis

Declared in <unordered.cpp>
-
bool
-operator==(Z const& rhs) const;
+
+bool
+operator==(Z const& rhs) const;
+
-

-Return Value

+

Return Value

true if the objects are equal, false otherwise
-

-Parameters

+

Parameters

@@ -371,141 +346,132 @@

-

-Z::operator!# -

+

Z::operator!

Negation operator

-

-Synopsis

+

Synopsis

Declared in <unordered.cpp>
-
bool
-operator!() const;
+
+bool
+operator!() const;
+
-

-Return Value

+

Return Value

true if the object is falsy, false otherwise
-

-Z::operator bool# -

+

Z::operator bool

Conversion to bool

-

-Synopsis

+

Synopsis

Declared in <unordered.cpp>
-
operator bool() const;
+
+operator bool() const;
+
-

-Return Value

+

Return Value

The object converted to bool
-

-Z::foo# -

+

Z::foo

-

-Synopsis

+

Synopsis

Declared in <unordered.cpp>
-
void
-foo() const;
+
+void
+foo() const;
+
-

-Z::~Z# -

+

Z::~Z

Destructor

-

-Synopsis

+

Synopsis

Declared in <unordered.cpp>
-
~Z();
+
+~Z();
+
-

-Z::Z# -

+

Z::Z

Constructors

-

-Synopses

+

Synopses

Declared in <unordered.cpp>

Default constructor

-
Z();
-Β» more... +
+Z();
+
Β» more...

Construct from int

-
Z(int value);
-Β» more... +
+Z(int value);
+
Β» more... +
-

-Z::Z# -

+

Z::Z

Default constructor

-

-Synopsis

+

Synopsis

Declared in <unordered.cpp>
-
Z();
+
+Z();
+
-

-Z::Z# -

+

Z::Z

Construct from int

-

-Synopsis

+

Synopsis

Declared in <unordered.cpp>
-
Z(int value);
+
+Z(int value);
+
-

-Parameters

+

Parameters

@@ -524,31 +490,28 @@

-

-operator!=# -

+

operator!=

Inequality operator

-

-Synopsis

+

Synopsis

Declared in <unordered.cpp>
-
bool
+
+bool
 operator!=(
     A const& lhs,
-    A const& rhs);
+ A const& rhs);
+
-

-Return Value

+

Return Value

true if the objects are not equal, false otherwise
-

-Parameters

+

Parameters

@@ -571,31 +534,28 @@

-

-operator==# -

+

operator==

Equality operator

-

-Synopsis

+

Synopsis

Declared in <unordered.cpp>
-
bool
+
+bool
 operator==(
     A const& lhs,
-    A const& rhs);
+ A const& rhs);
+
-

-Return Value

+

Return Value

true if the objects are equal, false otherwise
-

-Parameters

+

Parameters

@@ -618,29 +578,26 @@

-

-operator!# -

+

operator!

Negation operator

-

-Synopsis

+

Synopsis

Declared in <unordered.cpp>
-
bool
-operator!(A const& v);
+
+bool
+operator!(A const& v);
+
-

-Return Value

+

Return Value

true if the object is falsy, false otherwise
-

-Parameters

+

Parameters

@@ -659,217 +616,213 @@

-

-h# -

+

h

-

-Synopsis

+

Synopsis

Declared in <unordered.cpp>
-
void
-h();
+
+void
+h();
+
-

-g# -

+

g

-

-Synopses

+

Synopses

Declared in <unordered.cpp>
-
template<class T>
+
+template<class T>
 char
 g(
     T,
     T,
-    T);
-Β» more... + T);
+
Β» more... -
template<>
+
+template<>
 char
 g<int>(
     int,
     int,
-    int);
-Β» more... + int);
+
Β» more... -
char
+
+char
 g(
     char,
     char,
-    char);
-Β» more... + char);
+
Β» more... -
char
+
+char
 g(
     double,
-    char);
-Β» more... + char);
+
Β» more... + +
+char
+g(double);
+
Β» more... -
char
-g(double);
-Β» more... +
+char
+g(int);
+
Β» more... -
char
-g(int);
-Β» more... +
+void
+g();
+
Β» more... -
void
-g();
-Β» more...
-

-g# -

+

g

-

-Synopsis

+

Synopsis

Declared in <unordered.cpp>
-
template<class T>
+
+template<class T>
 char
 g(
     T,
     T,
-    T);
+ T);
+
-

-g<int># -

+

g<int>

-

-Synopsis

+

Synopsis

Declared in <unordered.cpp>
-
template<>
+
+template<>
 char
 g<int>(
     int,
     int,
-    int);
+ int);
+
-

-g# -

+

g

-

-Synopsis

+

Synopsis

Declared in <unordered.cpp>
-
char
+
+char
 g(
     char,
     char,
-    char);
+ char);
+
-

-g# -

+

g

-

-Synopsis

+

Synopsis

Declared in <unordered.cpp>
-
char
+
+char
 g(
     double,
-    char);
+ char);
+
-

-g# -

+

g

-

-Synopsis

+

Synopsis

Declared in <unordered.cpp>
-
char
-g(double);
+
+char
+g(double);
+
-

-g# -

+

g

-

-Synopsis

+

Synopsis

Declared in <unordered.cpp>
-
char
-g(int);
+
+char
+g(int);
+
-

-g# -

+

g

-

-Synopsis

+

Synopsis

Declared in <unordered.cpp>
-
void
-g();
+
+void
+g();
+
-

-f# -

+

f

-

-Synopsis

+

Synopsis

Declared in <unordered.cpp>
-
void
-f();
+
+void
+f();
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/config/stylesheets/custom.css b/test-files/golden-tests/config/stylesheets/custom.css deleted file mode 100644 index a73e3e1995..0000000000 --- a/test-files/golden-tests/config/stylesheets/custom.css +++ /dev/null @@ -1,7 +0,0 @@ -body { - background: #f7f7ff; -} - -.title { - color: #123456; -} diff --git a/test-files/golden-tests/config/stylesheets/default-inline.adoc b/test-files/golden-tests/config/stylesheets/default-inline.adoc deleted file mode 100644 index 50b403dd0c..0000000000 --- a/test-files/golden-tests/config/stylesheets/default-inline.adoc +++ /dev/null @@ -1,42 +0,0 @@ -= Reference -:mrdocs: - -[#index] -== Global namespace - -=== Namespaces - -[cols=1] -|=== -| Name -| link:#ns[`ns`] -|=== - -[#ns] -== ns - -=== Types - -[cols="1,4"] -|=== -| Name| Description -| link:#ns-Foo[`Foo`] -| Doc for Foo -|=== - -[#ns-Foo] -== link:#ns[ns]::Foo - -Doc for Foo - -=== Synopsis - -Declared in `<default‐inline.cpp>` - -[source,cpp,subs="verbatim,replacements,macros,-callouts"] ----- -struct Foo; ----- - - -[.small]#Created with https://www.mrdocs.com[MrDocs]# diff --git a/test-files/golden-tests/config/stylesheets/default-inline.cpp b/test-files/golden-tests/config/stylesheets/default-inline.cpp deleted file mode 100644 index ad27e4f884..0000000000 --- a/test-files/golden-tests/config/stylesheets/default-inline.cpp +++ /dev/null @@ -1,8 +0,0 @@ -namespace ns { - -/// Doc for Foo -struct Foo -{ -}; - -} // namespace ns diff --git a/test-files/golden-tests/config/stylesheets/default-inline.html b/test-files/golden-tests/config/stylesheets/default-inline.html deleted file mode 100644 index 43b16dbf5b..0000000000 --- a/test-files/golden-tests/config/stylesheets/default-inline.html +++ /dev/null @@ -1,500 +0,0 @@ - - - - - -Reference - - - -
-

Reference

-
-
-

-Global Namespace# -

-
-

-Namespaces

-

- - - - - - - - - -
Name
ns
- - -
-
-

-ns# -

-
-

-Types

- - - - - - - - - - -
NameDescription
Foo Doc for Foo
- -
-
-
-

-ns::Foo# -

-
-

Doc for Foo

-
-
-
-

-Synopsis

-
-Declared in <default-inline.cpp>
-
struct Foo;
-
- - -
- - - - - - \ No newline at end of file diff --git a/test-files/golden-tests/config/stylesheets/default-inline.xml b/test-files/golden-tests/config/stylesheets/default-inline.xml deleted file mode 100644 index d7e860728d..0000000000 --- a/test-files/golden-tests/config/stylesheets/default-inline.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - Doc for Foo - - - - - - diff --git a/test-files/golden-tests/config/stylesheets/default-inline.yml b/test-files/golden-tests/config/stylesheets/default-inline.yml deleted file mode 100644 index 4917eb3432..0000000000 --- a/test-files/golden-tests/config/stylesheets/default-inline.yml +++ /dev/null @@ -1 +0,0 @@ -no-default-styles: false diff --git a/test-files/golden-tests/config/stylesheets/inline-custom.adoc b/test-files/golden-tests/config/stylesheets/inline-custom.adoc deleted file mode 100644 index 501f23d9c2..0000000000 --- a/test-files/golden-tests/config/stylesheets/inline-custom.adoc +++ /dev/null @@ -1,42 +0,0 @@ -= Reference -:mrdocs: - -[#index] -== Global namespace - -=== Namespaces - -[cols=1] -|=== -| Name -| link:#ns[`ns`] -|=== - -[#ns] -== ns - -=== Types - -[cols="1,4"] -|=== -| Name| Description -| link:#ns-Styled[`Styled`] -| Custom style sample -|=== - -[#ns-Styled] -== link:#ns[ns]::Styled - -Custom style sample - -=== Synopsis - -Declared in `<inline‐custom.cpp>` - -[source,cpp,subs="verbatim,replacements,macros,-callouts"] ----- -struct Styled; ----- - - -[.small]#Created with https://www.mrdocs.com[MrDocs]# diff --git a/test-files/golden-tests/config/stylesheets/inline-custom.cpp b/test-files/golden-tests/config/stylesheets/inline-custom.cpp deleted file mode 100644 index 5151a362b8..0000000000 --- a/test-files/golden-tests/config/stylesheets/inline-custom.cpp +++ /dev/null @@ -1,8 +0,0 @@ -namespace ns { - -/// Custom style sample -struct Styled -{ -}; - -} // namespace ns diff --git a/test-files/golden-tests/config/stylesheets/inline-custom.html b/test-files/golden-tests/config/stylesheets/inline-custom.html deleted file mode 100644 index e83ad24f21..0000000000 --- a/test-files/golden-tests/config/stylesheets/inline-custom.html +++ /dev/null @@ -1,86 +0,0 @@ - - - -Reference - - - -
-

Reference

-
-
-

-Global Namespace# -

-
-

-Namespaces

- - - - - - - - - - -
Name
ns
- -
-
-
-

-ns# -

-
-

-Types

- - - - - - - - - - -
NameDescription
Styled Custom style sample
- -
-
-
-

-ns::Styled# -

-
-

Custom style sample

-
-
-
-

-Synopsis

-
-Declared in <inline-custom.cpp>
-
struct Styled;
-
- - -
- -
- - - \ No newline at end of file diff --git a/test-files/golden-tests/config/stylesheets/inline-custom.xml b/test-files/golden-tests/config/stylesheets/inline-custom.xml deleted file mode 100644 index 77c0000df4..0000000000 --- a/test-files/golden-tests/config/stylesheets/inline-custom.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - Custom style sample - - - - - - diff --git a/test-files/golden-tests/config/stylesheets/inline-custom.yml b/test-files/golden-tests/config/stylesheets/inline-custom.yml deleted file mode 100644 index ce00c3712c..0000000000 --- a/test-files/golden-tests/config/stylesheets/inline-custom.yml +++ /dev/null @@ -1,4 +0,0 @@ -stylesheets: - - custom.css -linkcss: false -no-default-styles: true diff --git a/test-files/golden-tests/config/stylesheets/link-custom-stylesdir-no-copy.cpp b/test-files/golden-tests/config/stylesheets/link-custom-stylesdir-no-copy.cpp deleted file mode 100644 index c86f37ef48..0000000000 --- a/test-files/golden-tests/config/stylesheets/link-custom-stylesdir-no-copy.cpp +++ /dev/null @@ -1,8 +0,0 @@ -namespace ns { - -/// Linked stylesheet without copying assets -struct NoCopy -{ -}; - -} // namespace ns diff --git a/test-files/golden-tests/config/stylesheets/link-custom-stylesdir-no-copy.multipage/adoc/index.adoc b/test-files/golden-tests/config/stylesheets/link-custom-stylesdir-no-copy.multipage/adoc/index.adoc deleted file mode 100644 index cb23f9db53..0000000000 --- a/test-files/golden-tests/config/stylesheets/link-custom-stylesdir-no-copy.multipage/adoc/index.adoc +++ /dev/null @@ -1,28 +0,0 @@ -[#index] -= Global namespace -:mrdocs: - -:stylesheet: assets/css/custom.css -:stylesdir: assets/css -:linkcss: -== Namespaces - -[cols=1] -|=== -| Name -| xref:ns.adoc[`ns`] -|=== - -== xref:ns.adoc[ns] namespace - -=== Types - -[cols="1,4"] -|=== -| Name| Description -| xref:ns/NoCopy.adoc[`NoCopy`] -| Linked stylesheet without copying assets -|=== - - -[.small]#Created with https://www.mrdocs.com[MrDocs]# diff --git a/test-files/golden-tests/config/stylesheets/link-custom-stylesdir-no-copy.multipage/adoc/ns.adoc b/test-files/golden-tests/config/stylesheets/link-custom-stylesdir-no-copy.multipage/adoc/ns.adoc deleted file mode 100644 index d24dd070b9..0000000000 --- a/test-files/golden-tests/config/stylesheets/link-custom-stylesdir-no-copy.multipage/adoc/ns.adoc +++ /dev/null @@ -1,18 +0,0 @@ -[#ns] -= ns -:mrdocs: - -:stylesheet: assets/css/custom.css -:stylesdir: assets/css -:linkcss: -== Types - -[cols="1,4"] -|=== -| Name| Description -| xref:ns/NoCopy.adoc[`NoCopy`] -| Linked stylesheet without copying assets -|=== - - -[.small]#Created with https://www.mrdocs.com[MrDocs]# diff --git a/test-files/golden-tests/config/stylesheets/link-custom-stylesdir-no-copy.multipage/adoc/ns/NoCopy.adoc b/test-files/golden-tests/config/stylesheets/link-custom-stylesdir-no-copy.multipage/adoc/ns/NoCopy.adoc deleted file mode 100644 index b96a35c930..0000000000 --- a/test-files/golden-tests/config/stylesheets/link-custom-stylesdir-no-copy.multipage/adoc/ns/NoCopy.adoc +++ /dev/null @@ -1,21 +0,0 @@ -[#ns-NoCopy] -= xref:ns.adoc[ns]::NoCopy -:relfileprefix: ../ -:mrdocs: - -:stylesheet: assets/css/custom.css -:stylesdir: assets/css -:linkcss: -Linked stylesheet without copying assets - -== Synopsis - -Declared in `<link‐custom‐stylesdir‐no‐copy.cpp>` - -[source,cpp,subs="verbatim,replacements,macros,-callouts"] ----- -struct NoCopy; ----- - - -[.small]#Created with https://www.mrdocs.com[MrDocs]# diff --git a/test-files/golden-tests/config/stylesheets/link-custom-stylesdir-no-copy.multipage/html/index.html b/test-files/golden-tests/config/stylesheets/link-custom-stylesdir-no-copy.multipage/html/index.html deleted file mode 100644 index 319f08e28e..0000000000 --- a/test-files/golden-tests/config/stylesheets/link-custom-stylesdir-no-copy.multipage/html/index.html +++ /dev/null @@ -1,46 +0,0 @@ - - - -Reference - - - -
-

Global namespace

-

-Namespaces

- - - - - - - - - - -
Name
ns
- -

-ns namespace

-

-Types

- - - - - - - - - - -
NameDescription
NoCopy Linked stylesheet without copying assets
- - -
- - - \ No newline at end of file diff --git a/test-files/golden-tests/config/stylesheets/link-custom-stylesdir-no-copy.multipage/html/ns.html b/test-files/golden-tests/config/stylesheets/link-custom-stylesdir-no-copy.multipage/html/ns.html deleted file mode 100644 index 89bd1b7b05..0000000000 --- a/test-files/golden-tests/config/stylesheets/link-custom-stylesdir-no-copy.multipage/html/ns.html +++ /dev/null @@ -1,30 +0,0 @@ - - - -Reference: ns - - - -
-

ns

-

-Types

- - - - - - - - - - -
NameDescription
NoCopy Linked stylesheet without copying assets
- - -
- - - \ No newline at end of file diff --git a/test-files/golden-tests/config/stylesheets/link-custom-stylesdir-no-copy.multipage/html/ns/NoCopy.html b/test-files/golden-tests/config/stylesheets/link-custom-stylesdir-no-copy.multipage/html/ns/NoCopy.html deleted file mode 100644 index 72bb17070c..0000000000 --- a/test-files/golden-tests/config/stylesheets/link-custom-stylesdir-no-copy.multipage/html/ns/NoCopy.html +++ /dev/null @@ -1,28 +0,0 @@ - - - -Reference: NoCopy - - - -
-

ns::NoCopy

-
-

Linked stylesheet without copying assets

-
-
-

-Synopsis

-
-Declared in <link-custom-stylesdir-no-copy.cpp>
-
struct NoCopy;
-
- - - -
- - - \ No newline at end of file diff --git a/test-files/golden-tests/config/stylesheets/link-custom-stylesdir-no-copy.multipage/xml/reference.xml b/test-files/golden-tests/config/stylesheets/link-custom-stylesdir-no-copy.multipage/xml/reference.xml deleted file mode 100644 index f2d4bda702..0000000000 --- a/test-files/golden-tests/config/stylesheets/link-custom-stylesdir-no-copy.multipage/xml/reference.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - Linked stylesheet without copying assets - - - - - - diff --git a/test-files/golden-tests/config/stylesheets/link-custom-stylesdir-no-copy.yml b/test-files/golden-tests/config/stylesheets/link-custom-stylesdir-no-copy.yml deleted file mode 100644 index b4d506492c..0000000000 --- a/test-files/golden-tests/config/stylesheets/link-custom-stylesdir-no-copy.yml +++ /dev/null @@ -1,7 +0,0 @@ -stylesheets: - - custom.css -stylesdir: assets/css -linkcss: true -copycss: false -no-default-styles: true -multipage: true diff --git a/test-files/golden-tests/config/stylesheets/link-multipage.cpp b/test-files/golden-tests/config/stylesheets/link-multipage.cpp deleted file mode 100644 index f7a82e469e..0000000000 --- a/test-files/golden-tests/config/stylesheets/link-multipage.cpp +++ /dev/null @@ -1,11 +0,0 @@ -// NOTE: This golden test uses multipage output because link styling relies on -// multipage asset paths rather than a single bundled page. - -namespace ns { - -/// Multipage style sample -struct Linkable -{ -}; - -} // namespace ns diff --git a/test-files/golden-tests/config/stylesheets/link-multipage.multipage/adoc/css/custom.css b/test-files/golden-tests/config/stylesheets/link-multipage.multipage/adoc/css/custom.css deleted file mode 100644 index a73e3e1995..0000000000 --- a/test-files/golden-tests/config/stylesheets/link-multipage.multipage/adoc/css/custom.css +++ /dev/null @@ -1,7 +0,0 @@ -body { - background: #f7f7ff; -} - -.title { - color: #123456; -} diff --git a/test-files/golden-tests/config/stylesheets/link-multipage.multipage/adoc/index.adoc b/test-files/golden-tests/config/stylesheets/link-multipage.multipage/adoc/index.adoc deleted file mode 100644 index 877631ac17..0000000000 --- a/test-files/golden-tests/config/stylesheets/link-multipage.multipage/adoc/index.adoc +++ /dev/null @@ -1,28 +0,0 @@ -[#index] -= Global namespace -:mrdocs: - -:stylesheet: css/custom.css -:stylesdir: css -:linkcss: -== Namespaces - -[cols=1] -|=== -| Name -| xref:ns.adoc[`ns`] -|=== - -== xref:ns.adoc[ns] namespace - -=== Types - -[cols="1,4"] -|=== -| Name| Description -| xref:ns/Linkable.adoc[`Linkable`] -| Multipage style sample -|=== - - -[.small]#Created with https://www.mrdocs.com[MrDocs]# diff --git a/test-files/golden-tests/config/stylesheets/link-multipage.multipage/adoc/ns.adoc b/test-files/golden-tests/config/stylesheets/link-multipage.multipage/adoc/ns.adoc deleted file mode 100644 index 3aefd20cdb..0000000000 --- a/test-files/golden-tests/config/stylesheets/link-multipage.multipage/adoc/ns.adoc +++ /dev/null @@ -1,18 +0,0 @@ -[#ns] -= ns -:mrdocs: - -:stylesheet: css/custom.css -:stylesdir: css -:linkcss: -== Types - -[cols="1,4"] -|=== -| Name| Description -| xref:ns/Linkable.adoc[`Linkable`] -| Multipage style sample -|=== - - -[.small]#Created with https://www.mrdocs.com[MrDocs]# diff --git a/test-files/golden-tests/config/stylesheets/link-multipage.multipage/adoc/ns/Linkable.adoc b/test-files/golden-tests/config/stylesheets/link-multipage.multipage/adoc/ns/Linkable.adoc deleted file mode 100644 index de4b897754..0000000000 --- a/test-files/golden-tests/config/stylesheets/link-multipage.multipage/adoc/ns/Linkable.adoc +++ /dev/null @@ -1,21 +0,0 @@ -[#ns-Linkable] -= xref:ns.adoc[ns]::Linkable -:relfileprefix: ../ -:mrdocs: - -:stylesheet: css/custom.css -:stylesdir: css -:linkcss: -Multipage style sample - -== Synopsis - -Declared in `<link‐multipage.cpp>` - -[source,cpp,subs="verbatim,replacements,macros,-callouts"] ----- -struct Linkable; ----- - - -[.small]#Created with https://www.mrdocs.com[MrDocs]# diff --git a/test-files/golden-tests/config/stylesheets/link-multipage.multipage/html/css/custom.css b/test-files/golden-tests/config/stylesheets/link-multipage.multipage/html/css/custom.css deleted file mode 100644 index a73e3e1995..0000000000 --- a/test-files/golden-tests/config/stylesheets/link-multipage.multipage/html/css/custom.css +++ /dev/null @@ -1,7 +0,0 @@ -body { - background: #f7f7ff; -} - -.title { - color: #123456; -} diff --git a/test-files/golden-tests/config/stylesheets/link-multipage.multipage/html/index.html b/test-files/golden-tests/config/stylesheets/link-multipage.multipage/html/index.html deleted file mode 100644 index fa708863db..0000000000 --- a/test-files/golden-tests/config/stylesheets/link-multipage.multipage/html/index.html +++ /dev/null @@ -1,46 +0,0 @@ - - - -Reference - - - -
-

Global namespace

-

-Namespaces

- - - - - - - - - - -
Name
ns
- -

-ns namespace

-

-Types

- - - - - - - - - - -
NameDescription
Linkable Multipage style sample
- - -
- - - \ No newline at end of file diff --git a/test-files/golden-tests/config/stylesheets/link-multipage.multipage/html/ns.html b/test-files/golden-tests/config/stylesheets/link-multipage.multipage/html/ns.html deleted file mode 100644 index 254a63c6f6..0000000000 --- a/test-files/golden-tests/config/stylesheets/link-multipage.multipage/html/ns.html +++ /dev/null @@ -1,30 +0,0 @@ - - - -Reference: ns - - - -
-

ns

-

-Types

- - - - - - - - - - -
NameDescription
Linkable Multipage style sample
- - -
- - - \ No newline at end of file diff --git a/test-files/golden-tests/config/stylesheets/link-multipage.multipage/html/ns/Linkable.html b/test-files/golden-tests/config/stylesheets/link-multipage.multipage/html/ns/Linkable.html deleted file mode 100644 index b74452056c..0000000000 --- a/test-files/golden-tests/config/stylesheets/link-multipage.multipage/html/ns/Linkable.html +++ /dev/null @@ -1,28 +0,0 @@ - - - -Reference: Linkable - - - -
-

ns::Linkable

-
-

Multipage style sample

-
-
-

-Synopsis

-
-Declared in <link-multipage.cpp>
-
struct Linkable;
-
- - - -
- - - \ No newline at end of file diff --git a/test-files/golden-tests/config/stylesheets/link-multipage.multipage/xml/reference.xml b/test-files/golden-tests/config/stylesheets/link-multipage.multipage/xml/reference.xml deleted file mode 100644 index 81fb4735b2..0000000000 --- a/test-files/golden-tests/config/stylesheets/link-multipage.multipage/xml/reference.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - Multipage style sample - - - - - - diff --git a/test-files/golden-tests/config/stylesheets/link-multipage.yml b/test-files/golden-tests/config/stylesheets/link-multipage.yml deleted file mode 100644 index 83e1136037..0000000000 --- a/test-files/golden-tests/config/stylesheets/link-multipage.yml +++ /dev/null @@ -1,6 +0,0 @@ -stylesheets: - - custom.css -linkcss: true -no-default-styles: true -multipage: true -output: reference-output diff --git a/test-files/golden-tests/config/stylesheets/remote-stylesheet.adoc b/test-files/golden-tests/config/stylesheets/remote-stylesheet.adoc deleted file mode 100644 index 831b8494a9..0000000000 --- a/test-files/golden-tests/config/stylesheets/remote-stylesheet.adoc +++ /dev/null @@ -1,45 +0,0 @@ -= Reference -:mrdocs: - -:stylesheet: https://cdn.example.com/theme.css -:stylesdir: css -:linkcss: -[#index] -== Global namespace - -=== Namespaces - -[cols=1] -|=== -| Name -| link:#ns[`ns`] -|=== - -[#ns] -== ns - -=== Types - -[cols="1,4"] -|=== -| Name| Description -| link:#ns-RemoteStyled[`RemoteStyled`] -| Uses remote stylesheet -|=== - -[#ns-RemoteStyled] -== link:#ns[ns]::RemoteStyled - -Uses remote stylesheet - -=== Synopsis - -Declared in `<remote‐stylesheet.cpp>` - -[source,cpp,subs="verbatim,replacements,macros,-callouts"] ----- -struct RemoteStyled; ----- - - -[.small]#Created with https://www.mrdocs.com[MrDocs]# diff --git a/test-files/golden-tests/config/stylesheets/remote-stylesheet.cpp b/test-files/golden-tests/config/stylesheets/remote-stylesheet.cpp deleted file mode 100644 index 91af4e8a9c..0000000000 --- a/test-files/golden-tests/config/stylesheets/remote-stylesheet.cpp +++ /dev/null @@ -1,8 +0,0 @@ -namespace ns { - -/// Uses remote stylesheet -struct RemoteStyled -{ -}; - -} // namespace ns diff --git a/test-files/golden-tests/config/stylesheets/remote-stylesheet.html b/test-files/golden-tests/config/stylesheets/remote-stylesheet.html deleted file mode 100644 index 6b1e3965a9..0000000000 --- a/test-files/golden-tests/config/stylesheets/remote-stylesheet.html +++ /dev/null @@ -1,77 +0,0 @@ - - - -Reference - - - -
-

Reference

-
-
-

-Global Namespace# -

-
-

-Namespaces

- - - - - - - - - - -
Name
ns
- -
-
-
-

-ns# -

-
-

-Types

- - - - - - - - - - -
NameDescription
RemoteStyled Uses remote stylesheet
- -
-
-
-

-ns::RemoteStyled# -

-
-

Uses remote stylesheet

-
-
-
-

-Synopsis

-
-Declared in <remote-stylesheet.cpp>
-
struct RemoteStyled;
-
- - -
- -
- - - \ No newline at end of file diff --git a/test-files/golden-tests/config/stylesheets/remote-stylesheet.xml b/test-files/golden-tests/config/stylesheets/remote-stylesheet.xml deleted file mode 100644 index 388b25cc6f..0000000000 --- a/test-files/golden-tests/config/stylesheets/remote-stylesheet.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - Uses remote stylesheet - - - - - - diff --git a/test-files/golden-tests/config/stylesheets/remote-stylesheet.yml b/test-files/golden-tests/config/stylesheets/remote-stylesheet.yml deleted file mode 100644 index 0354d8e99b..0000000000 --- a/test-files/golden-tests/config/stylesheets/remote-stylesheet.yml +++ /dev/null @@ -1,4 +0,0 @@ -stylesheets: - - https://cdn.example.com/theme.css -linkcss: true -no-default-styles: true diff --git a/test-files/golden-tests/core/empty.html b/test-files/golden-tests/core/empty.html index e583553dba..135e79d40d 100644 --- a/test-files/golden-tests/core/empty.html +++ b/test-files/golden-tests/core/empty.html @@ -1,22 +1,19 @@ Reference -

Reference

-

-Global Namespace# -

+

- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/core/libcxx.html b/test-files/golden-tests/core/libcxx.html index f181e7fb52..df84cf40fd 100644 --- a/test-files/golden-tests/core/libcxx.html +++ b/test-files/golden-tests/core/libcxx.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Functions

+

Functions

@@ -29,31 +25,28 @@

-

-sqrt# -

+

sqrt

Computes the square root of an integral value.

-

-Synopsis

+

Synopsis

Declared in <libcxx.cpp>
-
template<typename T>
+
+template<typename T>
 T
 sqrt(T value)
-requires std::is_integral_v<T>;
+requires std::is_integral_v<T>;
+
-

-Description

+

Description

This function calculates the square root of a given integral value using bit manipulation.

-

-Exceptions

+

Exceptions

@@ -70,13 +63,11 @@

-

-Return Value

+

Return Value

The square root of the input value.
-

-Template Parameters

+

Template Parameters

@@ -93,8 +84,7 @@

-

-Parameters

+

Parameters

@@ -113,8 +103,8 @@

- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/core/utf-8.html b/test-files/golden-tests/core/utf-8.html index 442c54d5f4..76f5e369a6 100644 --- a/test-files/golden-tests/core/utf-8.html +++ b/test-files/golden-tests/core/utf-8.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Functions

+

Functions

@@ -29,23 +25,22 @@

-

-Π₯ристос_воскрСс# -

+

Π₯ристос_воскрСс

-

-Synopsis

+

Synopsis

Declared in <utf-8.cpp>
-
bool
-Π₯ристос_воскрСс();
+
+bool
+Π₯ристос_воскрСс();
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/filters/file/exclude-self.html b/test-files/golden-tests/filters/file/exclude-self.html index e583553dba..135e79d40d 100644 --- a/test-files/golden-tests/filters/file/exclude-self.html +++ b/test-files/golden-tests/filters/file/exclude-self.html @@ -1,22 +1,19 @@ Reference -

Reference

-

-Global Namespace# -

+

- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/filters/file/include-self.html b/test-files/golden-tests/filters/file/include-self.html index 980cb6c656..72968dd614 100644 --- a/test-files/golden-tests/filters/file/include-self.html +++ b/test-files/golden-tests/filters/file/include-self.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Namespaces

+

Namespaces

@@ -29,12 +25,9 @@

-

-TEST# -

+

TEST

-

-Types

+

Types

@@ -50,24 +43,23 @@

-

-TEST::SUCCESS# -

+

TEST::SUCCESS

-

-Synopsis

+

Synopsis

Declared in <include-self.cpp>
-
struct SUCCESS;
+
+struct SUCCESS;
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/filters/file/include-symlink.html b/test-files/golden-tests/filters/file/include-symlink.html index 22dcc114c3..b60a669c6d 100644 --- a/test-files/golden-tests/filters/file/include-symlink.html +++ b/test-files/golden-tests/filters/file/include-symlink.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Functions

+

Functions

@@ -29,26 +25,25 @@

-

-f# -

+

f

A brief.

-

-Synopsis

+

Synopsis

Declared in <included.hpp>
-
void
-f();
+
+void
+f();
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/filters/file/subdirectories.html b/test-files/golden-tests/filters/file/subdirectories.html index 406f7c55c2..e037e39f5c 100644 --- a/test-files/golden-tests/filters/file/subdirectories.html +++ b/test-files/golden-tests/filters/file/subdirectories.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Functions

+

Functions

@@ -29,26 +25,25 @@

-

-f# -

+

f

A brief.

-

-Synopsis

+

Synopsis

Declared in <a/included.hpp>
-
void
-f();
+
+void
+f();
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/filters/file/subdirectories2.html b/test-files/golden-tests/filters/file/subdirectories2.html index 406f7c55c2..e037e39f5c 100644 --- a/test-files/golden-tests/filters/file/subdirectories2.html +++ b/test-files/golden-tests/filters/file/subdirectories2.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Functions

+

Functions

@@ -29,26 +25,25 @@

-

-f# -

+

f

A brief.

-

-Synopsis

+

Synopsis

Declared in <a/included.hpp>
-
void
-f();
+
+void
+f();
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/filters/symbol-name/blacklist_0.html b/test-files/golden-tests/filters/symbol-name/blacklist_0.html index ebca7c0424..245ac2fb83 100644 --- a/test-files/golden-tests/filters/symbol-name/blacklist_0.html +++ b/test-files/golden-tests/filters/symbol-name/blacklist_0.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Namespaces

+

Namespaces

@@ -31,12 +27,9 @@

-

-N0# -

+

N0

-

-Functions

+

Functions

@@ -52,27 +45,23 @@

-

-N0::f0# -

+

N0::f0

-

-Synopsis

+

Synopsis

Declared in <blacklist_0.cpp>
-
void
-f0();
+
+void
+f0();
+
-

-N4# -

+

N4

-

-Namespaces

+

Namespaces

@@ -89,12 +78,9 @@

-

-N4::N5# -

+

N4::N5

-

-Functions

+

Functions

@@ -110,27 +96,23 @@

-

-N4::N5::f1# -

+

N4::N5::f1

-

-Synopsis

+

Synopsis

Declared in <blacklist_0.cpp>
-
void
-f1();
+
+void
+f1();
+
-

-N4::N6# -

+

N4::N6

-

-Functions

+

Functions

@@ -146,27 +128,23 @@

-

-N4::N6::f1# -

+

N4::N6::f1

-

-Synopsis

+

Synopsis

Declared in <blacklist_0.cpp>
-
void
-f1();
+
+void
+f1();
+
-

-N7# -

+

N7

-

-Namespaces

+

Namespaces

@@ -182,12 +160,9 @@

-

-N7::N9# -

+

N7::N9

-

-Functions

+

Functions

@@ -203,23 +178,22 @@

-

-N7::N9::g0# -

+

N7::N9::g0

-

-Synopsis

+

Synopsis

Declared in <blacklist_0.cpp>
-
void
-g0();
+
+void
+g0();
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/filters/symbol-name/excluded-base-class.html b/test-files/golden-tests/filters/symbol-name/excluded-base-class.html index d2dbfa9df9..5eead8405d 100644 --- a/test-files/golden-tests/filters/symbol-name/excluded-base-class.html +++ b/test-files/golden-tests/filters/symbol-name/excluded-base-class.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Namespaces

+

Namespaces

@@ -29,12 +25,9 @@

-

-A# -

+

A

-

-Types

+

Types

@@ -51,21 +44,19 @@

-

-A::D# -

+

A::D

-

-Synopsis

+

Synopsis

Declared in <excluded-base-class.cpp>
-
class D
-    : public B::C
+
+class D
+    : public B::C
+
-

-Base Classes

+

Base Classes

@@ -78,8 +69,7 @@

-

-Member Functions

+

Member Functions

@@ -100,83 +90,77 @@

-

-A::D::f# -

+

A::D::f

-

-Synopsis

+

Synopsis

Declared in <excluded-base-class.cpp>
-
void
-f();
+
+void
+f();
+
-

-A::D::g# -

+

A::D::g

-

-Synopsis

+

Synopsis

Declared in <excluded-base-class.cpp>
-
virtual
+
+virtual
 void
-g() override;
+g() override;
+
-

-A::D::h# -

+

A::D::h

-

-Synopsis

+

Synopsis

Declared in <excluded-base-class.cpp>
-
virtual
+
+virtual
 void
-h() override;
+h() override;
+
-

-A::D::i# -

+

A::D::i

-

-Synopsis

+

Synopsis

Declared in <excluded-base-class.cpp>
-
void
-i();
+
+void
+i();
+
-

-A::E# -

+

A::E

-

-Synopsis

+

Synopsis

Declared in <excluded-base-class.cpp>
-
class E
-    : public B::C
+
+class E
+    : public B::C
+
-

-Base Classes

+

Base Classes

@@ -189,8 +173,7 @@

-

-Member Functions

+

Member Functions

@@ -211,70 +194,66 @@

-

-A::E::f# -

+

A::E::f

-

-Synopsis

+

Synopsis

Declared in <excluded-base-class.cpp>
-
void
-f();
+
+void
+f();
+
-

-A::E::g# -

+

A::E::g

-

-Synopsis

+

Synopsis

Declared in <excluded-base-class.cpp>
-
virtual
+
+virtual
 void
-g();
+g();
+
-

-A::E::h# -

+

A::E::h

-

-Synopsis

+

Synopsis

Declared in <excluded-base-class.cpp>
-
virtual
+
+virtual
 void
-h() override;
+h() override;
+
-

-A::E::i# -

+

A::E::i

-

-Synopsis

+

Synopsis

Declared in <excluded-base-class.cpp>
-
void
-i();
+
+void
+i();
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/filters/symbol-name/excluded-namespace-alias.html b/test-files/golden-tests/filters/symbol-name/excluded-namespace-alias.html index 9417f0dbe3..5c8caba5ae 100644 --- a/test-files/golden-tests/filters/symbol-name/excluded-namespace-alias.html +++ b/test-files/golden-tests/filters/symbol-name/excluded-namespace-alias.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Namespaces

+

Namespaces

@@ -29,12 +25,9 @@

-

-B# -

+

B

-

-Namespaces

+

Namespaces

@@ -50,12 +43,9 @@

-

-B::U# -

+

B::U

-

-Namespace Aliases

+

Namespace Aliases

@@ -71,22 +61,21 @@

-

-B::U::E# -

+

B::U::E

-

-Synopsis

+

Synopsis

Declared in <excluded-namespace-alias.cpp>
-
namespace E = B::S::E;
+
+namespace E = B::S::E;
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/filters/symbol-name/extraction-mode.adoc b/test-files/golden-tests/filters/symbol-name/extraction-mode.adoc index 0ea5c5ce60..69fa426e3e 100644 --- a/test-files/golden-tests/filters/symbol-name/extraction-mode.adoc +++ b/test-files/golden-tests/filters/symbol-name/extraction-mode.adoc @@ -99,10 +99,6 @@ Declared in `<extraction‐mode.cpp>` struct regular; ---- -=== Description - -The symbol should have a page as usual - === Types [cols="1,4"] @@ -122,6 +118,10 @@ The symbol should have a page as usual | A function to get a regular symbol |=== +=== Description + +The symbol should have a page as usual + [#regular_ns-regular-also_regular] == link:#regular_ns[regular_ns]::link:#regular_ns-regular[regular]::also_regular @@ -272,12 +272,6 @@ A symbol that passes the see‐below filter A see‐below namespace -=== Description - -All member symbols should become see‐below. All members are traversed as see‐below. - -The documentation page for these symbols should include the see‐below comment. - === Types [cols="1,4"] @@ -300,6 +294,12 @@ The documentation page for these symbols should include the see‐below com | A function to get an implementation‐defined symbol in a see‐below namespace |=== +=== Description + +All member symbols should become see‐below. All members are traversed as see‐below. + +The documentation page for these symbols should include the see‐below comment. + [#see_below_ns-regular] == link:#see_below_ns[see_below_ns]::regular @@ -442,10 +442,6 @@ Declared in `<extraction‐mode.cpp>` struct regular; ---- -=== Description - -This symbol should have a page as usual. - === Types [cols="1,4"] @@ -465,6 +461,10 @@ This symbol should have a page as usual. | A function to get a regular symbol in the global namespace |=== +=== Description + +This symbol should have a page as usual. + [#regular-also_regular] == link:#regular[regular]::also_regular diff --git a/test-files/golden-tests/filters/symbol-name/extraction-mode.html b/test-files/golden-tests/filters/symbol-name/extraction-mode.html index 210398696f..2f5a29f0eb 100644 --- a/test-files/golden-tests/filters/symbol-name/extraction-mode.html +++ b/test-files/golden-tests/filters/symbol-name/extraction-mode.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Namespaces

+

Namespaces

@@ -27,8 +23,7 @@

-

-Namespace Aliases

+

Namespace Aliases

@@ -43,8 +38,7 @@

-

-Types

+

Types

@@ -58,8 +52,7 @@

-

-Functions

+

Functions

@@ -78,15 +71,12 @@

-

-regular_ns# -

+

regular_ns

A regular namespace with different filters for members

-

-Types

+

Types

@@ -100,8 +90,7 @@

-

-Functions

+

Functions

@@ -120,27 +109,20 @@

-

-regular_ns::regular# -

+

regular_ns::regular

A symbol that passes the filters

-

-Synopsis

+

Synopsis

Declared in <extraction-mode.cpp>
-
struct regular;
+
+struct regular;
+
-
-

-Description

-

The symbol should have a page as usual

-
-

-Types

+

Types

@@ -156,8 +138,7 @@

-

-Non-Member Functions

+

Non-Member Functions

@@ -170,25 +151,27 @@

+
+

Description

+

The symbol should have a page as usual

+
-

-regular_ns::regular::also_regular# -

+

regular_ns::regular::also_regular

Child of a regular symbol extracted as regular

-

-Synopsis

+

Synopsis

Declared in <extraction-mode.cpp>
-
struct also_regular;
+
+struct also_regular;
+
-

-Types

+

Types

@@ -206,172 +189,149 @@

-

-regular_ns::regular::also_regular::regular_as_well# -

+

regular_ns::regular::also_regular::regular_as_well

Grandchild of a regular symbol extracted as regular

-

-Synopsis

+

Synopsis

Declared in <extraction-mode.cpp>
-
struct regular_as_well;
+
+struct regular_as_well;
+
-

-regular_ns::see_below# -

+

regular_ns::see_below

A symbol that passes the see-below filter

-

-Synopsis

+

Synopsis

Declared in <extraction-mode.cpp>
-
struct see_below { /* see-below */ };
+
+struct see_below { /* see-below */ };
+
+ +
-

-Description

+

Description

A symbol that passes the filters and the see-below filter. The symbol should have a page as usual but, because it's a scope and not a namespace, the members should not be listed on that page.

- -
-

-regular_ns::get_dependency# -

+

regular_ns::get_dependency

A function to get an excluded symbol

-

-Synopsis

+

Synopsis

Declared in <extraction-mode.cpp>
-
dependency
-get_dependency();
+
+dependency
+get_dependency();
+
-

-Description

+

Description

When used in a function, only the symbol name should be shown. No links should be generated for this symbol.

-

-regular_ns::get_implementation_defined# -

+

regular_ns::get_implementation_defined

A function to get an implementation-defined symbol

-

-Synopsis

+

Synopsis

Declared in <extraction-mode.cpp>
-
/* implementation-defined */
-get_implementation_defined();
+
+/* implementation-defined */
+get_implementation_defined();
+
-

-Description

+

Description

When used in a function, the implementation-defined comment should replace the real type.

It's the responsibility of the function documentation to explain the implementation-defined symbol.

-

-Return Value

+

Return Value

A symbol that passes the implementation-defined filter
-

-regular_ns::get_regular# -

+

regular_ns::get_regular

A function to get a regular symbol

-

-Synopsis

+

Synopsis

Declared in <extraction-mode.cpp>
-
regular
-get_regular();
+
+regular
+get_regular();
+
-

-Description

+

Description

When used in a function, the symbol should be shown as usual with a link to the page.

-

-Return Value

+

Return Value

A symbol that passes the filters
-

-regular_ns::get_see_below# -

+

regular_ns::get_see_below

A function to get a see-below symbol

-

-Synopsis

+

Synopsis

Declared in <extraction-mode.cpp>
-
see_below
-get_see_below();
+
+see_below
+get_see_below();
+
-

-Description

+

Description

When used in a function, the symbol name should be shown as usual. The page for this symbol is what should be different because the synopsis should say "See below" and the members are not listed unless it's a namespace or the symbol has been explicitly used as a dependency elsewhere.

-

-Return Value

+

Return Value

A symbol that passes the see-below filter
-

-see_below_ns# -

+

see_below_ns

A see-below namespace

-
-

-Description

-

All member symbols should become see-below. All members are traversed as see-below.

-

The documentation page for these symbols should include the see-below comment.

-
-

-Types

+

Types

@@ -385,8 +345,7 @@

-

-Functions

+

Functions

@@ -400,187 +359,172 @@

+
+

Description

+

All member symbols should become see-below. All members are traversed as see-below.

+

The documentation page for these symbols should include the see-below comment.

+
-

-see_below_ns::regular# -

+

see_below_ns::regular

Regular symbol in a see-below namespace

-

-Synopsis

+

Synopsis

Declared in <extraction-mode.cpp>
-
struct regular { /* see-below */ };
+
+struct regular { /* see-below */ };
+
+ +
-

-Description

+

Description

The symbol becomes see-below because the whole namespace is see-below.

- -
-

-see_below_ns::see_below# -

+

see_below_ns::see_below

See-below symbol in a see-below namespace

-

-Synopsis

+

Synopsis

Declared in <extraction-mode.cpp>
-
struct see_below { /* see-below */ };
+
+struct see_below { /* see-below */ };
+
+ +
-

-Description

+

Description

The symbol becomes see-below because the whole namespace is see-below and because it's explicitly marked as see-below.

- -
-

-see_below_ns::get_dependency# -

+

see_below_ns::get_dependency

A function to get a dependency symbol in a see-below namespace

-

-Synopsis

+

Synopsis

Declared in <extraction-mode.cpp>
-
dependency
-get_dependency();
+
+dependency
+get_dependency();
+
-

-Description

+

Description

The symbol should be extracted as a dependency because the exclude filter has precedence over the see-below filter. Only included symbols can be promoted to see-below.

It's the responsibility of the function documentation to explain the dependency.

-

-see_below_ns::get_implementation_defined# -

+

see_below_ns::get_implementation_defined

A function to get an implementation-defined symbol in a see-below namespace

-

-Synopsis

+

Synopsis

Declared in <extraction-mode.cpp>
-
/* implementation-defined */
-get_implementation_defined();
+
+/* implementation-defined */
+get_implementation_defined();
+
-

-Description

+

Description

When used in a function, the implementation-defined comment should replace the real type.

It's the responsibility of the function documentation to explain the implementation-defined symbol.

-

-Return Value

+

Return Value

Implementation-defined symbol in a see-below namespace
-

-dependency_ns_alias# -

+

dependency_ns_alias

Namespace alias to form the dependency on dependency_ns

-

-Synopsis

+

Synopsis

Declared in <extraction-mode.cpp>
-
namespace dependency_ns_alias = dependency_ns;
+
+namespace dependency_ns_alias = dependency_ns;
+
-

-implementation_defined_ns_alias# -

+

implementation_defined_ns_alias

Namespace alias to form a dependency on the implementation-defined namespace

-

-Synopsis

+

Synopsis

Declared in <extraction-mode.cpp>
-
namespace implementation_defined_ns_alias = /* implementation-defined */;
+
+namespace implementation_defined_ns_alias = /* implementation-defined */;
+
-

-see_below_ns_alias# -

+

see_below_ns_alias

Namespace alias to form a dependency on the see-below namespace

-

-Synopsis

+

Synopsis

Declared in <extraction-mode.cpp>
-
namespace see_below_ns_alias = see_below_ns;
+
+namespace see_below_ns_alias = see_below_ns;
+
-

-Description

+

Description

The alias should be linked as usual and, because it's a namespace, the members should be listed on the page.

-

-regular# -

+

regular

A regular symbol in the global namespace

-

-Synopsis

+

Synopsis

Declared in <extraction-mode.cpp>
-
struct regular;
-
-
-

-Description

-

This symbol should have a page as usual.

+
+struct regular;
+
-

-Types

+

Types

@@ -596,8 +540,7 @@

-

-Non-Member Functions

+

Non-Member Functions

@@ -610,25 +553,27 @@

+
+

Description

+

This symbol should have a page as usual.

+
-

-regular::also_regular# -

+

regular::also_regular

Child of a regular symbol: should be traversed as usual

-

-Synopsis

+

Synopsis

Declared in <extraction-mode.cpp>
-
struct also_regular;
+
+struct also_regular;
+
-

-Types

+

Types

@@ -646,160 +591,146 @@

-

-regular::also_regular::regular_as_well# -

+

regular::also_regular::regular_as_well

Grandchild of a regular symbol: should be traversed as usual

-

-Synopsis

+

Synopsis

Declared in <extraction-mode.cpp>
-
struct regular_as_well;
+
+struct regular_as_well;
+
-

-see_below# -

+

see_below

A see-below symbol in the global namespace

-

-Synopsis

+

Synopsis

Declared in <extraction-mode.cpp>
-
struct see_below { /* see-below */ };
+
+struct see_below { /* see-below */ };
+
+ +
-

-Description

+

Description

This symbol should have a page as usual but, because it's a scope and not a namespace, the members should not be listed on that page.

The synopsis should say "See below".

- -
-

-get_dependency# -

+

get_dependency

A function to get a dependency symbol on the global namespace

-

-Synopsis

+

Synopsis

Declared in <extraction-mode.cpp>
-
dependency
-get_dependency();
+
+dependency
+get_dependency();
+
-

-Description

+

Description

The symbol should be extracted as a dependency but its members should not be traversed.

-

-get_implementation_defined# -

+

get_implementation_defined

A function to get an implementation-defined symbol in the global namespace

-

-Synopsis

+

Synopsis

Declared in <extraction-mode.cpp>
-
/* implementation-defined */
-get_implementation_defined();
+
+/* implementation-defined */
+get_implementation_defined();
+
-

-Description

+

Description

When used in a function, the implementation-defined comment should replace the real type.

It's the responsibility of the function documentation to explain the implementation-defined symbol.

-

-Return Value

+

Return Value

An implementation-defined symbol in the global namespace
-

-get_regular# -

+

get_regular

A function to get a regular symbol in the global namespace

-

-Synopsis

+

Synopsis

Declared in <extraction-mode.cpp>
-
regular
-get_regular();
+
+regular
+get_regular();
+
-

-Description

+

Description

When used in a function, the symbol should be shown as usual with a link to the page.

-

-Return Value

+

Return Value

A regular symbol in the global namespace
-

-get_see_below# -

+

get_see_below

A function to get a see-below symbol in the global namespace

-

-Synopsis

+

Synopsis

Declared in <extraction-mode.cpp>
-
see_below
-get_see_below();
+
+see_below
+get_see_below();
+
-

-Description

+

Description

When used in a function, the symbol name should be shown as usual. The page for this symbol is what should be different because the synopsis should say "See below" and the members are not listed unless it's a namespace or the symbol has been explicitly used as a dependency elsewhere.

-

-Return Value

+

Return Value

A see-below symbol in the global namespace
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/filters/symbol-name/impl-defined-member.html b/test-files/golden-tests/filters/symbol-name/impl-defined-member.html index 8eb7132d73..8ed76a9777 100644 --- a/test-files/golden-tests/filters/symbol-name/impl-defined-member.html +++ b/test-files/golden-tests/filters/symbol-name/impl-defined-member.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Namespaces

+

Namespaces

@@ -26,8 +22,7 @@

-

-Variables

+

Variables

@@ -44,12 +39,9 @@

-

-regular# -

+

regular

-

-Types

+

Types

@@ -65,52 +57,49 @@

-

-regular::absolute_uri_rule_t# -

+

regular::absolute_uri_rule_t

-

-Synopsis

+

Synopsis

Declared in <impl-defined-member.cpp>
-
struct absolute_uri_rule_t;
+
+struct absolute_uri_rule_t;
+
-

-absolute_uri_rule# -

+

absolute_uri_rule

-

-Synopsis

+

Synopsis

Declared in <impl-defined-member.cpp>
-
constexpr /* implementation-defined */ absolute_uri_rule = {};
+
+constexpr /* implementation-defined */ absolute_uri_rule = {};
+
-

-regular_absolute_uri_rule# -

+

regular_absolute_uri_rule

-

-Synopsis

+

Synopsis

Declared in <impl-defined-member.cpp>
-
constexpr regular::absolute_uri_rule_t regular_absolute_uri_rule = {};
+
+constexpr regular::absolute_uri_rule_t regular_absolute_uri_rule = {};
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/filters/symbol-name/whitelist_0.html b/test-files/golden-tests/filters/symbol-name/whitelist_0.html index b78d67b40f..e407a86a61 100644 --- a/test-files/golden-tests/filters/symbol-name/whitelist_0.html +++ b/test-files/golden-tests/filters/symbol-name/whitelist_0.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Namespaces

+

Namespaces

@@ -28,8 +24,7 @@

-

-Types

+

Types

@@ -45,15 +40,12 @@

-

-N0# -

+

N0

This namespace should extracted because it's implied by N0::f0_WL

-

-Functions

+

Functions

@@ -69,33 +61,29 @@

-

-N0::f0_WL# -

+

N0::f0_WL

This function should be included because it matches N0::f0_WL

-

-Synopsis

+

Synopsis

Declared in <whitelist_0.cpp>
-
void
-f0_WL();
+
+void
+f0_WL();
+
-

-N1# -

+

N1

This namespace should extracted because it's implied by N1::N3_WL and N1::N4::f1_WL

-

-Namespaces

+

Namespaces

@@ -112,15 +100,12 @@

-

-N1::N3_WL# -

+

N1::N3_WL

This namespace should extracted because it's explicitly included by N1::N3_WL

-

-Functions

+

Functions

@@ -136,33 +121,29 @@

-

-N1::N3_WL::f1_WL# -

+

N1::N3_WL::f1_WL

This function should extracted because the namespace N1::N3_WL is included as a literal.

-

-Synopsis

+

Synopsis

Declared in <whitelist_0.cpp>
-
void
-f1_WL();
+
+void
+f1_WL();
+
-

-N1::N4# -

+

N1::N4

This namespace should extracted because it's implied by N1::N4::f1_WL

-

-Functions

+

Functions

@@ -178,33 +159,29 @@

-

-N1::N4::f1_WL# -

+

N1::N4::f1_WL

This function should extracted because it matches N1::N4::f1_WL

-

-Synopsis

+

Synopsis

Declared in <whitelist_0.cpp>
-
void
-f1_WL();
+
+void
+f1_WL();
+
-

-N5# -

+

N5

This namespace should extracted because it's implied by N5::N6::*7

-

-Namespaces

+

Namespaces

@@ -220,15 +197,12 @@

-

-N5::N6# -

+

N5::N6

This namespace should extracted because it's implied by N5::N6::*7

-

-Namespaces

+

Namespaces

@@ -245,15 +219,12 @@

-

-N5::N6::M7# -

+

N5::N6::M7

This namespace should be included because it matches N5::N6::*7

-

-Functions

+

Functions

@@ -269,33 +240,29 @@

-

-N5::N6::M7::f2_WL# -

+

N5::N6::M7::f2_WL

This function should be included because it's a member of M7, which matches N5::N6::*7

-

-Synopsis

+

Synopsis

Declared in <whitelist_0.cpp>
-
void
-f2_WL();
+
+void
+f2_WL();
+
-

-N5::N6::N7# -

+

N5::N6::N7

This namespace should be included because it matches N5::N6::*7

-

-Functions

+

Functions

@@ -311,40 +278,37 @@

-

-N5::N6::N7::f2_WL# -

+

N5::N6::N7::f2_WL

This function should be included because it's a member of N7, which matches N5::N6::*7

-

-Synopsis

+

Synopsis

Declared in <whitelist_0.cpp>
-
void
-f2_WL();
+
+void
+f2_WL();
+
-

-C# -

+

C

This namespace should be included because it strictly matches C

-

-Synopsis

+

Synopsis

Declared in <whitelist_0.cpp>
-
struct C;
+
+struct C;
+
-

-Types

+

Types

@@ -357,8 +321,7 @@

-

-Member Functions

+

Member Functions

@@ -376,22 +339,20 @@

-

-C::D# -

+

C::D

This struct should be included because it's a member of C

-

-Synopsis

+

Synopsis

Declared in <whitelist_0.cpp>
-
struct D;
+
+struct D;
+
-

-Member Functions

+

Member Functions

@@ -409,44 +370,42 @@

-

-C::D::f1_WL# -

+

C::D::f1_WL

This function should be included because it's a member of D

-

-Synopsis

+

Synopsis

Declared in <whitelist_0.cpp>
-
void
-f1_WL();
+
+void
+f1_WL();
+
-

-C::f0_WL# -

+

C::f0_WL

This function should be included because it's a member of C

-

-Synopsis

+

Synopsis

Declared in <whitelist_0.cpp>
-
void
-f0_WL();
+
+void
+f0_WL();
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/filters/symbol-type/nested-private-template.html b/test-files/golden-tests/filters/symbol-type/nested-private-template.html index 6baa27b712..7d0f966722 100644 --- a/test-files/golden-tests/filters/symbol-type/nested-private-template.html +++ b/test-files/golden-tests/filters/symbol-type/nested-private-template.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Types

+

Types

@@ -29,22 +25,20 @@

-

-range# -

+

range

-

-Synopsis

+

Synopsis

Declared in <nested-private-template.cpp>
-
template<class T>
-class range;
+
+template<class T>
+class range;
+
-

-Private Types

+

Private Types

@@ -61,44 +55,42 @@

-

-range::impl# -

+

range::impl

-

-Synopsis

+

Synopsis

Declared in <nested-private-template.cpp>
-
template<
+
+template<
     class R,
     bool>
-struct impl;
+struct impl;
+
-

-range::impl<R, false># -

+

range::impl<R, false>

-

-Synopsis

+

Synopsis

Declared in <nested-private-template.cpp>
-
template<class R>
-struct impl<R, false>;
+
+template<class R>
+struct impl<R, false>;
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/javadoc/brief/brief-1.html b/test-files/golden-tests/javadoc/brief/brief-1.html index 88de536e9e..41666ab56b 100644 --- a/test-files/golden-tests/javadoc/brief/brief-1.html +++ b/test-files/golden-tests/javadoc/brief/brief-1.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Functions

+

Functions

@@ -30,49 +26,46 @@

-

-f5# -

+

f5

brief bold it continues to the line.

-

-Synopsis

+

Synopsis

Declared in <brief-1.cpp>
-
void
-f5();
+
+void
+f5();
+
-

-f6# -

+

f6

brief

-

-Synopsis

+

Synopsis

Declared in <brief-1.cpp>
-
void
-f6();
+
+void
+f6();
+
-

-Description

+

Description

many lined bold what will happen?

- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/javadoc/brief/brief-2.html b/test-files/golden-tests/javadoc/brief/brief-2.html index dcb70203fe..94a92d510a 100644 --- a/test-files/golden-tests/javadoc/brief/brief-2.html +++ b/test-files/golden-tests/javadoc/brief/brief-2.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Functions

+

Functions

@@ -34,126 +30,118 @@

-

-f1# -

+

f1

brief

-

-Synopsis

+

Synopsis

Declared in <brief-2.cpp>
-
void
-f1();
+
+void
+f1();
+
-

-f2# -

+

f2

brief

-

-Synopsis

+

Synopsis

Declared in <brief-2.cpp>
-
void
-f2();
+
+void
+f2();
+
-

-f3# -

+

f3

brief

-

-Synopsis

+

Synopsis

Declared in <brief-2.cpp>
-
void
-f3();
+
+void
+f3();
+
-

-f4# -

+

f4

brief x

-

-Synopsis

+

Synopsis

Declared in <brief-2.cpp>
-
void
-f4();
+
+void
+f4();
+
-

-Description

+

Description

brief

-

-f5# -

+

f5

brief

-

-Synopsis

+

Synopsis

Declared in <brief-2.cpp>
-
void
-f5();
+
+void
+f5();
+
-

-f6# -

+

f6

brief

-

-Synopsis

+

Synopsis

Declared in <brief-2.cpp>
-
void
-f6();
+
+void
+f6();
+
-

-Description

+

Description

desc

- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/javadoc/brief/brief-3.html b/test-files/golden-tests/javadoc/brief/brief-3.html index c560c7d1ba..86775b32dd 100644 --- a/test-files/golden-tests/javadoc/brief/brief-3.html +++ b/test-files/golden-tests/javadoc/brief/brief-3.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Functions

+

Functions

@@ -29,126 +25,122 @@

-

-f# -

+

f

f overloads

-

-Synopses

+

Synopses

Declared in <brief-3.cpp>

Integer overload.

-
void
-f(int);
-Β» more... +
+void
+f(int);
+
Β» more...

Integer overload.

-
void
-f(double);
-Β» more... +
+void
+f(double);
+
Β» more...

C string overload.

-
void
-f(char const*);
-Β» more... +
+void
+f(char const*);
+
Β» more...

C string overload.

-
void
-f(float const*);
-Β» more... +
+void
+f(float const*);
+
Β» more... +
-

-f# -

+

f

Integer overload.

-

-Synopsis

+

Synopsis

Declared in <brief-3.cpp>
-
void
-f(int);
+
+void
+f(int);
+
-

-Description

+

Description

More info

-

-f# -

+

f

Integer overload.

-

-Synopsis

+

Synopsis

Declared in <brief-3.cpp>
-
void
-f(double);
+
+void
+f(double);
+
-

-f# -

+

f

C string overload.

-

-Synopsis

+

Synopsis

Declared in <brief-3.cpp>
-
void
-f(char const*);
+
+void
+f(char const*);
+
-

-Description

+

Description

More info

-

-f# -

+

f

C string overload.

-

-Synopsis

+

Synopsis

Declared in <brief-3.cpp>
-
void
-f(float const*);
+
+void
+f(float const*);
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/javadoc/brief/brief-4.html b/test-files/golden-tests/javadoc/brief/brief-4.html index e7816ee2cd..b33de55be1 100644 --- a/test-files/golden-tests/javadoc/brief/brief-4.html +++ b/test-files/golden-tests/javadoc/brief/brief-4.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Functions

+

Functions

@@ -32,68 +28,64 @@

-

-f0# -

+

f0

-

-Synopsis

+

Synopsis

Declared in <brief-4.cpp>
-
void
-f0();
+
+void
+f0();
+
-

-f1# -

+

f1

-

-Synopsis

+

Synopsis

Declared in <brief-4.cpp>
-
void
-f1();
+
+void
+f1();
+
-

-f2# -

+

f2

-

-Synopsis

+

Synopsis

Declared in <brief-4.cpp>
-
void
-f2();
+
+void
+f2();
+
-

-f3# -

+

f3

-

-Synopsis

+

Synopsis

Declared in <brief-4.cpp>
-
void
-f3();
+
+void
+f3();
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/javadoc/brief/brief-5.html b/test-files/golden-tests/javadoc/brief/brief-5.html index cf7a9ffeb8..9b17d8f5d7 100644 --- a/test-files/golden-tests/javadoc/brief/brief-5.html +++ b/test-files/golden-tests/javadoc/brief/brief-5.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Functions

+

Functions

@@ -34,110 +30,104 @@

-

-f0# -

+

f0

brief

-

-Synopsis

+

Synopsis

Declared in <brief-5.cpp>
-
void
-f0();
+
+void
+f0();
+
-

-f1# -

+

f1

-

-Synopsis

+

Synopsis

Declared in <brief-5.cpp>
-
void
-f1();
+
+void
+f1();
+
-

-f2# -

+

f2

-

-Synopsis

+

Synopsis

Declared in <brief-5.cpp>
-
void
-f2();
+
+void
+f2();
+
-

-f3# -

+

f3

brief

-

-Synopsis

+

Synopsis

Declared in <brief-5.cpp>
-
void
-f3();
+
+void
+f3();
+
-

-f4# -

+

f4

brief

-

-Synopsis

+

Synopsis

Declared in <brief-5.cpp>
-
void
-f4();
+
+void
+f4();
+
-

-f5# -

+

f5

brief

-

-Synopsis

+

Synopsis

Declared in <brief-5.cpp>
-
void
-f5();
+
+void
+f5();
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/javadoc/brief/brief-6.html b/test-files/golden-tests/javadoc/brief/brief-6.html index f23b01f44c..38b9413a63 100644 --- a/test-files/golden-tests/javadoc/brief/brief-6.html +++ b/test-files/golden-tests/javadoc/brief/brief-6.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Functions

+

Functions

@@ -29,31 +25,29 @@

-

-f0# -

+

f0

brief

-

-Synopsis

+

Synopsis

Declared in <brief-6.cpp>
-
void
-f0();
+
+void
+f0();
+
-

-Description

+

Description

desc

- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/javadoc/code/code.html b/test-files/golden-tests/javadoc/code/code.html index 67720409d4..5fd8849b7c 100644 --- a/test-files/golden-tests/javadoc/code/code.html +++ b/test-files/golden-tests/javadoc/code/code.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Functions

+

Functions

@@ -29,24 +25,22 @@

-

-f# -

+

f

brief

-

-Synopsis

+

Synopsis

Declared in <code.cpp>
-
void
-f();
+
+void
+f();
+
-

-Description

+

Description

This description contains code:

// code comment @@ -62,8 +56,8 @@

- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/javadoc/copybrief/copybrief.html b/test-files/golden-tests/javadoc/copybrief/copybrief.html index e51cbc8612..be7d6ca9c2 100644 --- a/test-files/golden-tests/javadoc/copybrief/copybrief.html +++ b/test-files/golden-tests/javadoc/copybrief/copybrief.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Functions

+

Functions

@@ -31,67 +27,63 @@

-

-f1# -

+

f1

brief1

-

-Synopsis

+

Synopsis

Declared in <copybrief.cpp>
-
void
-f1();
+
+void
+f1();
+
-

-f2# -

+

f2

brief1

-

-Synopsis

+

Synopsis

Declared in <copybrief.cpp>
-
void
-f2();
+
+void
+f2();
+
-

-f3# -

+

f3

brief1

-

-Synopsis

+

Synopsis

Declared in <copybrief.cpp>
-
void
-f3();
+
+void
+f3();
+
-

-Description

+

Description

f2

- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/javadoc/copydetails/copydetails.html b/test-files/golden-tests/javadoc/copydetails/copydetails.html index 192b3f8d62..9f4f6c5cf0 100644 --- a/test-files/golden-tests/javadoc/copydetails/copydetails.html +++ b/test-files/golden-tests/javadoc/copydetails/copydetails.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Functions

+

Functions

@@ -31,41 +27,37 @@

-

-dest# -

+

dest

Destination doc function

-

-Synopsis

+

Synopsis

Declared in <copydetails.cpp>
-
template<
+
+template<
     class A,
     class B>
 int
 dest(
     int a,
-    int b);
+ int b);
+
-

-Description

+

Description

Documentation prefix for dest only.

This is the documentation from the source function.

Documentation suffix for dest only.

-

-Return Value

+

Return Value

A nice integer
-

-Template Parameters

+

Template Parameters

@@ -86,8 +78,7 @@

-

-Parameters

+

Parameters

@@ -108,41 +99,36 @@

-

-Preconditions

+

Preconditions

  • a must be greater than 0.
-

-Postconditions

+

Postconditions

  • The return value is greater than 0.
-

-See Also

+

See Also

dest

-

-destOverride# -

+

destOverride

Destination doc function

-

-Synopsis

+

Synopsis

Declared in <copydetails.cpp>
-
template<
+
+template<
     class A,
     class C,
     class D>
@@ -150,19 +136,18 @@ 

destOverride( int a, int c, - int d);

+ int d);
+
-

-Description

+

Description

Documentation prefix for dest only.

This is the documentation from the source function.

Documentation suffix for dest only.

Parameter b is not copied because it doesn't exist in the destination function.

-

-Exceptions

+

Exceptions

@@ -179,13 +164,11 @@

-

-Return Value

+

Return Value

An integer meaning something else.
-

-Template Parameters

+

Template Parameters

@@ -210,8 +193,7 @@

-

-Parameters

+

Parameters

@@ -236,56 +218,50 @@

-

-Preconditions

+

Preconditions

  • overriden precondition
-

-Postconditions

+

Postconditions

  • overriden postcondition
-

-See Also

+

See Also

source

-

-source# -

+

source

Source doc function

-

-Synopsis

+

Synopsis

Declared in <copydetails.cpp>
-
template<
+
+template<
     class A,
     class B>
 int
 source(
     int a,
-    int b);
+ int b);
+
-

-Description

+

Description

This is the documentation from the source function.

-

-Exceptions

+

Exceptions

@@ -302,13 +278,11 @@

-

-Return Value

+

Return Value

A nice integer
-

-Template Parameters

+

Template Parameters

@@ -329,8 +303,7 @@

-

-Parameters

+

Parameters

@@ -351,30 +324,27 @@

-

-Preconditions

+

Preconditions

  • a must be greater than 0.
-

-Postconditions

+

Postconditions

  • The return value is greater than 0.
-

-See Also

+

See Also

dest

- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/javadoc/copydoc/conversion.html b/test-files/golden-tests/javadoc/copydoc/conversion.html index 0d7d35653a..46ecf90d4a 100644 --- a/test-files/golden-tests/javadoc/copydoc/conversion.html +++ b/test-files/golden-tests/javadoc/copydoc/conversion.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Types

+

Types

@@ -31,19 +27,17 @@

-

-A# -

+

A

-

-Synopsis

+

Synopsis

Declared in <conversion.cpp>
-
struct A;
+
+struct A;
+
-

-Member Functions

+

Member Functions

@@ -63,37 +57,35 @@

-

-A::operator=# -

+

A::operator=

Convert a string to A

-

-Synopses

+

Synopses

Declared in <conversion.cpp>

Convert a string to A

-
A&
-operator=(string_type const& other);
-Β» more... +
+A&
+operator=(string_type const& other);
+
Β» more...

Convert a string to A

-
A&
-operator=(string_view_type const& other);
-Β» more... +
+A&
+operator=(string_view_type const& other);
+
Β» more... +
-

-Return Value

+

Return Value

A representation of the string
-

-Parameters

+

Parameters

@@ -112,29 +104,26 @@

-

-A::operator=# -

+

A::operator=

Convert a string to A

-

-Synopsis

+

Synopsis

Declared in <conversion.cpp>
-
A&
-operator=(string_type const& other);
+
+A&
+operator=(string_type const& other);
+
-

-Return Value

+

Return Value

A representation of the string
-

-Parameters

+

Parameters

@@ -153,29 +142,26 @@

-

-A::operator=# -

+

A::operator=

Convert a string to A

-

-Synopsis

+

Synopsis

Declared in <conversion.cpp>
-
A&
-operator=(string_view_type const& other);
+
+A&
+operator=(string_view_type const& other);
+
-

-Return Value

+

Return Value

A representation of the string
-

-Parameters

+

Parameters

@@ -194,84 +180,78 @@

-

-A::operator string_type# -

+

A::operator string_type

Convert A to a string

-

-Synopsis

+

Synopsis

Declared in <conversion.cpp>
-
operator string_type() const;
+
+operator string_type() const;
+
-

-Return Value

+

Return Value

A string representation of A
-

-A::operator string_view_type# -

+

A::operator string_view_type

Convert A to a string

-

-Synopsis

+

Synopsis

Declared in <conversion.cpp>
-
operator string_view_type() const;
+
+operator string_view_type() const;
+
-

-Return Value

+

Return Value

A string representation of A
-

-string_type# -

+

string_type

-

-Synopsis

+

Synopsis

Declared in <conversion.cpp>
-
class string_type;
+
+class string_type;
+
-

-string_view_type# -

+

string_view_type

-

-Synopsis

+

Synopsis

Declared in <conversion.cpp>
-
class string_view_type;
+
+class string_view_type;
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/javadoc/copydoc/decay-params.html b/test-files/golden-tests/javadoc/copydoc/decay-params.html index 640c1beb90..b28ca5427d 100644 --- a/test-files/golden-tests/javadoc/copydoc/decay-params.html +++ b/test-files/golden-tests/javadoc/copydoc/decay-params.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Functions

+

Functions

@@ -30,35 +26,31 @@

-

-bar# -

+

bar

Brief from foo()

-

-Synopsis

+

Synopsis

Declared in <decay-params.cpp>
-
constexpr
+
+constexpr
 bool
-bar(int* a);
+bar(int* a);
+
-

-Description

+

Description

This is the function original documentation for the foo function with an array parameter.

-

-Return Value

+

Return Value

A boolean value.
-

-Parameters

+

Parameters

@@ -77,43 +69,42 @@

-

-foo# -

+

foo

foo overloads

-

-Synopses

+

Synopses

Declared in <decay-params.cpp>

We should not copy this doc

-
void
-foo();
-Β» more... +
+void
+foo();
+
Β» more...

We should not copy this doc

-
void
-foo(int a);
-Β» more... +
+void
+foo(int a);
+
Β» more...

Brief from foo()

-
constexpr
+
+constexpr
 bool
-foo(int a[3]);
-Β» more... +foo(int a[3]);
+
Β» more... +
-

-Return Value

+

Return Value

A boolean value.
-

-Parameters

+

Parameters

@@ -132,52 +123,47 @@

-

-foo# -

+

foo

We should not copy this doc

-

-Synopsis

+

Synopsis

Declared in <decay-params.cpp>
-
void
-foo();
+
+void
+foo();
+
-

-Description

+

Description

bar should not copy this documentation just because it has the same name and is simpler.

-

-foo# -

+

foo

We should not copy this doc

-

-Synopsis

+

Synopsis

Declared in <decay-params.cpp>
-
void
-foo(int a);
+
+void
+foo(int a);
+
-

-Description

+

Description

bar should not copy this documentation just because it has the same number of parameters.

-

-Parameters

+

Parameters

@@ -196,35 +182,31 @@

-

-foo# -

+

foo

Brief from foo()

-

-Synopsis

+

Synopsis

Declared in <decay-params.cpp>
-
constexpr
+
+constexpr
 bool
-foo(int a[3]);
+foo(int a[3]);
+
-

-Description

+

Description

This is the function original documentation for the foo function with an array parameter.

-

-Return Value

+

Return Value

A boolean value.
-

-Parameters

+

Parameters

@@ -243,8 +225,8 @@

- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/javadoc/copydoc/fundamental.html b/test-files/golden-tests/javadoc/copydoc/fundamental.html index 6a1e7b6515..049d481153 100644 --- a/test-files/golden-tests/javadoc/copydoc/fundamental.html +++ b/test-files/golden-tests/javadoc/copydoc/fundamental.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Functions

+

Functions

@@ -31,32 +27,31 @@

-

-f# -

+

f

f overloads

-

-Synopses

+

Synopses

Declared in <fundamental.cpp>

Fail

-
void
-f(int a);
-Β» more... +
+void
+f(int a);
+
Β» more...

Brief

-
void
-f(long a);
-Β» more... +
+void
+f(long a);
+
Β» more... +
-

-Parameters

+

Parameters

@@ -75,24 +70,22 @@

-

-f# -

+

f

Fail

-

-Synopsis

+

Synopsis

Declared in <fundamental.cpp>
-
void
-f(int a);
+
+void
+f(int a);
+
-

-Parameters

+

Parameters

@@ -111,29 +104,26 @@

-

-f# -

+

f

Brief

-

-Synopsis

+

Synopsis

Declared in <fundamental.cpp>
-
void
-f(long a);
+
+void
+f(long a);
+
-

-Description

+

Description

Details

-

-Parameters

+

Parameters

@@ -152,29 +142,26 @@

-

-g# -

+

g

Brief

-

-Synopsis

+

Synopsis

Declared in <fundamental.cpp>
-
void
-g(long a);
+
+void
+g(long a);
+
-

-Description

+

Description

Details

-

-Parameters

+

Parameters

@@ -193,29 +180,26 @@

-

-h# -

+

h

Brief

-

-Synopsis

+

Synopsis

Declared in <fundamental.cpp>
-
void
-h(long a);
+
+void
+h(long a);
+
-

-Description

+

Description

Details

-

-Parameters

+

Parameters

@@ -234,8 +218,8 @@

- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/javadoc/copydoc/no-param.html b/test-files/golden-tests/javadoc/copydoc/no-param.html index d8b5182f03..6a36f60c5e 100644 --- a/test-files/golden-tests/javadoc/copydoc/no-param.html +++ b/test-files/golden-tests/javadoc/copydoc/no-param.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Functions

+

Functions

@@ -31,98 +27,90 @@

-

-copyFromNoParam# -

+

copyFromNoParam

Brief from foo()

-

-Synopsis

+

Synopsis

Declared in <no-param.cpp>
-
constexpr
+
+constexpr
 bool
-copyFromNoParam();
+copyFromNoParam();
+
-

-Description

+

Description

This is the function original documentation for the foo function with no parameters.

This documentation is copied from the page containing the foo overload with no parameters.

-

-Return Value

+

Return Value

A boolean value.
-

-copyfromOverloads# -

+

copyfromOverloads

Brief from foo()

-

-Synopsis

+

Synopsis

Declared in <no-param.cpp>
-
constexpr
+
+constexpr
 bool
-copyfromOverloads();
+copyfromOverloads();
+
-

-Description

+

Description

This documentation is copied from the page containing all overloads of foo.

-

-Return Value

+

Return Value

A boolean value.
-

-foo# -

+

foo

Brief from foo()

-

-Synopses

+

Synopses

Declared in <no-param.cpp>

Brief from foo()

-
constexpr
+
+constexpr
 bool
-foo();
-Β» more... +foo();
+
Β» more...

Brief from foo()

-
constexpr
+
+constexpr
 bool
-foo(char ch);
-Β» more... +foo(char ch);
+
Β» more... +
-

-Return Value

+

Return Value

A boolean value.
-

-Parameters

+

Parameters

@@ -141,64 +129,57 @@

-

-foo# -

+

foo

Brief from foo()

-

-Synopsis

+

Synopsis

Declared in <no-param.cpp>
-
constexpr
+
+constexpr
 bool
-foo();
+foo();
+
-

-Description

+

Description

This is the function original documentation for the foo function with no parameters.

-

-Return Value

+

Return Value

A boolean value.
-

-foo# -

+

foo

Brief from foo()

-

-Synopsis

+

Synopsis

Declared in <no-param.cpp>
-
constexpr
+
+constexpr
 bool
-foo(char ch);
+foo(char ch);
+
-

-Description

+

Description

This is the function original documentation for the foo function with no parameters.

-

-Return Value

+

Return Value

A boolean value.
-

-Parameters

+

Parameters

@@ -217,8 +198,8 @@

- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/javadoc/copydoc/operator-param.html b/test-files/golden-tests/javadoc/copydoc/operator-param.html index 5f4296b8b0..b50f8ff151 100644 --- a/test-files/golden-tests/javadoc/copydoc/operator-param.html +++ b/test-files/golden-tests/javadoc/copydoc/operator-param.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Types

+

Types

@@ -29,19 +25,17 @@

-

-A# -

+

A

-

-Synopsis

+

Synopsis

Declared in <operator-param.cpp>
-
struct A;
+
+struct A;
+
-

-Member Functions

+

Member Functions

@@ -59,39 +53,37 @@

-

-A::operator()# -

+

A::operator()

Return true if ch is in the character set.

-

-Synopses

+

Synopses

Declared in <operator-param.cpp>

Return true if ch is in the character set.

-
constexpr
+
+constexpr
 bool
-operator()(char ch) const noexcept;
-Β» more... +operator()(char ch) const noexcept;
+
Β» more...

Return true if ch is in the character set.

-
constexpr
+
+constexpr
 bool
-operator()(unsigned char ch) const noexcept;
-Β» more... +operator()(unsigned char ch) const noexcept;
+
Β» more... +
-

-Return Value

+

Return Value

True if ch is in the set, otherwise false.
-

-Parameters

+

Parameters

@@ -110,35 +102,31 @@

-

-A::operator()# -

+

A::operator()

Return true if ch is in the character set.

-

-Synopsis

+

Synopsis

Declared in <operator-param.cpp>
-
constexpr
+
+constexpr
 bool
-operator()(char ch) const noexcept;
+operator()(char ch) const noexcept;
+
-

-Description

+

Description

This function returns true if the character is in the set, otherwise it returns false.

-

-Return Value

+

Return Value

True if ch is in the set, otherwise false.
-

-Parameters

+

Parameters

@@ -157,35 +145,31 @@

-

-A::operator()# -

+

A::operator()

Return true if ch is in the character set.

-

-Synopsis

+

Synopsis

Declared in <operator-param.cpp>
-
constexpr
+
+constexpr
 bool
-operator()(unsigned char ch) const noexcept;
+operator()(unsigned char ch) const noexcept;
+
-

-Description

+

Description

This function returns true if the character is in the set, otherwise it returns false.

-

-Return Value

+

Return Value

True if ch is in the set, otherwise false.
-

-Parameters

+

Parameters

@@ -204,8 +188,8 @@

- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/javadoc/copydoc/param-types.html b/test-files/golden-tests/javadoc/copydoc/param-types.html index 22fe5f83d1..52fee942b0 100644 --- a/test-files/golden-tests/javadoc/copydoc/param-types.html +++ b/test-files/golden-tests/javadoc/copydoc/param-types.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Namespaces

+

Namespaces

@@ -26,8 +22,7 @@

-

-Types

+

Types

@@ -41,8 +36,7 @@

-

-Enums

+

Enums

@@ -55,8 +49,7 @@

-

-Functions

+

Functions

@@ -73,15 +66,12 @@

-

-N# -

+

N

Namespace to test qualified identifier parameters.

-

-Namespaces

+

Namespaces

@@ -97,15 +87,12 @@

-

-N::M# -

+

N::M

Namespace to test qualified identifier parameters.

-

-Types

+

Types

@@ -121,25 +108,23 @@

-

-N::M::Q# -

+

N::M::Q

Struct to test qualified identifier parameters.

-

-Synopsis

+

Synopsis

Declared in <param-types.cpp>
-
struct Q;
+
+struct Q;
+
-

-Non-Member Functions

+

Non-Member Functions

@@ -155,22 +140,20 @@

-

-A# -

+

A

Struct to test explicit object member functions.

-

-Synopsis

+

Synopsis

Declared in <param-types.cpp>
-
struct A;
+
+struct A;
+
-

-Member Functions

+

Member Functions

@@ -187,8 +170,7 @@

-

-Non-Member Functions

+

Non-Member Functions

@@ -204,30 +186,27 @@

-

-A::f# -

+

A::f

Reference member function.

-

-Synopsis

+

Synopsis

Declared in <param-types.cpp>
-
void
-f(paramType<4> a);
+
+void
+f(paramType<4> a);
+
-

-Description

+

Description

Documentation for a function with an explicit object parameter.

This reference uses the this keyword.

-

-Parameters

+

Parameters

@@ -246,31 +225,28 @@

-

-A::g# -

+

A::g

Reference member function.

-

-Synopsis

+

Synopsis

Declared in <param-types.cpp>
-
void
+
+void
 g(this 
     A& self,
-    int a);
+ int a);
+
-

-Description

+

Description

Documentation for a function with an explicit object parameter.

-

-Parameters

+

Parameters

@@ -293,26 +269,24 @@

-

-paramType# -

+

paramType

Struct used to vary the parameter type.

-

-Synopsis

+

Synopsis

Declared in <param-types.cpp>
-
template<int Idx>
-struct paramType;
+
+template<int Idx>
+struct paramType;
+
-

-Non-Member Functions

+

Non-Member Functions

@@ -336,20 +310,18 @@

-

-testEnum# -

+

testEnum

-

-Synopsis

+

Synopsis

Declared in <param-types.cpp>
-
enum testEnum;
+
+enum testEnum;
+
-

-Non-Member Functions

+

Non-Member Functions

@@ -365,72 +337,79 @@

-

-f# -

+

f

f overloads

-

-Synopses

+

Synopses

Declared in <param-types.cpp>

Reference function.

-
void
-f();
-Β» more... +
+void
+f();
+
Β» more...

Reference function.

-
void
-f(paramType<0> a);
-Β» more... +
+void
+f(paramType<0> a);
+
Β» more...

Reference function.

-
void
-f(paramType<1> a);
-Β» more... +
+void
+f(paramType<1> a);
+
Β» more...

Variadic function

-
void
-f(paramType<2> a);
-Β» more... +
+void
+f(paramType<2> a);
+
Β» more...

Non-variadic function

-
void
-f(paramType<3> a);
-Β» more... +
+void
+f(paramType<3> a);
+
Β» more...

struct param function

-
void
-f(paramType<5> a);
-Β» more... +
+void
+f(paramType<5> a);
+
Β» more...

Decltype function

-
void
-f(paramType<6> a);
-Β» more... +
+void
+f(paramType<6> a);
+
Β» more...

struct param function

-
void
-f(paramType<7> a);
-Β» more... +
+void
+f(paramType<7> a);
+
Β» more...

Enum param function

-
void
-f(paramType<8> a);
-Β» more... +
+void
+f(paramType<8> a);
+
Β» more...

Qualified identifier param function

-
void
-f(paramType<9> a);
-Β» more... +
+void
+f(paramType<9> a);
+
Β» more... +
-

-Parameters

+

Parameters

@@ -449,53 +428,48 @@

-

-f# -

+

f

Reference function.

-

-Synopsis

+

Synopsis

Declared in <param-types.cpp>
-
void
-f();
+
+void
+f();
+
-

-Description

+

Description

Documentation for the reference function.

-

-f# -

+

f

Reference function.

-

-Synopsis

+

Synopsis

Declared in <param-types.cpp>
-
void
-f(paramType<0> a);
+
+void
+f(paramType<0> a);
+
-

-Description

+

Description

Documentation for the reference function.

This function uses a reference with no parameters.

-

-Parameters

+

Parameters

@@ -514,30 +488,27 @@

-

-f# -

+

f

Reference function.

-

-Synopsis

+

Synopsis

Declared in <param-types.cpp>
-
void
-f(paramType<1> a);
+
+void
+f(paramType<1> a);
+
-

-Description

+

Description

Documentation for the reference function.

This reference uses the void keyword.

-

-Parameters

+

Parameters

@@ -556,30 +527,27 @@

-

-f# -

+

f

Variadic function

-

-Synopsis

+

Synopsis

Declared in <param-types.cpp>
-
void
-f(paramType<2> a);
+
+void
+f(paramType<2> a);
+
-

-Description

+

Description

Documentation for the variadic function.

This reference uses the ... keyword.

-

-Parameters

+

Parameters

@@ -598,30 +566,27 @@

-

-f# -

+

f

Non-variadic function

-

-Synopsis

+

Synopsis

Declared in <param-types.cpp>
-
void
-f(paramType<3> a);
+
+void
+f(paramType<3> a);
+
-

-Description

+

Description

Documentation for the non-variadic function.

This reference uses the int keyword.

-

-Parameters

+

Parameters

@@ -640,30 +605,27 @@

-

-f# -

+

f

struct param function

-

-Synopsis

+

Synopsis

Declared in <param-types.cpp>
-
void
-f(paramType<5> a);
+
+void
+f(paramType<5> a);
+
-

-Description

+

Description

Documentation for a function with a struct parameter.

This reference uses the auto keyword.

-

-Parameters

+

Parameters

@@ -682,30 +644,27 @@

-

-f# -

+

f

Decltype function

-

-Synopsis

+

Synopsis

Declared in <param-types.cpp>
-
void
-f(paramType<6> a);
+
+void
+f(paramType<6> a);
+
-

-Description

+

Description

Documentation for a function with a decltype parameter.

This reference uses the decltype keyword.

-

-Parameters

+

Parameters

@@ -724,30 +683,27 @@

-

-f# -

+

f

struct param function

-

-Synopsis

+

Synopsis

Declared in <param-types.cpp>
-
void
-f(paramType<7> a);
+
+void
+f(paramType<7> a);
+
-

-Description

+

Description

Documentation for a function with a struct parameter.

This reference uses the struct keyword.

-

-Parameters

+

Parameters

@@ -766,30 +722,27 @@

-

-f# -

+

f

Enum param function

-

-Synopsis

+

Synopsis

Declared in <param-types.cpp>
-
void
-f(paramType<8> a);
+
+void
+f(paramType<8> a);
+
-

-Description

+

Description

Documentation for a function with an enum parameter.

This reference uses the enum keyword.

-

-Parameters

+

Parameters

@@ -808,30 +761,27 @@

-

-f# -

+

f

Qualified identifier param function

-

-Synopsis

+

Synopsis

Declared in <param-types.cpp>
-
void
-f(paramType<9> a);
+
+void
+f(paramType<9> a);
+
-

-Description

+

Description

Documentation for a function with a qualified identifier parameter.

This reference uses the qualified identifier N::M::Q.

-

-Parameters

+

Parameters

@@ -850,59 +800,63 @@

-

-g# -

+

g

g overloads

-

-Synopses

+

Synopses

Declared in <param-types.cpp>

struct param function

-
void
-g(A a);
-Β» more... +
+void
+g(A a);
+
Β» more...

Qualified identifier param function

-
void
-g(N::M::Q a);
-Β» more... +
+void
+g(N::M::Q a);
+
Β» more...

Auto function

-
void
-g(auto a);
-Β» more... +
+void
+g(auto a);
+
Β» more...

Enum param function

-
void
-g(testEnum a);
-Β» more... +
+void
+g(testEnum a);
+
Β» more...

Variadic function

-
void
-g(int a, ...);
-Β» more... +
+void
+g(int a, ...);
+
Β» more...

Non-variadic function

-
void
-g(int a);
-Β» more... +
+void
+g(int a);
+
Β» more...

Decltype function

-
void
+
+void
 g(
     int a,
-    decltype(a) b);
-Β» more... + decltype(a) b);
+
Β» more... +
-

-Parameters

+

Parameters

@@ -925,29 +879,26 @@

-

-g# -

+

g

struct param function

-

-Synopsis

+

Synopsis

Declared in <param-types.cpp>
-
void
-g(A a);
+
+void
+g(A a);
+
-

-Description

+

Description

Documentation for a function with a struct parameter.

-

-Parameters

+

Parameters

@@ -966,29 +917,26 @@

-

-g# -

+

g

Qualified identifier param function

-

-Synopsis

+

Synopsis

Declared in <param-types.cpp>
-
void
-g(N::M::Q a);
+
+void
+g(N::M::Q a);
+
-

-Description

+

Description

Documentation for a function with a qualified identifier parameter.

-

-Parameters

+

Parameters

@@ -1007,29 +955,26 @@

-

-g# -

+

g

Auto function

-

-Synopsis

+

Synopsis

Declared in <param-types.cpp>
-
void
-g(auto a);
+
+void
+g(auto a);
+
-

-Description

+

Description

Documentation for a function with an auto parameter.

-

-Parameters

+

Parameters

@@ -1048,29 +993,26 @@

-

-g# -

+

g

Enum param function

-

-Synopsis

+

Synopsis

Declared in <param-types.cpp>
-
void
-g(testEnum a);
+
+void
+g(testEnum a);
+
-

-Description

+

Description

Documentation for a function with an enum parameter.

-

-Parameters

+

Parameters

@@ -1089,29 +1031,26 @@

-

-g# -

+

g

Variadic function

-

-Synopsis

+

Synopsis

Declared in <param-types.cpp>
-
void
-g(int a, ...);
+
+void
+g(int a, ...);
+
-

-Description

+

Description

Documentation for the variadic function.

-

-Parameters

+

Parameters

@@ -1130,29 +1069,26 @@

-

-g# -

+

g

Non-variadic function

-

-Synopsis

+

Synopsis

Declared in <param-types.cpp>
-
void
-g(int a);
+
+void
+g(int a);
+
-

-Description

+

Description

Documentation for the non-variadic function.

-

-Parameters

+

Parameters

@@ -1171,31 +1107,28 @@

-

-g# -

+

g

Decltype function

-

-Synopsis

+

Synopsis

Declared in <param-types.cpp>
-
void
+
+void
 g(
     int a,
-    decltype(a) b);
+ decltype(a) b);
+
-

-Description

+

Description

Documentation for a function with a decltype parameter.

-

-Parameters

+

Parameters

@@ -1218,8 +1151,8 @@

- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/javadoc/copydoc/qualified.html b/test-files/golden-tests/javadoc/copydoc/qualified.html index e675aa1fcf..324b8deebf 100644 --- a/test-files/golden-tests/javadoc/copydoc/qualified.html +++ b/test-files/golden-tests/javadoc/copydoc/qualified.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Namespaces

+

Namespaces

@@ -26,8 +22,7 @@

-

-Types

+

Types

@@ -43,12 +38,9 @@

-

-N# -

+

N

-

-Types

+

Types

@@ -64,19 +56,17 @@

-

-N::A# -

+

N::A

-

-Synopsis

+

Synopsis

Declared in <qualified.cpp>
-
struct A;
+
+struct A;
+
-

-Types

+

Types

@@ -89,8 +79,7 @@

-

-Member Functions

+

Member Functions

@@ -110,78 +99,82 @@

-

-N::A::B# -

+

N::A::B

-

-Synopsis

+

Synopsis

Declared in <qualified.cpp>
-
struct B;
+
+struct B;
+
-

-N::A::f# -

+

N::A::f

Reference function

-

-Synopses

+

Synopses

Declared in <qualified.cpp>

Reference function

-
void
-f(param_t<0> a);
-Β» more... +
+void
+f(param_t<0> a);
+
Β» more...

Reference function

-
void
-f(param_t<1> a);
-Β» more... +
+void
+f(param_t<1> a);
+
Β» more...

Reference function

-
void
-f(param_t<2> a);
-Β» more... +
+void
+f(param_t<2> a);
+
Β» more...

Reference function

-
void
-f(param_t<3> a);
-Β» more... +
+void
+f(param_t<3> a);
+
Β» more...

Reference function

-
void
-f(param_t<4> a);
-Β» more... +
+void
+f(param_t<4> a);
+
Β» more...

Reference function

-
void
-f(param_t<5> a);
-Β» more... +
+void
+f(param_t<5> a);
+
Β» more...

Reference function

-
void
-f(param_t<6> a);
-Β» more... +
+void
+f(param_t<6> a);
+
Β» more...

Reference function

-
void
-f(param_t<7> a);
-Β» more... +
+void
+f(param_t<7> a);
+
Β» more... +
-

-Parameters

+

Parameters

@@ -200,29 +193,26 @@

-

-N::A::f# -

+

N::A::f

Reference function

-

-Synopsis

+

Synopsis

Declared in <qualified.cpp>
-
void
-f(param_t<0> a);
+
+void
+f(param_t<0> a);
+
-

-Description

+

Description

Documentation for the reference function

-

-Parameters

+

Parameters

@@ -241,29 +231,26 @@

-

-N::A::f# -

+

N::A::f

Reference function

-

-Synopsis

+

Synopsis

Declared in <qualified.cpp>
-
void
-f(param_t<1> a);
+
+void
+f(param_t<1> a);
+
-

-Description

+

Description

Documentation for the reference function

-

-Parameters

+

Parameters

@@ -282,29 +269,26 @@

-

-N::A::f# -

+

N::A::f

Reference function

-

-Synopsis

+

Synopsis

Declared in <qualified.cpp>
-
void
-f(param_t<2> a);
+
+void
+f(param_t<2> a);
+
-

-Description

+

Description

Documentation for the reference function

-

-Parameters

+

Parameters

@@ -323,29 +307,26 @@

-

-N::A::f# -

+

N::A::f

Reference function

-

-Synopsis

+

Synopsis

Declared in <qualified.cpp>
-
void
-f(param_t<3> a);
+
+void
+f(param_t<3> a);
+
-

-Description

+

Description

Documentation for the reference function

-

-Parameters

+

Parameters

@@ -364,29 +345,26 @@

-

-N::A::f# -

+

N::A::f

Reference function

-

-Synopsis

+

Synopsis

Declared in <qualified.cpp>
-
void
-f(param_t<4> a);
+
+void
+f(param_t<4> a);
+
-

-Description

+

Description

Documentation for the reference function

-

-Parameters

+

Parameters

@@ -405,29 +383,26 @@

-

-N::A::f# -

+

N::A::f

Reference function

-

-Synopsis

+

Synopsis

Declared in <qualified.cpp>
-
void
-f(param_t<5> a);
+
+void
+f(param_t<5> a);
+
-

-Description

+

Description

Documentation for the reference function

-

-Parameters

+

Parameters

@@ -446,29 +421,26 @@

-

-N::A::f# -

+

N::A::f

Reference function

-

-Synopsis

+

Synopsis

Declared in <qualified.cpp>
-
void
-f(param_t<6> a);
+
+void
+f(param_t<6> a);
+
-

-Description

+

Description

Documentation for the reference function

-

-Parameters

+

Parameters

@@ -487,29 +459,26 @@

-

-N::A::f# -

+

N::A::f

Reference function

-

-Synopsis

+

Synopsis

Declared in <qualified.cpp>
-
void
-f(param_t<7> a);
+
+void
+f(param_t<7> a);
+
-

-Description

+

Description

Documentation for the reference function

-

-Parameters

+

Parameters

@@ -528,32 +497,31 @@

-

-N::A::g# -

+

N::A::g

g overloads

-

-Synopses

+

Synopses

Declared in <qualified.cpp>

Reference function

-
void
-g(B a);
-Β» more... +
+void
+g(B a);
+
Β» more...

Fail

-
void
-g(int a);
-Β» more... +
+void
+g(int a);
+
Β» more... +
-

-Parameters

+

Parameters

@@ -572,29 +540,26 @@

-

-N::A::g# -

+

N::A::g

Reference function

-

-Synopsis

+

Synopsis

Declared in <qualified.cpp>
-
void
-g(B a);
+
+void
+g(B a);
+
-

-Description

+

Description

Documentation for the reference function

-

-Parameters

+

Parameters

@@ -613,29 +578,26 @@

-

-N::A::g# -

+

N::A::g

Fail

-

-Synopsis

+

Synopsis

Declared in <qualified.cpp>
-
void
-g(int a);
+
+void
+g(int a);
+
-

-Description

+

Description

Function with same number of parameters but different types. This should fail.

-

-Parameters

+

Parameters

@@ -654,32 +616,31 @@

-

-N::A::h# -

+

N::A::h

h overloads

-

-Synopses

+

Synopses

Declared in <qualified.cpp>

Reference function

-
void
-h(N::A::B a);
-Β» more... +
+void
+h(N::A::B a);
+
Β» more...

Fail

-
void
-h(int a);
-Β» more... +
+void
+h(int a);
+
Β» more... +
-

-Parameters

+

Parameters

@@ -698,29 +659,26 @@

-

-N::A::h# -

+

N::A::h

Reference function

-

-Synopsis

+

Synopsis

Declared in <qualified.cpp>
-
void
-h(N::A::B a);
+
+void
+h(N::A::B a);
+
-

-Description

+

Description

Documentation for the reference function

-

-Parameters

+

Parameters

@@ -739,29 +697,26 @@

-

-N::A::h# -

+

N::A::h

Fail

-

-Synopsis

+

Synopsis

Declared in <qualified.cpp>
-
void
-h(int a);
+
+void
+h(int a);
+
-

-Description

+

Description

Function with same number of parameters but different types. This should fail.

-

-Parameters

+

Parameters

@@ -780,28 +735,27 @@

-

-param_t# -

+

param_t

Helper class for distinct parameter types

-

-Synopsis

+

Synopsis

Declared in <qualified.cpp>
-
template<int N>
-class param_t;
+
+template<int N>
+class param_t;
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/javadoc/copydoc/qualifiers.html b/test-files/golden-tests/javadoc/copydoc/qualifiers.html index e618d39268..f58c19d762 100644 --- a/test-files/golden-tests/javadoc/copydoc/qualifiers.html +++ b/test-files/golden-tests/javadoc/copydoc/qualifiers.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Types

+

Types

@@ -29,19 +25,17 @@

-

-A# -

+

A

-

-Synopsis

+

Synopsis

Declared in <qualifiers.cpp>
-
struct A;
+
+struct A;
+
-

-Types

+

Types

@@ -55,8 +49,7 @@

-

-Member Functions

+

Member Functions

@@ -78,64 +71,61 @@

-

-A::const_iterator# -

+

A::const_iterator

-

-Synopsis

+

Synopsis

Declared in <qualifiers.cpp>
-
class const_iterator;
+
+class const_iterator;
+
-

-A::iterator# -

+

A::iterator

-

-Synopsis

+

Synopsis

Declared in <qualifiers.cpp>
-
class iterator;
+
+class iterator;
+
-

-A::begin# -

+

A::begin

begin overloads

-

-Synopses

+

Synopses

Declared in <qualifiers.cpp>

Returns an iterator to the beginning

-
iterator
-begin();
-Β» more... +
+iterator
+begin();
+
Β» more...

Return a const iterator to the beginning

-
const_iterator
-begin() const;
-Β» more... +
+const_iterator
+begin() const;
+
Β» more... +
-

-Return Value

+

Return Value

  • Iterator to the first element.
  • Const iterator to the first element.
  • @@ -144,271 +134,251 @@

-

-A::begin# -

+

A::begin

Returns an iterator to the beginning

-

-Synopsis

+

Synopsis

Declared in <qualifiers.cpp>
-
iterator
-begin();
+
+iterator
+begin();
+
-

-Description

+

Description

Returns an iterator to the first element of the vector.

-

-Return Value

+

Return Value

Iterator to the first element.
-

-A::begin# -

+

A::begin

Return a const iterator to the beginning

-

-Synopsis

+

Synopsis

Declared in <qualifiers.cpp>
-
const_iterator
-begin() const;
+
+const_iterator
+begin() const;
+
-

-Description

+

Description

Returns a const iterator to the first element of the vector.

-

-Return Value

+

Return Value

Const iterator to the first element.
-

-A::cbegin# -

+

A::cbegin

Return a const iterator to the beginning

-

-Synopsis

+

Synopsis

Declared in <qualifiers.cpp>
-
const_iterator
-cbegin() const;
+
+const_iterator
+cbegin() const;
+
-

-Description

+

Description

Returns a const iterator to the first element of the vector.

-

-Return Value

+

Return Value

Const iterator to the first element.
-

-A::crvalue# -

+

A::crvalue

An const rvalue reference to A

-

-Synopsis

+

Synopsis

Declared in <qualifiers.cpp>
-
A&&
-crvalue() const &&;
+
+A&&
+crvalue() const &&;
+
-

-Return Value

+

Return Value

A reference to A
-

-A::ref# -

+

A::ref

ref overloads

-

-Synopses

+

Synopses

Declared in <qualifiers.cpp>

An lvalue reference to A

-
A&
-ref() &;
-Β» more... +
+A&
+ref() &;
+
Β» more...

An rvalue reference to A

-
A&&
-ref() &&;
-Β» more... +
+A&&
+ref() &&;
+
Β» more...

An const lvalue reference to A

-
A const&
-ref() const &;
-Β» more... +
+A const&
+ref() const &;
+
Β» more...

An const rvalue reference to A

-
A const&&
-ref() const &&;
-Β» more... +
+A const&&
+ref() const &&;
+
Β» more... +
-

-Return Value

+

Return Value

A reference to A
-

-A::ref# -

+

A::ref

An lvalue reference to A

-

-Synopsis

+

Synopsis

Declared in <qualifiers.cpp>
-
A&
-ref() &;
+
+A&
+ref() &;
+
-

-Return Value

+

Return Value

A reference to A
-

-A::ref# -

+

A::ref

An rvalue reference to A

-

-Synopsis

+

Synopsis

Declared in <qualifiers.cpp>
-
A&&
-ref() &&;
+
+A&&
+ref() &&;
+
-

-Return Value

+

Return Value

A reference to A
-

-A::ref# -

+

A::ref

An const lvalue reference to A

-

-Synopsis

+

Synopsis

Declared in <qualifiers.cpp>
-
A const&
-ref() const &;
+
+A const&
+ref() const &;
+
-

-Return Value

+

Return Value

A reference to A
-

-A::ref# -

+

A::ref

An const rvalue reference to A

-

-Synopsis

+

Synopsis

Declared in <qualifiers.cpp>
-
A const&&
-ref() const &&;
+
+A const&&
+ref() const &&;
+
-

-Return Value

+

Return Value

A reference to A
-

-A::rvalue# -

+

A::rvalue

An rvalue reference to A

-

-Synopsis

+

Synopsis

Declared in <qualifiers.cpp>
-
A&&
-rvalue() &&;
+
+A&&
+rvalue() &&;
+
-

-Return Value

+

Return Value

A reference to A
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/javadoc/copydoc/template-arguments.html b/test-files/golden-tests/javadoc/copydoc/template-arguments.html index ce40d6cab7..fc9c6d9e15 100644 --- a/test-files/golden-tests/javadoc/copydoc/template-arguments.html +++ b/test-files/golden-tests/javadoc/copydoc/template-arguments.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Namespaces

+

Namespaces

@@ -29,12 +25,9 @@

-

-A# -

+

A

-

-Types

+

Types

@@ -62,60 +55,56 @@

-

-A::BInt# -

+

A::BInt

Specialization of B for int.

-

-Synopsis

+

Synopsis

Declared in <template-arguments.cpp>
-
using BInt = B<int>;
+
+using BInt = B<int>;
+
-

-A::BInt2# -

+

A::BInt2

Specialization of B for int with value 2.

-

-Synopsis

+

Synopsis

Declared in <template-arguments.cpp>
-
using BInt2 = B<int, 2>;
+
+using BInt2 = B<int, 2>;
+
-

-A::B_t# -

+

A::B_t

Main class template for B.

-

-Synopsis

+

Synopsis

Declared in <template-arguments.cpp>
-
template<
+
+template<
     class T,
     int I>
-using B_t = B<T, I>;
+using B_t = B<T, I>;
+
-

-Template Parameters

+

Template Parameters

@@ -134,60 +123,56 @@

-

-A::CDTrue# -

+

A::CDTrue

Specialization of C for D with true.

-

-Synopsis

+

Synopsis

Declared in <template-arguments.cpp>
-
using CDTrue = C<D, true>;
+
+using CDTrue = C<D, true>;
+
-

-A::CIntTrue# -

+

A::CIntTrue

Specialization of C for D with true.

-

-Synopsis

+

Synopsis

Declared in <template-arguments.cpp>
-
using CIntTrue = C<int, true>;
+
+using CIntTrue = C<int, true>;
+
-

-A::C_t# -

+

A::C_t

Main class template for C.

-

-Synopsis

+

Synopsis

Declared in <template-arguments.cpp>
-
template<
+
+template<
     class T,
     bool B>
-using C_t = C<T, B>;
+using C_t = C<T, B>;
+
-

-Template Parameters

+

Template Parameters

@@ -206,28 +191,26 @@

-

-A::B# -

+

A::B

Main class template for B.

-

-Synopsis

+

Synopsis

Declared in <template-arguments.cpp>
-
template<
+
+template<
     class T,
     int = 0>
-struct B;
+struct B;
+
-

-Template Parameters

+

Template Parameters

@@ -250,68 +233,64 @@

-

-A::B<int># -

+

A::B<int>

Specialization of B for int.

-

-Synopsis

+

Synopsis

Declared in <template-arguments.cpp>
-
template<>
-struct B<int>;
+
+template<>
+struct B<int>;
+
-

-A::B<int, 2># -

+

A::B<int, 2>

Specialization of B for int with value 2.

-

-Synopsis

+

Synopsis

Declared in <template-arguments.cpp>
-
template<>
-struct B<int, 2>;
+
+template<>
+struct B<int, 2>;
+
-

-A::C# -

+

A::C

Main class template for C.

-

-Synopsis

+

Synopsis

Declared in <template-arguments.cpp>
-
template<
+
+template<
     class T,
     bool = false>
-struct C;
+struct C;
+
-

-Template Parameters

+

Template Parameters

@@ -334,67 +313,64 @@

-

-A::C<D, true># -

+

A::C<D, true>

Specialization of C for D with true.

-

-Synopsis

+

Synopsis

Declared in <template-arguments.cpp>
-
template<>
-struct C<D, true>;
+
+template<>
+struct C<D, true>;
+
-

-A::C<int, true># -

+

A::C<int, true>

Specialization of C for int with true.

-

-Synopsis

+

Synopsis

Declared in <template-arguments.cpp>
-
template<>
-struct C<int, true>;
+
+template<>
+struct C<int, true>;
+
-

-A::D# -

+

A::D

Helper struct D.

-

-Synopsis

+

Synopsis

Declared in <template-arguments.cpp>
-
struct D;
+
+struct D;
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/javadoc/inline/styled.adoc b/test-files/golden-tests/javadoc/inline/styled.adoc index f643e244d4..5400943323 100644 --- a/test-files/golden-tests/javadoc/inline/styled.adoc +++ b/test-files/golden-tests/javadoc/inline/styled.adoc @@ -27,12 +27,6 @@ Declared in `<styled.cpp>` struct A; ---- -=== Description - -Paragraph with `code`, *bold* text, and _italic_ text. - -We can also escape these markers: `, *, and _. - === Member Functions [cols="1,4"] @@ -42,6 +36,12 @@ We can also escape these markers: `, *, and _. | Compare function |=== +=== Description + +Paragraph with `code`, *bold* text, and _italic_ text. + +We can also escape these markers: `, *, and _. + [#A-compare] == link:#A[A]::compare diff --git a/test-files/golden-tests/javadoc/inline/styled.html b/test-files/golden-tests/javadoc/inline/styled.html index 3b6f43564e..397066c8a5 100644 --- a/test-files/golden-tests/javadoc/inline/styled.html +++ b/test-files/golden-tests/javadoc/inline/styled.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Types

+

Types

@@ -29,28 +25,20 @@

-

-A# -

+

A

Brief for A

-

-Synopsis

+

Synopsis

Declared in <styled.cpp>
-
struct A;
+
+struct A;
+
-
-

-Description

-

Paragraph with code, bold text, and italic text.

-

We can also escape these markers: `, *, and _.

-
-

-Member Functions

+

Member Functions

@@ -65,32 +53,34 @@

+
+

Description

+

Paragraph with code, bold text, and italic text.

+

We can also escape these markers: `, *, and _.

+
-

-A::compare# -

+

A::compare

Compare function

-

-Synopsis

+

Synopsis

Declared in <styled.cpp>
-
int
-compare(A const& other) const noexcept;
+
+int
+compare(A const& other) const noexcept;
+
-

-Return Value

+

Return Value

-1 if *this < other, 0 if this == other, and 1 if this > other.
-

-Parameters

+

Parameters

@@ -109,8 +99,8 @@

- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/javadoc/link/link.html b/test-files/golden-tests/javadoc/link/link.html index 6687c0a50c..73d29f255d 100644 --- a/test-files/golden-tests/javadoc/link/link.html +++ b/test-files/golden-tests/javadoc/link/link.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Functions

+

Functions

@@ -29,31 +25,29 @@

-

-f# -

+

f

A function with a link

-

-Synopsis

+

Synopsis

Declared in <link.cpp>
-
void
-f();
+
+void
+f();
+
-

-Description

+

Description

This is a function with a link to Boost.

- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/javadoc/lists/li.html b/test-files/golden-tests/javadoc/lists/li.html index 4ca5a7a4fd..4862d5a569 100644 --- a/test-files/golden-tests/javadoc/lists/li.html +++ b/test-files/golden-tests/javadoc/lists/li.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Functions

+

Functions

@@ -29,24 +25,22 @@

-

-f# -

+

f

A function

-

-Synopsis

+

Synopsis

Declared in <li.cpp>
-
void
-f();
+
+void
+f();
+
-

-Description

+

Description

Description:

  • Point 1

    @@ -58,8 +52,8 @@

- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/javadoc/lists/listitem.html b/test-files/golden-tests/javadoc/lists/listitem.html index d61669430c..40612534f4 100644 --- a/test-files/golden-tests/javadoc/lists/listitem.html +++ b/test-files/golden-tests/javadoc/lists/listitem.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Functions

+

Functions

@@ -32,21 +28,19 @@

-

-f0# -

+

f0

-

-Synopsis

+

Synopsis

Declared in <listitem.cpp>
-
void
-f0();
+
+void
+f0();
+
-

-Description

+

Description

  • item

  • @@ -54,21 +48,19 @@

-

-f1# -

+

f1

-

-Synopsis

+

Synopsis

Declared in <listitem.cpp>
-
void
-f1();
+
+void
+f1();
+
-

-Description

+

Description

  • item 1

  • @@ -78,24 +70,22 @@

-

-f2# -

+

f2

brief

-

-Synopsis

+

Synopsis

Declared in <listitem.cpp>
-
void
-f2();
+
+void
+f2();
+
-

-Description

+

Description

  • item 1

  • @@ -105,24 +95,22 @@

-

-f3# -

+

f3

brief

-

-Synopsis

+

Synopsis

Declared in <listitem.cpp>
-
void
-f3();
+
+void
+f3();
+
-

-Description

+

Description

  • item 1

  • @@ -134,8 +122,8 @@

- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/javadoc/paragraph/par-1.html b/test-files/golden-tests/javadoc/paragraph/par-1.html index ee98a3b659..7a8006c3f5 100644 --- a/test-files/golden-tests/javadoc/paragraph/par-1.html +++ b/test-files/golden-tests/javadoc/paragraph/par-1.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Functions

+

Functions

@@ -32,24 +28,22 @@

-

-f1# -

+

f1

Brief

-

-Synopsis

+

Synopsis

Declared in <par-1.cpp>
-
void
-f1();
+
+void
+f1();
+
-

-Custom par

+

Custom par

Paragraph 1

void f1(); @@ -57,24 +51,22 @@

-

-f2# -

+

f2

Brief

-

-Synopsis

+

Synopsis

Declared in <par-1.cpp>
-
void
-f2();
+
+void
+f2();
+
-

-Custom par

+

Custom par

Paragraph 2

void f2(); @@ -82,56 +74,52 @@

-

-f3# -

+

f3

Brief

-

-Synopsis

+

Synopsis

Declared in <par-1.cpp>
-
void
-f3();
+
+void
+f3();
+
-

-Custom par

+

Custom par

void f3();
-

-f4# -

+

f4

Brief

-

-Synopsis

+

Synopsis

Declared in <par-1.cpp>
-
void
-f4();
+
+void
+f4();
+
-

-Custom par

+

Custom par

void f4();
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/javadoc/paragraph/para-1.html b/test-files/golden-tests/javadoc/paragraph/para-1.html index cd51658863..25ef27a696 100644 --- a/test-files/golden-tests/javadoc/paragraph/para-1.html +++ b/test-files/golden-tests/javadoc/paragraph/para-1.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Functions

+

Functions

@@ -32,69 +28,64 @@

-

-f1# -

+

f1

-

-Synopsis

+

Synopsis

Declared in <para-1.cpp>
-
void
-f1();
+
+void
+f1();
+
-

-f2# -

+

f2

-

-Synopsis

+

Synopsis

Declared in <para-1.cpp>
-
void
-f2();
+
+void
+f2();
+
-

-f3# -

+

f3

-

-Synopsis

+

Synopsis

Declared in <para-1.cpp>
-
void
-f3();
+
+void
+f3();
+
-

-f4# -

+

f4

brief

-

-Synopsis

+

Synopsis

Declared in <para-1.cpp>
-
void
-f4();
+
+void
+f4();
+
-

-Description

+

Description

a

b

c

@@ -102,8 +93,8 @@

- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/javadoc/paragraph/para-2.html b/test-files/golden-tests/javadoc/paragraph/para-2.html index 1f67d7ab4f..59db832058 100644 --- a/test-files/golden-tests/javadoc/paragraph/para-2.html +++ b/test-files/golden-tests/javadoc/paragraph/para-2.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Functions

+

Functions

@@ -29,31 +25,29 @@

-

-f1# -

+

f1

brief

-

-Synopsis

+

Synopsis

Declared in <para-2.cpp>
-
void
-f1();
+
+void
+f1();
+
-

-Description

+

Description

a b c d

- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/javadoc/paragraph/para-3.html b/test-files/golden-tests/javadoc/paragraph/para-3.html index 0addb6d841..cae5d205ca 100644 --- a/test-files/golden-tests/javadoc/paragraph/para-3.html +++ b/test-files/golden-tests/javadoc/paragraph/para-3.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Functions

+

Functions

@@ -29,36 +25,33 @@

-

-my_function# -

+

my_function

A function

-

-Synopsis

+

Synopsis

Declared in <para-3.cpp>
-
void
-my_function();
+
+void
+my_function();
+
-

-A heading.

+

A heading.

Some text.

More text...

Another paragraph Next line

-

-Exception safety

+

Exception safety

No-throw guarantee.

- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/javadoc/param/param-1.html b/test-files/golden-tests/javadoc/param/param-1.html index e3e5fd534a..fd57226ea2 100644 --- a/test-files/golden-tests/javadoc/param/param-1.html +++ b/test-files/golden-tests/javadoc/param/param-1.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Functions

+

Functions

@@ -33,21 +29,19 @@

-

-f0# -

+

f0

-

-Synopsis

+

Synopsis

Declared in <param-1.cpp>
-
void
-f0(int i);
+
+void
+f0(int i);
+
-

-Parameters

+

Parameters

@@ -66,21 +60,19 @@

-

-f1# -

+

f1

-

-Synopsis

+

Synopsis

Declared in <param-1.cpp>
-
void
-f1(int i);
+
+void
+f1(int i);
+
-

-Parameters

+

Parameters

@@ -99,21 +91,19 @@

-

-f2# -

+

f2

-

-Synopsis

+

Synopsis

Declared in <param-1.cpp>
-
void
-f2(int& i);
+
+void
+f2(int& i);
+
-

-Parameters

+

Parameters

@@ -132,21 +122,19 @@

-

-f3# -

+

f3

-

-Synopsis

+

Synopsis

Declared in <param-1.cpp>
-
void
-f3(int& i);
+
+void
+f3(int& i);
+
-

-Parameters

+

Parameters

@@ -165,23 +153,21 @@

-

-f4# -

+

f4

-

-Synopsis

+

Synopsis

Declared in <param-1.cpp>
-
void
+
+void
 f4(
     int i,
-    double j);
+ double j);
+
-

-Parameters

+

Parameters

@@ -200,8 +186,8 @@

- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/javadoc/param/param-direction.html b/test-files/golden-tests/javadoc/param/param-direction.html index e7026d16f5..e788716c03 100644 --- a/test-files/golden-tests/javadoc/param/param-direction.html +++ b/test-files/golden-tests/javadoc/param/param-direction.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Functions

+

Functions

@@ -38,21 +34,19 @@

-

-f# -

+

f

-

-Synopsis

+

Synopsis

Declared in <param-direction.cpp>
-
void
-f(int x0);
+
+void
+f(int x0);
+
-

-Parameters

+

Parameters

@@ -71,23 +65,21 @@

-

-g# -

+

g

-

-Synopsis

+

Synopsis

Declared in <param-direction.cpp>
-
void
+
+void
 g(
     int x1,
-    int y1);
+ int y1);
+
-

-Parameters

+

Parameters

@@ -110,23 +102,21 @@

-

-h# -

+

h

-

-Synopsis

+

Synopsis

Declared in <param-direction.cpp>
-
void
+
+void
 h(
     int x2,
-    int y2);
+ int y2);
+
-

-Parameters

+

Parameters

@@ -149,23 +139,21 @@

-

-i# -

+

i

-

-Synopsis

+

Synopsis

Declared in <param-direction.cpp>
-
void
+
+void
 i(
     int x3,
-    int y3);
+ int y3);
+
-

-Parameters

+

Parameters

@@ -188,23 +176,21 @@

-

-j# -

+

j

-

-Synopsis

+

Synopsis

Declared in <param-direction.cpp>
-
void
+
+void
 j(
     int x4,
-    int y4);
+ int y4);
+
-

-Parameters

+

Parameters

@@ -227,24 +213,22 @@

-

-k# -

+

k

-

-Synopsis

+

Synopsis

Declared in <param-direction.cpp>
-
void
+
+void
 k(
     int x5,
     int y5,
-    int z5);
+ int z5);
+
-

-Parameters

+

Parameters

@@ -271,25 +255,23 @@

-

-l# -

+

l

-

-Synopsis

+

Synopsis

Declared in <param-direction.cpp>
-
void
+
+void
 l(
     int x6,
     int y6,
     int,
-    int z6);
+ int z6);
+
-

-Parameters

+

Parameters

@@ -316,23 +298,21 @@

-

-m# -

+

m

-

-Synopsis

+

Synopsis

Declared in <param-direction.cpp>
-
void
+
+void
 m(
     int x7,
-    int y7);
+ int y7);
+
-

-Parameters

+

Parameters

@@ -355,21 +335,19 @@

-

-n# -

+

n

-

-Synopsis

+

Synopsis

Declared in <param-direction.cpp>
-
void
-n(int x8);
+
+void
+n(int x8);
+
-

-Parameters

+

Parameters

@@ -388,21 +366,19 @@

-

-o# -

+

o

-

-Synopsis

+

Synopsis

Declared in <param-direction.cpp>
-
void
-o(int x9);
+
+void
+o(int x9);
+
-

-Parameters

+

Parameters

@@ -425,8 +401,8 @@

- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/javadoc/param/param-duplicate.html b/test-files/golden-tests/javadoc/param/param-duplicate.html index 1e2369dc0f..7d65d083fe 100644 --- a/test-files/golden-tests/javadoc/param/param-duplicate.html +++ b/test-files/golden-tests/javadoc/param/param-duplicate.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Functions

+

Functions

@@ -34,24 +30,22 @@

-

-f0# -

+

f0

f0 brief

-

-Synopsis

+

Synopsis

Declared in <param-duplicate.cpp>
-
int
-f0();
+
+int
+f0();
+
-

-Return Value

+

Return Value

  • int
  • int
  • @@ -60,24 +54,22 @@

-

-f1# -

+

f1

f1 brief

-

-Synopsis

+

Synopsis

Declared in <param-duplicate.cpp>
-
int
-f1();
+
+int
+f1();
+
-

-Return Value

+

Return Value

  • int
  • bool
  • @@ -86,24 +78,22 @@

-

-g0# -

+

g0

g0 brief

-

-Synopsis

+

Synopsis

Declared in <param-duplicate.cpp>
-
void
-g0(int a);
+
+void
+g0(int a);
+
-

-Parameters

+

Parameters

@@ -126,24 +116,22 @@

-

-g1# -

+

g1

g1 brief

-

-Synopsis

+

Synopsis

Declared in <param-duplicate.cpp>
-
void
-g1(int a);
+
+void
+g1(int a);
+
-

-Parameters

+

Parameters

@@ -166,25 +154,23 @@

-

-h0# -

+

h0

h0 brief

-

-Synopsis

+

Synopsis

Declared in <param-duplicate.cpp>
-
template<typename T>
+
+template<typename T>
 void
-h0();
+h0();
+
-

-Template Parameters

+

Template Parameters

@@ -207,25 +193,23 @@

-

-h1# -

+

h1

h1 brief

-

-Synopsis

+

Synopsis

Declared in <param-duplicate.cpp>
-
template<typename T>
+
+template<typename T>
 void
-h1();
+h1();
+
-

-Template Parameters

+

Template Parameters

@@ -248,8 +232,8 @@

- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/javadoc/param/param.html b/test-files/golden-tests/javadoc/param/param.html index 7a9e31873d..e1d0e4b758 100644 --- a/test-files/golden-tests/javadoc/param/param.html +++ b/test-files/golden-tests/javadoc/param/param.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Functions

+

Functions

@@ -32,21 +28,19 @@

-

-f# -

+

f

-

-Synopsis

+

Synopsis

Declared in <param.cpp>
-
void
-f(int x);
+
+void
+f(int x);
+
-

-Parameters

+

Parameters

@@ -65,23 +59,21 @@

-

-g# -

+

g

-

-Synopsis

+

Synopsis

Declared in <param.cpp>
-
void
+
+void
 g(
     int x,
-    int y);
+ int y);
+
-

-Parameters

+

Parameters

@@ -104,24 +96,22 @@

-

-h# -

+

h

-

-Synopsis

+

Synopsis

Declared in <param.cpp>
-
void
+
+void
 h(
     int x,
     int y,
-    int z);
+ int z);
+
-

-Parameters

+

Parameters

@@ -148,25 +138,23 @@

-

-i# -

+

i

-

-Synopsis

+

Synopsis

Declared in <param.cpp>
-
void
+
+void
 i(
     int w,
     int x,
     int y,
-    int z);
+ int z);
+
-

-Parameters

+

Parameters

@@ -197,8 +185,8 @@

- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/javadoc/pre/pre-post.html b/test-files/golden-tests/javadoc/pre/pre-post.html index 231a07e895..05a53b7202 100644 --- a/test-files/golden-tests/javadoc/pre/pre-post.html +++ b/test-files/golden-tests/javadoc/pre/pre-post.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Functions

+

Functions

@@ -29,29 +25,26 @@

-

-f# -

+

f

-

-Synopsis

+

Synopsis

Declared in <pre-post.cpp>
-
void
-f();
+
+void
+f();
+
-

-Preconditions

+

Preconditions

  • first precondition
  • second precondition
-

-Postconditions

+

Postconditions

  • first postcondition
@@ -59,8 +52,8 @@

- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/javadoc/ref/broken-ref.html b/test-files/golden-tests/javadoc/ref/broken-ref.html index 0ae621efdf..70800723f0 100644 --- a/test-files/golden-tests/javadoc/ref/broken-ref.html +++ b/test-files/golden-tests/javadoc/ref/broken-ref.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Functions

+

Functions

@@ -30,39 +26,36 @@

-

-f0# -

+

f0

-

-Synopsis

+

Synopsis

Declared in <broken-ref.cpp>
-
void
-f0();
+
+void
+f0();
+
-

-f1# -

+

f1

See f0

-

-Synopsis

+

Synopsis

Declared in <broken-ref.cpp>
-
void
-f1();
+
+void
+f1();
+
-

-Description

+

Description

See ::f2

Broken should be warned only once

See ::f2

@@ -70,8 +63,8 @@

- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/javadoc/ref/parent_context.html b/test-files/golden-tests/javadoc/ref/parent_context.html index ad4c95a4aa..ce746d9eb0 100644 --- a/test-files/golden-tests/javadoc/ref/parent_context.html +++ b/test-files/golden-tests/javadoc/ref/parent_context.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Namespaces

+

Namespaces

@@ -29,12 +25,9 @@

-

-boost# -

+

boost

-

-Namespaces

+

Namespaces

@@ -50,12 +43,9 @@

-

-boost::openmethod# -

+

boost::openmethod

-

-Namespaces

+

Namespaces

@@ -68,8 +58,7 @@

-

-Functions

+

Functions

@@ -85,12 +74,9 @@

-

-boost::openmethod::policies# -

+

boost::openmethod::policies

-

-Namespaces

+

Namespaces

@@ -106,12 +92,9 @@

-

-boost::openmethod::policies::runtime_checks# -

+

boost::openmethod::policies::runtime_checks

-

-Types

+

Types

@@ -127,93 +110,89 @@

-

-boost::openmethod::policies::runtime_checks::runtime_checks# -

+

boost::openmethod::policies::runtime_checks::runtime_checks

Documentation with ref to final_virtual_ptr

-

-Synopsis

+

Synopsis

Declared in <parent_context.cpp>
-
struct runtime_checks;
+
+struct runtime_checks;
+
+ +
-

-Description

+

Description

See final_virtual_ptr

- -
-

-boost::openmethod::final_virtual_ptr# -

+

boost::openmethod::final_virtual_ptr

-

-Synopses

+

Synopses

Declared in <parent_context.cpp>
-
template<class Arg>
+
+template<class Arg>
 auto
-final_virtual_ptr(Arg&& obj);
-Β» more... +final_virtual_ptr(Arg&& obj);
+
Β» more... -
template<
+
+template<
     class Registry,
     typename Arg>
 auto
-final_virtual_ptr(Arg&& obj);
-Β» more... +final_virtual_ptr(Arg&& obj);
+
Β» more... +
-

-boost::openmethod::final_virtual_ptr# -

+

boost::openmethod::final_virtual_ptr

-

-Synopsis

+

Synopsis

Declared in <parent_context.cpp>
-
template<class Arg>
+
+template<class Arg>
 auto
-final_virtual_ptr(Arg&& obj);
+final_virtual_ptr(Arg&& obj);
+
-

-boost::openmethod::final_virtual_ptr# -

+

boost::openmethod::final_virtual_ptr

-

-Synopsis

+

Synopsis

Declared in <parent_context.cpp>
-
template<
+
+template<
     class Registry,
     typename Arg>
 auto
-final_virtual_ptr(Arg&& obj);
+final_virtual_ptr(Arg&& obj);
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/javadoc/ref/punctuation.html b/test-files/golden-tests/javadoc/ref/punctuation.html index e13bc9ba14..6774d9c261 100644 --- a/test-files/golden-tests/javadoc/ref/punctuation.html +++ b/test-files/golden-tests/javadoc/ref/punctuation.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Functions

+

Functions

@@ -31,56 +27,53 @@

-

-f0# -

+

f0

-

-Synopsis

+

Synopsis

Declared in <punctuation.cpp>
-
void
-f0();
+
+void
+f0();
+
-

-f1# -

+

f1

-

-Synopsis

+

Synopsis

Declared in <punctuation.cpp>
-
void
-f1();
+
+void
+f1();
+
-

-f2# -

+

f2

See f0, f1.

-

-Synopsis

+

Synopsis

Declared in <punctuation.cpp>
-
void
-f2();
+
+void
+f2();
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/javadoc/ref/ref.adoc b/test-files/golden-tests/javadoc/ref/ref.adoc index 903216fdcf..575993c937 100644 --- a/test-files/golden-tests/javadoc/ref/ref.adoc +++ b/test-files/golden-tests/javadoc/ref/ref.adoc @@ -73,12 +73,6 @@ template<typename> struct B; ---- -=== Description - -See link:#A-f1[`A::f1`] - -See link:#A-f1[`::A::f1`] - === Member Functions [cols=1] @@ -87,6 +81,12 @@ See link:#A-f1[`::A::f1`] | link:#A-B-f2[`f2`] |=== +=== Description + +See link:#A-f1[`A::f1`] + +See link:#A-f1[`::A::f1`] + [#A-B-f2] == link:#A[A]::link:#A-B[B]::f2 diff --git a/test-files/golden-tests/javadoc/ref/ref.html b/test-files/golden-tests/javadoc/ref/ref.html index f4f93147a4..3d86c2d696 100644 --- a/test-files/golden-tests/javadoc/ref/ref.html +++ b/test-files/golden-tests/javadoc/ref/ref.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Namespaces

+

Namespaces

@@ -26,8 +22,7 @@

-

-Types

+

Types

@@ -40,8 +35,7 @@

-

-Functions

+

Functions

@@ -59,12 +53,9 @@

-

-A# -

+

A

-

-Types

+

Types

@@ -79,8 +70,7 @@

-

-Functions

+

Functions

@@ -96,29 +86,21 @@

-

-A::B# -

+

A::B

See f1

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
template<typename>
-struct B;
+
+template<typename>
+struct B;
+
-
-

-Description

-

See A::f1

-

See ::A::f1

-
-

-Member Functions

+

Member Functions

@@ -133,37 +115,39 @@

+
+

Description

+

See A::f1

+

See ::A::f1

+
-

-A::B::f2# -

+

A::B::f2

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
void
-f2();
+
+void
+f2();
+
-

-A::C# -

+

A::C

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
struct C;
+
+struct C;
+
-

-Member Functions

+

Member Functions

@@ -180,8 +164,7 @@

-

-Derived Classes

+

Derived Classes

@@ -198,51 +181,47 @@

-

-A::C::f3# -

+

A::C::f3

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
void
-f3();
+
+void
+f3();
+
-

-A::C::f4# -

+

A::C::f4

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
void
-f4();
+
+void
+f4();
+
-

-A::D# -

+

A::D

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
struct D
-    : C
+
+struct D
+    : C
+
-

-Base Classes

+

Base Classes

@@ -255,8 +234,7 @@

-

-Types

+

Types

@@ -269,8 +247,7 @@

-

-Member Functions

+

Member Functions

@@ -289,82 +266,75 @@

-

-A::D::E# -

+

A::D::E

See f3

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
struct E;
+
+struct E;
+
+ +
-

-Description

+

Description

See f4

See C::f4

- -
-

-A::D::f4# -

+

A::D::f4

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
void
-f4();
+
+void
+f4();
+
-

-A::f1# -

+

A::f1

See f0

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
void
-f1();
+
+void
+f1();
+
-

-Description

+

Description

See ::f0

-

-F# -

+

F

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
struct F;
+
+struct F;
+
-

-Member Functions

+

Member Functions

@@ -420,647 +390,603 @@

-

-F::operator=# -

+

F::operator=

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
void
-operator=(F& other);
+
+void
+operator=(F& other);
+
-

-F::operator%# -

+

F::operator%

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
void
-operator%(F& rhs);
+
+void
+operator%(F& rhs);
+
-

-F::operator%=# -

+

F::operator%=

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
void
-operator%=(F& rhs);
+
+void
+operator%=(F& rhs);
+
-

-F::operator&# -

+

F::operator&

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
void
-operator&(F& rhs);
+
+void
+operator&(F& rhs);
+
-

-F::operator&&# -

+

F::operator&&

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
void
-operator&&(F& rhs);
+
+void
+operator&&(F& rhs);
+
-

-F::operator&=# -

+

F::operator&=

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
void
-operator&=(F& rhs);
+
+void
+operator&=(F& rhs);
+
-

-F::operator()# -

+

F::operator()

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
void
-operator()(F& rhs);
+
+void
+operator()(F& rhs);
+
-

-F::operator*# -

+

F::operator*

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
void
-operator*(F& rhs);
+
+void
+operator*(F& rhs);
+
-

-F::operator*=# -

+

F::operator*=

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
void
-operator*=(F& rhs);
+
+void
+operator*=(F& rhs);
+
-

-F::operator+# -

+

F::operator+

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
void
-operator+(F& rhs);
+
+void
+operator+(F& rhs);
+
-

-F::operator++# -

+

F::operator++

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
void
-operator++();
+
+void
+operator++();
+
-

-F::operator+=# -

+

F::operator+=

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
void
-operator+=(F& rhs);
+
+void
+operator+=(F& rhs);
+
-

-F::operator,# -

+

F::operator,

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
void
-operator,(F& rhs);
+
+void
+operator,(F& rhs);
+
-

-F::operator-# -

+

F::operator-

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
void
-operator-(F& rhs);
+
+void
+operator-(F& rhs);
+
-

-F::operator--# -

+

F::operator--

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
void
-operator--();
+
+void
+operator--();
+
-

-F::operator-=# -

+

F::operator-=

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
void
-operator-=(F& rhs);
+
+void
+operator-=(F& rhs);
+
-

-F::operator-># -

+

F::operator->

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
void
-operator->();
+
+void
+operator->();
+
-

-F::operator->*# -

+

F::operator->*

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
void
-operator->*(F& rhs);
+
+void
+operator->*(F& rhs);
+
-

-F::operator/# -

+

F::operator/

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
void
-operator/(F& rhs);
+
+void
+operator/(F& rhs);
+
-

-F::operator/=# -

+

F::operator/=

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
void
-operator/=(F& rhs);
+
+void
+operator/=(F& rhs);
+
-

-F::operator<<=# -

+

F::operator<<=

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
void
-operator<<=(F& rhs);
+
+void
+operator<<=(F& rhs);
+
-

-F::operator>># -

+

F::operator>>

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
void
-operator>>(F& rhs);
+
+void
+operator>>(F& rhs);
+
-

-F::operator>>=# -

+

F::operator>>=

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
void
-operator>>=(F& rhs);
+
+void
+operator>>=(F& rhs);
+
-

-F::operator[]# -

+

F::operator[]

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
void
-operator[](F& rhs);
+
+void
+operator[](F& rhs);
+
-

-F::operator^# -

+

F::operator^

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
void
-operator^(F& rhs);
+
+void
+operator^(F& rhs);
+
-

-F::operator^=# -

+

F::operator^=

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
void
-operator^=(F& rhs);
+
+void
+operator^=(F& rhs);
+
-

-F::operator|# -

+

F::operator|

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
void
-operator|(F& rhs);
+
+void
+operator|(F& rhs);
+
-

-F::operator|=# -

+

F::operator|=

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
void
-operator|=(F& rhs);
+
+void
+operator|=(F& rhs);
+
-

-F::operator||# -

+

F::operator||

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
void
-operator||(F& rhs);
+
+void
+operator||(F& rhs);
+
-

-F::operator~# -

+

F::operator~

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
void
-operator~();
+
+void
+operator~();
+
-

-F::operator<<# -

+

F::operator<<

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
void
-operator<<(F& rhs);
+
+void
+operator<<(F& rhs);
+
-

-F::operator!# -

+

F::operator!

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
void
-operator!();
+
+void
+operator!();
+
-

-F::operator==# -

+

F::operator==

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
void
-operator==(F& rhs);
+
+void
+operator==(F& rhs);
+
-

-F::operator!=# -

+

F::operator!=

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
void
-operator!=(F& rhs);
+
+void
+operator!=(F& rhs);
+
-

-F::operator<# -

+

F::operator<

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
void
-operator<(F& rhs);
+
+void
+operator<(F& rhs);
+
-

-F::operator<=# -

+

F::operator<=

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
void
-operator<=(F& rhs);
+
+void
+operator<=(F& rhs);
+
-

-F::operator># -

+

F::operator>

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
void
-operator>(F& rhs);
+
+void
+operator>(F& rhs);
+
-

-F::operator>=# -

+

F::operator>=

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
void
-operator>=(F& rhs);
+
+void
+operator>=(F& rhs);
+
-

-F::operator<=># -

+

F::operator<=>

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
void
-operator<=>(F& rhs);
+
+void
+operator<=>(F& rhs);
+
-

-f0# -

+

f0

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
void
-f0();
+
+void
+f0();
+
-

-f5# -

+

f5

See A::f1

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
void
-f5();
+
+void
+f5();
+
-

-Description

+

Description

See ::A::f1

-

-f6# -

+

f6

-

-Synopsis

+

Synopsis

Declared in <ref.cpp>
-
void
-f6();
+
+void
+f6();
+
-

-Description

+

Description

See F::operator,

See F::operator()

See F::operator[]

@@ -1103,8 +1029,8 @@

- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/javadoc/relates/relates.html b/test-files/golden-tests/javadoc/relates/relates.html index 6568592206..4d095e09e1 100644 --- a/test-files/golden-tests/javadoc/relates/relates.html +++ b/test-files/golden-tests/javadoc/relates/relates.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Types

+

Types

@@ -27,8 +23,7 @@

-

-Functions

+

Functions

@@ -44,25 +39,23 @@

-

-A# -

+

A

A brief for A.

-

-Synopsis

+

Synopsis

Declared in <relates.cpp>
-
struct A;
+
+struct A;
+
-

-Non-Member Functions

+

Non-Member Functions

@@ -78,45 +71,43 @@

-

-B# -

+

B

A brief for B

-

-Synopsis

+

Synopsis

Declared in <relates.cpp>
-
struct B;
+
+struct B;
+
-

-f# -

+

f

A brief for f.

-

-Synopsis

+

Synopsis

Declared in <relates.cpp>
-
void
-f();
+
+void
+f();
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/javadoc/returns/returns.html b/test-files/golden-tests/javadoc/returns/returns.html index c1c6697ed5..9d0f2dca28 100644 --- a/test-files/golden-tests/javadoc/returns/returns.html +++ b/test-files/golden-tests/javadoc/returns/returns.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Types

+

Types

@@ -26,8 +22,7 @@

-

-Functions

+

Functions

@@ -44,22 +39,20 @@

-

-pair# -

+

pair

-

-Synopsis

+

Synopsis

Declared in <returns.cpp>
-
template<
+
+template<
     class T,
     class U>
-struct pair;
+struct pair;
+
-

-Data Members

+

Data Members

@@ -76,8 +69,7 @@

-

-Non-Member Functions

+

Non-Member Functions

@@ -93,75 +85,69 @@

-

-pair::first# -

+

pair::first

-

-Synopsis

+

Synopsis

Declared in <returns.cpp>
-
T first;
+
+T first;
+
-

-pair::second# -

+

pair::second

-

-Synopsis

+

Synopsis

Declared in <returns.cpp>
-
U second;
+
+U second;
+
-

-f# -

+

f

A function with a single return value.

-

-Synopsis

+

Synopsis

Declared in <returns.cpp>
-
int
-f();
+
+int
+f();
+
-

-Return Value

+

Return Value

The return value of the function.
-

-g# -

+

g

A function with multiple return values.

-

-Synopsis

+

Synopsis

Declared in <returns.cpp>
-
pair<int, int>
-g();
+
+pair<int, int>
+g();
+
-

-Return Value

+

Return Value

  • The first return value of the function.
  • The second return value of the function.
  • @@ -170,8 +156,8 @@

- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/javadoc/throw/throw.html b/test-files/golden-tests/javadoc/throw/throw.html index 22b7547a20..8c9245c766 100644 --- a/test-files/golden-tests/javadoc/throw/throw.html +++ b/test-files/golden-tests/javadoc/throw/throw.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Functions

+

Functions

@@ -29,24 +25,22 @@

-

-f# -

+

f

brief

-

-Synopsis

+

Synopsis

Declared in <throw.cpp>
-
void
-f();
+
+void
+f();
+
-

-Exceptions

+

Exceptions

@@ -65,8 +59,8 @@

- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/javadoc/tparam/tparam-1.html b/test-files/golden-tests/javadoc/tparam/tparam-1.html index 9c677e7786..de7a654dd6 100644 --- a/test-files/golden-tests/javadoc/tparam/tparam-1.html +++ b/test-files/golden-tests/javadoc/tparam/tparam-1.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Functions

+

Functions

@@ -30,22 +26,20 @@

-

-f0# -

+

f0

-

-Synopsis

+

Synopsis

Declared in <tparam-1.cpp>
-
template<class T>
+
+template<class T>
 void
-f0();
+f0();
+
-

-Template Parameters

+

Template Parameters

@@ -64,30 +58,27 @@

-

-f1# -

+

f1

brief

-

-Synopsis

+

Synopsis

Declared in <tparam-1.cpp>
-
template<class T>
+
+template<class T>
 void
-f1();
+f1();
+
-

-Description

+

Description

desc

-

-Template Parameters

+

Template Parameters

@@ -106,8 +97,8 @@

- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/mrdocs.yml b/test-files/golden-tests/mrdocs.yml index 7c0987b38d..3342a7ec21 100644 --- a/test-files/golden-tests/mrdocs.yml +++ b/test-files/golden-tests/mrdocs.yml @@ -1,6 +1,3 @@ concurrency: 1 source-root: . -multipage: false -warn-if-undocumented: false -tagfile: "" -no-default-styles: true \ No newline at end of file +single-page: true diff --git a/test-files/golden-tests/output/canonical_1.html b/test-files/golden-tests/output/canonical_1.html index 20ab37da25..b4fea15a5d 100644 --- a/test-files/golden-tests/output/canonical_1.html +++ b/test-files/golden-tests/output/canonical_1.html @@ -1,19 +1,15 @@ Reference -

Reference

-

-Global Namespace# -

+

-

-Types

+

Types

@@ -36,136 +32,128 @@

-

-A# -

+

A

-

-Synopsis

+

Synopsis

Declared in <canonical_1.cpp>
-
struct A;
+
+struct A;
+
-

-B# -

+

B

-

-Synopsis

+

Synopsis

Declared in <canonical_1.cpp>
-
struct B;
+
+struct B;
+
-

-Ba# -

+

Ba

-

-Synopsis

+

Synopsis

Declared in <canonical_1.cpp>
-
struct Ba;
+
+struct Ba;
+
-

-Bx# -

+

Bx

-

-Synopsis

+

Synopsis

Declared in <canonical_1.cpp>
-
struct Bx;
+
+struct Bx;
+
-

-a# -

+

a

-

-Synopsis

+

Synopsis

Declared in <canonical_1.cpp>
-
struct a;
+
+struct a;
+
-

-b# -

+

b

-

-Synopsis

+

Synopsis

Declared in <canonical_1.cpp>
-
struct b;
+
+struct b;
+
-

-bA# -

+

bA

-

-Synopsis

+

Synopsis

Declared in <canonical_1.cpp>
-
struct bA;
+
+struct bA;
+
-

-ba# -

+

ba

-

-Synopsis

+

Synopsis

Declared in <canonical_1.cpp>
-
struct ba;
+
+struct ba;
+
- +
+

Created with MrDocs

+
\ No newline at end of file diff --git a/test-files/golden-tests/output/multipage.cpp b/test-files/golden-tests/output/multipage.cpp deleted file mode 100644 index d353e7bec4..0000000000 --- a/test-files/golden-tests/output/multipage.cpp +++ /dev/null @@ -1,19 +0,0 @@ -// NOTE: This golden test uses multipage output to validate cross-page links produced for -// nested namespaces/types. Single-page output cannot exercise the relative paths. - -namespace alpha { - -namespace beta { - -/// Widget with its own page -struct Widget {}; - -/// Factory living under a nested namespace -Widget make_widget(); - -} // namespace beta - -/// Uses a nested type to force cross-page links and asset resolution. -beta::Widget use_widget(beta::Widget); - -} // namespace alpha diff --git a/test-files/golden-tests/output/multipage.multipage/adoc/alpha.adoc b/test-files/golden-tests/output/multipage.multipage/adoc/alpha.adoc deleted file mode 100644 index 81ce64e51f..0000000000 --- a/test-files/golden-tests/output/multipage.multipage/adoc/alpha.adoc +++ /dev/null @@ -1,23 +0,0 @@ -[#alpha] -= alpha -:mrdocs: - -== Namespaces - -[cols=1] -|=== -| Name -| xref:alpha/beta.adoc[`beta`] -|=== - -== Functions - -[cols="1,4"] -|=== -| Name| Description -| xref:alpha/use_widget.adoc[`use_widget`] -| Uses a nested type to force cross‐page links and asset resolution. -|=== - - -[.small]#Created with https://www.mrdocs.com[MrDocs]# diff --git a/test-files/golden-tests/output/multipage.multipage/adoc/alpha/beta.adoc b/test-files/golden-tests/output/multipage.multipage/adoc/alpha/beta.adoc deleted file mode 100644 index f7084bce3c..0000000000 --- a/test-files/golden-tests/output/multipage.multipage/adoc/alpha/beta.adoc +++ /dev/null @@ -1,25 +0,0 @@ -[#alpha-beta] -= xref:alpha.adoc[alpha]::beta -:relfileprefix: ../ -:mrdocs: - -== Types - -[cols="1,4"] -|=== -| Name| Description -| xref:alpha/beta/Widget.adoc[`Widget`] -| Widget with its own page -|=== - -== Functions - -[cols="1,4"] -|=== -| Name| Description -| xref:alpha/beta/make_widget.adoc[`make_widget`] -| Factory living under a nested namespace -|=== - - -[.small]#Created with https://www.mrdocs.com[MrDocs]# diff --git a/test-files/golden-tests/output/multipage.multipage/adoc/alpha/beta/Widget.adoc b/test-files/golden-tests/output/multipage.multipage/adoc/alpha/beta/Widget.adoc deleted file mode 100644 index 207e294941..0000000000 --- a/test-files/golden-tests/output/multipage.multipage/adoc/alpha/beta/Widget.adoc +++ /dev/null @@ -1,30 +0,0 @@ -[#alpha-beta-Widget] -= xref:alpha.adoc[alpha]::xref:alpha/beta.adoc[beta]::Widget -:relfileprefix: ../../ -:mrdocs: - -Widget with its own page - -== Synopsis - -Declared in `<multipage.cpp>` - -[source,cpp,subs="verbatim,replacements,macros,-callouts"] ----- -struct Widget; ----- - -== Non-Member Functions - -[cols="1,4"] -|=== -| Name -| Description -| xref:alpha/beta/make_widget.adoc[`make_widget`] -| Factory living under a nested namespace -| xref:alpha/use_widget.adoc[`::alpha::use_widget`] -| Uses a nested type to force cross‐page links and asset resolution. -|=== - - -[.small]#Created with https://www.mrdocs.com[MrDocs]# diff --git a/test-files/golden-tests/output/multipage.multipage/adoc/alpha/beta/make_widget.adoc b/test-files/golden-tests/output/multipage.multipage/adoc/alpha/beta/make_widget.adoc deleted file mode 100644 index ca25e2b8b6..0000000000 --- a/test-files/golden-tests/output/multipage.multipage/adoc/alpha/beta/make_widget.adoc +++ /dev/null @@ -1,23 +0,0 @@ -[#alpha-beta-make_widget] -= xref:alpha.adoc[alpha]::xref:alpha/beta.adoc[beta]::make_widget -:relfileprefix: ../../ -:mrdocs: - -Factory living under a nested namespace - -== Synopsis - -Declared in `<multipage.cpp>` - -[source,cpp,subs="verbatim,replacements,macros,-callouts"] ----- -xref:alpha/beta/Widget.adoc[Widget] -make_widget(); ----- - -== Return Value - -Widget with its own page - - -[.small]#Created with https://www.mrdocs.com[MrDocs]# diff --git a/test-files/golden-tests/output/multipage.multipage/adoc/alpha/use_widget.adoc b/test-files/golden-tests/output/multipage.multipage/adoc/alpha/use_widget.adoc deleted file mode 100644 index def4a9a356..0000000000 --- a/test-files/golden-tests/output/multipage.multipage/adoc/alpha/use_widget.adoc +++ /dev/null @@ -1,23 +0,0 @@ -[#alpha-use_widget] -= xref:alpha.adoc[alpha]::use_widget -:relfileprefix: ../ -:mrdocs: - -Uses a nested type to force cross‐page links and asset resolution. - -== Synopsis - -Declared in `<multipage.cpp>` - -[source,cpp,subs="verbatim,replacements,macros,-callouts"] ----- -xref:alpha/beta/Widget.adoc[beta::Widget] -use_widget(xref:alpha/beta/Widget.adoc[beta::Widget]); ----- - -== Return Value - -Widget with its own page - - -[.small]#Created with https://www.mrdocs.com[MrDocs]# diff --git a/test-files/golden-tests/output/multipage.multipage/adoc/index.adoc b/test-files/golden-tests/output/multipage.multipage/adoc/index.adoc deleted file mode 100644 index 766a2b5fa3..0000000000 --- a/test-files/golden-tests/output/multipage.multipage/adoc/index.adoc +++ /dev/null @@ -1,53 +0,0 @@ -[#index] -= Global namespace -:mrdocs: - -== Namespaces - -[cols=1] -|=== -| Name -| xref:alpha.adoc[`alpha`] -|=== - -== xref:alpha.adoc[alpha] namespace - -=== Namespaces - -[cols=1] -|=== -| Name -| xref:alpha/beta.adoc[`beta`] -|=== - -=== Functions - -[cols="1,4"] -|=== -| Name| Description -| xref:alpha/use_widget.adoc[`use_widget`] -| Uses a nested type to force cross‐page links and asset resolution. -|=== - -== xref:alpha/beta.adoc[alpha::beta] namespace - -=== Types - -[cols="1,4"] -|=== -| Name| Description -| xref:alpha/beta/Widget.adoc[`Widget`] -| Widget with its own page -|=== - -=== Functions - -[cols="1,4"] -|=== -| Name| Description -| xref:alpha/beta/make_widget.adoc[`make_widget`] -| Factory living under a nested namespace -|=== - - -[.small]#Created with https://www.mrdocs.com[MrDocs]# diff --git a/test-files/golden-tests/output/multipage.multipage/html/alpha.html b/test-files/golden-tests/output/multipage.multipage/html/alpha.html deleted file mode 100644 index 20216c2d55..0000000000 --- a/test-files/golden-tests/output/multipage.multipage/html/alpha.html +++ /dev/null @@ -1,43 +0,0 @@ - - -Reference: alpha - - - -
-

alpha

-

-Namespaces

-

- - - - - - - - - -
Name
beta
- -

-Functions

- - - - - - - - - - -
NameDescription
use_widget Uses a nested type to force cross-page links and asset resolution.
- - -
- - - \ No newline at end of file diff --git a/test-files/golden-tests/output/multipage.multipage/html/alpha/beta.html b/test-files/golden-tests/output/multipage.multipage/html/alpha/beta.html deleted file mode 100644 index 6fab247ecd..0000000000 --- a/test-files/golden-tests/output/multipage.multipage/html/alpha/beta.html +++ /dev/null @@ -1,43 +0,0 @@ - - -Reference: beta - - - -
-

alpha::beta

-

-Types

- - - - - - - - - - -
NameDescription
Widget Widget with its own page
- -

-Functions

- - - - - - - - - - -
NameDescription
make_widget Factory living under a nested namespace
- - -
- - - \ No newline at end of file diff --git a/test-files/golden-tests/output/multipage.multipage/html/alpha/beta/Widget.html b/test-files/golden-tests/output/multipage.multipage/html/alpha/beta/Widget.html deleted file mode 100644 index d2a6457c14..0000000000 --- a/test-files/golden-tests/output/multipage.multipage/html/alpha/beta/Widget.html +++ /dev/null @@ -1,43 +0,0 @@ - - -Reference: Widget - - - -
-

alpha::beta::Widget

-
-

Widget with its own page

-
-
-

-Synopsis

-
-Declared in <multipage.cpp>
-
struct Widget;
-
- - -
-

-Non-Member Functions

- - - - - - - - - - - -
NameDescription
make_widgetFactory living under a nested namespace
::alpha::use_widgetUses a nested type to force cross-page links and asset resolution.
-
- -
- - - \ No newline at end of file diff --git a/test-files/golden-tests/output/multipage.multipage/html/alpha/beta/make_widget.html b/test-files/golden-tests/output/multipage.multipage/html/alpha/beta/make_widget.html deleted file mode 100644 index 13996074d5..0000000000 --- a/test-files/golden-tests/output/multipage.multipage/html/alpha/beta/make_widget.html +++ /dev/null @@ -1,31 +0,0 @@ - - -Reference: make_widget - - - -
-

alpha::beta::make_widget

-
-

Factory living under a nested namespace

-
-
-

-Synopsis

-
-Declared in <multipage.cpp>
-
Widget
-make_widget();
-
-
-

-Return Value

-Widget with its own page -
- -
- - - \ No newline at end of file diff --git a/test-files/golden-tests/output/multipage.multipage/html/alpha/use_widget.html b/test-files/golden-tests/output/multipage.multipage/html/alpha/use_widget.html deleted file mode 100644 index cda5e5bcd3..0000000000 --- a/test-files/golden-tests/output/multipage.multipage/html/alpha/use_widget.html +++ /dev/null @@ -1,31 +0,0 @@ - - -Reference: use_widget - - - -
-

alpha::use_widget

-
-

Uses a nested type to force cross-page links and asset resolution.

-
-
-

-Synopsis

-
-Declared in <multipage.cpp>
-
beta::Widget
-use_widget(beta::Widget);
-
-
-

-Return Value

-Widget with its own page -
- -
- - - \ No newline at end of file diff --git a/test-files/golden-tests/output/multipage.multipage/html/index.html b/test-files/golden-tests/output/multipage.multipage/html/index.html deleted file mode 100644 index b6a2c7ad97..0000000000 --- a/test-files/golden-tests/output/multipage.multipage/html/index.html +++ /dev/null @@ -1,89 +0,0 @@ - - -Reference - - - -
-

Global namespace

-

-Namespaces

- - - - - - - - - - -
Name
alpha
- -

-alpha namespace

-

-Namespaces

- - - - - - - - - - -
Name
beta
- -

-Functions

- - - - - - - - - - -
NameDescription
use_widget Uses a nested type to force cross-page links and asset resolution.
- -

-alpha::beta namespace

-

-Types

- - - - - - - - - - -
NameDescription
Widget Widget with its own page
- -

-Functions

- - - - - - - - - - -
NameDescription
make_widget Factory living under a nested namespace
- - -
- - - \ No newline at end of file diff --git a/test-files/golden-tests/output/multipage.multipage/xml/reference.xml b/test-files/golden-tests/output/multipage.multipage/xml/reference.xml deleted file mode 100644 index 65b6a32f5a..0000000000 --- a/test-files/golden-tests/output/multipage.multipage/xml/reference.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - Widget with its own page - - - make_widget - ::alpha::use_widget - - - - - - - - - - - Factory living under a nested namespace - - - Widget with its own page - - - Widget - - - - - - - - - - - - - - - Uses a nested type to force cross-page links and asset resolution. - - - Widget with its own page - - - Widget - - - - - - diff --git a/test-files/golden-tests/output/multipage.yml b/test-files/golden-tests/output/multipage.yml deleted file mode 100644 index 51c4dcb0f9..0000000000 --- a/test-files/golden-tests/output/multipage.yml +++ /dev/null @@ -1 +0,0 @@ -multipage: true diff --git a/test-files/golden-tests/symbols/using/using-alias-template-dependent.adoc b/test-files/golden-tests/regression/1057.adoc similarity index 77% rename from test-files/golden-tests/symbols/using/using-alias-template-dependent.adoc rename to test-files/golden-tests/regression/1057.adoc index 0c6c6c692b..6aa15593b2 100644 --- a/test-files/golden-tests/symbols/using/using-alias-template-dependent.adoc +++ b/test-files/golden-tests/regression/1057.adoc @@ -21,7 +21,7 @@ === Synopsis -Declared in `<using‐alias‐template‐dependent.cpp>` +Declared in `<1057.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- @@ -36,7 +36,7 @@ using _UniqAssignable = int; === Synopsis -Declared in `<using‐alias‐template‐dependent.cpp>` +Declared in `<1057.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- @@ -52,7 +52,7 @@ using _UniqCompatible = _Res; === Synopsis -Declared in `<using‐alias‐template‐dependent.cpp>` +Declared in `<1057.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- @@ -75,7 +75,7 @@ struct enable_if; === Synopsis -Declared in `<using‐alias‐template‐dependent.cpp>` +Declared in `<1057.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- @@ -87,7 +87,7 @@ using type = T; === Synopsis -Declared in `<using‐alias‐template‐dependent.cpp>` +Declared in `<1057.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- @@ -100,7 +100,7 @@ struct link:#enable_if-03[enable_if]<false, T>; === Synopsis -Declared in `<using‐alias‐template‐dependent.cpp>` +Declared in `<1057.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- @@ -121,7 +121,7 @@ struct is_match; === Synopsis -Declared in `<using‐alias‐template‐dependent.cpp>` +Declared in `<1057.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- diff --git a/test-files/golden-tests/symbols/using/using-alias-template-dependent.cpp b/test-files/golden-tests/regression/1057.cpp similarity index 73% rename from test-files/golden-tests/symbols/using/using-alias-template-dependent.cpp rename to test-files/golden-tests/regression/1057.cpp index 9dd1727c77..3953f87c56 100644 --- a/test-files/golden-tests/symbols/using/using-alias-template-dependent.cpp +++ b/test-files/golden-tests/regression/1057.cpp @@ -1,7 +1,4 @@ -// Regression test for issue #1057 (see PR #1076): -// ensure alias templates with dependent enable_if patterns -// (std::unique_ptr-like) are documented correctly. template struct enable_if { using type = T; diff --git a/test-files/golden-tests/regression/1057.html b/test-files/golden-tests/regression/1057.html new file mode 100644 index 0000000000..58aafa11af --- /dev/null +++ b/test-files/golden-tests/regression/1057.html @@ -0,0 +1,184 @@ + + +Reference + + +
+

Reference

+
+
+

+
+

Types

+ + + + + + + + + + + + + + +
Name
enable_if
enable_if<false, T>
is_match
_UniqAssignable
_UniqCompatible
+ +
+
+
+

_UniqAssignable

+
+
+

Synopsis

+
+Declared in <1057.cpp>
+
+template<
+    typename _Yp,
+    typename _Del>
+using _UniqAssignable = int;
+
+
+
+
+
+

_UniqCompatible

+
+
+

Synopsis

+
+Declared in <1057.cpp>
+
+template<
+    typename _Yp,
+    typename _Del,
+    typename _Res>
+using _UniqCompatible = _Res;
+
+
+
+
+
+

enable_if

+
+
+

Synopsis

+
+Declared in <1057.cpp>
+
+template<
+    bool C,
+    typename T>
+struct enable_if;
+
+
+

Types

+ + + + + + + + + + +
Name
type
+ + + +
+
+
+

enable_if::type

+
+
+

Synopsis

+
+Declared in <1057.cpp>
+
+using type = T;
+
+
+
+
+
+

enable_if<false, T>

+
+
+

Synopsis

+
+Declared in <1057.cpp>
+
+template<typename T>
+struct enable_if<false, T>;
+
+
+ + +
+
+
+

is_match

+
+
+

Synopsis

+
+Declared in <1057.cpp>
+
+template<typename T>
+struct is_match;
+
+
+

Enums

+ + + + + + + + + + +
Name
Unnamed enum
+ + + +
+
+
+

is_match::

+
+
+

Synopsis

+
+Declared in <1057.cpp>
+
+enum Unnamed enum;
+
+
+

Members

+ + + + + + + + + + +
Name
value
+ +
+ +
+
+

Created with MrDocs

+
+ + \ No newline at end of file diff --git a/test-files/golden-tests/symbols/using/using-alias-template-dependent.xml b/test-files/golden-tests/regression/1057.xml similarity index 62% rename from test-files/golden-tests/symbols/using/using-alias-template-dependent.xml rename to test-files/golden-tests/regression/1057.xml index 1e880dd173..1be4e5cddc 100644 --- a/test-files/golden-tests/symbols/using/using-alias-template-dependent.xml +++ b/test-files/golden-tests/regression/1057.xml @@ -6,7 +6,7 @@ - + @@ -15,7 +15,7 @@ - + @@ -23,9 +23,9 @@ - + - + @@ -35,17 +35,17 @@ - +