Add template to generate HTML 5 compliant code.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Mon, 22 Feb 2016 10:55:12 +0200
changeset 1901 12a7d89c74a9
parent 1900 505319f3423e
child 1902 1dd434abf745
Add template to generate HTML 5 compliant code.
Makefile
rst.tmpl
--- a/Makefile	Sun Feb 21 00:20:10 2016 +0200
+++ b/Makefile	Mon Feb 22 10:55:12 2016 +0200
@@ -34,8 +34,8 @@
 endif
 
 RST_WARNING_FLAGS := --halt warning
-RST_FLAGS := --strip-comments
-RST_FLAGS += $(RST_WARNING_FLAGS)
+RST_RENDER_FLAGS := --strip-comments --embed-stylesheet --no-xml-declaration --math-output=MathJax
+RST_FLAGS := $(RST_WARNING_FLAGS) $(RST_RENDER_FLAGS)
 
 ################################################################
 # Proj dirs/files.
@@ -95,8 +95,8 @@
 .PHONY: html
 html: $(HTML_FILES) $(TXT__FILES)
 
-$(HTML_DIR)/%.html: %.rst HEADER.rst rst.css $(MAKEFILE_LIST) | $(HTML_DIR)
-	$(RST2HTML) $(RST_FLAGS) --stylesheet=rst.css $*.rst $@
+$(HTML_DIR)/%.html: %.rst HEADER.rst rst.css rst.tmpl $(MAKEFILE_LIST) | $(HTML_DIR)
+	$(RST2HTML) $(RST_FLAGS) --stylesheet=rst.css --template=rst.tmpl $*.rst $@
 
 $(HTML_DIR)/iframe.html: $(RST_FILES) $(MAKEFILE_LIST) | $(HTML_DIR)
 	{ \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rst.tmpl	Mon Feb 22 10:55:12 2016 +0200
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta name=viewport content="width=device-width, initial-scale=1">
+%(head)s
+%(stylesheet)s
+%(body_prefix)s
+%(body_pre_docinfo)s
+%(docinfo)s
+%(body)s
+%(body_suffix)s