changeset 74:69323ee4fd3a

Remove HEADER.rst because that info now added to HTML template.
author Oleksandr Gavenko <gavenkoa@gmail.com>
date Mon, 22 Feb 2016 13:52:03 +0200
parents 7ed63a934571
children 540d83fc281e
files Makefile index.rst
diffstat 2 files changed, 7 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Mon Feb 22 13:31:27 2016 +0200
+++ b/Makefile	Mon Feb 22 13:52:03 2016 +0200
@@ -40,7 +40,7 @@
 ################################################################
 # Proj dirs/files.
 
-RST_FILES := $(filter-out HEADER.rst,$(wildcard *.rst))
+RST_FILES := $(wildcard *.rst)
 
 HTML_DIR := tips-html
 RST_HTML_FILES := $(patsubst %.rst,$(HTML_DIR)/%.html,$(RST_FILES))
@@ -61,7 +61,7 @@
 LOCAL_DIR := /srv/www/tips
 
 ifneq '' '$(filter deploy%,$(MAKECMDGOALS))'
-  $(shell rm -f HEADER.rst)
+  $(shell rm -f $(HTML_DIR)/rst.tmpl)
 endif
 
 .PHONY: deploy
@@ -98,8 +98,8 @@
 .PHONY: html
 html: $(HTML_FILES)
 
-$(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)/%.html: %.rst rst.css rst-multi.css $(HTML_DIR)/rst.tmpl $(MAKEFILE_LIST) | $(HTML_DIR)
+	$(RST2HTML) $(RST_FLAGS) --stylesheet=rst.css,rst-multi.css --template=$(HTML_DIR)/rst.tmpl $*.rst $@
 
 $(HTML_DIR)/iframe.html: $(RST_FILES) $(MAKEFILE_LIST) | $(HTML_DIR)
 	{ \
@@ -118,21 +118,8 @@
 echo '</body></html>'; \
 } >$@
 
-HEADER.rst: $(MAKEFILE_LIST)
-	{ \
-echo '.. _About: README.html'; \
-echo '.. _`Contacts`: http://resume.defun.work/'; \
-echo '.. _`Oleksandr Gavenko`: http://resume.defun.work/'; \
-echo '.. _`gavenkoa`: http://resume.defun.work/'; \
-echo '.. _Licence: README.html#tips-licence'; \
-echo; \
-echo '.. container:: header'; \
-echo; \
-echo '  [ About_ | Licence_ | `Contacts`_ ]'; \
-echo '.. container:: header small'; \
-echo; \
-echo '  Written by Oleksandr Gavenko (AKA gavenkoa), compiled at ``'`date +%F`'`` from rev ``'`hg id -i`'``.'; \
-} >$@
+$(HTML_DIR)/rst.tmpl: rst.tmpl $(MAKEFILE_LIST)
+	sed -e "s|{date}|$$(date +%F)|" -e "s|{rev}|$$(hg id -i)|"  <$< >$@
 
 $(HTML_DIR)/index.html: $(HTML_DIR)/README.html $(MAKEFILE_LIST) | $(HTML_DIR)
 	cp $< $@
@@ -184,7 +171,7 @@
 
 .PHONY: clean
 clean:
-	rm -r -f $(DIRS) HEADER.rst
+	rm -r -f $(DIRS)
 
 ################################################################
 # Helper target.
@@ -201,9 +188,6 @@
   if grep '^.. -\*- coding: utf-8; -\*-' $$f >/dev/null; then :; else \
     echo $$f:1:" Has no 'coding: utf-8' directive."; \
   fi; \
-  if grep '^.. include:: HEADER.rst' $$f >/dev/null; then :; else \
-    echo $$f:2:" Has no 'include:: HEADER.rst' directive."; \
-  fi; \
   if grep '^.. contents::' $$f >/dev/null; then :; else \
     echo $$f:7:" Has no 'contents::' directive."; \
   fi; \
--- a/index.rst	Mon Feb 22 13:31:27 2016 +0200
+++ b/index.rst	Mon Feb 22 13:52:03 2016 +0200
@@ -1,5 +1,4 @@
 .. -*- coding: utf-8; -*-
-.. include:: HEADER.rst
 
 ==========
  Рецепты.