Generate single HTML build.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Mon, 22 Feb 2016 13:12:06 +0200
changeset 1908 0260f8ffef35
parent 1907 f4b078cbff20
child 1909 6b76120bd2d3
Generate single HTML build.
Makefile
rst-multi.css
rst-single.css
rst.css
rst.tmpl
--- a/Makefile	Mon Feb 22 13:02:27 2016 +0200
+++ b/Makefile	Mon Feb 22 13:12:06 2016 +0200
@@ -98,8 +98,8 @@
 .PHONY: html
 html: $(HTML_FILES)
 
-$(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)/%.html: %.rst HEADER.rst rst.css rst-multi.css rst.tmpl $(MAKEFILE_LIST) | $(HTML_DIR)
+	$(RST2HTML) $(RST_FLAGS) --stylesheet=rst.css,rst-multi.css --template=rst.tmpl $*.rst $@
 
 $(HTML_DIR)/iframe.html: $(RST_FILES) $(MAKEFILE_LIST) | $(HTML_DIR)
 	{ \
@@ -120,10 +120,6 @@
 
 HEADER.rst: $(MAKEFILE_LIST)
 	{ \
-echo '.. raw:: html'; \
-echo; \
-echo '  <div id="sidebar"><iframe src="iframe.html"></iframe></div>'; \
-echo; \
 echo '.. _About: README.html'; \
 echo '.. _`Contacts`: http://resume.defun.work/'; \
 echo '.. _`Oleksandr Gavenko`: http://resume.defun.work/'; \
@@ -160,6 +156,20 @@
 $(HTML_DIR)/chm.hhc: chm-hhc.sh $(MAKEFILE_LIST) | $(HTML_DIR)
 	./chm-hhc.sh >$@
 
+.PHONY: single-html
+single-html: $(HTML_DIR)/single.html
+
+$(HTML_DIR)/single.html: $(HTML_DIR)/single.rest rst.css rst-single.css $(RST_FILES)
+	$(RST2HTML) $(RST_FLAGS) --stylesheet=rst.css,rst-single.css $(HTML_DIR)/single.rest $@
+
+$(HTML_DIR)/single.rest: $(RST_FILES) $(MAKEFILE_LIST)
+	{ \
+echo ".. contents::"; \
+echo "   :local:"; \
+echo; \
+for f in *.rst; do echo ".. include:: ../$$f"; done; \
+} >$@
+
 ################################################################
 # Init targets.
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rst-multi.css	Mon Feb 22 13:12:06 2016 +0200
@@ -0,0 +1,29 @@
+iframe {
+    overflow: hidden;
+}
+.document {
+    max-width: 800px;
+    margin: .5em auto;
+    padding-left: 210px;
+    padding-right: 10px;
+    overflow: hidden;
+}
+#sidebar { position: fixed; }
+iframe { border: none; }
+#sidebar, iframe {
+    top: 0;
+    left: 0;
+    width: 200px;
+    height: 100%;
+}
+@media (max-width: 780px) {
+    .document {
+        margin: 5px 10px 1em 10px;
+        padding: 0;
+    }
+    #sidebar { position: inherit; }
+    #sidebar, iframe {
+        width: 100%;
+        height: 7em;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rst-single.css	Mon Feb 22 13:12:06 2016 +0200
@@ -0,0 +1,10 @@
+.document {
+    max-width: 800px;
+    margin: .5em auto;
+}
+@media (max-width: 780px) {
+    .document {
+        margin: 5px 10px 1em 10px;
+        padding: 0;
+    }
+}
--- a/rst.css	Mon Feb 22 13:02:27 2016 +0200
+++ b/rst.css	Mon Feb 22 13:12:06 2016 +0200
@@ -2,35 +2,6 @@
     margin: 0px;
     padding: 0px;
 }
-iframe {
-    overflow: hidden;
-}
-.document {
-    max-width: 800px;
-    margin: .5em auto;
-    padding-left: 210px;
-    padding-right: 10px;
-    overflow: hidden;
-}
-#sidebar { position: fixed; }
-iframe { border: none; }
-#sidebar, iframe {
-    top: 0;
-    left: 0;
-    width: 200px;
-    height: 100%;
-}
-@media (max-width: 780px) {
-    .document {
-        margin: 5px 10px 1em 10px;
-        padding: 0;
-    }
-    #sidebar { position: inherit; }
-    #sidebar, iframe {
-        width: 100%;
-        height: 7em;
-    }
-}
 
 .header {
     font-size: 1.2em;
--- a/rst.tmpl	Mon Feb 22 13:02:27 2016 +0200
+++ b/rst.tmpl	Mon Feb 22 13:12:06 2016 +0200
@@ -5,6 +5,7 @@
 %(head)s
 %(stylesheet)s
 %(body_prefix)s
+  <div id="sidebar"><iframe src="iframe.html"></iframe></div>
 %(body_pre_docinfo)s
 %(docinfo)s
 %(body)s