Generalise RST build code. Remove index.rst, use README.rst instead.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Sun, 27 Oct 2013 17:03:36 +0200
changeset 276 66db1bbebe45
parent 275 9f70f66ee2a1
child 277 f1fe7e8bed03
Generalise RST build code. Remove index.rst, use README.rst instead.
Makefile
README.rst
header.rst
index.rst
--- a/Makefile	Fri Oct 25 22:37:32 2013 +0300
+++ b/Makefile	Sun Oct 27 17:03:36 2013 +0200
@@ -131,9 +131,10 @@
 DICTDZ_FILES := $(C5_FILES:.dict-c5=.dict.dz)
 INDEX_FILES := $(C5_FILES:.dict-c5=.index)
 
-RST_GEN_FILES := VERSION.rst STAT.rst
-RST_FILES := $(sort $(wildcard *.rst) $(RST_GEN_FILES))
-HTML_FILES := $(filter-out VERSION.html header.html,$(RST_FILES:.rst=.html))
+RST_GEN_FILES := VERSION.rst STAT.rst index.rst
+RST_COMMON_FILES := VERSION.rst header.rst
+RST_FILES := $(filter-out $(RST_COMMON_FILES),$(sort $(wildcard *.rst) $(RST_GEN_FILES)))
+RST_HTML_FILES := $(RST_FILES:.rst=.html)
 
 LOGO_NAME := logo
 LOGO_SVG := $(LOGO_NAME).svg
@@ -143,7 +144,7 @@
 DIST_DIR = $(fullpkgname)
 DISTSRC_DIR = $(fullpkgname)_src
 
-DIST_FILES = $(DICTDZ_FILES) $(INDEX_FILES) $(HTML_FILES) $(RST_FILES) VERSION
+DIST_FILES = $(DICTDZ_FILES) $(INDEX_FILES) $(RST_HTML_FILES) $(RST_FILES) VERSION
 
 DISTSRC_HELPER_FILES = VERSION Makefile rst.css .dir-locals.el
 DISTSRC_FILES = $(C5_FILES) $(RST_FILES) $(DISTSRC_HELPER_FILES)
@@ -175,9 +176,9 @@
 
 # Will be accessed via http://$(pkgname).sourceforge.net
 .PHONY: deploy2sf-doc
-deploy2sf-doc: deploy-check $(HTML_FILES)
+deploy2sf-doc: deploy-check $(RST_HTML_FILES)
 	( echo 'cd htdocs'; \
-for f in $(HTML_FILES); do \
+for f in $(RST_HTML_FILES); do \
   echo "put $$f"; \
   echo "chmod 644 $$f"; \
 done; \
@@ -283,9 +284,9 @@
 docs: html
 
 .PHONY: html
-html: $(HTML_FILES)
+html: $(RST_HTML_FILES)
 
-$(HTML_FILES): %.html: %.rst header.rst VERSION.rst rst.css $(BUILD_SCRIPTS)
+$(RST_HTML_FILES): %.html: %.rst $(RST_COMMON_FILES) rst.css $(BUILD_SCRIPTS)
 	$(RST2HTML) $(RST2HTML_FLAGS) --stylesheet=rst.css $*.rst $@
 
 VERSION.rst: VERSION $(BUILD_SCRIPTS)
@@ -305,6 +306,9 @@
 	echo 'Build date: ``'$$(date +%F)'``.'; \
 	} >$@
 
+index.rst: README.rst
+	cp $< $@
+
 ################################################################
 # Misc targets.
 
@@ -398,7 +402,7 @@
 
 .PHONY: clean
 clean:
-	rm -f $(DICTDZ_FILES) $(INDEX_FILES) $(HTML_FILES) $(RST_GEN_FILES) $(LOGO_PNG_FILES)
+	rm -f $(DICTDZ_FILES) $(INDEX_FILES) $(RST_GEN_FILES) $(RST_HTML_FILES) $(LOGO_PNG_FILES)
 	rm -rf $(DIST_DIR) $(DIST_TARBALLS)
 	rm -rf $(DISTSRC_DIR) $(DISTSRC_TARBALLS)
 
--- a/README.rst	Fri Oct 25 22:37:32 2013 +0300
+++ b/README.rst	Sun Oct 27 17:03:36 2013 +0200
@@ -74,8 +74,6 @@
 
 See LICENSE_ file.
 
-.. _LICENSE: LICENSE.html
-
 Download page.
 ==============
 
@@ -89,6 +87,14 @@
 
 Check `Installation instructions <INSTALL.html>`_.
 
+Documentation.
+==============
+
+ * `Statistics on count of articles in gadict dictionaries <STAT.html>`_.
+ * `English punctuation <en-punctuation_en.html>`_.
+ * `English pronunciation <en-pronunciation_en.html>`_.
+ * `English pronunciation on Russian <en-pronunciation_ru.html>`_.
+
 Reporting issue.
 ================
 
--- a/header.rst	Fri Oct 25 22:37:32 2013 +0300
+++ b/header.rst	Sun Oct 27 17:03:36 2013 +0200
@@ -8,6 +8,12 @@
 .. _INSTALL: INSTALL.html
 .. _Installing: INSTALL.html
 .. _Statistics: STAT.html
+.. _LICENSE: LICENSE.html
+.. _License: LICENSE.html
+.. _AUTHORS: AUTHORS.html
+.. _Authors: AUTHORS.html
+.. _HACKING: HACKING.html
+.. _Hacking: HACKING.html
 
-[ Home_ | Changes_ | Statistics_ | About_ | Installing_ ]
+[ About_ | Installing_ | Statistics_ | Changes_ | License_ | Authors_ | Hacking_ ]
 
--- a/index.rst	Fri Oct 25 22:37:32 2013 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-.. -*- coding: utf-8 -*-
-.. include:: header.rst
-
-===========================
- gadict project home page.
-===========================
-.. contents::
-
-Document version.
-=================
-
-.. include:: VERSION.rst
-
-General project info.
-=====================
-
-Check `README <README.html>`_ for info about project, term of use, how to
-download or install dictionaries, how to report issue, how to contribute to
-project, and many more topics...
-
-To see additional supplied data and info check `Sitemap`_ section below.
-
- * `README <README.html>`_
- * `INSTALL <INSTALL.html>`_
- * `LICENSE <LICENSE.html>`_
- * `CHANGES <CHANGES.html>`_
- * `HACKING <HACKING.html>`_
- * `AUTHORS <AUTHORS.html>`_
-
-Resources.
-==========
-
- * Home page: http://gadict.sourceforge.net/
- * SourceForge home page: http://sourceforge.net/p/gadict/
-
-Sitemap
-=======
-
- * `Statistics on count of articles in gadict dictionaries <STAT.html>`_.
- * `English punctuation <en-punctuation_en.html>`_.
- * `English pronunciation <en-pronunciation_en.html>`_.
- * `English pronunciation on Russian <en-pronunciation_ru.html>`_.
-