diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 22ba029c4..8703116fb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,7 +59,7 @@ jobs: contents: write steps: - - name: Clone MrDox + - name: Clone MrDocs uses: actions/checkout@v3 - name: Install LLVM @@ -84,7 +84,7 @@ jobs: fi llvm_commit_id=29b20829 llvm_archive_filename="$llvm_runner_os-$llvm_config_type-$llvm_commit_id.$llvm_archive_type" - llvm_url="https://github.com/cppalliance/mrdox/releases/download/llvm-package-release/$llvm_archive_filename" + llvm_url="https://github.com/cppalliance/mrdocs/releases/download/llvm-package-release/$llvm_archive_filename" if ! curl --head --silent --fail "$llvm_url"; then llvm_url="https://mrdox.com/llvm+clang/$llvm_archive_filename" @@ -220,7 +220,7 @@ jobs: contents: write steps: - - name: Clone mrdox + - name: Clone mrdocs uses: actions/checkout@v3 - name: Install Node.js @@ -232,8 +232,8 @@ jobs: working-directory: docs run: | npm install - master_antora_exists=$(curl --silent --fail --head https://github.com/cppalliance/mrdox/blob/master/docs/antora.yml >/dev/null && echo "true" || echo "false") - develop_antora_exists=$(curl --silent --fail --head https://github.com/cppalliance/mrdox/blob/develop/docs/antora.yml >/dev/null && echo "true" || echo "false") + master_antora_exists=$(curl --silent --fail --head https://github.com/cppalliance/mrdocs/blob/master/docs/antora.yml >/dev/null && echo "true" || echo "false") + develop_antora_exists=$(curl --silent --fail --head https://github.com/cppalliance/mrdocs/blob/develop/docs/antora.yml >/dev/null && echo "true" || echo "false") if [ "$master_antora_exists" == "true" ] && [ "$develop_antora_exists" == "true" ]; then # Antora is set up in both master and develop: render complete playbook npx antora antora-playbook.yml @@ -281,7 +281,7 @@ jobs: contents: write steps: - - name: Clone mrdox + - name: Clone mrdocs uses: actions/checkout@v3 - uses: actions/download-artifact@v3 @@ -309,11 +309,11 @@ jobs: cc: ${{ steps.setup-cpp.outputs.cc }} cxx: ${{ steps.setup-cpp.outputs.cxx }} - - name: Install mrdox from release package + - name: Install mrdocs from release package run: | set -x - sudo find packages -name 'MrDox-*-Linux.tar.gz' -exec tar -xzf {} -C /usr/local --strip-components=1 \; - mrdox --version + sudo find packages -name 'MrDocs-*-Linux.tar.gz' -exec tar -xzf {} -C /usr/local --strip-components=1 \; + mrdocs --version - name: Clone Boost.URL uses: alandefreitas/cpp-actions/boost-clone@v1.5.0 @@ -351,31 +351,31 @@ jobs: - name: Generate demos run: | - echo "verbose: true" > $(pwd)/boost/libs/url/mrdox-single.yml - echo "source-root: ." >> $(pwd)/boost/libs/url/mrdox-single.yml - echo "multipage: false" >> $(pwd)/boost/libs/url/mrdox-single.yml - echo "inaccessible-members: never" >> $(pwd)/boost/libs/url/mrdox-single.yml - echo "filters:" >> $(pwd)/boost/libs/url/mrdox-single.yml - echo " symbols:" >> $(pwd)/boost/libs/url/mrdox-single.yml - echo " exclude:" >> $(pwd)/boost/libs/url/mrdox-single.yml - echo " - 'boost::urls::detail'" >> $(pwd)/boost/libs/url/mrdox-single.yml - echo " - 'boost::urls::*::detail'" >> $(pwd)/boost/libs/url/mrdox-single.yml + echo "verbose: true" > $(pwd)/boost/libs/url/mrdocs-single.yml + echo "source-root: ." >> $(pwd)/boost/libs/url/mrdocs-single.yml + echo "multipage: false" >> $(pwd)/boost/libs/url/mrdocs-single.yml + echo "inaccessible-members: never" >> $(pwd)/boost/libs/url/mrdocs-single.yml + echo "filters:" >> $(pwd)/boost/libs/url/mrdocs-single.yml + echo " symbols:" >> $(pwd)/boost/libs/url/mrdocs-single.yml + echo " exclude:" >> $(pwd)/boost/libs/url/mrdocs-single.yml + echo " - 'boost::urls::detail'" >> $(pwd)/boost/libs/url/mrdocs-single.yml + echo " - 'boost::urls::*::detail'" >> $(pwd)/boost/libs/url/mrdocs-single.yml - echo "verbose: true" > $(pwd)/boost/libs/url/mrdox-multi.yml - echo "source-root: ." >> $(pwd)/boost/libs/url/mrdox-multi.yml - echo "multipage: true" >> $(pwd)/boost/libs/url/mrdox-multi.yml - echo "inaccessible-members: never" >> $(pwd)/boost/libs/url/mrdox-multi.yml - echo "filters:" >> $(pwd)/boost/libs/url/mrdox-multi.yml - echo " symbols:" >> $(pwd)/boost/libs/url/mrdox-multi.yml - echo " exclude:" >> $(pwd)/boost/libs/url/mrdox-multi.yml - echo " - 'boost::urls::detail'" >> $(pwd)/boost/libs/url/mrdox-multi.yml - echo " - 'boost::urls::*::detail'" >> $(pwd)/boost/libs/url/mrdox-multi.yml + echo "verbose: true" > $(pwd)/boost/libs/url/mrdocs-multi.yml + echo "source-root: ." >> $(pwd)/boost/libs/url/mrdocs-multi.yml + echo "multipage: true" >> $(pwd)/boost/libs/url/mrdocs-multi.yml + echo "inaccessible-members: never" >> $(pwd)/boost/libs/url/mrdocs-multi.yml + echo "filters:" >> $(pwd)/boost/libs/url/mrdocs-multi.yml + echo " symbols:" >> $(pwd)/boost/libs/url/mrdocs-multi.yml + echo " exclude:" >> $(pwd)/boost/libs/url/mrdocs-multi.yml + echo " - 'boost::urls::detail'" >> $(pwd)/boost/libs/url/mrdocs-multi.yml + echo " - 'boost::urls::*::detail'" >> $(pwd)/boost/libs/url/mrdocs-multi.yml set -x for variant in single multi; do for format in adoc html xml; do mkdir -p "demos/boost-url/$variant/$format" - mrdox --config="$(pwd)/boost/libs/url/mrdox-$variant.yml" "$(pwd)/boost/libs/url/__build__/compile_commands.json" --addons="$(pwd)/share/mrdox/addons" --format="$format" --output="$(pwd)/demos/boost-url/$variant/$format" + mrdocs --config="$(pwd)/boost/libs/url/mrdocs-$variant.yml" "$(pwd)/boost/libs/url/__build__/compile_commands.json" --addons="$(pwd)/share/mrdocs/addons" --format="$format" --output="$(pwd)/demos/boost-url/$variant/$format" done asciidoctor -R "$(pwd)/demos/boost-url/$variant/adoc" -D "$(pwd)/demos/boost-url/$variant/adoc-asciidoc" "$(pwd)/demos/boost-url/$variant/adoc/**/*.adoc" done @@ -421,7 +421,7 @@ jobs: contents: write steps: - - name: Clone mrdox + - name: Clone mrdocs uses: actions/checkout@v3 - uses: actions/download-artifact@v3 @@ -458,7 +458,7 @@ jobs: if: ${{ github.event_name == 'push' && (contains(fromJSON('["master", "develop"]'), github.ref_name) || startsWith(github.ref, 'refs/tags/')) }} uses: softprops/action-gh-release@v1 with: - files: build/MrDox-?.?.?-*.* + files: build/MrDocs-?.?.?-*.* name: ${{ github.ref_name || github.ref }} tag_name: ${{ github.ref_name || github.ref }}${{ ((!startsWith(github.ref, 'refs/tags/')) && '-release') || '' }} body_path: CHANGELOG.md diff --git a/CMakeLists.txt b/CMakeLists.txt index e336fa33a..143f2ed96 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ # Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) # Copyright (c) 2023 Alan de Freitas (alandefreitas@gmail.com) # -# Official repository: https://github.com/cppalliance/mrdox +# Official repository: https://github.com/cppalliance/mrdocs # #------------------------------------------------- @@ -23,38 +23,38 @@ elseif(NOT GENERATOR_IS_MULTI_CONFIG AND NOT CMAKE_BUILD_TYPE) endif() cmake_policy(SET CMP0111 OLD) project( - MrDox + MrDocs VERSION 1.0.0 DESCRIPTION "C++ Documentation Tool" - HOMEPAGE_URL "https://github.com/cppalliance/mrdox" + HOMEPAGE_URL "https://github.com/cppalliance/mrdocs" LANGUAGES CXX C ) include(CMakePackageConfigHelpers) include(GNUInstallDirs) -option(MRDOX_INSTALL "Configure install target" ON) -option(MRDOX_PACKAGE "Build install package" ON) -option(MRDOX_BUILD_SHARED "Link shared" ${BUILD_SHARED_LIBS}) -option(MRDOX_BUILD_TESTS "Build tests" ${BUILD_TESTING}) -if (MRDOX_BUILD_TESTS OR MRDOX_INSTALL) - option(MRDOX_BUILD_DOCS "Build documentation" ON) +option(MRDOCS_INSTALL "Configure install target" ON) +option(MRDOCS_PACKAGE "Build install package" ON) +option(MRDOCS_BUILD_SHARED "Link shared" ${BUILD_SHARED_LIBS}) +option(MRDOCS_BUILD_TESTS "Build tests" ${BUILD_TESTING}) +if (MRDOCS_BUILD_TESTS OR MRDOCS_INSTALL) + option(MRDOCS_BUILD_DOCS "Build documentation" ON) else() - option(MRDOX_BUILD_DOCS "Build documentation" OFF) + option(MRDOCS_BUILD_DOCS "Build documentation" OFF) endif() -option(MRDOX_GENERATE_REFERENCE "Generate MrDox reference" ${MRDOX_BUILD_DOCS}) -option(MRDOX_GENERATE_ANTORA_REFERENCE "Generate MrDox reference in Antora module pages" OFF) +option(MRDOCS_GENERATE_REFERENCE "Generate MrDocs reference" ${MRDOCS_BUILD_DOCS}) +option(MRDOCS_GENERATE_ANTORA_REFERENCE "Generate MrDocs reference in Antora module pages" OFF) -if (MRDOX_BUILD_SHARED) - set(MRDOX_LINK_MODE SHARED) - set(MRDOX_LINK_MODE_DEFINITION -DMRDOX_SHARED_LINK) +if (MRDOCS_BUILD_SHARED) + set(MRDOCS_LINK_MODE SHARED) + set(MRDOCS_LINK_MODE_DEFINITION -DMRDOCS_SHARED_LINK) else() - set(MRDOX_LINK_MODE_DEFINITION -DMRDOX_STATIC_LINK) + set(MRDOCS_LINK_MODE_DEFINITION -DMRDOCS_STATIC_LINK) endif() if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - set(MRDOX_GCC ON) + set(MRDOCS_GCC ON) elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang$") - set(MRDOX_CLANG ON) + set(MRDOCS_CLANG ON) endif() #------------------------------------------------- @@ -136,7 +136,7 @@ unset(CMAKE_FOLDER) #------------------------------------------------- # -# mrdox-core +# mrdocs-core # #------------------------------------------------- @@ -147,9 +147,9 @@ file( include/*.hpp include/*.ipp include/*.natvis SourceFileNames.cpp) -add_library(mrdox-core ${LIB_SOURCES}) -target_compile_features(mrdox-core PUBLIC cxx_std_20) -target_include_directories(mrdox-core +add_library(mrdocs-core ${LIB_SOURCES}) +target_compile_features(mrdocs-core PUBLIC cxx_std_20) +target_include_directories(mrdocs-core PUBLIC "$" "$" @@ -157,23 +157,23 @@ target_include_directories(mrdox-core "${PROJECT_SOURCE_DIR}/src" "${PROJECT_SOURCE_DIR}/include") target_compile_definitions( - mrdox-core + mrdocs-core PUBLIC - ${MRDOX_LINK_MODE_DEFINITION} + ${MRDOCS_LINK_MODE_DEFINITION} PRIVATE - -DMRDOX_TOOL + -DMRDOCS_TOOL ) # Deps -target_include_directories(mrdox-core SYSTEM PUBLIC ${LLVM_INCLUDE_DIRS}) -target_include_directories(mrdox-core SYSTEM PUBLIC ${CLANG_INCLUDE_DIRS}) -target_link_libraries(mrdox-core PUBLIC fmt::fmt duktape::duktape) +target_include_directories(mrdocs-core SYSTEM PUBLIC ${LLVM_INCLUDE_DIRS}) +target_include_directories(mrdocs-core SYSTEM PUBLIC ${CLANG_INCLUDE_DIRS}) +target_link_libraries(mrdocs-core PUBLIC fmt::fmt duktape::duktape) # Clang if (CLANG_SIMPLE_LIBS) - target_link_libraries(mrdox-core PUBLIC LLVM clang clang-cpp) + target_link_libraries(mrdocs-core PUBLIC LLVM clang clang-cpp) else() - target_link_libraries(mrdox-core + target_link_libraries(mrdocs-core PUBLIC clangAST clangBasic @@ -187,7 +187,7 @@ endif() # Windows, Win64 if (WIN32) target_compile_definitions( - mrdox-core + mrdocs-core PUBLIC -D_WIN32_WINNT=0x0601 -D_CRT_SECURE_NO_WARNINGS @@ -197,15 +197,15 @@ if (WIN32) if(MSVC) get_target_property(LLVM_CONFIGURATION_TYPE LLVMCore IMPORTED_CONFIGURATIONS) if (LLVM_CONFIGURATION_TYPE STREQUAL RELWITHDEBINFO) - # Handle Debug/RelWithDebInfo mismatch between mrdox and LLVM - target_compile_definitions(mrdox-core PUBLIC $<$:-D_ITERATOR_DEBUG_LEVEL=0>) - target_compile_options(mrdox-core PUBLIC $<$:/MD>) + # Handle Debug/RelWithDebInfo mismatch between mrdocs and LLVM + target_compile_definitions(mrdocs-core PUBLIC $<$:-D_ITERATOR_DEBUG_LEVEL=0>) + target_compile_options(mrdocs-core PUBLIC $<$:/MD>) endif() if("${CMAKE_GENERATOR_PLATFORM}" STREQUAL "Win64") # 64-bit - target_compile_options(mrdox-core PUBLIC /arch:AMD64) + target_compile_options(mrdocs-core PUBLIC /arch:AMD64) endif() target_compile_options( - mrdox-core + mrdocs-core PUBLIC /permissive- # strict C++ /W4 # enable all warnings @@ -215,9 +215,9 @@ if (WIN32) endif() endif () -if (MRDOX_CLANG) +if (MRDOCS_CLANG) target_compile_options( - mrdox-core + mrdocs-core PUBLIC -Wno-unused-private-field -Wno-unused-value @@ -233,10 +233,10 @@ endif () #------------------------------------------------- file(GLOB_RECURSE TOOL_SOURCES CONFIGURE_DEPENDS src/tool/*.cpp src/tool/*.hpp) -add_executable(mrdox ${TOOL_SOURCES}) -target_compile_definitions(mrdox PRIVATE -DMRDOX_TOOL) +add_executable(mrdocs ${TOOL_SOURCES}) +target_compile_definitions(mrdocs PRIVATE -DMRDOCS_TOOL) -target_include_directories(mrdox +target_include_directories(mrdocs PUBLIC "$" "$" @@ -245,18 +245,18 @@ target_include_directories(mrdox "${PROJECT_SOURCE_DIR}/src" ) -target_compile_definitions(mrdox PRIVATE -DMRDOX_TOOL) -target_link_libraries(mrdox PUBLIC mrdox-core) -if (MRDOX_CLANG) +target_compile_definitions(mrdocs PRIVATE -DMRDOCS_TOOL) +target_link_libraries(mrdocs PUBLIC mrdocs-core) +if (MRDOCS_CLANG) target_compile_options( - mrdox + mrdocs PRIVATE -Wno-covered-switch-default ) endif () set_property(GLOBAL PROPERTY USE_FOLDERS ON) -source_group(TREE ${PROJECT_SOURCE_DIR}/include/mrdox PREFIX "include" FILES ${INCLUDES}) +source_group(TREE ${PROJECT_SOURCE_DIR}/include/mrdocs PREFIX "include" FILES ${INCLUDES}) source_group(TREE ${PROJECT_SOURCE_DIR}/source PREFIX "source" FILES ${SOURCES}) #------------------------------------------------- @@ -265,35 +265,35 @@ source_group(TREE ${PROJECT_SOURCE_DIR}/source PREFIX "source" FILES ${SOURCES}) # #------------------------------------------------- -if (MRDOX_BUILD_TESTS) +if (MRDOCS_BUILD_TESTS) #------------------------------------------------- # Unit tests #------------------------------------------------- include(CTest) file(GLOB_RECURSE TEST_SUITE_FILES CONFIGURE_DEPENDS src/test_suite/*.cpp src/test_suite/*.hpp) file(GLOB_RECURSE UNIT_TEST_SOURCES CONFIGURE_DEPENDS src/test/*.cpp src/test/*.hpp) - add_executable(mrdox-test ${TEST_SUITE_FILES} ${UNIT_TEST_SOURCES}) - target_include_directories(mrdox-test + add_executable(mrdocs-test ${TEST_SUITE_FILES} ${UNIT_TEST_SOURCES}) + target_include_directories(mrdocs-test PRIVATE "${PROJECT_SOURCE_DIR}/include" "${PROJECT_SOURCE_DIR}/src" ) - target_link_libraries(mrdox-test PUBLIC mrdox-core) - if (MRDOX_CLANG) - target_compile_options(mrdox-test PRIVATE -Wno-covered-switch-default) + target_link_libraries(mrdocs-test PUBLIC mrdocs-core) + if (MRDOCS_CLANG) + target_compile_options(mrdocs-test PRIVATE -Wno-covered-switch-default) endif () - target_compile_definitions(mrdox-test PRIVATE -DMRDOX_TEST_FILES_DIR="${CMAKE_CURRENT_SOURCE_DIR}/test-files") + target_compile_definitions(mrdocs-test PRIVATE -DMRDOCS_TEST_FILES_DIR="${CMAKE_CURRENT_SOURCE_DIR}/test-files") add_custom_command( # if we run tests, we need the addons in the right place. - TARGET mrdox-test + TARGET mrdocs-test POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy - ${CMAKE_SOURCE_DIR}/share/mrdox/addons + ${CMAKE_SOURCE_DIR}/share/mrdocs/addons ${CMAKE_BINARY_DIR}/addons BYPRODUCTS ${CMAKE_BINARY_DIR}/addons - DEPENDS ${CMAKE_SOURCE_DIR}/share/mrdox/addons + DEPENDS ${CMAKE_SOURCE_DIR}/share/mrdocs/addons ) - add_test(NAME mrdox-test COMMAND mrdox-test --action test "${PROJECT_SOURCE_DIR}/test-files/old-tests") + add_test(NAME mrdocs-test COMMAND mrdocs-test --action test "${PROJECT_SOURCE_DIR}/test-files/old-tests") #------------------------------------------------- # XML lint @@ -308,15 +308,15 @@ if (MRDOX_BUILD_TESTS) add_custom_command( COMMAND ${Java_JAVA_EXECUTABLE} -jar ${CMAKE_CURRENT_SOURCE_DIR}/util/trang.jar - ${CMAKE_CURRENT_SOURCE_DIR}/mrdox.rnc ${CMAKE_CURRENT_BINARY_DIR}/mrdox.rng - OUTPUT mrdox.rng - DEPENDS mrdox.rnc) - add_custom_target(mrdox_rng ALL DEPENDS mrdox.rng) + ${CMAKE_CURRENT_SOURCE_DIR}/mrdocs.rnc ${CMAKE_CURRENT_BINARY_DIR}/mrdocs.rng + OUTPUT mrdocs.rng + DEPENDS mrdocs.rnc) + add_custom_target(mrdocs_rng ALL DEPENDS mrdocs.rng) file(GLOB_RECURSE XML_SOURCES CONFIGURE_DEPENDS test-files/*.xml) add_test(NAME xml-lint COMMAND ${LIBXML2_XMLLINT_EXECUTABLE} --dropdtd --noout - --relaxng ${CMAKE_CURRENT_BINARY_DIR}/mrdox.rng ${XML_SOURCES} + --relaxng ${CMAKE_CURRENT_BINARY_DIR}/mrdocs.rng ${XML_SOURCES} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) endif() endif() @@ -327,27 +327,27 @@ endif() # #------------------------------------------------- -if (MRDOX_BUILD_DOCS) +if (MRDOCS_BUILD_DOCS) #------------------------------------------------- # Reference #------------------------------------------------- - if (MRDOX_GENERATE_REFERENCE) - include(share/cmake/MrDox.cmake) - set(MRDOX_REFERENCE_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/docs/reference) + if (MRDOCS_GENERATE_REFERENCE) + include(share/cmake/MrDocs.cmake) + set(MRDOCS_REFERENCE_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/docs/reference) file(GLOB_RECURSE REFERENCE_SOURCES CONFIGURE_DEPENDS include/*.hpp) set(CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES}) - add_mrdox(generate_reference - CONFIG docs/mrdox.yml + add_mrdocs(generate_reference + CONFIG docs/mrdocs.yml FORMAT adoc - COMMENT "Generate MrDox reference" - OUTPUT ${MRDOX_REFERENCE_OUTPUT_DIR} + COMMENT "Generate MrDocs reference" + OUTPUT ${MRDOCS_REFERENCE_OUTPUT_DIR} ${REFERENCE_SOURCES}) - if (MRDOX_GENERATE_ANTORA_REFERENCE) - set(MRDOX_ANTORA_REFERENCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/docs/modules/ROOT/pages/reference) + if (MRDOCS_GENERATE_ANTORA_REFERENCE) + set(MRDOCS_ANTORA_REFERENCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/docs/modules/ROOT/pages/reference) add_custom_target(generate_antora_reference - COMMAND ${CMAKE_COMMAND} -E copy_directory ${MRDOX_REFERENCE_OUTPUT_DIR} ${MRDOX_ANTORA_REFERENCE_DIR} + COMMAND ${CMAKE_COMMAND} -E copy_directory ${MRDOCS_REFERENCE_OUTPUT_DIR} ${MRDOCS_ANTORA_REFERENCE_DIR} DEPENDS generate_reference - COMMENT "Copy MrDox reference to Antora") + COMMENT "Copy MrDocs reference to Antora") endif() endif() @@ -363,7 +363,7 @@ if (MRDOX_BUILD_DOCS) set(DOCS_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/docs) set(DOCS_BUILD_DIR ${DOCS_SOURCE_DIR}/build/site) - set(DOCS_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/doc/mrdox/html) + set(DOCS_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/doc/mrdocs/html) # Add custom target for generating documentation add_custom_target(generate_docs @@ -373,10 +373,10 @@ if (MRDOX_BUILD_DOCS) COMMAND ${CMAKE_COMMAND} -E echo "Run Antora" COMMAND ${NPX_EXECUTABLE} antora local-antora-playbook.yml WORKING_DIRECTORY ${DOCS_SOURCE_DIR} - COMMENT "Generating MrDox documentation" + COMMENT "Generating MrDocs documentation" USES_TERMINAL ) - if (MRDOX_GENERATE_REFERENCE AND MRDOX_GENERATE_ANTORA_REFERENCE) + if (MRDOCS_GENERATE_REFERENCE AND MRDOCS_GENERATE_ANTORA_REFERENCE) add_dependencies(generate_docs generate_antora_reference) endif() elseif (NOT NPM_EXECUTABLE AND NPX_EXECUTABLE) @@ -394,37 +394,37 @@ endif () # #------------------------------------------------- -if (MRDOX_INSTALL) +if (MRDOCS_INSTALL) #------------------------------------------------- # bin #------------------------------------------------- - install(TARGETS mrdox - EXPORT mrdox-targets + install(TARGETS mrdocs + EXPORT mrdocs-targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) - set(MRDOX_EXECUTABLE $) + set(MRDOCS_EXECUTABLE $) #------------------------------------------------- # lib #------------------------------------------------- - install(TARGETS mrdox-core duktape - EXPORT mrdox-targets + install(TARGETS mrdocs-core duktape + EXPORT mrdocs-targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT development ) - install(EXPORT mrdox-targets - FILE mrdox-targets.cmake - NAMESPACE mrdox:: - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/mrdox) + install(EXPORT mrdocs-targets + FILE mrdocs-targets.cmake + NAMESPACE mrdocs:: + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/mrdocs) #------------------------------------------------- # include #------------------------------------------------- - install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/mrdox + install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/mrdocs DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT development FILES_MATCHING @@ -452,7 +452,7 @@ if (MRDOX_INSTALL) #------------------------------------------------- # doc #------------------------------------------------- - if (MRDOX_BUILD_DOCS AND NPM_EXECUTABLE AND NPX_EXECUTABLE) + if (MRDOCS_BUILD_DOCS AND NPM_EXECUTABLE AND NPX_EXECUTABLE) if (EXISTS ${DOCS_BUILD_DIR}) install(DIRECTORY ${DOCS_BUILD_DIR} DESTINATION ${CMAKE_INSTALL_DOCDIR} @@ -464,31 +464,31 @@ if (MRDOX_INSTALL) #------------------------------------------------- # lib/cmake #------------------------------------------------- - set(CONFIG_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/mrdox) + set(CONFIG_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/mrdocs) - # mrdox-config-version.cmake + # mrdocs-config-version.cmake if (CMAKE_PROJECT_VERSION VERSION_LESS 1.0.0) set(compatibility_mode SameMajorVersion) else () set(compatibility_mode SameMinorVersion) endif () write_basic_package_version_file( - mrdox-config-version.cmake + mrdocs-config-version.cmake VERSION ${PACKAGE_VERSION} COMPATIBILITY ${compatibility_mode}) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/mrdox-config-version.cmake - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/mrdox) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/mrdocs-config-version.cmake + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/mrdocs) - # mrdox-config.cmake + # mrdocs-config.cmake set(INCLUDE_INSTALL_DIR include/) set(LIB_INSTALL_DIR lib/) configure_package_config_file( - ${CMAKE_CURRENT_SOURCE_DIR}/mrdox-config.cmake.in # input file - ${CMAKE_CURRENT_BINARY_DIR}/mrdox-config.cmake # output file - INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/mrdox + ${CMAKE_CURRENT_SOURCE_DIR}/mrdocs-config.cmake.in # input file + ${CMAKE_CURRENT_BINARY_DIR}/mrdocs-config.cmake # output file + INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/mrdocs PATH_VARS CMAKE_INSTALL_LIBDIR INCLUDE_INSTALL_DIR LIB_INSTALL_DIR) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/mrdox-config.cmake - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/mrdox) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/mrdocs-config.cmake + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/mrdocs) endif () #------------------------------------------------- @@ -496,9 +496,9 @@ endif () # Packages # #------------------------------------------------- -if (MRDOX_INSTALL AND MRDOX_PACKAGE) +if (MRDOCS_INSTALL AND MRDOCS_PACKAGE) # Project description - set(CPACK_PACKAGE_VENDOR "mrdox") + set(CPACK_PACKAGE_VENDOR "mrdocs") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY ${PROJECT_DESCRIPTION}) set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) diff --git a/CMakePresets.json b/CMakePresets.json index 9189282a7..97ca400f0 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -19,7 +19,7 @@ "LLVM_ROOT": "$env{LLVM_ROOT}", "Clang_ROOT": "$env{LLVM_ROOT}", "DUKTAPE_SOURCE_ROOT": "$env{DUKTAPE_SOURCE_ROOT}", - "MRDOX_BUILD_TESTS": "ON" + "MRDOCS_BUILD_TESTS": "ON" }, "vendor": { "microsoft.com/VisualStudioSettings/CMake/1.0": { @@ -55,7 +55,7 @@ "description": "Release Config without Tests.", "binaryDir": "${sourceDir}/build/dist", "cacheVariables": { - "MRDOX_BUILD_TESTS": "OFF" + "MRDOCS_BUILD_TESTS": "OFF" } } ] diff --git a/README.adoc b/README.adoc index a7d0a3511..035adcd7a 100644 --- a/README.adoc +++ b/README.adoc @@ -16,12 +16,12 @@ cmake --build . -j --config Release cmake --install . ---- -Once LLVM is available in `/path/to/llvm+clang`, you can build and install mrdox with: +Once LLVM is available in `/path/to/llvm+clang`, you can build and install mrdocs with: [source,bash] ---- -git clone https://github.com/cppalliance/mrdox -cd mrdox +git clone https://github.com/cppalliance/mrdocs +cd mrdocs cmake -S . -B build -D CMAKE_BUILD_TYPE=Release -D LLVM_ROOT=/path/to/llvm+clang -D Clang_ROOT=/path/to/llvm+clang cd build cmake --build . -j @@ -37,11 +37,11 @@ cmake --install . * old program with lots of technical debt * not written by me -=== MrDox: +=== MrDocs: * narrow and deep focus on {cpp} only * uses clang's unstable libtooling API: -** Understands ALL C++: if clang can compile it, MrDox knows about it +** Understands ALL C++: if clang can compile it, MrDocs knows about it ** This includes up to {cpp}20 and even experimental things in {cpp}23 * brand-new program with no technical debt * written by me diff --git a/SourceFileNames.cpp b/SourceFileNames.cpp index 2aa80cd87..b86205251 100644 --- a/SourceFileNames.cpp +++ b/SourceFileNames.cpp @@ -5,7 +5,7 @@ // // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // /* diff --git a/docs/.asciidoctorconfig b/docs/.asciidoctorconfig index 6b1dd4d44..d7697ee5a 100644 --- a/docs/.asciidoctorconfig +++ b/docs/.asciidoctorconfig @@ -1,3 +1,3 @@ :linkcss: -:stylesdir: https://cppalliance.org/mrdox/_/css +:stylesdir: https://cppalliance.org/mrdocs/_/css :stylesheet: site.css diff --git a/docs/antora-playbook.yml b/docs/antora-playbook.yml index 6636e20ca..2b4dc450a 100644 --- a/docs/antora-playbook.yml +++ b/docs/antora-playbook.yml @@ -1,7 +1,7 @@ # npm install # npx antora --fetch antora-playbook.yml site: - title: MrDox + title: MrDocs url: https://cppalliance.github.io/mrdox/ start_page: mrdox::index.adoc robots: allow diff --git a/docs/antora.yml b/docs/antora.yml index c49a5bd12..d25c2478e 100644 --- a/docs/antora.yml +++ b/docs/antora.yml @@ -1,5 +1,5 @@ -name: mrdox -title: MrDox +name: mrdocs +title: MrDocs version: true start_page: index.adoc asciidoc: diff --git a/docs/local-antora-playbook.yml b/docs/local-antora-playbook.yml index 9f189b1b1..8d162f025 100644 --- a/docs/local-antora-playbook.yml +++ b/docs/local-antora-playbook.yml @@ -1,7 +1,7 @@ # npm install # npx antora --fetch local-antora-playbook.yml site: - title: MrDox + title: MrDocs url: https://cppalliance.github.io/mrdox/ start_page: mrdox::index.adoc robots: allow diff --git a/docs/modules/ROOT/images/MrDoxBanner.png b/docs/modules/ROOT/images/MrDocsBanner.png similarity index 100% rename from docs/modules/ROOT/images/MrDoxBanner.png rename to docs/modules/ROOT/images/MrDocsBanner.png diff --git a/docs/modules/ROOT/pages/commands.adoc b/docs/modules/ROOT/pages/commands.adoc index 38975bafd..010b4da3d 100644 --- a/docs/modules/ROOT/pages/commands.adoc +++ b/docs/modules/ROOT/pages/commands.adoc @@ -1,6 +1,6 @@ = Commands -These are the Doxygen-style "@" commands recognized by MrDox: +These are the Doxygen-style "@" commands recognized by MrDocs: == Italics / Emphasis [] diff --git a/docs/modules/ROOT/pages/design-notes.adoc b/docs/modules/ROOT/pages/design-notes.adoc index d4e6e0f3a..b8f5e7677 100644 --- a/docs/modules/ROOT/pages/design-notes.adoc +++ b/docs/modules/ROOT/pages/design-notes.adoc @@ -13,7 +13,7 @@ full interface for user-defined types. == Bitcode AST traversal is performed in parallel on a per-translation-unit basis. -To maximize the size of the code base MrDox is capable of processing, `Info` +To maximize the size of the code base MrDocs is capable of processing, `Info` types generated during traversal are serialized to a compressed bitcode representation. Once AST traversal is complete for all translation units, the bitcode is deserialized back into `Info` types, and then merged to form the corpus. The merging step is necessar diff --git a/docs/modules/ROOT/pages/index.adoc b/docs/modules/ROOT/pages/index.adoc index ae45f07f3..dddbc22df 100644 --- a/docs/modules/ROOT/pages/index.adoc +++ b/docs/modules/ROOT/pages/index.adoc @@ -1,22 +1,22 @@ -= MrDox += MrDocs Alan Freitas -:description: MrDox: A Clang/LLVM tool for building reference documentation from C++ code and javadoc comments. +:description: MrDocs: A Clang/LLVM tool for building reference documentation from C++ code and javadoc comments. :sectanchors: -:url-repo: https://github.com/cppalliance/mrdox -:page-tags: mrdox +:url-repo: https://github.com/cppalliance/mrdocs +:page-tags: mrdocs :navtitle: Home -image::MrDoxBanner.png[] +image::MrDocsBanner.png[] -Welcome to MrDox, the ultimate solution for generating comprehensive reference documentation from your {cpp} codebase and javadoc comments. MrDox harnesses the power of Clang/LLVM, offering a seamless and efficient way to document your {cpp} projects. +Welcome to MrDocs, the ultimate solution for generating comprehensive reference documentation from your {cpp} codebase and javadoc comments. MrDocs harnesses the power of Clang/LLVM, offering a seamless and efficient way to document your {cpp} projects. -With MrDox, you can effortlessly extract valuable insights and produce detailed documentation for your {cpp} code. By leveraging the rich semantic knowledge provided by Clang/LLVM, MrDox accurately captures the nuances of your codebase, including class hierarchies, functions, and their respective parameters and return types. This ensures that your documentation is not only informative but also up-to-date, eliminating the need for manual documentation maintenance. +With MrDocs, you can effortlessly extract valuable insights and produce detailed documentation for your {cpp} code. By leveraging the rich semantic knowledge provided by Clang/LLVM, MrDocs accurately captures the nuances of your codebase, including class hierarchies, functions, and their respective parameters and return types. This ensures that your documentation is not only informative but also up-to-date, eliminating the need for manual documentation maintenance. -The integration of javadoc-style comments takes your documentation to the next level. With MrDox, you can easily embed human-readable explanations, usage examples, and additional contextual information directly within your code. These comments serve as a valuable resource for both developers and consumers of your code, promoting clarity and understanding. +The integration of javadoc-style comments takes your documentation to the next level. With MrDocs, you can easily embed human-readable explanations, usage examples, and additional contextual information directly within your code. These comments serve as a valuable resource for both developers and consumers of your code, promoting clarity and understanding. -MrDox seamlessly fits into your development workflow, with the freedom to customize the output format to suit your project requirements. MrDox offers versatile options for output formats, including XML and Asciidoc. In addition to the provided output formats, MrDox empowers users to bring their own creativity and customization to the documentation generation process. With support for handlebars templates, you can create and apply your own unique templates to the generated documentation. This allows you to customize the styling, layout, and overall presentation of your documentation, making it truly personalized and aligned with your project's branding. +MrDocs seamlessly fits into your development workflow, with the freedom to customize the output format to suit your project requirements. MrDocs offers versatile options for output formats, including XML and Asciidoc. In addition to the provided output formats, MrDocs empowers users to bring their own creativity and customization to the documentation generation process. With support for handlebars templates, you can create and apply your own unique templates to the generated documentation. This allows you to customize the styling, layout, and overall presentation of your documentation, making it truly personalized and aligned with your project's branding. -MrDox empowers you to produce high-quality documentation that benefits both developers and users. Explore the power of MrDox today and experience the ease of building comprehensive reference documentation for your {cpp} projects. Say goodbye to tedious manual documentation and embrace the efficiency and accuracy of MrDox. +MrDocs empowers you to produce high-quality documentation that benefits both developers and users. Explore the power of MrDocs today and experience the ease of building comprehensive reference documentation for your {cpp} projects. Say goodbye to tedious manual documentation and embrace the efficiency and accuracy of MrDocs. == Comparison @@ -27,11 +27,11 @@ MrDox empowers you to produce high-quality documentation that benefits both deve * old program with lots of technical debt * not written by me -=== MrDox: +=== MrDocs: * narrow and deep focus on {cpp} only * uses clang's unstable libtooling API: -** Understands ALL C++: if clang can compile it, MrDox knows about it +** Understands ALL C++: if clang can compile it, MrDocs knows about it ** This includes up to {cpp}20 and even experimental things in {cpp}23 * brand-new program with no technical debt * written by me diff --git a/docs/modules/ROOT/pages/install.adoc b/docs/modules/ROOT/pages/install.adoc index b1618c95c..16683a48a 100644 --- a/docs/modules/ROOT/pages/install.adoc +++ b/docs/modules/ROOT/pages/install.adoc @@ -2,17 +2,17 @@ == Binaries -Binary packages are available from our https://github.com/cppalliance/mrdox/releases[Release Page,window="_blank"] +Binary packages are available from our https://github.com/cppalliance/mrdocs/releases[Release Page,window="_blank"] == Source -=== Cloning MrDox +=== Cloning MrDocs -Clone the MrDox repository with: +Clone the MrDocs repository with: [source,bash] ---- -git clone https://github.com/cppalliance/mrdox +git clone https://github.com/cppalliance/mrdocs ---- === Requirements @@ -28,14 +28,14 @@ cd third-party [NOTE] ==== These instructions assume all dependencies are installed in the `third-party` directory for simplicity. -Fell free to install them anywhere you want and adjust the main MrDox configuration command later. +Fell free to install them anywhere you want and adjust the main MrDocs configuration command later. ==== === LLVM -MrDox depends on a specific recent version of LLVM: https://github.com/llvm/llvm-project/tree/731264b0c2af7aa46bd39625202a99e06cfccff9[731264b0] +MrDocs depends on a specific recent version of LLVM: https://github.com/llvm/llvm-project/tree/731264b0c2af7aa46bd39625202a99e06cfccff9[731264b0] -Because building LLVM may take many hours to complete, we provide pre-built binaries for Windows and Linux: https://mrdox.com/llvm+clang/[LLVM Releases]. +Because building LLVM may take many hours to complete, we provide pre-built binaries for Windows and Linux: https://mrdocs.com/llvm+clang/[LLVM Releases]. You can download the binaries and uncompress them in the `./third-party/llvm+clang` directory. Alternatively, if building LLVM from source, you can clone the project from the official repository: @@ -47,7 +47,7 @@ cd llvm-project git checkout 731264b0c2af7aa46bd39625202a99e06cfccff9 ---- -Configure LLVM with the settings required by MrDox: +Configure LLVM with the settings required by MrDocs: Windows (from administrator `cmd.exe`, after running `vcvars64.bat`): @@ -63,7 +63,7 @@ Unix variants: cmake -S llvm -B build -D LLVM_ENABLE_PROJECTS="clang;clang-tools-extra" -D CMAKE_BUILD_TYPE=RelWithDebInfo -D LLVM_ENABLE_RTTI=ON -D CMAKE_INSTALL_PREFIX=../llvm+clang/RelWithDebInfo ---- -As you can see from the step above, we configure a `RelWithDebInfo` version of LLVM for MrDox by default. +As you can see from the step above, we configure a `RelWithDebInfo` version of LLVM for MrDocs by default. This is a release build with debug information. Other possible CMake configurations supported by LLVM are `Debug` (including debug information and no optimizations), `Release` (including optimizations and no debug information), and `MinSizeRel` (which optimizes for size). @@ -75,7 +75,7 @@ To create such an installation, set `CMAKE_CONFIGURATION_TYPES` or `CMAKE_BUILD_ This should give you an optimized build with all debug features and flags, such as an appropriate https://learn.microsoft.com/en-us/cpp/standard-library/iterator-debug-level[`_ITERATOR_DEBUG_LEVEL`] and the `/MDd` flag in MSVC. In other platforms, this should give you a release somewhat equivalent to `RelWithDebInfo` optimized for debugging experience. `-Og` offers a reasonable level of optimization while maintaining fast compilation and a good debugging experience. -This custom configuration can be installed in an alternative directory, such as `../llvm+clang/DebWithOpt`, to be used by the MrDox `Debug` builds by developers. +This custom configuration can be installed in an alternative directory, such as `../llvm+clang/DebWithOpt`, to be used by the MrDocs `Debug` builds by developers. ==== Then build and install it: @@ -96,7 +96,7 @@ cd ../.. ==== Duktape -Duktape is a JavaScript engine that is used by MrDox to parse and evaluate JavaScript code. +Duktape is a JavaScript engine that is used by MrDocs to parse and evaluate JavaScript code. The release files can be obtained from the Duktape repository: @@ -107,7 +107,7 @@ tar -xvf "duktape-2.7.0.tar.xz" ---- Duktape provides no CMake integration scripts. -The MrDox configuration script needs direct access to the installed source files for Duktape so that's all you need to do. +The MrDocs configuration script needs direct access to the installed source files for Duktape so that's all you need to do. ==== VcPkg dependencies @@ -147,39 +147,39 @@ Unix variants: ./vcpkg fmt zlib libxml2[tools] ---- -Return from `./third-party/vcpkg` to the parent directory of `third-party` (the one containing the `mrdox` directory) to build and install MrDox: +Return from `./third-party/vcpkg` to the parent directory of `third-party` (the one containing the `mrdocs` directory) to build and install MrDocs: [source,bash] ---- cd ../.. ---- -=== MrDox +=== MrDocs -Once the dependencies are available in `third-party`, you can configure MrDox with: +Once the dependencies are available in `third-party`, you can configure MrDocs with: Windows: [source,commandline] ---- -cmake -S mrdox -B build -G "Visual Studio 17 2022" -A x64 -D CMAKE_CONFIGURATION_TYPES="RelWithDebInfo" -D CMAKE_EXPORT_COMPILE_COMMANDS=ON -D LLVM_ROOT="%cd%/third-party/llvm+clang/RelWithDebInfo" -D DUKTAPE_SOURCE_ROOT="%cd%/third-party/duktape-2.7.0" -D CMAKE_TOOLCHAIN_FILE="%cd%/third-party/vcpkg/scripts/buildsystems/vcpkg.cmake" +cmake -S mrdocs -B build -G "Visual Studio 17 2022" -A x64 -D CMAKE_CONFIGURATION_TYPES="RelWithDebInfo" -D CMAKE_EXPORT_COMPILE_COMMANDS=ON -D LLVM_ROOT="%cd%/third-party/llvm+clang/RelWithDebInfo" -D DUKTAPE_SOURCE_ROOT="%cd%/third-party/duktape-2.7.0" -D CMAKE_TOOLCHAIN_FILE="%cd%/third-party/vcpkg/scripts/buildsystems/vcpkg.cmake" ---- Unix variants: [source,bash] ---- -cmake -S mrdox -B build -D CMAKE_BUILD_TYPE=RelWithDebInfo -D CMAKE_EXPORT_COMPILE_COMMANDS=ON -D LLVM_ROOT="$(pwd)/third-party/llvm+clang/RelWithDebInfo" -D DUKTAPE_SOURCE_ROOT="$(pwd)/third-party/duktape-2.7.0" -D CMAKE_TOOLCHAIN_FILE="$(pwd)/third-party/vcpkg/scripts/buildsystems/vcpkg.cmake" +cmake -S mrdocs -B build -D CMAKE_BUILD_TYPE=RelWithDebInfo -D CMAKE_EXPORT_COMPILE_COMMANDS=ON -D LLVM_ROOT="$(pwd)/third-party/llvm+clang/RelWithDebInfo" -D DUKTAPE_SOURCE_ROOT="$(pwd)/third-party/duktape-2.7.0" -D CMAKE_TOOLCHAIN_FILE="$(pwd)/third-party/vcpkg/scripts/buildsystems/vcpkg.cmake" ---- [TIP] ==== -The MrDox repository also includes a `CMakePresets.json` file that contains the parameters to configure MrDox with CMake. +The MrDocs repository also includes a `CMakePresets.json` file that contains the parameters to configure MrDocs with CMake. To specify the installation directories, you can use the `LLVM_ROOT`, `DUKTAPE_SOURCE_ROOT`, `CMAKE_TOOLCHAIN_FILE` environment variables. To specify a generator (`-G`) and platform name (`-A`), you can use the `CMAKE_GENERATOR` and `CMAKE_GENERATOR_PLATFORM` environment variables. -Alternatively, you can create a `CMakeUserPresets.json` file in the `mrdox` directory with the specific values you want to override in each configuration. +Alternatively, you can create a `CMakeUserPresets.json` file in the `mrdocs` directory with the specific values you want to override in each configuration. This is typically more convenient than using environment variables when working on an IDE. The repository includes a `CMakeUserPresets.json.example` file that can be used as a template. ==== @@ -204,12 +204,12 @@ If any custom build of LLVM is being used (such as `DebWithOpt`), the `LLVM_ROOT == Package layout -The MrDox installation directory follows the "Filesystem Hierarchy Standard" (FHS) layout: +The MrDocs installation directory follows the "Filesystem Hierarchy Standard" (FHS) layout: -* `bin`: the MrDox executable intended to be used by users or invoked from the command line. -* `share`: resource files installed by MrDox -* `doc`: the MrDox documentation -* `include`: the MrDox headers -* `lib`: the MrDox library +* `bin`: the MrDocs executable intended to be used by users or invoked from the command line. +* `share`: resource files installed by MrDocs +* `doc`: the MrDocs documentation +* `include`: the MrDocs headers +* `lib`: the MrDocs library The FHS layout provides a directory structure that also serves as a widely accepted convention for organizing files and directories in Unix-like systems, but that can be used in any operating system. diff --git a/docs/modules/ROOT/pages/usage.adoc b/docs/modules/ROOT/pages/usage.adoc index 4d3905cdf..341efb46e 100644 --- a/docs/modules/ROOT/pages/usage.adoc +++ b/docs/modules/ROOT/pages/usage.adoc @@ -1,18 +1,18 @@ = Usage -== MrDox invocation +== MrDocs invocation For consistency, these instructions assume you have the following environment variables set: [source,bash] ---- -MRDOX_ROOT=/path/to/mrdox +MRDOCS_ROOT=/path/to/mrdocs PROJECT_SOURCE_DIR=/path/to/your/project/source -MRDOX_CONFIG=$PROJECT_SOURCE_DIR/docs/mrdox.yml +MRDOCS_CONFIG=$PROJECT_SOURCE_DIR/docs/mrdocs.yml PROJECT_BUILD_DIR=$PROJECT_SOURCE_DIR/build-docs ---- -Where `MRDOX_ROOT` is the path of the mrdox executable, and `MRDOX_CONFIG` is the path to the `mrdox.yml` configuration file. +Where `MRDOCS_ROOT` is the path of the mrdocs executable, and `MRDOCS_CONFIG` is the path to the `mrdocs.yml` configuration file. We also assume `PROJECT_SOURCE_DIR` is the path to the root of your project's source code, where its main `CMakeLists.txt` file is located, and `PROJECT_BUILD_DIR` is the path to the directory where you want to generate the documentation. Feel free to change these variables to suit your needs. @@ -28,7 +28,7 @@ cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=ON At this step, you can also add any other flags you want to pass to `cmake`, such as `-DCMAKE_BUILD_TYPE=Release` or `-DCMAKE_CXX_COMPILER=clang++`. By running CMake with the `CMAKE_EXPORT_COMPILE_COMMANDS` flag, you will generate a `compile_commands.json` file in your build directory. -This file contains all the information mrdox needs to generate the documentation. +This file contains all the information mrdocs needs to generate the documentation. Now let's generate the reference files. The following command will generate the documentation with the most common options: @@ -36,66 +36,66 @@ The following command will generate the documentation with the most common optio [source,bash] ---- cd $PROJECT_BUILD_DIR -MRDOX_OUTPUT=$PROJECT_BUILD_DIR/docs/reference/adoc -$MRDOX_ROOT/mrdox $PROJECT_BUILD_DIR/compile_commands.json --format=adoc --config=$MRDOX_CONFIG --addons=$MRDOX_ROOT/addons --output=$MRDOX_OUTPUT +MRDOCS_OUTPUT=$PROJECT_BUILD_DIR/docs/reference/adoc +$MRDOCS_ROOT/mrdocs $PROJECT_BUILD_DIR/compile_commands.json --format=adoc --config=$MRDOCS_CONFIG --addons=$MRDOCS_ROOT/addons --output=$MRDOCS_OUTPUT ---- Here's a description of these options: * `--format=adoc`: the output format. It can be any of the generators available. -* `--config=$MRDOX_CONFIG`: the path to the `mrdox.yml` configuration file. +* `--config=$MRDOCS_CONFIG`: the path to the `mrdocs.yml` configuration file. This file more advanced information about the project. -* `--addons=$MRDOX_ROOT/addons`: the path to the `addons` directory. +* `--addons=$MRDOCS_ROOT/addons`: the path to the `addons` directory. This directory contains the addons that are used to generate the documentation. Among other things, it contains the default templates for the generator. This option defaults to current directory if not provided. -* `--output=$MRDOX_ROOT/output/adoc`: the path to the output directory. +* `--output=$MRDOCS_ROOT/output/adoc`: the path to the output directory. This is where the generated documentation will be placed. -MrDox ignores non-c++ source files, so nothing more needs to be done to generate the documentation for your project. +MrDocs ignores non-c++ source files, so nothing more needs to be done to generate the documentation for your project. == Demos -A few examples of reference documentation generated with MrDox are available in https://mrdox.com/demos/. +A few examples of reference documentation generated with MrDocs are available in https://mrdocs.com/demos/. -== MrDox configuration file +== MrDocs configuration file -The `mrdox.yml` configuration file contains information about the project that is not available in the `compile_commands.json` file or from the command line. -The most important information is the `source-root` options, which determines the root of the source tree relative to the `mrdox.yml` file. +The `mrdocs.yml` configuration file contains information about the project that is not available in the `compile_commands.json` file or from the command line. +The most important information is the `source-root` options, which determines the root of the source tree relative to the `mrdocs.yml` file. -Other options are available, such as the `concurrency` option, which determines the number of threads mrdox will use to generate the documentation. +Other options are available, such as the `concurrency` option, which determines the number of threads mrdocs will use to generate the documentation. This option defaults to the number of cores available on the machine. [source,yaml] ---- concurrency: 1 # number of threads to use -source-root: ../ # source files relative to the mrdox.yml file +source-root: ../ # source files relative to the mrdocs.yml file multipage: false # generate multiple pages verbose: true # print verbose output ---- -== MrDox CMake Module +== MrDocs CMake Module -MrDox also provides a CMake module that can be used to generate the documentation from your project's script. +MrDocs also provides a CMake module that can be used to generate the documentation from your project's script. You can include the CMake module with: [source,cmake] ---- -find_package(MrDox REQUIRED) +find_package(MrDocs REQUIRED) # ... -include(MrDox) +include(MrDocs) ---- -The module will define the `add_mrdox` function, which can be used define a CMake target that generates the documentation for your project. +The module will define the `add_mrdocs` function, which can be used define a CMake target that generates the documentation for your project. The syntax is similar to other cmake functions, such as `add_executable` or `add_library`: [source,cmake] ---- set(CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES}) -add_mrdox( +add_mrdocs( [EXCLUDE_FROM_ALL] - [CONFIG ] + [CONFIG ] [FORMAT ] [ADDONS ] [COMMENT comment] @@ -109,13 +109,13 @@ The `` corresponds to the logical target name and must be globally unique * If `EXCLUDE_FROM_ALL` is given the corresponding property will be set on the created target. See documentation of the https://cmake.org/cmake/help/latest/prop_tgt/EXCLUDE_FROM_ALL.html[`EXCLUDE_FROM_ALL`] target property for details. -* The `CONFIG` option specifies the path to the `mrdox.yml` configuration file. +* The `CONFIG` option specifies the path to the `mrdocs.yml` configuration file. If not specified, the function will look for the configuration file in your project directory. -* The `FORMAT` option specifies the generator used by MrDox. +* The `FORMAT` option specifies the generator used by MrDocs. If this option is not specified, the function will use the default generator, which is `adoc`. -* The `ADDONS` option specifies a custom path to the `addons` directory. By default, the function will use the `addons` directory in the MrDox installation directory. +* The `ADDONS` option specifies a custom path to the `addons` directory. By default, the function will use the `addons` directory in the MrDocs installation directory. * The `OUTPUT` option specifies the path to the output directory. If not specified, the function will use the default output directory, which is relative to the current binary directory. diff --git a/docs/mrdox.yml b/docs/mrdocs.yml similarity index 100% rename from docs/mrdox.yml rename to docs/mrdocs.yml diff --git a/include/mrdox/ADT/BitField.hpp b/include/mrdocs/ADT/BitField.hpp similarity index 93% rename from include/mrdox/ADT/BitField.hpp rename to include/mrdocs/ADT/BitField.hpp index b66180feb..7e27d6e30 100644 --- a/include/mrdox/ADT/BitField.hpp +++ b/include/mrdocs/ADT/BitField.hpp @@ -6,18 +6,18 @@ // // Copyright (c) 2023 Klemens D. Morgenstern // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_API_ADT_BITFIELD_HPP -#define MRDOX_API_ADT_BITFIELD_HPP +#ifndef MRDOCS_API_ADT_BITFIELD_HPP +#define MRDOCS_API_ADT_BITFIELD_HPP #include #include #include namespace clang { -namespace mrdox { +namespace mrdocs { constexpr std::uint32_t makeMask( unsigned char Offset, unsigned char Size) @@ -82,7 +82,7 @@ using BitFlag = BitField; using BitFieldFullValue = BitField<0, 32>; -} // mrdox +} // mrdocs } // clang #endif diff --git a/include/mrdox/ADT/Optional.hpp b/include/mrdocs/ADT/Optional.hpp similarity index 93% rename from include/mrdox/ADT/Optional.hpp rename to include/mrdocs/ADT/Optional.hpp index 3490112d0..745bf0b67 100644 --- a/include/mrdox/ADT/Optional.hpp +++ b/include/mrdocs/ADT/Optional.hpp @@ -6,19 +6,19 @@ // // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_API_ADT_OPTIONAL_HPP -#define MRDOX_API_ADT_OPTIONAL_HPP +#ifndef MRDOCS_API_ADT_OPTIONAL_HPP +#define MRDOCS_API_ADT_OPTIONAL_HPP -#include +#include #include #include #include namespace clang { -namespace mrdox { +namespace mrdocs { /** The default empty predicate. @@ -132,7 +132,7 @@ class Optional } }; -} // mrdox +} // mrdocs } // clang #endif diff --git a/include/mrdox/Config.hpp b/include/mrdocs/Config.hpp similarity index 90% rename from include/mrdox/Config.hpp rename to include/mrdocs/Config.hpp index d17905d42..e768d50af 100644 --- a/include/mrdox/Config.hpp +++ b/include/mrdocs/Config.hpp @@ -6,14 +6,14 @@ // // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_API_CONFIG_HPP -#define MRDOX_API_CONFIG_HPP +#ifndef MRDOCS_API_CONFIG_HPP +#define MRDOCS_API_CONFIG_HPP -#include -#include +#include +#include #include #include #include @@ -23,7 +23,7 @@ #include namespace clang { -namespace mrdox { +namespace mrdocs { class ThreadPool; @@ -35,7 +35,7 @@ class ThreadPool; particular directory from which absolute paths are calculated from relative paths. */ -class MRDOX_DECL +class MRDOCS_DECL Config { protected: @@ -94,13 +94,13 @@ class MRDOX_DECL /** Destructor. */ - MRDOX_DECL + MRDOCS_DECL virtual ~Config() noexcept = 0; /** Return a pool of threads for executing work. */ - MRDOX_DECL + MRDOCS_DECL virtual ThreadPool& threadPool() const noexcept = 0; @@ -114,7 +114,7 @@ class MRDOX_DECL virtual Settings const& settings() const noexcept = 0; }; -} // mrdox +} // mrdocs } // clang #endif diff --git a/include/mrdox/Corpus.hpp b/include/mrdocs/Corpus.hpp similarity index 90% rename from include/mrdox/Corpus.hpp rename to include/mrdocs/Corpus.hpp index 0247ae91e..a77e0ceec 100644 --- a/include/mrdox/Corpus.hpp +++ b/include/mrdocs/Corpus.hpp @@ -6,15 +6,15 @@ // // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_API_CORPUS_HPP -#define MRDOX_API_CORPUS_HPP +#ifndef MRDOCS_API_CORPUS_HPP +#define MRDOCS_API_CORPUS_HPP -#include -#include -#include +#include +#include +#include #include #include #include @@ -22,11 +22,11 @@ #include namespace clang { -namespace mrdox { +namespace mrdocs { /** The collection of declarations in extracted form. */ -class MRDOX_VISIBLE +class MRDOCS_VISIBLE Corpus { protected: @@ -42,7 +42,7 @@ class MRDOX_VISIBLE public: /** Destructor. */ - MRDOX_DECL + MRDOCS_DECL virtual ~Corpus() noexcept; @@ -54,27 +54,27 @@ class MRDOX_VISIBLE /** Return the begin iterator for the index of all symbols. */ - MRDOX_DECL + MRDOCS_DECL virtual iterator begin() const noexcept = 0; /** Return the end iterator for the index. */ - MRDOX_DECL + MRDOCS_DECL virtual iterator end() const noexcept = 0; /** Return the metadata for the global namespace. */ - MRDOX_DECL + MRDOCS_DECL NamespaceInfo const& globalNamespace() const noexcept; /** Return the Info with the matching ID, or nullptr. */ - MRDOX_DECL + MRDOCS_DECL virtual Info const* find(SymbolID const& id) const noexcept = 0; @@ -117,7 +117,7 @@ class MRDOX_VISIBLE //-------------------------------------------- // KRYSTIAN NOTE: temporary - MRDOX_DECL + MRDOCS_DECL std::string& getFullyQualifiedName( const Info& I, @@ -133,7 +133,7 @@ get( SymbolID const& id) const noexcept { auto I = find(id); - MRDOX_ASSERT(I != nullptr); + MRDOCS_ASSERT(I != nullptr); if constexpr(std::is_same_v) { return *I; @@ -141,7 +141,7 @@ get( else { auto const& J = *static_cast(I); - MRDOX_ASSERT(J.Kind == T::kind_id); + MRDOCS_ASSERT(J.Kind == T::kind_id); return J; } } @@ -220,14 +220,14 @@ class Corpus::iterator iterator& operator++() noexcept { - MRDOX_ASSERT(val_); + MRDOCS_ASSERT(val_); val_ = next_(corpus_, val_); return *this; } iterator operator++(int) noexcept { - MRDOX_ASSERT(val_); + MRDOCS_ASSERT(val_); auto temp = *this; val_ = next_(corpus_, val_); return temp; @@ -235,13 +235,13 @@ class Corpus::iterator const_pointer operator->() const noexcept { - MRDOX_ASSERT(val_); + MRDOCS_ASSERT(val_); return val_; } const_reference operator*() const noexcept { - MRDOX_ASSERT(val_); + MRDOCS_ASSERT(val_); return *val_; } @@ -256,7 +256,7 @@ class Corpus::iterator } }; -} // mrdox +} // mrdocs } // clang #endif diff --git a/include/mrdox/Dom.hpp b/include/mrdocs/Dom.hpp similarity index 64% rename from include/mrdox/Dom.hpp rename to include/mrdocs/Dom.hpp index 70dea4b9d..87b0309ad 100644 --- a/include/mrdox/Dom.hpp +++ b/include/mrdocs/Dom.hpp @@ -5,12 +5,12 @@ // // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_API_DOM_HPP -#define MRDOX_API_DOM_HPP +#ifndef MRDOCS_API_DOM_HPP +#define MRDOCS_API_DOM_HPP -#include +#include #endif diff --git a/include/mrdox/Dom/Array.hpp b/include/mrdocs/Dom/Array.hpp similarity index 96% rename from include/mrdox/Dom/Array.hpp rename to include/mrdocs/Dom/Array.hpp index 75b9d2786..4b3ab1934 100644 --- a/include/mrdox/Dom/Array.hpp +++ b/include/mrdocs/Dom/Array.hpp @@ -5,20 +5,20 @@ // // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_API_DOM_ARRAY_HPP -#define MRDOX_API_DOM_ARRAY_HPP +#ifndef MRDOCS_API_DOM_ARRAY_HPP +#define MRDOCS_API_DOM_ARRAY_HPP -#include +#include #include #include #include #include namespace clang { -namespace mrdox { +namespace mrdocs { namespace dom { class ArrayImpl; @@ -34,7 +34,7 @@ class Value; these ordered sequences of values. */ -class MRDOX_DECL +class MRDOCS_DECL Array final { std::shared_ptr impl_; @@ -125,7 +125,7 @@ class MRDOX_DECL Array(impl_type impl) noexcept : impl_(std::move(impl)) { - MRDOX_ASSERT(impl_); + MRDOCS_ASSERT(impl_); } /** Constructor. @@ -299,7 +299,7 @@ class MRDOX_DECL This interface is used by Array types. */ -class MRDOX_DECL +class MRDOCS_DECL ArrayImpl { public: @@ -348,7 +348,7 @@ class MRDOX_DECL This implementation is backed by a simple vector and allows appending. */ -class MRDOX_DECL +class MRDOCS_DECL DefaultArrayImpl : public ArrayImpl { public: @@ -386,10 +386,10 @@ newArray(Args&&... args) } } // dom -} // mrdox +} // mrdocs } // clang // This is here because of circular references -#include +#include #endif diff --git a/include/mrdox/Dom/Array.ipp b/include/mrdocs/Dom/Array.ipp similarity index 92% rename from include/mrdox/Dom/Array.ipp rename to include/mrdocs/Dom/Array.ipp index bbfb72332..d36da06dd 100644 --- a/include/mrdox/Dom/Array.ipp +++ b/include/mrdocs/Dom/Array.ipp @@ -5,14 +5,14 @@ // // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_API_DOM_ARRAY_IPP -#define MRDOX_API_DOM_ARRAY_IPP +#ifndef MRDOCS_API_DOM_ARRAY_IPP +#define MRDOCS_API_DOM_ARRAY_IPP namespace clang { -namespace mrdox { +namespace mrdocs { namespace dom { //------------------------------------------------ @@ -21,7 +21,7 @@ namespace dom { // //------------------------------------------------ -class MRDOX_DECL +class MRDOCS_DECL Array::iterator { ArrayImpl const* obj_ = nullptr; @@ -91,7 +91,7 @@ public: auto operator<=>(iterator const& other) const noexcept { - MRDOX_ASSERT(obj_ == other.obj_); + MRDOCS_ASSERT(obj_ == other.obj_); return i_ <=> other.i_; } @@ -99,13 +99,13 @@ public: // VFALCO Why does ranges need these? Isn't <=> enough? bool operator==(iterator const& other) const noexcept { - MRDOX_ASSERT(obj_ == other.obj_); + MRDOCS_ASSERT(obj_ == other.obj_); return i_ == other.i_; } bool operator!=(iterator const& other) const noexcept { - MRDOX_ASSERT(obj_ == other.obj_); + MRDOCS_ASSERT(obj_ == other.obj_); return i_ != other.i_; } #endif @@ -134,7 +134,7 @@ public: difference_type operator-(iterator other) const noexcept { - MRDOX_ASSERT(obj_ == other.obj_); + MRDOCS_ASSERT(obj_ == other.obj_); return static_cast(i_) - static_cast(other.i_); } @@ -225,7 +225,7 @@ Array operator+(Array const& lhs, Array const& rhs) } } // dom -} // mrdox +} // mrdocs } // clang #endif diff --git a/include/mrdox/Dom/Function.hpp b/include/mrdocs/Dom/Function.hpp similarity index 95% rename from include/mrdox/Dom/Function.hpp rename to include/mrdocs/Dom/Function.hpp index 7020f02d6..4595fe902 100644 --- a/include/mrdox/Dom/Function.hpp +++ b/include/mrdocs/Dom/Function.hpp @@ -5,20 +5,20 @@ // // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_API_DOM_FUNCTION_HPP -#define MRDOX_API_DOM_FUNCTION_HPP +#ifndef MRDOCS_API_DOM_FUNCTION_HPP +#define MRDOCS_API_DOM_FUNCTION_HPP -#include -#include -#include -#include +#include +#include +#include +#include #include namespace clang { -namespace mrdox { +namespace mrdocs { namespace dom { class Array; @@ -139,7 +139,7 @@ class FunctionImpl; template class DefaultFunctionImpl; -class MRDOX_DECL +class MRDOCS_DECL Function { using impl_type = std::shared_ptr; @@ -150,7 +150,7 @@ class MRDOX_DECL std::shared_ptr impl) noexcept : impl_(std::move(impl)) { - MRDOX_ASSERT(impl_); + MRDOCS_ASSERT(impl_); } public: @@ -266,7 +266,7 @@ class MRDOX_DECL // //------------------------------------------------ -class MRDOX_DECL +class MRDOCS_DECL FunctionImpl { public: @@ -370,10 +370,10 @@ Function makeVariadicInvocable(F&& f) } } // dom -} // mrdox +} // mrdocs } // clang // This is here because of circular references -#include +#include #endif diff --git a/include/mrdox/Dom/Function.ipp b/include/mrdocs/Dom/Function.ipp similarity index 97% rename from include/mrdox/Dom/Function.ipp rename to include/mrdocs/Dom/Function.ipp index 64c8cdf2f..8947811ee 100644 --- a/include/mrdox/Dom/Function.ipp +++ b/include/mrdocs/Dom/Function.ipp @@ -5,14 +5,14 @@ // // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_API_DOM_FUNCTION_IPP -#define MRDOX_API_DOM_FUNCTION_IPP +#ifndef MRDOCS_API_DOM_FUNCTION_IPP +#define MRDOCS_API_DOM_FUNCTION_IPP namespace clang { -namespace mrdox { +namespace mrdocs { namespace dom { inline char const* Function::type_key() const noexcept @@ -256,7 +256,7 @@ call(Array const& args) const -> } } // dom -} // mrdox +} // mrdocs } // clang #endif diff --git a/include/mrdox/Dom/Kind.hpp b/include/mrdocs/Dom/Kind.hpp similarity index 93% rename from include/mrdox/Dom/Kind.hpp rename to include/mrdocs/Dom/Kind.hpp index ec0df56fc..f89b2f08d 100644 --- a/include/mrdox/Dom/Kind.hpp +++ b/include/mrdocs/Dom/Kind.hpp @@ -5,17 +5,17 @@ // // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_API_DOM_KIND_HPP -#define MRDOX_API_DOM_KIND_HPP +#ifndef MRDOCS_API_DOM_KIND_HPP +#define MRDOCS_API_DOM_KIND_HPP -#include +#include #include namespace clang { -namespace mrdox { +namespace mrdocs { namespace dom { /** The type of data in a Value. @@ -101,7 +101,7 @@ toString(Kind const& value) } } // dom -} // mrdox +} // mrdocs } // clang #endif diff --git a/include/mrdox/Dom/Object.hpp b/include/mrdocs/Dom/Object.hpp similarity index 96% rename from include/mrdox/Dom/Object.hpp rename to include/mrdocs/Dom/Object.hpp index 12c237429..00d86b07a 100644 --- a/include/mrdox/Dom/Object.hpp +++ b/include/mrdocs/Dom/Object.hpp @@ -5,20 +5,20 @@ // // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_API_DOM_OBJECT_HPP -#define MRDOX_API_DOM_OBJECT_HPP +#ifndef MRDOCS_API_DOM_OBJECT_HPP +#define MRDOCS_API_DOM_OBJECT_HPP -#include -#include +#include +#include #include #include #include namespace clang { -namespace mrdox { +namespace mrdocs { namespace dom { class ObjectImpl; @@ -67,7 +67,7 @@ class Value; functions. @endparblock */ -class MRDOX_DECL +class MRDOCS_DECL Object final { std::shared_ptr impl_; @@ -158,7 +158,7 @@ class MRDOX_DECL impl_type impl) noexcept : impl_(std::move(impl)) { - MRDOX_ASSERT(impl_); + MRDOCS_ASSERT(impl_); } /** Constructor. @@ -330,7 +330,7 @@ class MRDOX_DECL This interface is used by Object types. */ -class MRDOX_DECL +class MRDOCS_DECL ObjectImpl { public: @@ -396,7 +396,7 @@ newObject(Args&&... args) /** The default Object implementation. */ -class MRDOX_DECL +class MRDOCS_DECL DefaultObjectImpl : public ObjectImpl { public: @@ -429,7 +429,7 @@ class MRDOX_DECL initialized when the first property is set or accessed. */ -class MRDOX_DECL +class MRDOCS_DECL LazyObjectImpl : public ObjectImpl { std::atomic> mutable sp_; @@ -455,10 +455,10 @@ class MRDOX_DECL }; } // dom -} // mrdox +} // mrdocs } // clang // This is here because of circular references -#include +#include #endif diff --git a/include/mrdox/Dom/Object.ipp b/include/mrdocs/Dom/Object.ipp similarity index 92% rename from include/mrdox/Dom/Object.ipp rename to include/mrdocs/Dom/Object.ipp index 94c7bee83..4d131553f 100644 --- a/include/mrdox/Dom/Object.ipp +++ b/include/mrdocs/Dom/Object.ipp @@ -5,14 +5,14 @@ // // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_API_DOM_OBJECT_IPP -#define MRDOX_API_DOM_OBJECT_IPP +#ifndef MRDOCS_API_DOM_OBJECT_IPP +#define MRDOCS_API_DOM_OBJECT_IPP namespace clang { -namespace mrdox { +namespace mrdocs { namespace dom { //------------------------------------------------ @@ -143,17 +143,17 @@ Object::visit(F&& fn) const } } // dom -} // mrdox +} // mrdocs } // clang //------------------------------------------------ template<> -struct fmt::formatter +struct fmt::formatter : fmt::formatter { auto format( - clang::mrdox::dom::Object const& value, + clang::mrdocs::dom::Object const& value, fmt::format_context& ctx) const { return fmt::formatter::format( diff --git a/include/mrdox/Dom/String.hpp b/include/mrdocs/Dom/String.hpp similarity index 95% rename from include/mrdox/Dom/String.hpp rename to include/mrdocs/Dom/String.hpp index e75dd994d..8a06a5fb9 100644 --- a/include/mrdox/Dom/String.hpp +++ b/include/mrdocs/Dom/String.hpp @@ -5,18 +5,18 @@ // // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_API_DOM_STRING_HPP -#define MRDOX_API_DOM_STRING_HPP +#ifndef MRDOCS_API_DOM_STRING_HPP +#define MRDOCS_API_DOM_STRING_HPP -#include -#include +#include +#include #include namespace clang { -namespace mrdox { +namespace mrdocs { namespace dom { class String; @@ -28,7 +28,7 @@ concept StringLikeTy = ! std::is_same_v && std::convertible_to; -class MRDOX_DECL +class MRDOCS_DECL String final { const char* ptr_ = nullptr; @@ -36,7 +36,7 @@ class MRDOX_DECL bool is_literal() const noexcept { - MRDOX_ASSERT(! empty()); + MRDOCS_ASSERT(! empty()); // for string literals, data_ stores a pointer // to the first character of the string. // for ref-counted strings, data_ stores a pointer @@ -336,17 +336,17 @@ class MRDOX_DECL }; } // dom -} // mrdox +} // mrdocs } // clang //------------------------------------------------ template<> -struct fmt::formatter +struct fmt::formatter : fmt::formatter { auto format( - clang::mrdox::dom::String const& value, + clang::mrdocs::dom::String const& value, fmt::format_context& ctx) const { return fmt::formatter::format( diff --git a/include/mrdox/Dom/Value.hpp b/include/mrdocs/Dom/Value.hpp similarity index 93% rename from include/mrdox/Dom/Value.hpp rename to include/mrdocs/Dom/Value.hpp index a4a79db2f..bf4bff4b7 100644 --- a/include/mrdox/Dom/Value.hpp +++ b/include/mrdocs/Dom/Value.hpp @@ -5,27 +5,27 @@ // // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_API_DOM_VALUE_HPP -#define MRDOX_API_DOM_VALUE_HPP - -#include -#include -#include -#include -#include -#include -#include -#include +#ifndef MRDOCS_API_DOM_VALUE_HPP +#define MRDOCS_API_DOM_VALUE_HPP + +#include +#include +#include +#include +#include +#include +#include +#include #include // BAD #include #include #include namespace clang { -namespace mrdox { +namespace mrdocs { /** Create a wrapper for a safe string. @@ -56,7 +56,7 @@ namespace dom { /** A variant container for any kind of Dom value. */ -class MRDOX_DECL +class MRDOCS_DECL Value { Kind kind_{Kind::Undefined}; @@ -73,7 +73,7 @@ class MRDOX_DECL friend class Array; friend class Object; - friend Value clang::mrdox::safeString(std::string_view str); + friend Value clang::mrdocs::safeString(std::string_view str); public: ~Value(); @@ -245,7 +245,7 @@ class MRDOX_DECL */ bool getBool() const noexcept { - MRDOX_ASSERT(isBoolean()); + MRDOCS_ASSERT(isBoolean()); return b_ != 0; } @@ -256,7 +256,7 @@ class MRDOX_DECL std::int64_t getInteger() const noexcept { - MRDOX_ASSERT(isInteger()); + MRDOCS_ASSERT(isInteger()); return i_; } @@ -267,7 +267,7 @@ class MRDOX_DECL String const& getString() const noexcept { - MRDOX_ASSERT(isString() || isSafeString()); + MRDOCS_ASSERT(isString() || isSafeString()); return str_; } @@ -542,7 +542,7 @@ namespace JSON @param value The value to stringify. */ -MRDOX_DECL +MRDOCS_DECL std::string stringify(dom::Value const& value); } @@ -571,22 +571,22 @@ safeString(SV const& str) { return safeString(std::string_view(str)); } -} // mrdox +} // mrdocs } // clang // These are here because of circular references -#include -#include -#include +#include +#include +#include //------------------------------------------------ template<> -struct fmt::formatter +struct fmt::formatter : public fmt::formatter { auto format( - clang::mrdox::dom::Value const& value, + clang::mrdocs::dom::Value const& value, fmt::format_context& ctx) const { return fmt::formatter::format( diff --git a/include/mrdox/Generator.hpp b/include/mrdocs/Generator.hpp similarity index 89% rename from include/mrdox/Generator.hpp rename to include/mrdocs/Generator.hpp index cb8b2a172..dcc4f7c41 100644 --- a/include/mrdox/Generator.hpp +++ b/include/mrdocs/Generator.hpp @@ -6,35 +6,35 @@ // // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // // Generator classes for converting declaration // information into documentation in a specified format. -#ifndef MRDOX_API_GENERATOR_HPP -#define MRDOX_API_GENERATOR_HPP +#ifndef MRDOCS_API_GENERATOR_HPP +#define MRDOCS_API_GENERATOR_HPP -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include namespace clang { -namespace mrdox { +namespace mrdocs { /** Base class for documentation generators. */ -class MRDOX_VISIBLE +class MRDOCS_VISIBLE Generator { public: /** Destructor. */ - MRDOX_DECL + MRDOCS_DECL virtual ~Generator() noexcept; @@ -44,14 +44,14 @@ class MRDOX_VISIBLE the generator in command line options and in configuration files. */ - MRDOX_DECL + MRDOCS_DECL virtual std::string_view id() const noexcept = 0; /** Return the display name of the generator. */ - MRDOX_DECL + MRDOCS_DECL virtual std::string_view displayName() const noexcept = 0; @@ -68,7 +68,7 @@ class MRDOX_VISIBLE The returned string should not include a leading period. */ - MRDOX_DECL + MRDOCS_DECL virtual std::string_view fileExtension() const noexcept = 0; @@ -93,7 +93,7 @@ class MRDOX_VISIBLE @param config The configuration to use. */ - MRDOX_DECL + MRDOCS_DECL virtual Error build( @@ -116,7 +116,7 @@ class MRDOX_VISIBLE @param corpus The metadata to emit. */ - MRDOX_DECL + MRDOCS_DECL virtual Error buildOne( @@ -136,7 +136,7 @@ class MRDOX_VISIBLE @param corpus The metadata to emit. */ - MRDOX_DECL + MRDOCS_DECL Error buildOne( std::string_view fileName, @@ -152,14 +152,14 @@ class MRDOX_VISIBLE @param corpus The metadata to emit. */ - MRDOX_DECL + MRDOCS_DECL Error buildOneString( std::string& dest, Corpus const& corpus) const; }; -} // mrdox +} // mrdocs } // clang #endif diff --git a/include/mrdox/Generators.hpp b/include/mrdocs/Generators.hpp similarity index 81% rename from include/mrdox/Generators.hpp rename to include/mrdocs/Generators.hpp index b44f87bff..55441e80f 100644 --- a/include/mrdox/Generators.hpp +++ b/include/mrdocs/Generators.hpp @@ -5,23 +5,23 @@ // // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_API_GENERATORS_HPP -#define MRDOX_API_GENERATORS_HPP +#ifndef MRDOCS_API_GENERATORS_HPP +#define MRDOCS_API_GENERATORS_HPP -#include -#include +#include +#include #include #include namespace clang { -namespace mrdox { +namespace mrdocs { /** A dynamic list of Generator */ -class MRDOX_VISIBLE +class MRDOCS_VISIBLE Generators { protected: @@ -38,20 +38,20 @@ class MRDOX_VISIBLE /** Destructor. */ - MRDOX_DECL + MRDOCS_DECL virtual ~Generators() noexcept; /** Return an iterator to the beginning. */ - MRDOX_DECL + MRDOCS_DECL virtual iterator begin() const noexcept = 0; /** Return an iterator to the end. */ - MRDOX_DECL + MRDOCS_DECL virtual iterator end() const noexcept = 0; @@ -63,7 +63,7 @@ class MRDOX_VISIBLE @param name The name of the generator. The name must be an exact match, including case. */ - MRDOX_DECL + MRDOCS_DECL virtual Generator const* find( @@ -72,11 +72,11 @@ class MRDOX_VISIBLE /** Return a reference to the global Generators instance. */ -MRDOX_DECL +MRDOCS_DECL Generators const& getGenerators() noexcept; -} // mrdox +} // mrdocs } // clang #endif diff --git a/include/mrdocs/Metadata.hpp b/include/mrdocs/Metadata.hpp new file mode 100644 index 000000000..3a07e800a --- /dev/null +++ b/include/mrdocs/Metadata.hpp @@ -0,0 +1,38 @@ +// +// This is a derivative work. originally part of the LLVM Project. +// 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) 2023 Vinnie Falco (vinnie.falco@gmail.com) +// +// Official repository: https://github.com/cppalliance/mrdocs +// + +#ifndef MRDOCS_API_METADATA_HPP +#define MRDOCS_API_METADATA_HPP + +#include + +// All headers related to +// metadata extracted from AST + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/include/mrdox/Metadata/DomMetadata.hpp b/include/mrdocs/Metadata/DomMetadata.hpp similarity index 87% rename from include/mrdox/Metadata/DomMetadata.hpp rename to include/mrdocs/Metadata/DomMetadata.hpp index f05d89752..88f61fb54 100644 --- a/include/mrdox/Metadata/DomMetadata.hpp +++ b/include/mrdocs/Metadata/DomMetadata.hpp @@ -5,21 +5,21 @@ // // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_API_DOM_DOMMETADATA_HPP -#define MRDOX_API_DOM_DOMMETADATA_HPP +#ifndef MRDOCS_API_DOM_DOMMETADATA_HPP +#define MRDOCS_API_DOM_DOMMETADATA_HPP -#include -#include -#include -#include +#include +#include +#include +#include #include #include namespace clang { -namespace mrdox { +namespace mrdocs { /** Front-end factory for producing Dom nodes. @@ -27,7 +27,7 @@ namespace mrdox { then uses it to create the Dom nodes used for rendering in template engines. */ -class MRDOX_DECL +class MRDOCS_DECL DomCorpus { class Impl; @@ -98,7 +98,7 @@ class MRDOX_DECL Javadoc const& jd) const; }; -} // mrdox +} // mrdocs } // clang #endif diff --git a/include/mrdox/Metadata/Enum.hpp b/include/mrdocs/Metadata/Enum.hpp similarity index 81% rename from include/mrdox/Metadata/Enum.hpp rename to include/mrdocs/Metadata/Enum.hpp index c9f647a8d..9e00901b3 100644 --- a/include/mrdox/Metadata/Enum.hpp +++ b/include/mrdocs/Metadata/Enum.hpp @@ -6,24 +6,24 @@ // // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_API_METADATA_ENUM_HPP -#define MRDOX_API_METADATA_ENUM_HPP +#ifndef MRDOCS_API_METADATA_ENUM_HPP +#define MRDOCS_API_METADATA_ENUM_HPP -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include #include namespace clang { -namespace mrdox { +namespace mrdocs { // Information for a single possible value of an enumeration. struct EnumValueInfo @@ -76,7 +76,7 @@ struct EnumInfo } }; -} // mrdox +} // mrdocs } // clang #endif diff --git a/include/mrdox/Metadata/Expression.hpp b/include/mrdocs/Metadata/Expression.hpp similarity index 81% rename from include/mrdox/Metadata/Expression.hpp rename to include/mrdocs/Metadata/Expression.hpp index a4312aa19..890ab6813 100644 --- a/include/mrdox/Metadata/Expression.hpp +++ b/include/mrdocs/Metadata/Expression.hpp @@ -5,19 +5,19 @@ // // Copyright (c) 2023 Krystian Stasiowski (sdkrystian@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_API_METADATA_EXPRESSION_HPP -#define MRDOX_API_METADATA_EXPRESSION_HPP +#ifndef MRDOCS_API_METADATA_EXPRESSION_HPP +#define MRDOCS_API_METADATA_EXPRESSION_HPP -#include +#include #include #include #include namespace clang { -namespace mrdox { +namespace mrdocs { /** Represents an expression */ struct ExprInfo @@ -46,6 +46,6 @@ struct ConstantExprInfo }; } // clang -} // mrdox +} // mrdocs #endif diff --git a/include/mrdox/Metadata/Field.hpp b/include/mrdocs/Metadata/Field.hpp similarity index 80% rename from include/mrdox/Metadata/Field.hpp rename to include/mrdocs/Metadata/Field.hpp index 19953cebe..72d99dbff 100644 --- a/include/mrdox/Metadata/Field.hpp +++ b/include/mrdocs/Metadata/Field.hpp @@ -7,22 +7,22 @@ // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) // Copyright (c) 2023 Krystian Stasiowski (sdkrystian@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_API_METADATA_FIELD_HPP -#define MRDOX_API_METADATA_FIELD_HPP +#ifndef MRDOCS_API_METADATA_FIELD_HPP +#define MRDOCS_API_METADATA_FIELD_HPP -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include namespace clang { -namespace mrdox { +namespace mrdocs { union FieldFlags { @@ -72,7 +72,7 @@ struct FieldInfo } }; -} // mrdox +} // mrdocs } // clang #endif diff --git a/include/mrdox/Metadata/Function.hpp b/include/mrdocs/Metadata/Function.hpp similarity index 87% rename from include/mrdox/Metadata/Function.hpp rename to include/mrdocs/Metadata/Function.hpp index 022c58eb7..d0741c8cf 100644 --- a/include/mrdox/Metadata/Function.hpp +++ b/include/mrdocs/Metadata/Function.hpp @@ -7,32 +7,32 @@ // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) // Copyright (c) 2023 Krystian Stasiowski (sdkrystian@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_API_METADATA_FUNCTION_HPP -#define MRDOX_API_METADATA_FUNCTION_HPP +#ifndef MRDOCS_API_METADATA_FUNCTION_HPP +#define MRDOCS_API_METADATA_FUNCTION_HPP -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include #include namespace clang { -namespace mrdox { +namespace mrdocs { /** Return the name of an operator as a string. @param include_keyword Whether the name should be prefixed with the `operator` keyword. */ -MRDOX_DECL +MRDOCS_DECL std::string_view getOperatorName( OperatorKind kind, @@ -40,7 +40,7 @@ getOperatorName( /** Return the short name of an operator as a string. */ -MRDOX_DECL +MRDOCS_DECL std::string_view getShortOperatorName( OperatorKind kind) noexcept; @@ -50,7 +50,7 @@ getShortOperatorName( @param include_keyword Whether the name should be prefixed with `operator_`. */ -MRDOX_DECL +MRDOCS_DECL std::string_view getSafeOperatorName( OperatorKind kind, @@ -68,7 +68,7 @@ enum class FunctionClass Deduction, }; -MRDOX_DECL dom::String toString(FunctionClass kind) noexcept; +MRDOCS_DECL dom::String toString(FunctionClass kind) noexcept; /** Bit constants used with function specifiers. */ @@ -169,7 +169,7 @@ struct FunctionInfo //------------------------------------------------ -} // mrdox +} // mrdocs } // clang #endif diff --git a/include/mrdox/Metadata/Info.hpp b/include/mrdocs/Metadata/Info.hpp similarity index 92% rename from include/mrdox/Metadata/Info.hpp rename to include/mrdocs/Metadata/Info.hpp index 64d6e2317..cb1bc1071 100644 --- a/include/mrdox/Metadata/Info.hpp +++ b/include/mrdocs/Metadata/Info.hpp @@ -6,18 +6,18 @@ // // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_API_METADATA_INFO_HPP -#define MRDOX_API_METADATA_INFO_HPP +#ifndef MRDOCS_API_METADATA_INFO_HPP +#define MRDOCS_API_METADATA_INFO_HPP -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -25,7 +25,7 @@ #include namespace clang { -namespace mrdox { +namespace mrdocs { struct NamespaceInfo; struct RecordInfo; @@ -50,11 +50,11 @@ enum class InfoKind Specialization }; -MRDOX_DECL dom::String toString(InfoKind kind) noexcept; +MRDOCS_DECL dom::String toString(InfoKind kind) noexcept; /** Common properties of all symbols */ -struct MRDOX_VISIBLE +struct MRDOCS_VISIBLE Info { /** The unique identifier for this symbol. @@ -120,7 +120,7 @@ struct MRDOX_VISIBLE // Observers // - MRDOX_DECL + MRDOCS_DECL std::string extractName() const; @@ -219,11 +219,11 @@ visit( InfoTy, SpecializationInfo>&>(II), std::forward(args)...); default: - MRDOX_UNREACHABLE(); + MRDOCS_UNREACHABLE(); } } -} // mrdox +} // mrdocs } // clang #endif diff --git a/include/mrdox/Metadata/Interface.hpp b/include/mrdocs/Metadata/Interface.hpp similarity index 87% rename from include/mrdox/Metadata/Interface.hpp rename to include/mrdocs/Metadata/Interface.hpp index 6d1c45858..e8e48941e 100644 --- a/include/mrdox/Metadata/Interface.hpp +++ b/include/mrdocs/Metadata/Interface.hpp @@ -6,22 +6,22 @@ // // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_API_METADATA_INTERFACE_HPP -#define MRDOX_API_METADATA_INTERFACE_HPP +#ifndef MRDOCS_API_METADATA_INTERFACE_HPP +#define MRDOCS_API_METADATA_INTERFACE_HPP -#include -#include -#include +#include +#include +#include #include #include #include #include namespace clang { -namespace mrdox { +namespace mrdocs { /** The aggregated interface for a given struct, class, or union. */ @@ -55,7 +55,7 @@ class Interface */ Tranche Private; - MRDOX_DECL + MRDOCS_DECL friend Interface makeInterface( @@ -88,13 +88,13 @@ class Interface @param corpus The complete metadata. */ -MRDOX_DECL +MRDOCS_DECL Interface makeInterface( RecordInfo const& Derived, Corpus const& corpus); -} // mrdox +} // mrdocs } // clang #endif diff --git a/include/mrdox/Metadata/Javadoc.hpp b/include/mrdocs/Metadata/Javadoc.hpp similarity index 97% rename from include/mrdox/Metadata/Javadoc.hpp rename to include/mrdocs/Metadata/Javadoc.hpp index 5cd94336f..10152d007 100644 --- a/include/mrdox/Metadata/Javadoc.hpp +++ b/include/mrdocs/Metadata/Javadoc.hpp @@ -7,15 +7,15 @@ // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) // Copyright (c) 2023 Krystian Stasiowski (sdkrystian@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_API_METADATA_JAVADOC_HPP -#define MRDOX_API_METADATA_JAVADOC_HPP +#ifndef MRDOCS_API_METADATA_JAVADOC_HPP +#define MRDOCS_API_METADATA_JAVADOC_HPP -#include -#include -#include +#include +#include +#include #include #include #include @@ -23,7 +23,7 @@ #include namespace clang { -namespace mrdox { +namespace mrdocs { // This namespace contains all of the Javadoc // related types, constants, and functions. @@ -93,7 +93,7 @@ enum class ParamDirection : int /** This is a variant-like list element. */ -struct MRDOX_DECL +struct MRDOCS_DECL Node { Kind kind; @@ -218,7 +218,7 @@ struct Link : Text The top level is a list of blocks. */ -struct MRDOX_DECL +struct MRDOCS_DECL Block : Node { List children; @@ -562,7 +562,7 @@ visit( return f(static_cast(node), std::forward(args)...); default: - MRDOX_UNREACHABLE(); + MRDOCS_UNREACHABLE(); } } @@ -587,7 +587,7 @@ struct Overview std::vector tparams; }; -MRDOX_DECL dom::String toString(Style style) noexcept; +MRDOCS_DECL dom::String toString(Style style) noexcept; } // doc @@ -595,13 +595,13 @@ MRDOX_DECL dom::String toString(Style style) noexcept; /** A processed Doxygen-style comment attached to a declaration. */ -class MRDOX_DECL +class MRDOCS_DECL Javadoc { public: /** Constructor. */ - MRDOX_DECL + MRDOCS_DECL Javadoc() noexcept; /** Constructor @@ -696,7 +696,7 @@ class MRDOX_DECL doc::List blocks_; }; -} // mrdox +} // mrdocs } // clang #endif diff --git a/include/mrdox/Metadata/Namespace.hpp b/include/mrdocs/Metadata/Namespace.hpp similarity index 75% rename from include/mrdox/Metadata/Namespace.hpp rename to include/mrdocs/Metadata/Namespace.hpp index 4cfb94239..d4d29970e 100644 --- a/include/mrdox/Metadata/Namespace.hpp +++ b/include/mrdocs/Metadata/Namespace.hpp @@ -6,19 +6,19 @@ // // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_API_METADATA_NAMESPACE_HPP -#define MRDOX_API_METADATA_NAMESPACE_HPP +#ifndef MRDOCS_API_METADATA_NAMESPACE_HPP +#define MRDOCS_API_METADATA_NAMESPACE_HPP -#include -#include -#include +#include +#include +#include #include namespace clang { -namespace mrdox { +namespace mrdocs { union NamespaceFlags { @@ -48,7 +48,7 @@ struct NamespaceInfo } }; -} // mrdox +} // mrdocs } // clang #endif diff --git a/include/mrdox/Metadata/Overloads.hpp b/include/mrdocs/Metadata/Overloads.hpp similarity index 81% rename from include/mrdox/Metadata/Overloads.hpp rename to include/mrdocs/Metadata/Overloads.hpp index e35108245..4a61642c7 100644 --- a/include/mrdox/Metadata/Overloads.hpp +++ b/include/mrdocs/Metadata/Overloads.hpp @@ -6,20 +6,20 @@ // // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_API_METADATA_OVERLOADS_HPP -#define MRDOX_API_METADATA_OVERLOADS_HPP +#ifndef MRDOCS_API_METADATA_OVERLOADS_HPP +#define MRDOCS_API_METADATA_OVERLOADS_HPP -#include -#include -#include +#include +#include +#include #include #include namespace clang { -namespace mrdox { +namespace mrdocs { class Corpus; @@ -38,7 +38,7 @@ struct OverloadInfo std::span Functions; }; -class MRDOX_VISIBLE +class MRDOCS_VISIBLE NamespaceOverloads { public: @@ -49,7 +49,7 @@ class MRDOX_VISIBLE @par Complexity `O(N * log(N))` in `data.size()`. */ - MRDOX_DECL + MRDOCS_DECL NamespaceOverloads( NamespaceInfo const& I, std::vector data); @@ -69,13 +69,13 @@ class MRDOX_VISIBLE @param list The list of function references to use. */ -MRDOX_DECL +MRDOCS_DECL NamespaceOverloads makeNamespaceOverloads( NamespaceInfo const& I, Corpus const& corpus); -} // mrdox +} // mrdocs } // clang #endif diff --git a/include/mrdox/Metadata/Record.hpp b/include/mrdocs/Metadata/Record.hpp similarity index 77% rename from include/mrdox/Metadata/Record.hpp rename to include/mrdocs/Metadata/Record.hpp index fed86f3ab..10ea69c1a 100644 --- a/include/mrdox/Metadata/Record.hpp +++ b/include/mrdocs/Metadata/Record.hpp @@ -6,30 +6,30 @@ // // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_API_METADATA_RECORD_HPP -#define MRDOX_API_METADATA_RECORD_HPP - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#ifndef MRDOCS_API_METADATA_RECORD_HPP +#define MRDOCS_API_METADATA_RECORD_HPP + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include #include namespace clang { -namespace mrdox { +namespace mrdocs { /** Bit constants used with Record metadata */ @@ -69,7 +69,7 @@ enum class RecordKeyKind Union }; -MRDOX_DECL dom::String toString(RecordKeyKind kind) noexcept; +MRDOCS_DECL dom::String toString(RecordKeyKind kind) noexcept; /** Metadata for struct, class, or union. */ @@ -119,7 +119,7 @@ struct RecordInfo } }; -} // mrdox +} // mrdocs } // clang #endif diff --git a/include/mrdox/Metadata/Source.hpp b/include/mrdocs/Metadata/Source.hpp similarity index 85% rename from include/mrdox/Metadata/Source.hpp rename to include/mrdocs/Metadata/Source.hpp index a16c679fa..ed70e50fe 100644 --- a/include/mrdox/Metadata/Source.hpp +++ b/include/mrdocs/Metadata/Source.hpp @@ -7,22 +7,22 @@ // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) // Copyright (c) 2023 Krystian Stasiowski (sdkrystian@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_API_METADATA_SOURCE_HPP -#define MRDOX_API_METADATA_SOURCE_HPP +#ifndef MRDOCS_API_METADATA_SOURCE_HPP +#define MRDOCS_API_METADATA_SOURCE_HPP -#include -#include -#include +#include +#include +#include #include #include namespace clang { -namespace mrdox { +namespace mrdocs { -struct MRDOX_DECL +struct MRDOCS_DECL Location { /** Name of the file @@ -65,7 +65,7 @@ using OptionalLocation = Optional; /** Stores source information for a declaration. */ -struct MRDOX_DECL +struct MRDOCS_DECL SourceInfo { /** Location where the entity was defined @@ -87,7 +87,7 @@ struct MRDOX_DECL SourceInfo() = default; }; -} // mrdox +} // mrdocs } // clang #endif diff --git a/include/mrdox/Metadata/Specialization.hpp b/include/mrdocs/Metadata/Specialization.hpp similarity index 82% rename from include/mrdox/Metadata/Specialization.hpp rename to include/mrdocs/Metadata/Specialization.hpp index 3783889ad..f0794be4b 100644 --- a/include/mrdox/Metadata/Specialization.hpp +++ b/include/mrdocs/Metadata/Specialization.hpp @@ -5,21 +5,21 @@ // // Copyright (c) 2023 Krystian Stasiowski (sdkrystian@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_API_METADATA_SPECIALIZATION_HPP -#define MRDOX_API_METADATA_SPECIALIZATION_HPP +#ifndef MRDOCS_API_METADATA_SPECIALIZATION_HPP +#define MRDOCS_API_METADATA_SPECIALIZATION_HPP -#include -#include -#include -#include +#include +#include +#include +#include #include #include namespace clang { -namespace mrdox { +namespace mrdocs { /** Primary and specialized IDs of specialized members */ @@ -71,7 +71,7 @@ struct SpecializationInfo } }; -} // mrdox +} // mrdocs } // clang #endif diff --git a/include/mrdox/Metadata/Specifiers.hpp b/include/mrdocs/Metadata/Specifiers.hpp similarity index 84% rename from include/mrdox/Metadata/Specifiers.hpp rename to include/mrdocs/Metadata/Specifiers.hpp index 99fc7a541..960d5b80f 100644 --- a/include/mrdox/Metadata/Specifiers.hpp +++ b/include/mrdocs/Metadata/Specifiers.hpp @@ -5,18 +5,18 @@ // // Copyright (c) 2023 Krystian Stasiowski (sdkrystian@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_API_METADATA_SPECIFIERS_HPP -#define MRDOX_API_METADATA_SPECIFIERS_HPP +#ifndef MRDOCS_API_METADATA_SPECIFIERS_HPP +#define MRDOCS_API_METADATA_SPECIFIERS_HPP -#include -#include +#include +#include #include namespace clang { -namespace mrdox { +namespace mrdocs { /** Access specifier. @@ -176,14 +176,14 @@ enum class StorageClassKind Register }; -MRDOX_DECL dom::String toString(AccessKind kind) noexcept; -MRDOX_DECL dom::String toString(ConstexprKind kind) noexcept; -MRDOX_DECL dom::String toString(ExplicitKind kind) noexcept; -MRDOX_DECL dom::String toString(NoexceptKind kind) noexcept; -MRDOX_DECL dom::String toString(ReferenceKind kind) noexcept; -MRDOX_DECL dom::String toString(StorageClassKind kind) noexcept; +MRDOCS_DECL dom::String toString(AccessKind kind) noexcept; +MRDOCS_DECL dom::String toString(ConstexprKind kind) noexcept; +MRDOCS_DECL dom::String toString(ExplicitKind kind) noexcept; +MRDOCS_DECL dom::String toString(NoexceptKind kind) noexcept; +MRDOCS_DECL dom::String toString(ReferenceKind kind) noexcept; +MRDOCS_DECL dom::String toString(StorageClassKind kind) noexcept; -} // mrdox +} // mrdocs } // clang #endif diff --git a/include/mrdox/Metadata/Symbols.hpp b/include/mrdocs/Metadata/Symbols.hpp similarity index 89% rename from include/mrdox/Metadata/Symbols.hpp rename to include/mrdocs/Metadata/Symbols.hpp index cd37d25ef..6b77b278b 100644 --- a/include/mrdox/Metadata/Symbols.hpp +++ b/include/mrdocs/Metadata/Symbols.hpp @@ -7,21 +7,21 @@ // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) // Copyright (c) 2023 Krystian Stasiowski (sdkrystian@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_API_METADATA_SYMBOLS_HPP -#define MRDOX_API_METADATA_SYMBOLS_HPP +#ifndef MRDOCS_API_METADATA_SYMBOLS_HPP +#define MRDOCS_API_METADATA_SYMBOLS_HPP -#include -#include +#include +#include #include #include #include #include namespace clang { -namespace mrdox { +namespace mrdocs { /** A unique identifier for a symbol. @@ -114,20 +114,20 @@ using OptionalSymbolID = Optional; are compared with lowercase letters coming before uppercase letters. */ -MRDOX_DECL +MRDOCS_DECL std::strong_ordering compareSymbolNames( std::string_view symbolName0, std::string_view symbolName1) noexcept; -} // mrdox +} // mrdocs } // clang template<> -struct std::hash +struct std::hash { std::size_t operator()( - const clang::mrdox::SymbolID& id) const + const clang::mrdocs::SymbolID& id) const { return std::hash()( std::string_view(id)); diff --git a/include/mrdox/Metadata/Template.hpp b/include/mrdocs/Metadata/Template.hpp similarity index 91% rename from include/mrdox/Metadata/Template.hpp rename to include/mrdocs/Metadata/Template.hpp index c7a9f847e..dee5cbd61 100644 --- a/include/mrdox/Metadata/Template.hpp +++ b/include/mrdocs/Metadata/Template.hpp @@ -7,22 +7,22 @@ // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) // Copyright (c) 2023 Krystian Stasiowski (sdkrystian@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_API_METADATA_TEMPLATE_HPP -#define MRDOX_API_METADATA_TEMPLATE_HPP +#ifndef MRDOCS_API_METADATA_TEMPLATE_HPP +#define MRDOCS_API_METADATA_TEMPLATE_HPP -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include namespace clang { -namespace mrdox { +namespace mrdocs { enum class TArgKind : int { @@ -34,7 +34,7 @@ enum class TArgKind : int Template }; -MRDOX_DECL std::string_view toString(TArgKind kind) noexcept; +MRDOCS_DECL std::string_view toString(TArgKind kind) noexcept; struct TArg { @@ -127,11 +127,11 @@ visit( TArgTy, TemplateTArg>&>(A), std::forward(args)...); default: - MRDOX_UNREACHABLE(); + MRDOCS_UNREACHABLE(); } } -MRDOX_DECL std::string toString(const TArg& arg) noexcept; +MRDOCS_DECL std::string toString(const TArg& arg) noexcept; // ---------------------------------------------------------------- @@ -145,7 +145,7 @@ enum class TParamKind : int Template }; -MRDOX_DECL std::string_view toString(TParamKind kind) noexcept; +MRDOCS_DECL std::string_view toString(TParamKind kind) noexcept; struct TParam { @@ -200,7 +200,7 @@ enum class TParamKeyKind : int Typename }; -MRDOX_DECL std::string_view toString(TParamKeyKind kind) noexcept; +MRDOCS_DECL std::string_view toString(TParamKeyKind kind) noexcept; struct TypeTParam : IsTParam @@ -250,7 +250,7 @@ visit( TParamTy, TemplateTParam>&>(P), std::forward(args)...); default: - MRDOX_UNREACHABLE(); + MRDOCS_UNREACHABLE(); } } @@ -263,7 +263,7 @@ enum class TemplateSpecKind Partial }; -MRDOX_DECL +MRDOCS_DECL std::string_view toString(TemplateSpecKind kind); @@ -300,7 +300,7 @@ struct TemplateInfo } }; -} // mrdox +} // mrdocs } // clang #endif diff --git a/include/mrdox/Metadata/Type.hpp b/include/mrdocs/Metadata/Type.hpp similarity index 92% rename from include/mrdox/Metadata/Type.hpp rename to include/mrdocs/Metadata/Type.hpp index 189281932..3f24738dd 100644 --- a/include/mrdox/Metadata/Type.hpp +++ b/include/mrdocs/Metadata/Type.hpp @@ -5,26 +5,26 @@ // // Copyright (c) 2023 Krystian Stasiowski (sdkrystian@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_API_METADATA_TYPE_HPP -#define MRDOX_API_METADATA_TYPE_HPP +#ifndef MRDOCS_API_METADATA_TYPE_HPP +#define MRDOCS_API_METADATA_TYPE_HPP -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include #include #include namespace clang { -namespace mrdox { +namespace mrdocs { enum QualifierKind : int { @@ -33,7 +33,7 @@ enum QualifierKind : int Volatile }; -MRDOX_DECL dom::String toString(QualifierKind kind) noexcept; +MRDOCS_DECL dom::String toString(QualifierKind kind) noexcept; enum class TypeKind { @@ -48,7 +48,7 @@ enum class TypeKind Function }; -MRDOX_DECL dom::String toString(TypeKind kind) noexcept; +MRDOCS_DECL dom::String toString(TypeKind kind) noexcept; struct TypeInfo { @@ -265,18 +265,18 @@ visit( TypeTy, FunctionTypeInfo>&>(II), std::forward(args)...); default: - MRDOX_UNREACHABLE(); + MRDOCS_UNREACHABLE(); } } // VFALCO maybe we should rename this to `renderType` or something? -MRDOX_DECL +MRDOCS_DECL std::string toString( const TypeInfo& T, std::string_view Name = ""); -} // mrdox +} // mrdocs } // clang #endif diff --git a/include/mrdox/Metadata/Typedef.hpp b/include/mrdocs/Metadata/Typedef.hpp similarity index 76% rename from include/mrdox/Metadata/Typedef.hpp rename to include/mrdocs/Metadata/Typedef.hpp index f438661b3..1e82ef79a 100644 --- a/include/mrdox/Metadata/Typedef.hpp +++ b/include/mrdocs/Metadata/Typedef.hpp @@ -7,20 +7,20 @@ // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) // Copyright (c) 2023 Krystian Stasiowski (sdkrystian@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_API_METADATA_TYPEDEF_HPP -#define MRDOX_API_METADATA_TYPEDEF_HPP +#ifndef MRDOCS_API_METADATA_TYPEDEF_HPP +#define MRDOCS_API_METADATA_TYPEDEF_HPP -#include -#include -#include -#include +#include +#include +#include +#include #include namespace clang { -namespace mrdox { +namespace mrdocs { // Info for typedef and using statements. struct TypedefInfo @@ -47,7 +47,7 @@ struct TypedefInfo } }; -} // mrdox +} // mrdocs } // clang #endif diff --git a/include/mrdox/Metadata/Variable.hpp b/include/mrdocs/Metadata/Variable.hpp similarity index 75% rename from include/mrdox/Metadata/Variable.hpp rename to include/mrdocs/Metadata/Variable.hpp index 41b30d49d..ed0c7b117 100644 --- a/include/mrdox/Metadata/Variable.hpp +++ b/include/mrdocs/Metadata/Variable.hpp @@ -6,21 +6,21 @@ // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) // Copyright (c) 2023 Krystian Stasiowski (sdkrystian@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_API_METADATA_VARIABLE_HPP -#define MRDOX_API_METADATA_VARIABLE_HPP +#ifndef MRDOCS_API_METADATA_VARIABLE_HPP +#define MRDOCS_API_METADATA_VARIABLE_HPP -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include namespace clang { -namespace mrdox { +namespace mrdocs { union VariableFlags0 { @@ -58,7 +58,7 @@ struct VariableInfo } }; -} // mrdox +} // mrdocs } // clang #endif diff --git a/include/mrdox/MetadataFwd.hpp b/include/mrdocs/MetadataFwd.hpp similarity index 86% rename from include/mrdox/MetadataFwd.hpp rename to include/mrdocs/MetadataFwd.hpp index ed2c688b5..80894674e 100644 --- a/include/mrdox/MetadataFwd.hpp +++ b/include/mrdocs/MetadataFwd.hpp @@ -6,20 +6,20 @@ // // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_API_METADATAFWD_HPP -#define MRDOX_API_METADATAFWD_HPP +#ifndef MRDOCS_API_METADATAFWD_HPP +#define MRDOCS_API_METADATAFWD_HPP -#include -#include +#include +#include // Forward declarations for all types // related to metadata extracted from AST namespace clang { -namespace mrdox { +namespace mrdocs { class Corpus; @@ -81,7 +81,7 @@ template; -} // mrdox +} // mrdocs } // clang #endif diff --git a/include/mrdox/Platform.hpp b/include/mrdocs/Platform.hpp similarity index 54% rename from include/mrdox/Platform.hpp rename to include/mrdocs/Platform.hpp index 4b41f2b6e..0794e09c7 100644 --- a/include/mrdox/Platform.hpp +++ b/include/mrdocs/Platform.hpp @@ -5,17 +5,17 @@ // // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_API_PLATFORM_HPP -#define MRDOX_API_PLATFORM_HPP +#ifndef MRDOCS_API_PLATFORM_HPP +#define MRDOCS_API_PLATFORM_HPP -#include +#include #include #if __cplusplus < 202002L - #error "mrdox requires at least C++20" + #error "mrdocs requires at least C++20" #endif /* @@ -24,11 +24,11 @@ */ namespace clang { -namespace mrdox { +namespace mrdocs { /** The minimum version of LLVM required */ -#define MRDOX_MINIMUM_LLVM_VERSION 15 +#define MRDOCS_MINIMUM_LLVM_VERSION 15 //------------------------------------------------ // @@ -37,29 +37,29 @@ namespace mrdox { //------------------------------------------------ // static linking -#if defined(MRDOX_STATIC_LINK) -# define MRDOX_DECL -# define MRDOX_VISIBLE +#if defined(MRDOCS_STATIC_LINK) +# define MRDOCS_DECL +# define MRDOCS_VISIBLE // MSVC #elif defined(_MSC_VER) -# define MRDOX_SYMBOL_EXPORT __declspec(dllexport) -# define MRDOX_SYMBOL_IMPORT __declspec(dllimport) -# if defined(MRDOX_TOOL) // building tool -# define MRDOX_DECL MRDOX_SYMBOL_EXPORT +# define MRDOCS_SYMBOL_EXPORT __declspec(dllexport) +# define MRDOCS_SYMBOL_IMPORT __declspec(dllimport) +# if defined(MRDOCS_TOOL) // building tool +# define MRDOCS_DECL MRDOCS_SYMBOL_EXPORT # else -# define MRDOX_DECL MRDOX_SYMBOL_IMPORT +# define MRDOCS_DECL MRDOCS_SYMBOL_IMPORT # endif -# define MRDOX_VISIBLE +# define MRDOCS_VISIBLE // (unknown) #elif defined(__GNUC__) -# if defined(MRDOX_TOOL) // building library -# define MRDOX_DECL +# if defined(MRDOCS_TOOL) // building library +# define MRDOCS_DECL # else -# define MRDOX_DECL __attribute__((__visibility__("default"))) +# define MRDOCS_DECL __attribute__((__visibility__("default"))) #endif -# define MRDOX_VISIBLE __attribute__((__visibility__("default"))) +# define MRDOCS_VISIBLE __attribute__((__visibility__("default"))) #else # error unknown platform for dynamic linking #endif @@ -72,7 +72,7 @@ namespace mrdox { # endif #endif -} // mrdox +} // mrdocs } // clang #endif diff --git a/include/mrdocs/Support/Assert.hpp b/include/mrdocs/Support/Assert.hpp new file mode 100644 index 000000000..dc2e14476 --- /dev/null +++ b/include/mrdocs/Support/Assert.hpp @@ -0,0 +1,47 @@ +// +// 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) 2023 Krystian Stasiowski (sdkrystian@gmail.com) +// +// Official repository: https://github.com/cppalliance/mrdocs +// + +#ifndef MRDOCS_API_SUPPORT_ASSERT_HPP +#define MRDOCS_API_SUPPORT_ASSERT_HPP + +#include + +namespace clang { +namespace mrdocs { + +#ifdef NDEBUG + #ifdef __GNUC__ + #define MRDOCS_UNREACHABLE() static_cast(__builtin_unreachable()) + #elif defined(_MSC_VER) + #define MRDOCS_UNREACHABLE() static_cast(__assume(false)) + #endif + #define MRDOCS_ASSERT(x) static_cast(false) +#else + #ifdef __GNUC__ + #define MRDOCS_UNREACHABLE() static_cast(__builtin_trap(), __builtin_unreachable()) + #elif defined(_MSC_VER) + #define MRDOCS_UNREACHABLE() static_cast(__debugbreak(), __assume(false)) + #endif + + void + assert_failed( + const char* msg, + const char* file, + std::uint_least32_t line); + + #define MRDOCS_ASSERT(x) static_cast(!! (x) || \ + (assert_failed(#x, __builtin_FILE(), __builtin_LINE()), \ + MRDOCS_UNREACHABLE(), true)) +#endif + +} // mrdocs +} // clang + +#endif \ No newline at end of file diff --git a/include/mrdox/Support/Error.hpp b/include/mrdocs/Support/Error.hpp similarity index 97% rename from include/mrdox/Support/Error.hpp rename to include/mrdocs/Support/Error.hpp index 294a648a4..6cfb886bf 100644 --- a/include/mrdox/Support/Error.hpp +++ b/include/mrdocs/Support/Error.hpp @@ -6,14 +6,14 @@ // // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_API_SUPPORT_ERROR_HPP -#define MRDOX_API_SUPPORT_ERROR_HPP +#ifndef MRDOCS_API_SUPPORT_ERROR_HPP +#define MRDOCS_API_SUPPORT_ERROR_HPP -#include -#include +#include +#include #include #include #include @@ -26,7 +26,7 @@ #include namespace clang { -namespace mrdox { +namespace mrdocs { //------------------------------------------------ @@ -60,7 +60,7 @@ class Exception; /** Holds the description of an error, or success. */ -class MRDOX_DECL +class MRDOCS_DECL Error final { std::string where_; @@ -258,7 +258,7 @@ class MRDOX_DECL /** Type of all exceptions thrown by the API. */ -class MRDOX_DECL +class MRDOCS_DECL Exception final : public std::exception { Error err_; @@ -515,25 +515,25 @@ class Unexpected template Unexpected(E) -> Unexpected; -#ifndef MRDOX_TRY -# define MRDOX_MERGE_(a, b) a##b -# define MRDOX_LABEL_(a) MRDOX_MERGE_(expected_result_, a) -# define MRDOX_UNIQUE_NAME MRDOX_LABEL_(__LINE__) -# define MRDOX_TRY_VOID(expr) \ - auto MRDOX_UNIQUE_NAME = expr; \ - if (!MRDOX_UNIQUE_NAME) { \ - return Unexpected(MRDOX_UNIQUE_NAME.error()); \ +#ifndef MRDOCS_TRY +# define MRDOCS_MERGE_(a, b) a##b +# define MRDOCS_LABEL_(a) MRDOCS_MERGE_(expected_result_, a) +# define MRDOCS_UNIQUE_NAME MRDOCS_LABEL_(__LINE__) +# define MRDOCS_TRY_VOID(expr) \ + auto MRDOCS_UNIQUE_NAME = expr; \ + if (!MRDOCS_UNIQUE_NAME) { \ + return Unexpected(MRDOCS_UNIQUE_NAME.error()); \ } \ void(0) -# define MRDOX_TRY_VAR(var, expr) \ - auto MRDOX_UNIQUE_NAME = expr; \ - if (!MRDOX_UNIQUE_NAME) { \ - return Unexpected(MRDOX_UNIQUE_NAME.error()); \ +# define MRDOCS_TRY_VAR(var, expr) \ + auto MRDOCS_UNIQUE_NAME = expr; \ + if (!MRDOCS_UNIQUE_NAME) { \ + return Unexpected(MRDOCS_UNIQUE_NAME.error()); \ } \ - var = *std::move(MRDOX_UNIQUE_NAME) + var = *std::move(MRDOCS_UNIQUE_NAME) # define GET_MACRO(_1, _2, NAME, ...) NAME -# define MRDOX_TRY(...) \ - GET_MACRO(__VA_ARGS__, MRDOX_TRY_VAR, MRDOX_TRY_VOID)(__VA_ARGS__) +# define MRDOCS_TRY(...) \ + GET_MACRO(__VA_ARGS__, MRDOCS_TRY_VAR, MRDOCS_TRY_VOID)(__VA_ARGS__) #endif @@ -1058,7 +1058,7 @@ class Expected T const* operator->() const noexcept { - MRDOX_ASSERT(has_value_); + MRDOCS_ASSERT(has_value_); return std::addressof(val_); } @@ -1067,7 +1067,7 @@ class Expected T* operator->() noexcept { - MRDOX_ASSERT(has_value_); + MRDOCS_ASSERT(has_value_); return std::addressof(val_); } @@ -1076,7 +1076,7 @@ class Expected T const& operator*() const & noexcept { - MRDOX_ASSERT(has_value_); + MRDOCS_ASSERT(has_value_); return val_; } @@ -1085,7 +1085,7 @@ class Expected T& operator*() & noexcept { - MRDOX_ASSERT(has_value_); + MRDOCS_ASSERT(has_value_); return val_; } @@ -1094,7 +1094,7 @@ class Expected T const&& operator*() const && noexcept { - MRDOX_ASSERT(has_value_); + MRDOCS_ASSERT(has_value_); return std::move(val_); } @@ -1103,7 +1103,7 @@ class Expected T&& operator*() && noexcept { - MRDOX_ASSERT(has_value_); + MRDOCS_ASSERT(has_value_); return std::move(val_); } @@ -1164,28 +1164,28 @@ class Expected constexpr const E& error() const & noexcept { - MRDOX_ASSERT(!has_value_); + MRDOCS_ASSERT(!has_value_); return unex_; } constexpr E& error() & noexcept { - MRDOX_ASSERT(!has_value_); + MRDOCS_ASSERT(!has_value_); return unex_; } constexpr const E&& error() const && noexcept { - MRDOX_ASSERT(!has_value_); + MRDOCS_ASSERT(!has_value_); return std::move(unex_); } constexpr E&& error() && noexcept { - MRDOX_ASSERT(!has_value_); + MRDOCS_ASSERT(!has_value_); return std::move(unex_); } @@ -2027,7 +2027,7 @@ class Expected constexpr void operator*() const noexcept { - MRDOX_ASSERT(has_value_); + MRDOCS_ASSERT(has_value_); } constexpr @@ -2055,28 +2055,28 @@ class Expected constexpr const E& error() const & noexcept { - MRDOX_ASSERT(!has_value_); + MRDOCS_ASSERT(!has_value_); return unex_; } constexpr E& error() & noexcept { - MRDOX_ASSERT(!has_value_); + MRDOCS_ASSERT(!has_value_); return unex_; } constexpr const E&& error() const && noexcept { - MRDOX_ASSERT(!has_value_); + MRDOCS_ASSERT(!has_value_); return std::move(unex_); } constexpr E&& error() && noexcept { - MRDOX_ASSERT(!has_value_); + MRDOCS_ASSERT(!has_value_); return std::move(unex_); } @@ -2509,7 +2509,7 @@ class Expected /** A source location with filename prettification. */ -class MRDOX_DECL +class MRDOCS_DECL SourceLocation { std::string_view file_; @@ -2629,7 +2629,7 @@ struct Results /** Holds current statistics on reported messages. */ extern -MRDOX_DECL +MRDOCS_DECL Results results; @@ -2640,7 +2640,7 @@ results; that messages will still be counted towards result totals even if they are not displayed. */ -MRDOX_DECL +MRDOCS_DECL void setMinimumLevel( Level level) noexcept; @@ -2651,7 +2651,7 @@ setMinimumLevel( trailing newline will be added to the message automatically. */ -MRDOX_DECL +MRDOCS_DECL void print( std::string const& text); @@ -2668,7 +2668,7 @@ print( @param loc The source location of the report. If this value is null, no location is printed. */ -MRDOX_DECL +MRDOCS_DECL void print( Level level, @@ -2784,16 +2784,16 @@ fatal( } // report -} // mrdox +} // mrdocs } // clang //------------------------------------------------ template<> -struct std::hash<::clang::mrdox::Error> +struct std::hash<::clang::mrdocs::Error> { std::size_t operator()( - ::clang::mrdox::Error const& err) const noexcept + ::clang::mrdocs::Error const& err) const noexcept { return std::hash()(err.message()); } @@ -2802,11 +2802,11 @@ struct std::hash<::clang::mrdox::Error> //------------------------------------------------ template<> -struct fmt::formatter +struct fmt::formatter : fmt::formatter { auto format( - clang::mrdox::Error const& err, + clang::mrdocs::Error const& err, fmt::format_context& ctx) const { return fmt::formatter::format(err.reason(), ctx); diff --git a/include/mrdox/Support/ExecutorGroup.hpp b/include/mrdocs/Support/ExecutorGroup.hpp similarity index 88% rename from include/mrdox/Support/ExecutorGroup.hpp rename to include/mrdocs/Support/ExecutorGroup.hpp index 826a26606..a4f3f435d 100644 --- a/include/mrdox/Support/ExecutorGroup.hpp +++ b/include/mrdocs/Support/ExecutorGroup.hpp @@ -5,25 +5,25 @@ // // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_API_SUPPORT_EXECUTORGROUP_HPP -#define MRDOX_API_SUPPORT_EXECUTORGROUP_HPP +#ifndef MRDOCS_API_SUPPORT_EXECUTORGROUP_HPP +#define MRDOCS_API_SUPPORT_EXECUTORGROUP_HPP -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include #include namespace clang { -namespace mrdox { +namespace mrdocs { -class MRDOX_DECL +class MRDOCS_DECL ExecutorGroupBase { class scoped_agent; @@ -31,7 +31,7 @@ class MRDOX_DECL protected: struct Impl; - struct MRDOX_DECL + struct MRDOCS_DECL AnyAgent { virtual ~AnyAgent() = 0; @@ -135,7 +135,7 @@ class ExecutorGroup : public ExecutorGroupBase } }; -} // mrdox +} // mrdocs } // clang #endif diff --git a/include/mrdox/Support/Handlebars.hpp b/include/mrdocs/Support/Handlebars.hpp similarity index 98% rename from include/mrdox/Support/Handlebars.hpp rename to include/mrdocs/Support/Handlebars.hpp index 0cb3de89e..ad43e0b8a 100644 --- a/include/mrdox/Support/Handlebars.hpp +++ b/include/mrdocs/Support/Handlebars.hpp @@ -5,14 +5,14 @@ // // Copyright (c) 2023 Alan de Freitas (alandefreitas@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_TOOL_SUPPORT_PATH_HPP -#define MRDOX_TOOL_SUPPORT_PATH_HPP +#ifndef MRDOCS_TOOL_SUPPORT_PATH_HPP +#define MRDOCS_TOOL_SUPPORT_PATH_HPP -#include -#include +#include +#include #include #include #include @@ -21,7 +21,7 @@ #include namespace clang { -namespace mrdox { +namespace mrdocs { /** An error thrown or returned by Handlebars @@ -188,7 +188,7 @@ namespace detail { std::string, std::ostream, llvm::raw_string_ostream, and others. */ -class MRDOX_DECL OutputRef +class MRDOCS_DECL OutputRef { friend class Handlebars; @@ -900,7 +900,7 @@ class Handlebars { @see https://mustache.github.io/mustache.5.html#Sections */ -MRDOX_DECL +MRDOCS_DECL bool isEmpty(dom::Value const& arg); @@ -926,12 +926,12 @@ isEmpty(dom::Value const& arg); @see https://mustache.github.io/mustache.5.html#Sections */ -MRDOX_DECL +MRDOCS_DECL dom::Object createFrame(dom::Object const& parent); /// @overload -MRDOX_DECL +MRDOCS_DECL dom::Object createFrame(dom::Value const& parent); @@ -958,20 +958,20 @@ createFrame(dom::Object const& child, dom::Object const& parent); @param str The string to escape @return The escaped string */ -MRDOX_DECL +MRDOCS_DECL std::string escapeExpression( std::string_view str); /// @overload escapeExpression(std::string_view) -MRDOX_DECL +MRDOCS_DECL void escapeExpression( OutputRef out, std::string_view str); /// @overload escapeExpression(std::string_view) -MRDOX_DECL +MRDOCS_DECL void escapeExpression( OutputRef out, @@ -1019,7 +1019,7 @@ namespace helpers { @param hbs The Handlebars instance to register the helpers into */ -MRDOX_DECL +MRDOCS_DECL void registerBuiltinHelpers(Handlebars& hbs); @@ -1040,7 +1040,7 @@ registerBuiltinHelpers(Handlebars& hbs); @param hbs The Handlebars instance to register the helpers into */ -MRDOX_DECL +MRDOCS_DECL void registerAntoraHelpers(Handlebars& hbs); @@ -1065,7 +1065,7 @@ registerAntoraHelpers(Handlebars& hbs); @param hbs The Handlebars instance to register the helpers into */ -MRDOX_DECL +MRDOCS_DECL void registerStringHelpers(Handlebars& hbs); @@ -1086,7 +1086,7 @@ registerStringHelpers(Handlebars& hbs); @param hbs The Handlebars instance to register the helpers into */ -MRDOX_DECL +MRDOCS_DECL void registerContainerHelpers(Handlebars& hbs); @@ -1094,7 +1094,7 @@ registerContainerHelpers(Handlebars& hbs); * * The "and" helper returns true if all of the values are truthy. */ -MRDOX_DECL +MRDOCS_DECL bool and_fn(dom::Array const& args); @@ -1102,7 +1102,7 @@ and_fn(dom::Array const& args); * * The "or" helper returns true if any of the values are truthy. */ -MRDOX_DECL +MRDOCS_DECL bool or_fn(dom::Array const& args); @@ -1110,7 +1110,7 @@ or_fn(dom::Array const& args); * * The "eq" helper returns true if all of the values are equal. */ -MRDOX_DECL +MRDOCS_DECL bool eq_fn(dom::Array const& args); @@ -1118,7 +1118,7 @@ eq_fn(dom::Array const& args); * * The "ne" helper returns true if any of the values are not equal. */ -MRDOX_DECL +MRDOCS_DECL bool ne_fn(dom::Array const& args); @@ -1126,7 +1126,7 @@ ne_fn(dom::Array const& args); * * The "not" helper returns true if not all of the values are truthy. */ -MRDOX_DECL +MRDOCS_DECL bool not_fn(dom::Array const& arg); @@ -1135,7 +1135,7 @@ not_fn(dom::Array const& arg); * The "increment" helper adds 1 to the value if it's an integer and converts * booleans to `true`. Other values are returned as-is. */ -MRDOX_DECL +MRDOCS_DECL dom::Value increment_fn(dom::Value const& value); @@ -1144,7 +1144,7 @@ increment_fn(dom::Value const& value); * The "detag" helper applies the regex expression "<[^>]+>" to the * input to remove all HTML tags. */ -MRDOX_DECL +MRDOCS_DECL dom::Value detag_fn(dom::Value html); @@ -1152,7 +1152,7 @@ detag_fn(dom::Value html); * * The "relativize" helper makes the first path relative to the second path. */ -MRDOX_DECL +MRDOCS_DECL dom::Value relativize_fn(dom::Value to, dom::Value from, dom::Value context); @@ -1160,12 +1160,12 @@ relativize_fn(dom::Value to, dom::Value from, dom::Value context); * * The "year" helper returns the current year as an integer. */ -MRDOX_DECL +MRDOCS_DECL int year_fn(); } // helpers -} // mrdox +} // mrdocs } // clang #endif diff --git a/include/mrdox/Support/JavaScript.hpp b/include/mrdocs/Support/JavaScript.hpp similarity index 95% rename from include/mrdox/Support/JavaScript.hpp rename to include/mrdocs/Support/JavaScript.hpp index 2cb0880ff..1d4d6787a 100644 --- a/include/mrdox/Support/JavaScript.hpp +++ b/include/mrdocs/Support/JavaScript.hpp @@ -5,21 +5,21 @@ // // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_API_SUPPORT_JAVASCRIPT_HPP -#define MRDOX_API_SUPPORT_JAVASCRIPT_HPP +#ifndef MRDOCS_API_SUPPORT_JAVASCRIPT_HPP +#define MRDOCS_API_SUPPORT_JAVASCRIPT_HPP -#include -#include -#include +#include +#include +#include #include #include #include namespace clang { -namespace mrdox { +namespace mrdocs { namespace js { struct Access; @@ -89,7 +89,7 @@ class Prop @see Scope */ -class MRDOX_DECL +class MRDOCS_DECL Context { struct Impl; @@ -164,7 +164,7 @@ class Scope @param ctx The context to use. */ - MRDOX_DECL + MRDOCS_DECL Scope(Context const& ctx) noexcept; /** Destructor. @@ -177,7 +177,7 @@ class Scope associated with this scope when it is destroyed. */ - MRDOX_DECL + MRDOCS_DECL ~Scope(); /** Compile and run a script. @@ -193,7 +193,7 @@ class Scope @param jsCode The JavaScript code to execute. */ - MRDOX_DECL + MRDOCS_DECL Expected script(std::string_view jsCode); @@ -210,7 +210,7 @@ class Scope @param jsCode The JavaScript code to execute. */ - MRDOX_DECL + MRDOCS_DECL Expected eval(std::string_view jsCode); @@ -230,7 +230,7 @@ class Scope equivalent to the last non-empty statement value in the code. */ - MRDOX_DECL + MRDOCS_DECL Expected compile_script(std::string_view jsCode); @@ -247,7 +247,7 @@ class Scope return value is the first function compiled. */ - MRDOX_DECL + MRDOCS_DECL Expected compile_function(std::string_view jsCode); @@ -263,7 +263,7 @@ class Scope @param name The name of the global variable. */ - MRDOX_DECL + MRDOCS_DECL Expected getGlobal(std::string_view name); @@ -282,7 +282,7 @@ class Scope error is returned. */ - MRDOX_DECL + MRDOCS_DECL Value getGlobalObject(); }; @@ -313,7 +313,7 @@ class Scope @see Type */ -class MRDOX_DECL Value +class MRDOCS_DECL Value { protected: Scope* scope_; @@ -335,7 +335,7 @@ class MRDOX_DECL Value via @ref Scope::reset. */ - MRDOX_DECL ~Value(); + MRDOCS_DECL ~Value(); /** Constructor @@ -345,7 +345,7 @@ class MRDOX_DECL Value The value is undefined. */ - MRDOX_DECL Value() noexcept; + MRDOCS_DECL Value() noexcept; /** Constructor @@ -353,28 +353,28 @@ class MRDOX_DECL Value value to the stack and associates the new value the top of the stack. */ - MRDOX_DECL Value(Value const&); + MRDOCS_DECL Value(Value const&); /** Constructor The function associates the existing value with this object. */ - MRDOX_DECL Value(Value&&) noexcept; + MRDOCS_DECL Value(Value&&) noexcept; /** Copy assignment. @copydetails Value(Value const&) */ - MRDOX_DECL Value& operator=(Value const&); + MRDOCS_DECL Value& operator=(Value const&); /** Move assignment. @copydetails Value(Value&&) */ - MRDOX_DECL Value& operator=(Value&&) noexcept; + MRDOCS_DECL Value& operator=(Value&&) noexcept; /** Return the type of the value. @@ -397,7 +397,7 @@ class MRDOX_DECL Value internal ECMAScript class `Function`. */ - MRDOX_DECL Type type() const noexcept; + MRDOCS_DECL Type type() const noexcept; /// Check if the value is undefined. bool isUndefined() const noexcept; @@ -520,8 +520,8 @@ class MRDOX_DECL Value `level` is an unsigned integer and `message` is a string. - The mrdox library function - `clang::mrdox::report::print` + The mrdocs library function + `clang::mrdocs::report::print` is then called with these two arguments to report a message to the console. @@ -571,7 +571,7 @@ class MRDOX_DECL Value /** Set or replace the value for a given key. */ - MRDOX_DECL + MRDOCS_DECL void set( std::string_view key, @@ -579,7 +579,7 @@ class MRDOX_DECL Value /** Set or replace the value for a given key. */ - MRDOX_DECL + MRDOCS_DECL void set( std::string_view key, @@ -797,16 +797,16 @@ class MRDOX_DECL Value toString(Value const& value); private: - MRDOX_DECL + MRDOCS_DECL Expected callImpl( std::initializer_list args) const; - MRDOX_DECL + MRDOCS_DECL Expected callImpl(std::span args) const; - MRDOX_DECL + MRDOCS_DECL Expected callPropImpl( std::string_view prop, @@ -854,7 +854,7 @@ inline bool Value::isFunction() const noexcept } } // js -} // mrdox +} // mrdocs } // clang #endif diff --git a/include/mrdox/Support/Lua.hpp b/include/mrdocs/Support/Lua.hpp similarity index 89% rename from include/mrdox/Support/Lua.hpp rename to include/mrdocs/Support/Lua.hpp index 8a27410e2..a4fb532b5 100644 --- a/include/mrdox/Support/Lua.hpp +++ b/include/mrdocs/Support/Lua.hpp @@ -5,16 +5,16 @@ // // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_SUPPORT_LUA_HPP -#define MRDOX_SUPPORT_LUA_HPP +#ifndef MRDOCS_SUPPORT_LUA_HPP +#define MRDOCS_SUPPORT_LUA_HPP -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include @@ -22,7 +22,7 @@ #include namespace clang { -namespace mrdox { +namespace mrdocs { namespace lua { struct Access; @@ -72,7 +72,7 @@ class zstring /** A reference to an instance of a Lua interpreter. */ -class MRDOX_DECL +class MRDOCS_DECL Context { struct Impl; @@ -113,15 +113,15 @@ class Scope void reset(); public: - MRDOX_DECL + MRDOCS_DECL Scope(Context const& ctx) noexcept; - MRDOX_DECL + MRDOCS_DECL ~Scope(); /** Load a Lua chunk */ - MRDOX_DECL + MRDOCS_DECL Expected loadChunk( std::string_view luaChunk, @@ -131,7 +131,7 @@ class Scope /** Load a Lua chunk */ - MRDOX_DECL + MRDOCS_DECL Expected loadChunk( std::string_view luaChunk, @@ -140,7 +140,7 @@ class Scope /** Run a Lua chunk. */ - MRDOX_DECL + MRDOCS_DECL Expected loadChunkFromFile( std::string_view fileName, @@ -149,13 +149,13 @@ class Scope /** Return the global table. */ - MRDOX_DECL + MRDOCS_DECL Table getGlobalTable(); /** Return a value from the global table if it exists. */ - MRDOX_DECL + MRDOCS_DECL Expected getGlobal( std::string_view key, @@ -167,7 +167,7 @@ class Scope /** A lazy container to push values to the Lua stack. */ -class MRDOX_DECL +class MRDOCS_DECL Param { enum class Kind @@ -257,7 +257,7 @@ enum class Type /** A Lua value. */ -class MRDOX_DECL +class MRDOCS_DECL Value { protected: @@ -396,10 +396,10 @@ class String : public Value String(int index, Scope&) noexcept; public: - MRDOX_DECL String(Value value); - MRDOX_DECL explicit String(std::string_view s); + MRDOCS_DECL String(Value value); + MRDOCS_DECL explicit String(std::string_view s); - MRDOX_DECL std::string_view get() const noexcept; + MRDOCS_DECL std::string_view get() const noexcept; std::string_view operator*() const noexcept { @@ -416,7 +416,7 @@ class String : public Value /** A Lua function. */ -class MRDOX_DECL +class MRDOCS_DECL Function : public Value { friend struct Access; @@ -444,20 +444,20 @@ class Table : public Value std::size_t size) const; public: - MRDOX_DECL Table(Scope&, dom::Object const& obj); - MRDOX_DECL Table(Value value); - MRDOX_DECL explicit Table(Scope& scope); + MRDOCS_DECL Table(Scope&, dom::Object const& obj); + MRDOCS_DECL Table(Value value); + MRDOCS_DECL explicit Table(Scope& scope); - //MRDOX_DECL Value get(zstring key) const; + //MRDOCS_DECL Value get(zstring key) const; - MRDOX_DECL + MRDOCS_DECL Value get( std::string_view key) const; /** Create or replace the value with a key. */ - MRDOX_DECL + MRDOCS_DECL void set( std::string_view key, @@ -465,17 +465,17 @@ class Table : public Value }; } // lua -} // mrdox +} // mrdocs } // clang //------------------------------------------------ template<> -struct fmt::formatter +struct fmt::formatter : fmt::formatter { auto format( - clang::mrdox::lua::Value const& value, + clang::mrdocs::lua::Value const& value, fmt::format_context& ctx) const { return fmt::formatter::format( diff --git a/include/mrdox/Support/Path.hpp b/include/mrdocs/Support/Path.hpp similarity index 90% rename from include/mrdox/Support/Path.hpp rename to include/mrdocs/Support/Path.hpp index ad74aea8a..e4adacd9a 100644 --- a/include/mrdox/Support/Path.hpp +++ b/include/mrdocs/Support/Path.hpp @@ -5,23 +5,23 @@ // // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_API_SUPPORT_PATH_HPP -#define MRDOX_API_SUPPORT_PATH_HPP +#ifndef MRDOCS_API_SUPPORT_PATH_HPP +#define MRDOCS_API_SUPPORT_PATH_HPP -#include -#include +#include +#include #include #include namespace clang { -namespace mrdox { +namespace mrdocs { //------------------------------------------------ -struct MRDOX_VISIBLE +struct MRDOCS_VISIBLE AnyFileVisitor { virtual ~AnyFileVisitor() = 0; @@ -34,7 +34,7 @@ struct MRDOX_VISIBLE a directory and invoke the visitor with the path. */ -MRDOX_DECL +MRDOCS_DECL Error forEachFile( std::string_view dirPath, @@ -85,28 +85,28 @@ enum class FileType @param pathName The absolute or relative path to the file. */ -MRDOX_DECL +MRDOCS_DECL Expected getFileType( std::string_view pathName); /** Return true if pathName is absolute. */ -MRDOX_DECL +MRDOCS_DECL bool isAbsolute( std::string_view pathName) noexcept; /** Return an error if pathName is not absolute. */ -MRDOX_DECL +MRDOCS_DECL Error requireAbsolute( std::string_view pathName); /** Return true if pathName ends in a separator. */ -MRDOX_DECL +MRDOCS_DECL bool isDirsy( std::string_view pathName) noexcept; @@ -125,7 +125,7 @@ isDirsy( @param pathName The relative or absolute path. */ -MRDOX_DECL +MRDOCS_DECL std::string normalizePath( std::string_view pathName); @@ -135,28 +135,28 @@ normalizePath( If the parent directory is defined, the returned path will always have a trailing separator. */ -MRDOX_DECL +MRDOCS_DECL std::string getParentDir( std::string_view pathName); /** Return the filename part of the path. */ -MRDOX_DECL +MRDOCS_DECL std::string_view getFileName( std::string_view pathName); /** Return the contents of a file as a string. */ -MRDOX_DECL +MRDOCS_DECL Expected getFileText( std::string_view pathName); /** Append a trailing native separator if not already present. */ -MRDOX_DECL +MRDOCS_DECL std::string makeDirsy( std::string_view pathName); @@ -169,14 +169,14 @@ makeDirsy( @return The absolute path, or an error if any occurred. */ -MRDOX_DECL +MRDOCS_DECL Expected makeAbsolute( std::string_view pathName); /** Return an absolute path from a possibly relative path. */ -MRDOX_DECL +MRDOCS_DECL std::string makeAbsolute( std::string_view pathName, @@ -184,7 +184,7 @@ makeAbsolute( /** Convert all backward slashes to forward slashes. */ -MRDOX_DECL +MRDOCS_DECL std::string makePosixStyle( std::string_view pathName); @@ -199,26 +199,26 @@ makePosixStyle( contains an extension, then the extension is removed. */ -MRDOX_DECL +MRDOCS_DECL std::string withExtension( std::string_view fileName, std::string_view ext); -MRDOX_DECL +MRDOCS_DECL std::string appendPath( std::string_view basePath, std::string_view name); -MRDOX_DECL +MRDOCS_DECL std::string appendPath( std::string_view basePath, std::string_view name1, std::string_view name2); -MRDOX_DECL +MRDOCS_DECL std::string appendPath( std::string_view basePath, @@ -228,14 +228,14 @@ appendPath( /** Return an error if the path is not a directory. */ -MRDOX_DECL +MRDOCS_DECL Error requireDirectory( std::string_view pathName); /** Return the relevant suffix of a source file path. */ -MRDOX_DECL +MRDOCS_DECL std::string_view getSourceFilename( std::string_view pathName); @@ -247,14 +247,14 @@ getSourceFilename( @param pathName The absolute or relative path to create. */ -MRDOX_DECL +MRDOCS_DECL Error createDirectory( std::string_view pathName); } // files -} // mrdox +} // mrdocs } // clang #endif \ No newline at end of file diff --git a/include/mrdox/Support/RangeFor.hpp b/include/mrdocs/Support/RangeFor.hpp similarity index 94% rename from include/mrdox/Support/RangeFor.hpp rename to include/mrdocs/Support/RangeFor.hpp index ff606b010..016d697fd 100644 --- a/include/mrdox/Support/RangeFor.hpp +++ b/include/mrdocs/Support/RangeFor.hpp @@ -6,16 +6,16 @@ // // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_API_SUPPORT_RANGEFOR_HPP -#define MRDOX_API_SUPPORT_RANGEFOR_HPP +#ifndef MRDOCS_API_SUPPORT_RANGEFOR_HPP +#define MRDOCS_API_SUPPORT_RANGEFOR_HPP -#include +#include namespace clang { -namespace mrdox { +namespace mrdocs { /** Range to help range-for loops identify first and last. */ @@ -159,7 +159,7 @@ auto RangeFor::end() const noexcept -> return iterator(C_, C_.end()); } -} // mrdox +} // mrdocs } // clang #endif \ No newline at end of file diff --git a/include/mrdox/Support/String.hpp b/include/mrdocs/Support/String.hpp similarity index 88% rename from include/mrdox/Support/String.hpp rename to include/mrdocs/Support/String.hpp index 40c717968..b30e81e81 100644 --- a/include/mrdox/Support/String.hpp +++ b/include/mrdocs/Support/String.hpp @@ -5,18 +5,18 @@ // // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_API_SUPPORT_STRING_HPP -#define MRDOX_API_SUPPORT_STRING_HPP +#ifndef MRDOCS_API_SUPPORT_STRING_HPP +#define MRDOCS_API_SUPPORT_STRING_HPP -#include +#include #include #include namespace clang { -namespace mrdox { +namespace mrdocs { /** Return the substring without leading horizontal whitespace. */ @@ -76,7 +76,7 @@ trim( return std::string_view(&*left, right - left + 1); } -} // mrdox +} // mrdocs } // clang #endif diff --git a/include/mrdox/Support/ThreadPool.hpp b/include/mrdocs/Support/ThreadPool.hpp similarity index 85% rename from include/mrdox/Support/ThreadPool.hpp rename to include/mrdocs/Support/ThreadPool.hpp index c6cf9ef6e..65c8c6a0c 100644 --- a/include/mrdox/Support/ThreadPool.hpp +++ b/include/mrdocs/Support/ThreadPool.hpp @@ -6,15 +6,15 @@ // // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_API_SUPPORT_THREAD_HPP -#define MRDOX_API_SUPPORT_THREAD_HPP +#ifndef MRDOCS_API_SUPPORT_THREAD_HPP +#define MRDOCS_API_SUPPORT_THREAD_HPP -#include -#include -#include +#include +#include +#include #include #include #include @@ -26,7 +26,7 @@ class ThreadPoolTaskGroup; } // llvm namespace clang { -namespace mrdox { +namespace mrdocs { class TaskGroup; @@ -34,7 +34,7 @@ class TaskGroup; /** A pool of threads for executing work concurrently. */ -class MRDOX_VISIBLE +class MRDOCS_VISIBLE ThreadPool { std::unique_ptr impl_; @@ -49,7 +49,7 @@ class MRDOX_VISIBLE /** Destructor. */ - MRDOX_DECL + MRDOCS_DECL ~ThreadPool(); /** Constructor. @@ -59,20 +59,20 @@ class MRDOX_VISIBLE new threads. Submitted work blocks the caller until the work is complete. */ - MRDOX_DECL + MRDOCS_DECL explicit ThreadPool(); /** Constructor. */ - MRDOX_DECL + MRDOCS_DECL explicit ThreadPool( unsigned concurrency); /** Return the number of threads in the pool. */ - MRDOX_DECL + MRDOCS_DECL unsigned getThreadCount() const noexcept; @@ -100,19 +100,19 @@ class MRDOX_VISIBLE /** Block until all work has completed. */ - MRDOX_DECL + MRDOCS_DECL void wait(); private: - MRDOX_DECL void post(any_callable); + MRDOCS_DECL void post(any_callable); }; //------------------------------------------------ /** A subset of possible work in a thread pool. */ -class MRDOX_VISIBLE +class MRDOCS_VISIBLE TaskGroup { struct Impl; @@ -122,12 +122,12 @@ class MRDOX_VISIBLE public: /** Destructor. */ - MRDOX_DECL + MRDOCS_DECL ~TaskGroup(); /** Constructor. */ - MRDOX_DECL + MRDOCS_DECL explicit TaskGroup( ThreadPool& threadPool); @@ -149,13 +149,13 @@ class MRDOX_VISIBLE @return Zero or more errors which were thrown from submitted work. */ - MRDOX_DECL + MRDOCS_DECL [[nodiscard]] std::vector wait(); private: - MRDOX_DECL void post(any_callable); + MRDOCS_DECL void post(any_callable); }; //------------------------------------------------ @@ -177,7 +177,7 @@ forEach( return taskGroup.wait(); } -} // mrdox +} // mrdocs } // clang #endif diff --git a/include/mrdox/Support/TypeTraits.hpp b/include/mrdocs/Support/TypeTraits.hpp similarity index 94% rename from include/mrdox/Support/TypeTraits.hpp rename to include/mrdocs/Support/TypeTraits.hpp index 7b428f8e8..493282be6 100644 --- a/include/mrdox/Support/TypeTraits.hpp +++ b/include/mrdocs/Support/TypeTraits.hpp @@ -6,16 +6,16 @@ // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) // Copyright (c) 2023 Krystian Stasiowski (sdkrystian@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_TOOL_SUPPORT_TYPE_TRAITS_HPP -#define MRDOX_TOOL_SUPPORT_TYPE_TRAITS_HPP +#ifndef MRDOCS_TOOL_SUPPORT_TYPE_TRAITS_HPP +#define MRDOCS_TOOL_SUPPORT_TYPE_TRAITS_HPP #include namespace clang { -namespace mrdox { +namespace mrdocs { /** Return the value as its underlying type. */ @@ -119,7 +119,7 @@ template using add_cvref_from_t = add_cvref_from::type; -} // mrdox +} // mrdocs } // clang #endif diff --git a/include/mrdox/Support/any_callable.hpp b/include/mrdocs/Support/any_callable.hpp similarity index 86% rename from include/mrdox/Support/any_callable.hpp rename to include/mrdocs/Support/any_callable.hpp index 0cba05c50..830656d0f 100644 --- a/include/mrdox/Support/any_callable.hpp +++ b/include/mrdocs/Support/any_callable.hpp @@ -5,19 +5,19 @@ // // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_API_SUPPORT_ANY_CALLABLE_HPP -#define MRDOX_API_SUPPORT_ANY_CALLABLE_HPP +#ifndef MRDOCS_API_SUPPORT_ANY_CALLABLE_HPP +#define MRDOCS_API_SUPPORT_ANY_CALLABLE_HPP -#include +#include #include #include #include namespace clang { -namespace mrdox { +namespace mrdocs { /** A movable, type-erased function object. @@ -72,7 +72,7 @@ class any_callable } }; -} // mrdox +} // mrdocs } // clang #endif diff --git a/include/mrdox/Support/source_location.hpp b/include/mrdocs/Support/source_location.hpp similarity index 88% rename from include/mrdox/Support/source_location.hpp rename to include/mrdocs/Support/source_location.hpp index 82a7c16f5..984a7a001 100644 --- a/include/mrdox/Support/source_location.hpp +++ b/include/mrdocs/Support/source_location.hpp @@ -5,11 +5,11 @@ // // Copyright (c) 2023 Krystian Stasiowski (sdkrystian@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_API_SUPPORT_SOURCE_LOCATION_HPP -#define MRDOX_API_SUPPORT_SOURCE_LOCATION_HPP +#ifndef MRDOCS_API_SUPPORT_SOURCE_LOCATION_HPP +#define MRDOCS_API_SUPPORT_SOURCE_LOCATION_HPP #include @@ -18,17 +18,17 @@ #include namespace clang { - namespace mrdox { + namespace mrdocs { using std::source_location; - } // mrdox + } // mrdocs } // clang #else #include namespace clang { - namespace mrdox { + namespace mrdocs { struct source_location { @@ -83,7 +83,7 @@ std::uint_least32_t column_ = 0; }; -} // mrdox +} // mrdocs } // clang #endif #endif diff --git a/include/mrdox/Support/unlock_guard.hpp b/include/mrdocs/Support/unlock_guard.hpp similarity index 74% rename from include/mrdox/Support/unlock_guard.hpp rename to include/mrdocs/Support/unlock_guard.hpp index 701f9b36d..1b5164e3f 100644 --- a/include/mrdox/Support/unlock_guard.hpp +++ b/include/mrdocs/Support/unlock_guard.hpp @@ -5,17 +5,17 @@ // // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_API_SUPPORT_UNLOCK_GUARD_HPP -#define MRDOX_API_SUPPORT_UNLOCK_GUARD_HPP +#ifndef MRDOCS_API_SUPPORT_UNLOCK_GUARD_HPP +#define MRDOCS_API_SUPPORT_UNLOCK_GUARD_HPP -#include +#include #include namespace clang { -namespace mrdox { +namespace mrdocs { /** A scoped guard which unlocks a mutex. */ @@ -41,7 +41,7 @@ class unlock_guard } }; -} // mrdox +} // mrdocs } // clang #endif diff --git a/include/mrdox/Version.hpp b/include/mrdocs/Version.hpp similarity index 68% rename from include/mrdox/Version.hpp rename to include/mrdocs/Version.hpp index 8eda180c9..b12a12b5f 100644 --- a/include/mrdox/Version.hpp +++ b/include/mrdocs/Version.hpp @@ -5,22 +5,22 @@ // // Copyright (c) 2023 Klemens D. Morgenstern // -// Official repository: https://github.com/cppalliance/mrdox +// Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOX_VERSION_HPP -#define MRDOX_VERSION_HPP +#ifndef MRDOCS_VERSION_HPP +#define MRDOCS_VERSION_HPP #include namespace clang { -namespace mrdox { +namespace mrdocs { constexpr std::string_view project_version = "1.0.0"; -constexpr std::string_view project_name = "MrDox"; +constexpr std::string_view project_name = "MrDocs"; constexpr std::string_view project_description = "C++ Documentation Tool"; -} // mrdox +} // mrdocs } // clang #endif diff --git a/include/mrdox/mrdox.natvis b/include/mrdocs/mrdocs.natvis similarity index 74% rename from include/mrdox/mrdox.natvis rename to include/mrdocs/mrdocs.natvis index a00c9cfc3..fd676a280 100644 --- a/include/mrdox/mrdox.natvis +++ b/include/mrdocs/mrdocs.natvis @@ -13,14 +13,14 @@ - + {data_[0],nvoXb}{data_[1],nvoXb}{data_[2],nvoXb}{data_[3],nvoXb}{data_[4],nvoXb}{data_[5],nvoXb}{data_[6],nvoXb}{data_[7],nvoXb}{data_[8],nvoXb}{data_[9],nvoXb}{data_[10],nvoXb}{data_[11],nvoXb}{data_[12],nvoXb}{data_[13],nvoXb}{data_[14],nvoXb}{data_[15],nvoXb}{data_[16],nvoXb}{data_[17],nvoXb}{data_[18],nvoXb}{data_[19],nvoXb} empty SymbolID - + {t_} empty @@ -29,14 +29,14 @@ - + {val_} {->unex_} - + {psz_,s} {((char*)(impl_+1))+1,s} {((char*)(impl_+1))+2,s} @@ -51,11 +51,11 @@ [ doc::String ] - + [ dom::Array ] - + @@ -74,31 +74,31 @@ - - undefined - null - {b_} - {i_} - {str_} - {str_} - {arr_} - {obj_} - {fn_} + + undefined + null + {b_} + {i_} + {str_} + {str_} + {arr_} + {obj_} + {fn_} invalid - b_ - i_ - str_ - str_ - arr_ - obj_ - fn_ + b_ + i_ + str_ + str_ + arr_ + obj_ + fn_ - + doc::Block[{_Mypair._Myval2._Myend-_Mypair._Myval2._Myfirst}] @@ -107,7 +107,7 @@ - + doc::Block[{_Mypair._Myval2._Myend-_Mypair._Myval2._Myfirst}] @@ -117,9 +117,9 @@ - + - [ Admonition {(*(clang::mrdox::doc::Admonition*)this).admonish} ] + [ Admonition {(*(clang::mrdocs::doc::Admonition*)this).admonish} ] [ Brief ] [ Code] [ doc::Heading ] @@ -134,7 +134,7 @@ - + [ doc::Styled ] [ doc::Link ] {string} @@ -142,17 +142,17 @@ - + - + [ js::Access ] - + [ js::Scope ] - + undefined null {b_} @@ -165,16 +165,16 @@ {obj_} - + duk_value@{idx_} - + {pattern_} - +