diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index c05cd7754..dd5b7bf31 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -38,7 +38,7 @@ jobs:
clang >=18
msvc >=14.40
apple-clang *
- standards: '20'
+ standards: '23'
latest-factors: |
msvc Optimized-Debug
gcc Coverage
@@ -287,26 +287,6 @@ jobs:
run-tests: false
trace-commands: true
- - name: Install Fmt
- uses: alandefreitas/cpp-actions/cmake-workflow@v1.8.10
- with:
- source-dir: ../third-party/fmt
- git-repository: https://github.com/fmtlib/fmt
- git-tag: 10.2.1
- build-dir: ${sourceDir}/build
- cc: ${{ steps.setup-cpp.outputs.cc }}
- cxx: ${{ steps.setup-cpp.outputs.cxx }}
- ccflags: ${{ matrix.ccflags }}
- cxxflags: ${{ matrix.cxxflags }}
- build-type: ${{ matrix.build-type }}
- extra-args: |
- -D FMT_DOC=OFF
- -D FMT_TEST=OFF
- install: true
- install-prefix: ${sourceDir}/install
- run-tests: false
- trace-commands: true
-
- name: Install Libxml2
uses: alandefreitas/cpp-actions/cmake-workflow@v1.8.10
if: matrix.compiler == 'msvc'
@@ -384,7 +364,6 @@ jobs:
-D Clang_ROOT=../third-party/llvm-project/install
-D duktape_ROOT=../third-party/duktape/install
-D Duktape_ROOT=../third-party/duktape/install
- -D fmt_ROOT=../third-party/fmt/install
${{ runner.os == 'Windows' && '-D libxml2_ROOT=../third-party/libxml2/install' || '' }}
${{ runner.os == 'Windows' && '-D LibXml2_ROOT=../third-party/libxml2/install' || '' }}
export-compile-commands: true
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8cf953cd8..b6f1c987d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -119,9 +119,6 @@ llvm_map_components_to_libnames(llvm_libs all)
string(REGEX REPLACE " /W[0-4]" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
string(REGEX REPLACE " /W[0-4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
-# fmt
-find_package(fmt REQUIRED CONFIG)
-
# Duktape
find_package(Duktape CONFIG)
if (NOT DUKTAPE_FOUND)
@@ -214,7 +211,7 @@ list(APPEND LIB_SOURCES
${CMAKE_CURRENT_BINARY_DIR}/src/lib/Lib/PublicSettings.cpp
)
add_library(mrdocs-core ${LIB_SOURCES})
-target_compile_features(mrdocs-core PUBLIC cxx_std_20)
+target_compile_features(mrdocs-core PUBLIC cxx_std_23)
target_include_directories(mrdocs-core
PUBLIC
"$"
@@ -234,7 +231,6 @@ target_compile_definitions(
# Dependencies
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)
target_include_directories(mrdocs-core SYSTEM PRIVATE ${DUKTAPE_INCLUDE_DIRS})
target_link_libraries(mrdocs-core PRIVATE ${DUKTAPE_LIBRARY})
diff --git a/docs/modules/ROOT/pages/install.adoc b/docs/modules/ROOT/pages/install.adoc
index 1b662d0a4..44a21dc1d 100644
--- a/docs/modules/ROOT/pages/install.adoc
+++ b/docs/modules/ROOT/pages/install.adoc
@@ -116,27 +116,6 @@ These instructions assume all dependencies are installed in the `third-party` di
Feel free to install them anywhere you want and adjust the main MrDocs configuration command later.
====
-[#install-fmt]
-=== Fmt
-
-MrDocs uses the `fmt` library for formatting strings.
-From the `third-party` directory, you can clone the `fmt` repository and install it with the following commands:
-
-[source,bash]
-----
-git clone https://github.com/fmtlib/fmt --branch 10.2.1 --depth 1 <.>
-cd fmt
-cmake -S . -B ./build -DCMAKE_BUILD_TYPE=Release -D FMT_DOC=OFF -D FMT_TEST=OFF <.>
-cmake --build ./build --config Release <.>
-cmake --install ./build --prefix ./install <.>
-cd ..
-----
-
-<.> Shallow clones the fmt repository.
-<.> Configure the fmt library with CMake, excluding the documentation and tests.
-<.> Builds the fmt library in the `build` directory.
-<.> Installs the fmt library in the `install` directory.
-
[IMPORTANT]
====
All instructions in this document assume you are using a CMake version above 3.26.
@@ -376,7 +355,7 @@ cd ../..
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_ROOT`, `FMT_ROOT`, and `LIBXML2_ROOT` environment variables.
+To specify the installation directories, you can use the `LLVM_ROOT`, `DUKTAPE_ROOT`, and `LIBXML2_ROOT` environment variables.
To specify a generator (`-G`) and platform name (`-A`), you can use the `CMAKE_GENERATOR` and `CMAKE_GENERATOR_PLATFORM` environment variables.
You can also customize the presets by duplicating and editing the `CMakeUserPresets.json.example` file in the `mrdocs` directory.
diff --git a/include/mrdocs/Dom/Object.ipp b/include/mrdocs/Dom/Object.ipp
index f3c332eca..4eef5b1b3 100644
--- a/include/mrdocs/Dom/Object.ipp
+++ b/include/mrdocs/Dom/Object.ipp
@@ -149,14 +149,15 @@ Object::visit(F&& fn) const
//------------------------------------------------
template<>
-struct fmt::formatter
- : fmt::formatter
+struct std::formatter
+ : std::formatter
{
+ template
auto format(
clang::mrdocs::dom::Object const& value,
- fmt::format_context& ctx) const
+ FmtContext& ctx) const
{
- return fmt::formatter::format(
+ return std::formatter::format(
toString(value), ctx);
}
};
diff --git a/include/mrdocs/Dom/String.hpp b/include/mrdocs/Dom/String.hpp
index ff690c8f5..fb6c5de71 100644
--- a/include/mrdocs/Dom/String.hpp
+++ b/include/mrdocs/Dom/String.hpp
@@ -11,9 +11,9 @@
#ifndef MRDOCS_API_DOM_STRING_HPP
#define MRDOCS_API_DOM_STRING_HPP
+#include
#include
#include
-#include
namespace clang {
namespace mrdocs {
@@ -341,17 +341,13 @@ class MRDOCS_DECL
//------------------------------------------------
-template<>
-struct fmt::formatter
- : fmt::formatter
-{
- auto format(
- clang::mrdocs::dom::String const& value,
- fmt::format_context& ctx) const
- {
- return fmt::formatter::format(
- value.get(), ctx);
- }
+template <>
+struct std::formatter
+ : std::formatter {
+ template
+ auto format(clang::mrdocs::dom::String const &value, FmtContext &ctx) const {
+ return std::formatter::format(value.get(), ctx);
+ }
};
#endif
diff --git a/include/mrdocs/Dom/Value.hpp b/include/mrdocs/Dom/Value.hpp
index e05686c91..74f1a75fd 100644
--- a/include/mrdocs/Dom/Value.hpp
+++ b/include/mrdocs/Dom/Value.hpp
@@ -11,18 +11,19 @@
#ifndef MRDOCS_API_DOM_VALUE_HPP
#define MRDOCS_API_DOM_VALUE_HPP
-#include
+#include
+#include
+#include
+#include
#include
-#include
#include
+#include
#include
#include
-#include
+#include
#include
#include // BAD
#include
-#include
-#include
namespace clang {
namespace mrdocs {
@@ -849,17 +850,13 @@ safeString(SV const& str) {
//------------------------------------------------
-template<>
-struct fmt::formatter
- : public fmt::formatter
-{
- auto format(
- clang::mrdocs::dom::Value const& value,
- fmt::format_context& ctx) const
- {
- return fmt::formatter::format(
- toString(value), ctx);
- }
+template <>
+struct std::formatter
+ : public std::formatter {
+ template
+ auto format(clang::mrdocs::dom::Value const &value, FmtContext &ctx) const {
+ return std::formatter::format(toString(value), ctx);
+ }
};
#endif
diff --git a/include/mrdocs/Metadata/Javadoc.hpp b/include/mrdocs/Metadata/Javadoc.hpp
index b00d249cb..0f8d57b83 100644
--- a/include/mrdocs/Metadata/Javadoc.hpp
+++ b/include/mrdocs/Metadata/Javadoc.hpp
@@ -13,15 +13,16 @@
#ifndef MRDOCS_API_METADATA_JAVADOC_HPP
#define MRDOCS_API_METADATA_JAVADOC_HPP
-#include
-#include
-#include
-#include
+#include
+#include
#include
-#include
-#include
#include
-#include
+#include
+#include
+#include
+#include
+#include
+#include
#include
#include
#include
diff --git a/include/mrdocs/Support/Error.hpp b/include/mrdocs/Support/Error.hpp
index dbef752fd..dc24e5110 100644
--- a/include/mrdocs/Support/Error.hpp
+++ b/include/mrdocs/Support/Error.hpp
@@ -12,17 +12,18 @@
#ifndef MRDOCS_API_SUPPORT_ERROR_HPP
#define MRDOCS_API_SUPPORT_ERROR_HPP
-#include
-#include
-#include
#include
+#include
+#include
#include
+#include
+#include
#include
#include
+#include
#include
#include
#include
-#include
namespace clang::mrdocs {
@@ -256,28 +257,20 @@ struct std::hash<::clang::mrdocs::Error>
}
};
-template<>
-struct fmt::formatter
- : fmt::formatter
-{
- auto format(
- clang::mrdocs::Error const& err,
- fmt::format_context& ctx) const
- {
- return fmt::formatter::format(err.message(), ctx);
- }
+template <>
+struct std::formatter : std::formatter {
+ template
+ auto format(clang::mrdocs::Error const &err, FmtContext &ctx) const {
+ return std::formatter::format(err.message(), ctx);
+ }
};
-template<>
-struct fmt::formatter
- : fmt::formatter
-{
- auto format(
- std::error_code const& ec,
- fmt::format_context& ctx) const
- {
- return fmt::formatter::format(ec.message(), ctx);
- }
+template <>
+struct std::formatter : std::formatter {
+ template
+ auto format(std::error_code const &ec, FmtContext &ctx) const {
+ return std::formatter::format(ec.message(), ctx);
+ }
};
namespace clang::mrdocs {
@@ -353,9 +346,8 @@ formatError(
Args&&... args)
{
std::string s;
- fmt::vformat_to(
- std::back_inserter(s),
- fs.fs, fmt::make_format_args(args...));
+ std::vformat_to(std::back_inserter(s), fs.fs,
+ std::make_format_args(args...));
return Error(std::move(s), fs.loc);
}
diff --git a/include/mrdocs/Support/Expected.hpp b/include/mrdocs/Support/Expected.hpp
index 729d89268..f40f74919 100644
--- a/include/mrdocs/Support/Expected.hpp
+++ b/include/mrdocs/Support/Expected.hpp
@@ -12,19 +12,18 @@
#ifndef MRDOCS_API_SUPPORT_EXPECTED_HPP
#define MRDOCS_API_SUPPORT_EXPECTED_HPP
-#include
-#include
-#include
-#include
#include
+#include
#include
#include
+#include
+#include
+#include
#include
#include
#include
#include
#include
-#include
namespace clang::mrdocs {
diff --git a/include/mrdocs/Support/Handlebars.hpp b/include/mrdocs/Support/Handlebars.hpp
index 1109f759a..784c9bd6a 100644
--- a/include/mrdocs/Support/Handlebars.hpp
+++ b/include/mrdocs/Support/Handlebars.hpp
@@ -11,14 +11,15 @@
#ifndef MRDOCS_TOOL_SUPPORT_PATH_HPP
#define MRDOCS_TOOL_SUPPORT_PATH_HPP
-#include
+#include
+#include
#include
+#include
#include
-#include
-#include
#include
-#include
+#include
#include
+#include
namespace clang {
namespace mrdocs {
@@ -45,15 +46,10 @@ struct HandlebarsError
HandlebarsError(std::string_view msg)
: std::runtime_error(std::string(msg)) {}
- HandlebarsError(
- std::string_view msg,
- std::size_t line_,
- std::size_t column_,
- std::size_t pos_)
- : std::runtime_error(fmt::format("{} - {}:{}", msg, line_, column_))
- , line(line_)
- , column(column_)
- , pos(pos_) {}
+ HandlebarsError(std::string_view msg, std::size_t line_,
+ std::size_t column_, std::size_t pos_)
+ : std::runtime_error(std::format("{} - {}:{}", msg, line_, column_)),
+ line(line_), column(column_), pos(pos_) {}
};
namespace detail {
@@ -218,9 +214,9 @@ class MRDOCS_DECL OutputRef
@return A reference to this object
*/
template
- requires fmt::is_formattable::value
+ requires std::formattable
friend OutputRef &operator<<(OutputRef &os, T v) {
- std::string s = fmt::format("{}", v);
+ std::string s = std::format("{}", v);
return os.write_impl(s);
}
diff --git a/include/mrdocs/Support/Lua.hpp b/include/mrdocs/Support/Lua.hpp
index a4fb532b5..89bca4049 100644
--- a/include/mrdocs/Support/Lua.hpp
+++ b/include/mrdocs/Support/Lua.hpp
@@ -11,13 +11,12 @@
#ifndef MRDOCS_SUPPORT_LUA_HPP
#define MRDOCS_SUPPORT_LUA_HPP
-#include
+#include
+#include
#include
+#include
#include
#include
-#include
-#include
-#include
#include
#include
@@ -470,17 +469,12 @@ class Table : public Value
//------------------------------------------------
-template<>
-struct fmt::formatter
- : fmt::formatter
-{
- auto format(
- clang::mrdocs::lua::Value const& value,
- fmt::format_context& ctx) const
- {
- return fmt::formatter::format(
- value.displayString(), ctx);
- }
+template <>
+struct std::formatter : std::formatter {
+ template
+ auto format(clang::mrdocs::lua::Value const &value, FmtContext &ctx) const {
+ return std::formatter::format(value.displayString(), ctx);
+ }
};
#endif
diff --git a/include/mrdocs/Support/Report.hpp b/include/mrdocs/Support/Report.hpp
index db893db16..050b1ae1f 100644
--- a/include/mrdocs/Support/Report.hpp
+++ b/include/mrdocs/Support/Report.hpp
@@ -12,19 +12,19 @@
#ifndef MRDOCS_API_SUPPORT_REPORT_HPP
#define MRDOCS_API_SUPPORT_REPORT_HPP
-#include
-#include
-#include
-#include
#include
+#include
+#include
#include
#include
+#include
+#include
+#include
#include
#include
#include
#include
#include
-#include
namespace clang::mrdocs::report {
@@ -142,13 +142,9 @@ log_impl(
Arg0&& arg0,
Args&&... args)
{
- std::string str = fmt::vformat(
- fs.value,
- fmt::make_format_args(arg0, args...));
- return print(
- level,
- str,
- &fs.where);
+ std::string str =
+ std::vformat(fs.value, std::make_format_args(arg0, args...));
+ return print(level, str, &fs.where);
}
template
@@ -163,9 +159,8 @@ log_impl(
// the information relevant to the user from
// the information relevant for bug tracking
// so that users can understand the message.
- std::string str = fmt::vformat(
- fs.value,
- fmt::make_format_args(e.reason(), args...));
+ std::string str =
+ std::vformat(fs.value, std::make_format_args(e.reason(), args...));
return print(
level,
str,
@@ -179,12 +174,8 @@ log_impl(
Level level,
Located fs)
{
- std::string str = fmt::vformat(
- fs.value, fmt::make_format_args());
- return print(
- level,
- str,
- &fs.where);
+ std::string str = std::vformat(fs.value, std::make_format_args());
+ return print(level, str, &fs.where);
}
}
diff --git a/src/lib/AST/ParseJavadoc.cpp b/src/lib/AST/ParseJavadoc.cpp
index 1a9006ef1..a8cefb277 100644
--- a/src/lib/AST/ParseJavadoc.cpp
+++ b/src/lib/AST/ParseJavadoc.cpp
@@ -13,19 +13,20 @@
//
#include "ParseJavadoc.hpp"
+#include "lib/AST/ParseRef.hpp"
+#include
+#include
+#include
+#include
+#include
+#include
+#include
#include
+#include
#include
#include
-#include
#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include "lib/AST/ParseRef.hpp"
-#include
+#include
#ifdef _MSC_VER
#pragma warning(push)
@@ -466,14 +467,10 @@ class JavadocVisitor
//------------------------------------------------
-std::string&
-JavadocVisitor::
-ensureUTF8(
- std::string&& s)
-{
- if (!llvm::json::isUTF8(s))
- s = llvm::json::fixUTF8(s);
- return s;
+std::string &JavadocVisitor::ensureUTF8(std::string &&s) {
+ if (!llvm::json::isUTF8(s))
+ s = llvm::json::fixUTF8(s);
+ return static_cast(s);
}
/* Parse the inline content of a text
@@ -785,7 +782,9 @@ parseHTMLTag(HTMLStartTagComment const* C)
*static_cast(*tagEndIt);
if(cEndTag.getTagName() != res.tag)
{
- return Unexpected(Error(fmt::format("warning: HTML <{}> tag not followed by same end tag ({}> found)", res.tag, cEndTag.getTagName().str())));
+ return Unexpected(Error(std::format(
+ "warning: HTML <{}> tag not followed by same end tag ({}> found)",
+ res.tag, cEndTag.getTagName().str())));
}
// Check if all the siblings are text nodes
@@ -795,7 +794,8 @@ parseHTMLTag(HTMLStartTagComment const* C)
});
if (!areAllText)
{
- return Unexpected(Error(fmt::format("warning: HTML <{}> tag not followed by text", res.tag)));
+ return Unexpected(Error(
+ std::format("warning: HTML <{}> tag not followed by text", res.tag)));
}
// Extract text from all the siblings
@@ -829,7 +829,9 @@ visitHTMLStartTagComment(
});
if (attr_it == idxs.end())
{
- return Unexpected(Error(fmt::format("warning: HTML <{}> tag has no {} attribute", C->getTagName().str(), name.str())));
+ return Unexpected(
+ Error(std::format("warning: HTML <{}> tag has no {} attribute",
+ C->getTagName().str(), name.str())));
}
return C->getAttr(*attr_it).Value.str();
};
@@ -870,7 +872,9 @@ visitHTMLStartTagComment(
}
else
{
- report::warn(fmt::format("warning: unsupported HTML tag <{}>", tagComponents.tag), filename, loc.getLine());
+ report::warn(
+ std::format("warning: unsupported HTML tag <{}>", tagComponents.tag),
+ filename, loc.getLine());
}
// Skip the children we consumed in parseHTMLTag
it_ += tagComponents.n_siblings;
@@ -1756,13 +1760,10 @@ goodArgCount(std::size_t n,
{
auto loc = sm_.getPresumedLoc(C.getBeginLoc());
- diags_.error(fmt::format(
- "Expected {} but got {} args\n"
- "File: {}, line {}, col {}\n",
- n, C.getNumArgs(),
- loc.getFilename(),
- loc.getLine(),
- loc.getColumn()));
+ diags_.error(std::format("Expected {} but got {} args\n"
+ "File: {}, line {}, col {}\n",
+ n, C.getNumArgs(), loc.getFilename(),
+ loc.getLine(), loc.getColumn()));
return false;
}
diff --git a/src/lib/AST/ParseRef.cpp b/src/lib/AST/ParseRef.cpp
index 6209f011c..626ee8594 100644
--- a/src/lib/AST/ParseRef.cpp
+++ b/src/lib/AST/ParseRef.cpp
@@ -16,6 +16,8 @@
#include
#include
+#include
+
namespace clang::mrdocs {
namespace {
@@ -991,17 +993,19 @@ class RefParser
// Check if the type is named
if (!dest->isNamed())
{
- setError(fmt::format("expected named type for '{}' specifier", signStr));
- ptr_ = start;
- return false;
+ setError(std::format("expected named type for '{}' specifier",
+ signStr));
+ ptr_ = start;
+ return false;
}
// Check if the type is "int" or "char"
auto& namedParam = dynamic_cast(*dest);
if (!namedParam.FundamentalType)
{
- setError(fmt::format("expected fundamental type for '{}' specifier", signStr));
- ptr_ = start;
- return false;
+ setError(std::format(
+ "expected fundamental type for '{}' specifier", signStr));
+ ptr_ = start;
+ return false;
}
bool promoted =
explicitlySigned ?
@@ -1009,9 +1013,10 @@ class RefParser
makeUnsigned(*namedParam.FundamentalType);
if (!promoted)
{
- setError(fmt::format("expected 'int' or 'char' for '{}' specifier", signStr));
- ptr_ = start;
- return false;
+ setError(std::format(
+ "expected 'int' or 'char' for '{}' specifier", signStr));
+ ptr_ = start;
+ return false;
}
// Add the specifier to the type name
namedParam.Name->Name = toString(*namedParam.FundamentalType);
diff --git a/src/lib/Dom/Object.cpp b/src/lib/Dom/Object.cpp
index a3b046e10..fcdab886a 100644
--- a/src/lib/Dom/Object.cpp
+++ b/src/lib/Dom/Object.cpp
@@ -8,10 +8,10 @@
// Official repository: https://github.com/cppalliance/mrdocs
//
+#include
+#include
#include
#include
-#include
-#include
#include
namespace clang {
@@ -90,8 +90,7 @@ operator==(Object const& a, Object const& b) noexcept
std::string
toString(Object const& obj)
{
- return fmt::format(
- "[object {}]", obj.type_key());
+ return std::format("[object {}]", obj.type_key());
}
//------------------------------------------------
diff --git a/src/lib/Dom/String.cpp b/src/lib/Dom/String.cpp
index 572606579..6e1b5d147 100644
--- a/src/lib/Dom/String.cpp
+++ b/src/lib/Dom/String.cpp
@@ -8,8 +8,9 @@
// Official repository: https://github.com/cppalliance/mrdocs
//
-#include
#include
+#include
+#include
namespace clang {
namespace mrdocs {
diff --git a/src/lib/Gen/hbs/Builder.cpp b/src/lib/Gen/hbs/Builder.cpp
index c6f1eddeb..e9fcf30a0 100644
--- a/src/lib/Gen/hbs/Builder.cpp
+++ b/src/lib/Gen/hbs/Builder.cpp
@@ -10,13 +10,13 @@
//
#include "Builder.hpp"
+#include
+#include
#include
+#include
#include
#include
#include
-#include
-#include
-#include
namespace clang {
namespace mrdocs {
@@ -246,8 +246,10 @@ Builder(
hbs_.registerHelper("relativize", dom::makeInvocable(relativize_fn));
// Load layout templates
- std::string indexTemplateFilename = fmt::format("index.{}.hbs", domCorpus.fileExtension);
- std::string wrapperTemplateFilename = fmt::format("wrapper.{}.hbs", domCorpus.fileExtension);
+ std::string indexTemplateFilename =
+ std::format("index.{}.hbs", domCorpus.fileExtension);
+ std::string wrapperTemplateFilename =
+ std::format("wrapper.{}.hbs", domCorpus.fileExtension);
for (std::string const& filename : {indexTemplateFilename, wrapperTemplateFilename})
{
std::string pathName = files::appendPath(layoutDir(), filename);
@@ -319,22 +321,22 @@ Expected
Builder::
operator()(std::ostream& os, T const& I)
{
- std::string const templateFile = fmt::format("index.{}.hbs", domCorpus.fileExtension);
- dom::Object const ctx = createContext(I);
+ std::string const templateFile =
+ std::format("index.{}.hbs", domCorpus.fileExtension);
+ dom::Object const ctx = createContext(I);
- if (auto& config = domCorpus->config;
- config->embedded ||
- !config->multipage)
- {
- // Single page or embedded pages render the index template directly
- // without the wrapper
- return callTemplate(os, templateFile, ctx);
- }
+ if (auto &config = domCorpus->config;
+ config->embedded || !config->multipage) {
+ // Single page or embedded pages render the index template directly
+ // without the wrapper
+ return callTemplate(os, templateFile, ctx);
+ }
// Multipage output: render the wrapper template
// The context receives the original symbol and the contents from rendering
// the index template
- auto const wrapperFile = fmt::format("wrapper.{}.hbs", domCorpus.fileExtension);
+ auto const wrapperFile =
+ std::format("wrapper.{}.hbs", domCorpus.fileExtension);
dom::Object const wrapperCtx = createFrame(ctx);
wrapperCtx.set("contents", dom::makeInvocable([this, &I, templateFile, &os](
dom::Value const&) -> Expected
@@ -356,29 +358,26 @@ renderWrapped(
std::ostream& os,
std::function()> contentsCb)
{
- auto const wrapperFile = fmt::format(
- "wrapper.{}.hbs", domCorpus.fileExtension);
- dom::Object ctx;
- ctx.set("contents", dom::makeInvocable([&](
- dom::Value const&) -> Expected
- {
- MRDOCS_TRY(contentsCb());
- return {};
- }));
-
- // Render the wrapper directly to ostream
- auto pathName = files::appendPath(layoutDir(), wrapperFile);
- MRDOCS_TRY(auto fileText, files::getFileText(pathName));
- HandlebarsOptions options;
- options.escapeFunction = escapeFn_;
- OutputRef outRef(os);
- Expected exp =
- hbs_.try_render_to(
- outRef, fileText, ctx, options);
- if (!exp)
- {
- Error(exp.error().what()).Throw();
- }
+ auto const wrapperFile =
+ std::format("wrapper.{}.hbs", domCorpus.fileExtension);
+ dom::Object ctx;
+ ctx.set("contents",
+ dom::makeInvocable([&](dom::Value const &) -> Expected {
+ MRDOCS_TRY(contentsCb());
+ return {};
+ }));
+
+ // Render the wrapper directly to ostream
+ auto pathName = files::appendPath(layoutDir(), wrapperFile);
+ MRDOCS_TRY(auto fileText, files::getFileText(pathName));
+ HandlebarsOptions options;
+ options.escapeFunction = escapeFn_;
+ OutputRef outRef(os);
+ Expected exp =
+ hbs_.try_render_to(outRef, fileText, ctx, options);
+ if (!exp) {
+ Error(exp.error().what()).Throw();
+ }
return {};
}
diff --git a/src/lib/Gen/hbs/HandlebarsCorpus.cpp b/src/lib/Gen/hbs/HandlebarsCorpus.cpp
index d83722b0f..5e4314025 100644
--- a/src/lib/Gen/hbs/HandlebarsCorpus.cpp
+++ b/src/lib/Gen/hbs/HandlebarsCorpus.cpp
@@ -12,11 +12,9 @@
#include "HandlebarsCorpus.hpp"
#include "VisitorHelpers.hpp"
-#include
#include
-#include
-#include
#include
+#include
#include
#include
diff --git a/src/lib/Lib/Diagnostics.hpp b/src/lib/Lib/Diagnostics.hpp
index 18e8434c5..c3f6c0141 100644
--- a/src/lib/Lib/Diagnostics.hpp
+++ b/src/lib/Lib/Diagnostics.hpp
@@ -11,8 +11,9 @@
#ifndef MRDOCS_LIB_TOOL_DIAGNOSTICS_HPP
#define MRDOCS_LIB_TOOL_DIAGNOSTICS_HPP
-#include
+#include
#include
+#include
#include
#include
@@ -86,23 +87,19 @@ class Diagnostics
auto const warnCount = messages_.size() - errorCount_;
if (errorCount_ > 0)
{
- fmt::format_to(
- std::back_inserter(s),
- "{} error{}", errorCount_,
- errorCount_ > 1 ? "s" : "");
+ std::format_to(std::back_inserter(s), "{} error{}", errorCount_,
+ errorCount_ > 1 ? "s" : "");
}
if (warnCount > 0)
{
if(errorCount_ > 0)
{
- fmt::format_to(std::back_inserter(s), " and " );
+ std::format_to(std::back_inserter(s), " and ");
}
- fmt::format_to(
- std::back_inserter(s),
- "{} warning{}.\n", warnCount,
- warnCount > 1 ? "s" : "");
+ std::format_to(std::back_inserter(s), "{} warning{}.\n", warnCount,
+ warnCount > 1 ? "s" : "");
}
- fmt::format_to(std::back_inserter(s), " total.");
+ std::format_to(std::back_inserter(s), " total.");
report::print(level, s);
}
diff --git a/src/lib/Lib/MrDocsCompilationDatabase.cpp b/src/lib/Lib/MrDocsCompilationDatabase.cpp
index 9f8df357d..42e9b6623 100644
--- a/src/lib/Lib/MrDocsCompilationDatabase.cpp
+++ b/src/lib/Lib/MrDocsCompilationDatabase.cpp
@@ -9,22 +9,22 @@
// Official repository: https://github.com/cppalliance/mrdocs
//
-#include "lib/Support/Debug.hpp"
-#include "lib/Support/Path.hpp"
+#include "lib/Lib/MrDocsCompilationDatabase.hpp"
#include "lib/Lib/ConfigImpl.hpp"
#include "lib/Lib/ExecuteAndWaitWithLogging.hpp"
-#include "lib/Lib/MrDocsCompilationDatabase.hpp"
-#include
-#include
+#include "lib/Support/Debug.hpp"
+#include "lib/Support/Path.hpp"
#include
#include
#include
#include
+#include
#include
#include
#include
#include
#include
+#include
#include
namespace clang {
@@ -413,7 +413,7 @@ adjustCommandLine(
// These are additional defines specified in the config file
for(auto const& def : (*config)->defines)
{
- new_cmdline.emplace_back(fmt::format("-D{}", def));
+ new_cmdline.emplace_back(std::format("-D{}", def));
}
new_cmdline.emplace_back("-D__MRDOCS__");
@@ -430,7 +430,7 @@ adjustCommandLine(
it != implicitIncludeDirectories.end()) {
for (auto const& inc : it->second)
{
- new_cmdline.emplace_back(fmt::format("-isystem{}", inc));
+ new_cmdline.emplace_back(std::format("-isystem{}", inc));
}
}
}
@@ -449,7 +449,7 @@ adjustCommandLine(
new_cmdline.emplace_back("-nostdlib++");
for (auto const& inc : (*config)->stdlibIncludes)
{
- new_cmdline.emplace_back(fmt::format("-isystem{}", inc));
+ new_cmdline.emplace_back(std::format("-isystem{}", inc));
}
}
@@ -458,7 +458,7 @@ adjustCommandLine(
new_cmdline.emplace_back("-nostdinc");
for (auto const& inc : (*config)->libcIncludes)
{
- new_cmdline.emplace_back(fmt::format("-isystem{}", inc));
+ new_cmdline.emplace_back(std::format("-isystem{}", inc));
}
}
@@ -467,11 +467,11 @@ adjustCommandLine(
// ------------------------------------------------------
for (auto const& inc : (*config)->systemIncludes)
{
- new_cmdline.emplace_back(fmt::format("-isystem{}", inc));
+ new_cmdline.emplace_back(std::format("-isystem{}", inc));
}
for (auto const& inc : (*config)->includes)
{
- new_cmdline.emplace_back(fmt::format("-I{}", inc));
+ new_cmdline.emplace_back(std::format("-I{}", inc));
}
// ------------------------------------------------------
@@ -564,7 +564,7 @@ MrDocsCompilationDatabase(
}
else
{
- report::info(fmt::format("Skipping non-C++ file: {}", cmd.Filename));
+ report::info(std::format("Skipping non-C++ file: {}", cmd.Filename));
}
}
}
diff --git a/src/lib/Metadata/Finalizers/BaseMembersFinalizer.cpp b/src/lib/Metadata/Finalizers/BaseMembersFinalizer.cpp
index 0a59c2f23..a5db8b1f8 100644
--- a/src/lib/Metadata/Finalizers/BaseMembersFinalizer.cpp
+++ b/src/lib/Metadata/Finalizers/BaseMembersFinalizer.cpp
@@ -9,8 +9,9 @@
//
#include "BaseMembersFinalizer.hpp"
-#include
+#include
#include
+#include
namespace clang::mrdocs {
@@ -160,10 +161,8 @@ inheritBaseMembers(
});
otherCopy->Parent = derivedId;
otherCopy->id = SymbolID::createFromString(
- fmt::format(
- "{}-{}",
- toBase16Str(otherCopy->Parent),
- toBase16Str(otherInfo.id)));
+ std::format("{}-{}", toBase16Str(otherCopy->Parent),
+ toBase16Str(otherInfo.id)));
derived.push_back(otherCopy->id);
// Get the extraction mode from the derived class
if (otherCopy->Extraction == ExtractionMode::Dependency)
diff --git a/src/lib/Metadata/Finalizers/Javadoc/Function.hpp b/src/lib/Metadata/Finalizers/Javadoc/Function.hpp
index d4d1484b9..74fcefe09 100644
--- a/src/lib/Metadata/Finalizers/Javadoc/Function.hpp
+++ b/src/lib/Metadata/Finalizers/Javadoc/Function.hpp
@@ -13,6 +13,7 @@
#include "lib/Lib/CorpusImpl.hpp"
#include "lib/Lib/InfoSet.hpp"
+#include
#include
#include