[Kimchi-devel] [PATCH V3 21/34] Do not generate help index

Lucio Correia luciojhc at linux.vnet.ibm.com
Wed Jul 8 19:17:53 UTC 2015


Now that kimchi is not the main functionality, an index for
its help files is not necessary anymore.

Signed-off-by: Lucio Correia <luciojhc at linux.vnet.ibm.com>
Signed-off-by: Gustavo Y. Ribeiro <gyr at linux.vnet.ibm.com>
---
 plugins/kimchi/kimchi.conf                |    1 -
 plugins/kimchi/ui/pages/help/Makefile.am  |    5 +-
 plugins/kimchi/ui/pages/help/gen-index.py |   63 -----------------------------
 3 files changed, 2 insertions(+), 67 deletions(-)
 delete mode 100755 plugins/kimchi/ui/pages/help/gen-index.py

diff --git a/plugins/kimchi/kimchi.conf b/plugins/kimchi/kimchi.conf
index bf5efc5..78f4f3f 100644
--- a/plugins/kimchi/kimchi.conf
+++ b/plugins/kimchi/kimchi.conf
@@ -42,5 +42,4 @@ tools.staticfile.filename = wok.config.PluginPaths('kimchi').ui_dir + '/robots.t
 tools.staticdir.on = True
 tools.staticdir.dir = wok.config.PluginPaths('kimchi').ui_dir + '/pages/help'
 tools.nocache.on = True
-tools.staticdir.index = 'en_US/index.html'
 
diff --git a/plugins/kimchi/ui/pages/help/Makefile.am b/plugins/kimchi/ui/pages/help/Makefile.am
index 0fbe47b..a4ee361 100644
--- a/plugins/kimchi/ui/pages/help/Makefile.am
+++ b/plugins/kimchi/ui/pages/help/Makefile.am
@@ -20,14 +20,13 @@ DITA_HTML_FILES = $(patsubst %.dita,%.html,$(wildcard */*.dita))
 HTML_FILES = $(if $(DITA_HTML_FILES), $(DITA_HTML_FILES), $(wildcard */*.html))
 DITA_XSL_FILE = dita-help.xsl
 
-EXTRA_DIST = gen-index.py\
-			 $(DITA_XSL_FILE)
+EXTRA_DIST = $(DITA_XSL_FILE)
+
 helpdir = $(datadir)/wok/plugins/kimchi/ui/pages/help
 
 dist_help_DATA = kimchi.css
 
 all: $(HTML_FILES) $(wildcard */*.dita)
-	@$(foreach dir, $(dir $(wildcard */)), $(shell pwd)/gen-index.py $(wildcard $(dir)*.dita) > $(dir)/index.html;)
 
 %.html: %.dita $(DITA_XSL_FILE)
 	xsltproc -o $@ $(DITA_XSL_FILE) $<
diff --git a/plugins/kimchi/ui/pages/help/gen-index.py b/plugins/kimchi/ui/pages/help/gen-index.py
deleted file mode 100755
index d81e722..0000000
--- a/plugins/kimchi/ui/pages/help/gen-index.py
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/usr/bin/env python2
-#
-# Project Kimchi
-#
-# Copyright IBM, Corp. 2014-2015
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
-
-import lxml.etree as ET
-import sys
-
-
-HTML_HEAD = """
-<html>
-<head>
-  <title>Kimchi Help</title>
-</head>
-<body>
-<h1>Kimchi Help</h1>
-"""
-
-HTML_TAIL = """
-</body>
-</html>
-"""
-
-
-def main():
-    if len(sys.argv) < 2:
-        sys.exit("Missing input files")
-
-    input_files = sys.argv[1:]
-
-    pages = {}
-
-    for f in sorted(input_files):
-        with open(f) as fd:
-            xml = fd.read()
-            doc = ET.fromstring(xml)
-            name = doc.xpath('./title')[0].text
-            pages[f.replace('.dita', '.html')] = name.encode('utf-8')
-
-    print HTML_HEAD
-    for page, name in pages.iteritems():
-        html = '  <a href="/help/%s">%s</a><br />\n'
-        print html % (page, name)
-    print HTML_TAIL
-
-
-if __name__ == '__main__':
-    main()
-- 
1.7.1




More information about the Kimchi-devel mailing list