summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--Makefile5
-rw-r--r--default.css3
-rw-r--r--html.c24
4 files changed, 26 insertions, 7 deletions
diff --git a/.gitignore b/.gitignore
index cc46bc9..bc13172 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
 *.o
 .test
 config.mk
+default.css.h
 scooper
 tags
diff --git a/Makefile b/Makefile
index 1f56ebf..4894309 100644
--- a/Makefile
+++ b/Makefile
@@ -24,6 +24,11 @@ scooper: ${OBJS}
 
 ${OBJS}: server.h
 
+html.o: default.css.h
+
+default.css.h: default.css
+	file2c < default.css > $@
+
 test: .test
 
 .test: scooper
diff --git a/default.css b/default.css
new file mode 100644
index 0000000..7465c01
--- /dev/null
+++ b/default.css
@@ -0,0 +1,3 @@
+html {
+	font-family: monospace;
+}
diff --git a/html.c b/html.c
index 9d9134b..c6b4a42 100644
--- a/html.c
+++ b/html.c
@@ -21,16 +21,26 @@
 
 #include "server.h"
 
+static const char DefaultStyle[] = {
+#include "default.css.h"
+	,'\0'
+};
+
 const char *htmlStylesheet;
 
 static enum kcgi_err stylesheet(struct khtmlreq *html) {
-	if (!htmlStylesheet) return KCGI_OK;
-	return khtml_attr(
-		html, KELEM_LINK,
-		KATTR_REL, "stylesheet",
-		KATTR_HREF, htmlStylesheet,
-		KATTR__MAX
-	);
+	if (htmlStylesheet) {
+		return khtml_attr(
+			html, KELEM_LINK,
+			KATTR_REL, "stylesheet",
+			KATTR_HREF, htmlStylesheet,
+			KATTR__MAX
+		);
+	}
+	return 0
+		|| khtml_elem(html, KELEM_STYLE)
+		|| khtml_puts(html, DefaultStyle)
+		|| khtml_closeelem(html, 1);
 }
 
 enum kcgi_err htmlHead(struct khtmlreq *html, const char *title) {
d> 2013-05-15Use long names for all settingsJune McEnroe 2013-05-15Add vim-gitgutterJune McEnroe 2013-04-23Remove unused pluginsJune McEnroe 2013-04-23Switch to base16-default colorschemeJune McEnroe 2013-03-26Replace nerdcommenter with vim-commentaryJune McEnroe 2013-03-24Add paredit.vimJune McEnroe 2013-03-14Update base16-vimJune McEnroe It's still crap 2013-03-12Hide mode from below statuslineJune McEnroe 2013-03-12Switch to powerlineJune McEnroe Which I'm not going to bother configuring because it thinks it's all fancy and for other things that aren't Vim so it stores its config file in ~/.config which I keep in a different repo and I only want to use it for Vim so fuck you, Powerline. </rant> 2013-03-12Remove vim-powerlineJune McEnroe 2013-02-03Update base16 and refheapJune McEnroe 2013-02-03Ignore plugin/private.vimJune McEnroe 2012-09-29Disable GUI dialogsJune McEnroe