summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/html.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/html.c b/src/html.c
index bf4f18c..fb0d090 100644
--- a/src/html.c
+++ b/src/html.c
@@ -26,6 +26,35 @@
#include "html.h"
+static const gchar *document_format =
+ "<!doctype html>\n"
+ "<html dir=\"%s\">\n"
+ "<head>\n"
+ "<meta charset=\"utf-8\">\n"
+ "<title>%s</title>\n"
+ "</head>\n"
+ "%s"
+ "</html>\n";
+
+gchar *
+mq_html_document(const gchar *title, ...)
+{
+ va_list ap;
+ gchar *children;
+ gchar *document;
+
+ va_start(ap, element);
+ children = mq_html_container_v("body", ap);
+ va_end(ap);
+
+ document = g_strdup_printf(document_format,
+ GTK_TEXT_DIR_RTL ? "rtl" : "ltr", title, children);
+
+ g_free(children);
+
+ return document;
+}
+
gchar *
mq_html_container(const gchar *element, ...)
{