25 #include <string_view>
35 constexpr std::string_view
br{
"<br/>"};
49 template<
typename... Args>
53 if(input.empty())
return {};
66 template<
typename Value,
typename... Args>
70 if(input.empty())
return {};
71 return formatter() <<
"<span " << key <<
"='" << value <<
"'>" << input <<
"</span>";
86 template<
typename... Args>
104 template<
typename... Args>
122 template<
typename... Args>
137 template<
typename... Args>
140 return tag(
"b", std::forward<Args>(
data)...);
152 template<
typename... Args>
155 return tag(
"i", std::forward<Args>(
data)...);
169 std::string
img(
const std::string&
src,
const std::string& align =
"left",
bool floating =
false);
182 std::string
make_link(
const std::string& text,
const std::string&
dst);
A config object defines a single node in a WML file, with access to child nodes.
std::string italic(Args &&... data)
Applies italic Pango markup to the input.
std::string span_attribute(std::string_view key, const Value &value, Args &&... data)
Wraps the given data in a span tag with the specified attribute and value.
std::string img(const std::string &src, const std::string &align, bool floating)
Generates a Help markup tag corresponding to an image.
std::string make_link(const std::string &text, const std::string &dst)
Generates a Help markup tag corresponding to a reference or link.
std::string bold(Args &&... data)
Applies bold Pango markup to the input.
std::string span_color(const color_t &color, Args &&... data)
Applies Pango markup to the input specifying its display color.
constexpr std::string_view br
A Help markup tag corresponding to a linebreak.
std::string tag(std::string_view tag, Args &&... data)
Wraps the given data in the specified formatting tag.
config parse_text(const std::string &text)
Parse a xml style marked up text string.
std::string span_size(std::string_view size, Args &&... data)
Applies Pango markup to the input specifying its display size.
std::size_t size(std::string_view str)
Length in characters of a UTF-8 string.
static void msg(const char *act, debug_info &i, const char *to="", const char *result="")
rect dst
Location on the final composed sheet.
rect src
Non-transparent portion of the surface to compose.
The basic class for representing 8-bit RGB or RGBA colour values.
std::string to_hex_string() const
Returns the stored color in rrggbb hex format.
Base class for all the errors encountered by the engine.
Thrown when the help system fails to parse something.
parse_error(const std::string &msg)