summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-10-01 01:20:44 (EDT)
committer Patrick McDermott <pj@pehjota.net>2017-10-01 01:40:19 (EDT)
commit84283c5112e74b708fe984701427b72a25077ca0 (patch)
tree0b93e27c6b3eb142246bc3965a6653840875397f /src
parent692dfb796be36a0d25872ecf698de242dd2ce4a3 (diff)
downloadmarquee-84283c5112e74b708fe984701427b72a25077ca0.zip
marquee-84283c5112e74b708fe984701427b72a25077ca0.tar.gz
marquee-84283c5112e74b708fe984701427b72a25077ca0.tar.bz2
mq_html_document(): New (incomplete) function
Diffstat (limited to 'src')
-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, ...)
{