[Kimchi-devel] [PATCH 23/38] Do not generate help index

Lucio Correia luciojhc at linux.vnet.ibm.com
Thu May 21 21:33:36 UTC 2015


---
 plugins/kimchi/kimchi.conf                |    1 -
 plugins/kimchi/ui/pages/help/Makefile.am  |    7 +---
 plugins/kimchi/ui/pages/help/gen-index.py |   63 -----------------------------
 3 files changed, 1 insertions(+), 70 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 449b1cd..585c510 100644
--- a/plugins/kimchi/kimchi.conf
+++ b/plugins/kimchi/kimchi.conf
@@ -64,5 +64,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..1199ed5 100644
--- a/plugins/kimchi/ui/pages/help/Makefile.am
+++ b/plugins/kimchi/ui/pages/help/Makefile.am
@@ -20,14 +20,9 @@ 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)
-helpdir = $(datadir)/wok/plugins/kimchi/ui/pages/help
-
-dist_help_DATA = kimchi.css
+EXTRA_DIST = $(DITA_XSL_FILE)
 
 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