The Battle for Wesnoth  1.19.8+dev
Classes | Namespaces | Functions | Variables
markup.hpp File Reference
#include "color.hpp"
#include "exceptions.hpp"
#include "font/standard_colors.hpp"
#include "formatter.hpp"
#include <string>
#include <string_view>
Include dependency graph for markup.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  markup::parse_error
 Thrown when the help system fails to parse something. More...
 

Namespaces

 markup
 

Functions

template<typename... Args>
std::string markup::tag (std::string_view tag, Args &&... data)
 Wraps the given data in the specified formatting tag. More...
 
template<typename Value , typename... Args>
std::string markup::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. More...
 
template<typename... Args>
std::string markup::span_color (const color_t &color, Args &&... data)
 Applies Pango markup to the input specifying its display color. More...
 
template<typename... Args>
std::string markup::span_color (std::string_view color, Args &&... data)
 Applies Pango markup to the input specifying its display color. More...
 
template<typename... Args>
std::string markup::span_size (std::string_view size, Args &&... data)
 Applies Pango markup to the input specifying its display size. More...
 
template<typename... Args>
std::string markup::bold (Args &&... data)
 Applies bold Pango markup to the input. More...
 
template<typename... Args>
std::string markup::italic (Args &&... data)
 Applies italic Pango markup to the input. More...
 
std::string markup::img (const std::string &src, const std::string &align="left", bool floating=false)
 Generates a Help markup tag corresponding to an image. More...
 
std::string markup::make_link (const std::string &text, const std::string &dst)
 Generates a Help markup tag corresponding to a reference or link. More...
 
config markup::parse_text (const std::string &text)
 Parse a xml style marked up text string. More...
 

Variables

constexpr std::string_view markup::br {"<br/>"}
 A Help markup tag corresponding to a linebreak. More...