[PATCH 0/2] doc: Create index.html to join all help pages

From: Aline Manera <alinefm@br.ibm.com> It also fixes a bug found while building deb package. Aline Manera (2): bug fix: Package doc html files into deb package doc: Generate index.html to join all help pages ui/pages/help/Makefile.am | 8 +++--- ui/pages/help/gen-index.py | 64 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 3 deletions(-) create mode 100755 ui/pages/help/gen-index.py -- 1.7.10.4

From: Aline Manera <alinefm@br.ibm.com> To get the help html files dinamically the Makefile was using the following code: DITA_HTML_FILES = $(patsubst %.dita,%.html,$(wildcard *.dita)) $(wildcard *.html) But it does not well while building deb packages as it cointans duplicated values: /bin/mkdir -p '/tmp/tmp.86vGERYO70/usr/share/kimchi/ui/pages/help' /usr/bin/install -c -m 644 guests.html storage.html templates.html guests.html index.html storage.html templates.html '/tmp/tmp.86vGERYO70/usr/share/kimchi/ui/pages/help' /usr/bin/install: will not overwrite just-created `/tmp/tmp.86vGERYO70/usr/share/kimchi/ui/pages/help/guests.html' with `guests.html' (...) So use $(if()) statement to get html files from one source or from another to avoid the errors above. Signed-off-by: Aline Manera <alinefm@br.ibm.com> --- ui/pages/help/Makefile.am | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ui/pages/help/Makefile.am b/ui/pages/help/Makefile.am index 61ea209..81d7e90 100644 --- a/ui/pages/help/Makefile.am +++ b/ui/pages/help/Makefile.am @@ -17,14 +17,15 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -DITA_HTML_FILES = $(patsubst %.dita,%.html,$(wildcard *.dita)) $(wildcard *.html) +DITA_HTML_FILES = $(patsubst %.dita,%.html,$(wildcard *.dita)) +HTML_FILES = $(if $(wildcard *.html), $(wildcard *.html), $(DITA_HTML_FILES)) DITA_XSL_FILE = dita-help.xsl helpdir = $(datadir)/kimchi/ui/pages/help -dist_help_DATA = $(DITA_HTML_FILES) $(NULL) +dist_help_DATA = $(HTML_FILES) $(NULL) %.html: %.dita $(DITA_XSL_FILE) xsltproc -o $@ $(DITA_XSL_FILE) $< -CLEANFILES = $(DITA_HTML_FILES) +CLEANFILES = $(HTML_FILES) -- 1.7.10.4

From: Aline Manera <alinefm@br.ibm.com>
To get the help html files dinamically the Makefile was using the following code:
DITA_HTML_FILES = $(patsubst %.dita,%.html,$(wildcard *.dita)) $(wildcard *.html)
But it does not well while building deb packages as it cointans duplicated values:
/bin/mkdir -p '/tmp/tmp.86vGERYO70/usr/share/kimchi/ui/pages/help' /usr/bin/install -c -m 644 guests.html storage.html templates.html guests.html index.html storage.html templates.html '/tmp/tmp.86vGERYO70/usr/share/kimchi/ui/pages/help' /usr/bin/install: will not overwrite just-created `/tmp/tmp.86vGERYO70/usr/share/kimchi/ui/pages/help/guests.html' with `guests.html' (...)
So use $(if()) statement to get html files from one source or from another to avoid the errors above.
Signed-off-by: Aline Manera <alinefm@br.ibm.com> --- ui/pages/help/Makefile.am | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/ui/pages/help/Makefile.am b/ui/pages/help/Makefile.am index 61ea209..81d7e90 100644 --- a/ui/pages/help/Makefile.am +++ b/ui/pages/help/Makefile.am @@ -17,14 +17,15 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-DITA_HTML_FILES = $(patsubst %.dita,%.html,$(wildcard *.dita)) $(wildcard *.html) +DITA_HTML_FILES = $(patsubst %.dita,%.html,$(wildcard *.dita)) +HTML_FILES = $(if $(wildcard *.html), $(wildcard *.html), $(DITA_HTML_FILES)) I have a try it can work without if on rpm package, but not try on deb
DITA_XSL_FILE = dita-help.xsl miss EXTRA_DIST The /EXTRA_DIST/ argument holds a list of all the files that are part of
comments below On 02/18/2014 03:56 AM, Aline Manera wrote: package. the package, but are not installed by default and were not specified in any other way.
helpdir = $(datadir)/kimchi/ui/pages/help
-dist_help_DATA = $(DITA_HTML_FILES) $(NULL) +dist_help_DATA = $(HTML_FILES) $(NULL)
%.html: %.dita $(DITA_XSL_FILE) xsltproc -o $@ $(DITA_XSL_FILE) $<
-CLEANFILES = $(DITA_HTML_FILES) +CLEANFILES = $(HTML_FILES)
-- Thanks and best regards! Sheldon Feng(???)<shaohef@linux.vnet.ibm.com> IBM Linux Technology Center

From: ShaoHe Feng <shaohef@linux.vnet.ibm.com> To get the help html files dinamically the Makefile was using the following code: DITA_HTML_FILES = $(patsubst %.dita,%.html,$(wildcard *.dita)) $(wildcard *.html) But it does not well while building deb packages as it cointans duplicated values: /bin/mkdir -p '/tmp/tmp.86vGERYO70/usr/share/kimchi/ui/pages/help' /usr/bin/install -c -m 644 guests.html storage.html templates.html guests.html index.html storage.html templates.html '/tmp/tmp.86vGERYO70/usr/share/kimchi/ui/pages/help' /usr/bin/install: will not overwrite just-created `/tmp/tmp.86vGERYO70/usr/share/kimchi/ui/pages/help/guests.html' with `guests.html' (...) Fix it. Add *.html to HTML_FILES directly. Also add *.dita and dita-help.xsl to the EXTRA_DIST list. Signed-off-by: Aline Manera <alinefm@br.ibm.com> Signed-off-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com> --- ui/pages/help/Makefile.am | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/ui/pages/help/Makefile.am b/ui/pages/help/Makefile.am index 61ea209..772917c 100644 --- a/ui/pages/help/Makefile.am +++ b/ui/pages/help/Makefile.am @@ -17,12 +17,20 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -DITA_HTML_FILES = $(patsubst %.dita,%.html,$(wildcard *.dita)) $(wildcard *.html) +helpdir = $(datadir)/kimchi/ui/pages/help + DITA_XSL_FILE = dita-help.xsl -helpdir = $(datadir)/kimchi/ui/pages/help +HTML_FILES = *.html + +DITA_FILES = *.dita + +EXTRA_DIST = \ + $(DITA_XSL_FILE) \ + $(DITA_FILES) \ + $(NULL) -dist_help_DATA = $(DITA_HTML_FILES) $(NULL) +dist_help_DATA = $(HTML_FILES) $(NULL) %.html: %.dita $(DITA_XSL_FILE) xsltproc -o $@ $(DITA_XSL_FILE) $< -- 1.8.4.2

aline, can you try this can works on ubuntu? On 02/18/2014 04:26 PM, shaohef@linux.vnet.ibm.com wrote:
From: ShaoHe Feng <shaohef@linux.vnet.ibm.com>
To get the help html files dinamically the Makefile was using the following code:
DITA_HTML_FILES = $(patsubst %.dita,%.html,$(wildcard *.dita)) $(wildcard *.html)
But it does not well while building deb packages as it cointans duplicated values:
/bin/mkdir -p '/tmp/tmp.86vGERYO70/usr/share/kimchi/ui/pages/help' /usr/bin/install -c -m 644 guests.html storage.html templates.html guests.html index.html storage.html templates.html '/tmp/tmp.86vGERYO70/usr/share/kimchi/ui/pages/help' /usr/bin/install: will not overwrite just-created `/tmp/tmp.86vGERYO70/usr/share/kimchi/ui/pages/help/guests.html' with `guests.html' (...)
Fix it. Add *.html to HTML_FILES directly.
Also add *.dita and dita-help.xsl to the EXTRA_DIST list.
Signed-off-by: Aline Manera <alinefm@br.ibm.com> Signed-off-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com> --- ui/pages/help/Makefile.am | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/ui/pages/help/Makefile.am b/ui/pages/help/Makefile.am index 61ea209..772917c 100644 --- a/ui/pages/help/Makefile.am +++ b/ui/pages/help/Makefile.am @@ -17,12 +17,20 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-DITA_HTML_FILES = $(patsubst %.dita,%.html,$(wildcard *.dita)) $(wildcard *.html) +helpdir = $(datadir)/kimchi/ui/pages/help + DITA_XSL_FILE = dita-help.xsl
-helpdir = $(datadir)/kimchi/ui/pages/help +HTML_FILES = *.html + +DITA_FILES = *.dita + +EXTRA_DIST = \ + $(DITA_XSL_FILE) \ + $(DITA_FILES) \ + $(NULL)
-dist_help_DATA = $(DITA_HTML_FILES) $(NULL) +dist_help_DATA = $(HTML_FILES) $(NULL)
%.html: %.dita $(DITA_XSL_FILE) xsltproc -o $@ $(DITA_XSL_FILE) $<
-- Thanks and best regards! Sheldon Feng(冯少合)<shaohef@linux.vnet.ibm.com> IBM Linux Technology Center

On 02/18/2014 05:28 AM, Sheldon wrote:
aline, can you try this can works on ubuntu?
No, it does not work on Ubuntu alinefm@alinefm:~/kimchi$ dpkg --contents kimchi-1.1.0-255.gite6cabad.noarch.deb | grep help drwxr-xr-x root/root 0 2014-02-18 09:20 ./usr/share/kimchi/ui/pages/help/ -rw-r--r-- root/root 2111 2014-02-18 09:20 ./usr/share/kimchi/ui/pages/help/*.html alinefm@alinefm:~/kimchi$ ls ui/pages/help/ dita-help.xsl guests.dita *.html Makefile Makefile.am Makefile.am.orig Makefile.in storage.dita templates.dita I will add EXTRA_DIST you mentioned on V2.
On 02/18/2014 04:26 PM, shaohef@linux.vnet.ibm.com wrote:
From: ShaoHe Feng <shaohef@linux.vnet.ibm.com>
To get the help html files dinamically the Makefile was using the following code:
DITA_HTML_FILES = $(patsubst %.dita,%.html,$(wildcard *.dita)) $(wildcard *.html)
But it does not well while building deb packages as it cointans duplicated values:
/bin/mkdir -p '/tmp/tmp.86vGERYO70/usr/share/kimchi/ui/pages/help' /usr/bin/install -c -m 644 guests.html storage.html templates.html guests.html index.html storage.html templates.html '/tmp/tmp.86vGERYO70/usr/share/kimchi/ui/pages/help' /usr/bin/install: will not overwrite just-created `/tmp/tmp.86vGERYO70/usr/share/kimchi/ui/pages/help/guests.html' with `guests.html' (...)
Fix it. Add *.html to HTML_FILES directly.
Also add *.dita and dita-help.xsl to the EXTRA_DIST list.
Signed-off-by: Aline Manera <alinefm@br.ibm.com> Signed-off-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com> --- ui/pages/help/Makefile.am | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/ui/pages/help/Makefile.am b/ui/pages/help/Makefile.am index 61ea209..772917c 100644 --- a/ui/pages/help/Makefile.am +++ b/ui/pages/help/Makefile.am @@ -17,12 +17,20 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-DITA_HTML_FILES = $(patsubst %.dita,%.html,$(wildcard *.dita)) $(wildcard *.html) +helpdir = $(datadir)/kimchi/ui/pages/help + DITA_XSL_FILE = dita-help.xsl
-helpdir = $(datadir)/kimchi/ui/pages/help +HTML_FILES = *.html + +DITA_FILES = *.dita + +EXTRA_DIST = \ + $(DITA_XSL_FILE) \ + $(DITA_FILES) \ + $(NULL)
-dist_help_DATA = $(DITA_HTML_FILES) $(NULL) +dist_help_DATA = $(HTML_FILES) $(NULL)
%.html: %.dita $(DITA_XSL_FILE) xsltproc -o $@ $(DITA_XSL_FILE) $<

On 02/18/2014 09:22 AM, Aline Manera wrote:
On 02/18/2014 05:28 AM, Sheldon wrote:
aline, can you try this can works on ubuntu?
No, it does not work on Ubuntu
alinefm@alinefm:~/kimchi$ dpkg --contents kimchi-1.1.0-255.gite6cabad.noarch.deb | grep help drwxr-xr-x root/root 0 2014-02-18 09:20 ./usr/share/kimchi/ui/pages/help/ -rw-r--r-- root/root 2111 2014-02-18 09:20 ./usr/share/kimchi/ui/pages/help/*.html
alinefm@alinefm:~/kimchi$ ls ui/pages/help/ dita-help.xsl guests.dita *.html Makefile Makefile.am Makefile.am.orig Makefile.in storage.dita templates.dita
I will add EXTRA_DIST you mentioned on V2.
As remembered by Cristian we don't need the EXTRA_DIST as those files are not packaged.
On 02/18/2014 04:26 PM, shaohef@linux.vnet.ibm.com wrote:
From: ShaoHe Feng <shaohef@linux.vnet.ibm.com>
To get the help html files dinamically the Makefile was using the following code:
DITA_HTML_FILES = $(patsubst %.dita,%.html,$(wildcard *.dita)) $(wildcard *.html)
But it does not well while building deb packages as it cointans duplicated values:
/bin/mkdir -p '/tmp/tmp.86vGERYO70/usr/share/kimchi/ui/pages/help' /usr/bin/install -c -m 644 guests.html storage.html templates.html guests.html index.html storage.html templates.html '/tmp/tmp.86vGERYO70/usr/share/kimchi/ui/pages/help' /usr/bin/install: will not overwrite just-created `/tmp/tmp.86vGERYO70/usr/share/kimchi/ui/pages/help/guests.html' with `guests.html' (...)
Fix it. Add *.html to HTML_FILES directly.
Also add *.dita and dita-help.xsl to the EXTRA_DIST list.
Signed-off-by: Aline Manera <alinefm@br.ibm.com> Signed-off-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com> --- ui/pages/help/Makefile.am | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/ui/pages/help/Makefile.am b/ui/pages/help/Makefile.am index 61ea209..772917c 100644 --- a/ui/pages/help/Makefile.am +++ b/ui/pages/help/Makefile.am @@ -17,12 +17,20 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-DITA_HTML_FILES = $(patsubst %.dita,%.html,$(wildcard *.dita)) $(wildcard *.html) +helpdir = $(datadir)/kimchi/ui/pages/help + DITA_XSL_FILE = dita-help.xsl
-helpdir = $(datadir)/kimchi/ui/pages/help +HTML_FILES = *.html + +DITA_FILES = *.dita + +EXTRA_DIST = \ + $(DITA_XSL_FILE) \ + $(DITA_FILES) \ + $(NULL)
-dist_help_DATA = $(DITA_HTML_FILES) $(NULL) +dist_help_DATA = $(HTML_FILES) $(NULL)
%.html: %.dita $(DITA_XSL_FILE) xsltproc -o $@ $(DITA_XSL_FILE) $<
_______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel

On 02/18/2014 08:39 PM, Aline Manera wrote:
On 02/18/2014 09:22 AM, Aline Manera wrote:
On 02/18/2014 05:28 AM, Sheldon wrote:
aline, can you try this can works on ubuntu?
No, it does not work on Ubuntu
alinefm@alinefm:~/kimchi$ dpkg --contents kimchi-1.1.0-255.gite6cabad.noarch.deb | grep help drwxr-xr-x root/root 0 2014-02-18 09:20 ./usr/share/kimchi/ui/pages/help/ -rw-r--r-- root/root 2111 2014-02-18 09:20 ./usr/share/kimchi/ui/pages/help/*.html
alinefm@alinefm:~/kimchi$ ls ui/pages/help/ dita-help.xsl guests.dita *.html Makefile Makefile.am Makefile.am.orig Makefile.in storage.dita templates.dita
I will add EXTRA_DIST you mentioned on V2.
As remembered by Cristian we don't need the EXTRA_DIST as those files are not packaged. what do you mean of packaged? RPM package or tar ball?
dita files are in git repository, why they should not in tar ball? without EXTRA_DIST, how we can not put these files into tar.gz some times, user just get code by download tar.gz not from git repository. they need integrate source code.
On 02/18/2014 04:26 PM, shaohef@linux.vnet.ibm.com wrote:
From: ShaoHe Feng <shaohef@linux.vnet.ibm.com>
To get the help html files dinamically the Makefile was using the following code:
DITA_HTML_FILES = $(patsubst %.dita,%.html,$(wildcard *.dita)) $(wildcard *.html)
But it does not well while building deb packages as it cointans duplicated values:
/bin/mkdir -p '/tmp/tmp.86vGERYO70/usr/share/kimchi/ui/pages/help' /usr/bin/install -c -m 644 guests.html storage.html templates.html guests.html index.html storage.html templates.html '/tmp/tmp.86vGERYO70/usr/share/kimchi/ui/pages/help' /usr/bin/install: will not overwrite just-created `/tmp/tmp.86vGERYO70/usr/share/kimchi/ui/pages/help/guests.html' with `guests.html' (...)
Fix it. Add *.html to HTML_FILES directly.
Also add *.dita and dita-help.xsl to the EXTRA_DIST list.
Signed-off-by: Aline Manera <alinefm@br.ibm.com> Signed-off-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com> --- ui/pages/help/Makefile.am | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/ui/pages/help/Makefile.am b/ui/pages/help/Makefile.am index 61ea209..772917c 100644 --- a/ui/pages/help/Makefile.am +++ b/ui/pages/help/Makefile.am @@ -17,12 +17,20 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-DITA_HTML_FILES = $(patsubst %.dita,%.html,$(wildcard *.dita)) $(wildcard *.html) +helpdir = $(datadir)/kimchi/ui/pages/help + DITA_XSL_FILE = dita-help.xsl
-helpdir = $(datadir)/kimchi/ui/pages/help +HTML_FILES = *.html + +DITA_FILES = *.dita + +EXTRA_DIST = \ + $(DITA_XSL_FILE) \ + $(DITA_FILES) \ + $(NULL)
-dist_help_DATA = $(DITA_HTML_FILES) $(NULL) +dist_help_DATA = $(HTML_FILES) $(NULL)
%.html: %.dita $(DITA_XSL_FILE) xsltproc -o $@ $(DITA_XSL_FILE) $<
_______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel
-- Thanks and best regards! Sheldon Feng(冯少合)<shaohef@linux.vnet.ibm.com> IBM Linux Technology Center

On 02/18/2014 10:36 AM, Sheldon wrote:
On 02/18/2014 08:39 PM, Aline Manera wrote:
On 02/18/2014 09:22 AM, Aline Manera wrote:
On 02/18/2014 05:28 AM, Sheldon wrote:
aline, can you try this can works on ubuntu?
No, it does not work on Ubuntu
alinefm@alinefm:~/kimchi$ dpkg --contents kimchi-1.1.0-255.gite6cabad.noarch.deb | grep help drwxr-xr-x root/root 0 2014-02-18 09:20 ./usr/share/kimchi/ui/pages/help/ -rw-r--r-- root/root 2111 2014-02-18 09:20 ./usr/share/kimchi/ui/pages/help/*.html
alinefm@alinefm:~/kimchi$ ls ui/pages/help/ dita-help.xsl guests.dita *.html Makefile Makefile.am Makefile.am.orig Makefile.in storage.dita templates.dita
I will add EXTRA_DIST you mentioned on V2.
As remembered by Cristian we don't need the EXTRA_DIST as those files are not packaged. what do you mean of packaged? RPM package or tar ball?
dita files are in git repository, why they should not in tar ball? without EXTRA_DIST, how we can not put these files into tar.gz some times, user just get code by download tar.gz not from git repository. they need integrate source code.
Are you talking about the tar.gz provided in github page? The tar.gz contains all files in git repository. We don't need to update Makefile to make it works.
On 02/18/2014 04:26 PM, shaohef@linux.vnet.ibm.com wrote:
From: ShaoHe Feng <shaohef@linux.vnet.ibm.com>
To get the help html files dinamically the Makefile was using the following code:
DITA_HTML_FILES = $(patsubst %.dita,%.html,$(wildcard *.dita)) $(wildcard *.html)
But it does not well while building deb packages as it cointans duplicated values:
/bin/mkdir -p '/tmp/tmp.86vGERYO70/usr/share/kimchi/ui/pages/help' /usr/bin/install -c -m 644 guests.html storage.html templates.html guests.html index.html storage.html templates.html '/tmp/tmp.86vGERYO70/usr/share/kimchi/ui/pages/help' /usr/bin/install: will not overwrite just-created `/tmp/tmp.86vGERYO70/usr/share/kimchi/ui/pages/help/guests.html' with `guests.html' (...)
Fix it. Add *.html to HTML_FILES directly.
Also add *.dita and dita-help.xsl to the EXTRA_DIST list.
Signed-off-by: Aline Manera <alinefm@br.ibm.com> Signed-off-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com> --- ui/pages/help/Makefile.am | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/ui/pages/help/Makefile.am b/ui/pages/help/Makefile.am index 61ea209..772917c 100644 --- a/ui/pages/help/Makefile.am +++ b/ui/pages/help/Makefile.am @@ -17,12 +17,20 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-DITA_HTML_FILES = $(patsubst %.dita,%.html,$(wildcard *.dita)) $(wildcard *.html) +helpdir = $(datadir)/kimchi/ui/pages/help + DITA_XSL_FILE = dita-help.xsl
-helpdir = $(datadir)/kimchi/ui/pages/help +HTML_FILES = *.html + +DITA_FILES = *.dita + +EXTRA_DIST = \ + $(DITA_XSL_FILE) \ + $(DITA_FILES) \ + $(NULL)
-dist_help_DATA = $(DITA_HTML_FILES) $(NULL) +dist_help_DATA = $(HTML_FILES) $(NULL)
%.html: %.dita $(DITA_XSL_FILE) xsltproc -o $@ $(DITA_XSL_FILE) $<
_______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel

On 02/18/2014 09:55 PM, Aline Manera wrote:
On 02/18/2014 10:36 AM, Sheldon wrote:
On 02/18/2014 08:39 PM, Aline Manera wrote:
On 02/18/2014 09:22 AM, Aline Manera wrote:
On 02/18/2014 05:28 AM, Sheldon wrote:
aline, can you try this can works on ubuntu?
No, it does not work on Ubuntu
alinefm@alinefm:~/kimchi$ dpkg --contents kimchi-1.1.0-255.gite6cabad.noarch.deb | grep help drwxr-xr-x root/root 0 2014-02-18 09:20 ./usr/share/kimchi/ui/pages/help/ -rw-r--r-- root/root 2111 2014-02-18 09:20 ./usr/share/kimchi/ui/pages/help/*.html
alinefm@alinefm:~/kimchi$ ls ui/pages/help/ dita-help.xsl guests.dita *.html Makefile Makefile.am Makefile.am.orig Makefile.in storage.dita templates.dita
I will add EXTRA_DIST you mentioned on V2.
As remembered by Cristian we don't need the EXTRA_DIST as those files are not packaged. what do you mean of packaged? RPM package or tar ball?
dita files are in git repository, why they should not in tar ball? without EXTRA_DIST, how we can not put these files into tar.gz some times, user just get code by download tar.gz not from git repository. they need integrate source code.
Are you talking about the tar.gz provided in github page? The tar.gz contains all files in git repository. We don't need to update Makefile to make it works.
http://www.gnu.org/software/automake/manual/automake.html#Basics-of-Distribu... usually we will make the tar.gz "$ make dist" http://www.shlomifish.org/lecture/Autotools/slides/Makefile_am/extra_dist.ht... The EXTRA_DIST argument holds a list of all the files that are part of the package, but are not installed by default and were not specified in any other way.
On 02/18/2014 04:26 PM, shaohef@linux.vnet.ibm.com wrote:
From: ShaoHe Feng <shaohef@linux.vnet.ibm.com>
To get the help html files dinamically the Makefile was using the following code:
DITA_HTML_FILES = $(patsubst %.dita,%.html,$(wildcard *.dita)) $(wildcard *.html)
But it does not well while building deb packages as it cointans duplicated values:
/bin/mkdir -p '/tmp/tmp.86vGERYO70/usr/share/kimchi/ui/pages/help' /usr/bin/install -c -m 644 guests.html storage.html templates.html guests.html index.html storage.html templates.html '/tmp/tmp.86vGERYO70/usr/share/kimchi/ui/pages/help' /usr/bin/install: will not overwrite just-created `/tmp/tmp.86vGERYO70/usr/share/kimchi/ui/pages/help/guests.html' with `guests.html' (...)
Fix it. Add *.html to HTML_FILES directly.
Also add *.dita and dita-help.xsl to the EXTRA_DIST list.
Signed-off-by: Aline Manera <alinefm@br.ibm.com> Signed-off-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com> --- ui/pages/help/Makefile.am | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/ui/pages/help/Makefile.am b/ui/pages/help/Makefile.am index 61ea209..772917c 100644 --- a/ui/pages/help/Makefile.am +++ b/ui/pages/help/Makefile.am @@ -17,12 +17,20 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-DITA_HTML_FILES = $(patsubst %.dita,%.html,$(wildcard *.dita)) $(wildcard *.html) +helpdir = $(datadir)/kimchi/ui/pages/help + DITA_XSL_FILE = dita-help.xsl
-helpdir = $(datadir)/kimchi/ui/pages/help +HTML_FILES = *.html + +DITA_FILES = *.dita + +EXTRA_DIST = \ + $(DITA_XSL_FILE) \ + $(DITA_FILES) \ + $(NULL)
-dist_help_DATA = $(DITA_HTML_FILES) $(NULL) +dist_help_DATA = $(HTML_FILES) $(NULL)
%.html: %.dita $(DITA_XSL_FILE) xsltproc -o $@ $(DITA_XSL_FILE) $<
_______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel
-- Thanks and best regards! Sheldon Feng(冯少合)<shaohef@linux.vnet.ibm.com> IBM Linux Technology Center

On 02/18/2014 09:55 PM, Aline Manera wrote:
On 02/18/2014 10:36 AM, Sheldon wrote:
On 02/18/2014 08:39 PM, Aline Manera wrote:
On 02/18/2014 09:22 AM, Aline Manera wrote:
On 02/18/2014 05:28 AM, Sheldon wrote:
aline, can you try this can works on ubuntu?
No, it does not work on Ubuntu
alinefm@alinefm:~/kimchi$ dpkg --contents kimchi-1.1.0-255.gite6cabad.noarch.deb | grep help drwxr-xr-x root/root 0 2014-02-18 09:20 ./usr/share/kimchi/ui/pages/help/ -rw-r--r-- root/root 2111 2014-02-18 09:20 ./usr/share/kimchi/ui/pages/help/*.html
alinefm@alinefm:~/kimchi$ ls ui/pages/help/ dita-help.xsl guests.dita *.html Makefile Makefile.am Makefile.am.orig Makefile.in storage.dita templates.dita
I will add EXTRA_DIST you mentioned on V2.
As remembered by Cristian we don't need the EXTRA_DIST as those files are not packaged. what do you mean of packaged? RPM package or tar ball?
dita files are in git repository, why they should not in tar ball? without EXTRA_DIST, how we can not put these files into tar.gz some times, user just get code by download tar.gz not from git repository. they need integrate source code.
Are you talking about the tar.gz provided in github page? The tar.gz contains all files in git repository. We don't need to update Makefile to make it works. Make dist can not guarantee the tar.gz contains all files in git repository.
But here, this is a command, then automake knows *.dita and dita-help.xsl are source file. %.html: %.dita $(DITA_XSL_FILE) xsltproc -o $@ $(DITA_XSL_FILE) $<
On 02/18/2014 04:26 PM, shaohef@linux.vnet.ibm.com wrote:
From: ShaoHe Feng <shaohef@linux.vnet.ibm.com>
To get the help html files dinamically the Makefile was using the following code:
DITA_HTML_FILES = $(patsubst %.dita,%.html,$(wildcard *.dita)) $(wildcard *.html)
But it does not well while building deb packages as it cointans duplicated values:
/bin/mkdir -p '/tmp/tmp.86vGERYO70/usr/share/kimchi/ui/pages/help' /usr/bin/install -c -m 644 guests.html storage.html templates.html guests.html index.html storage.html templates.html '/tmp/tmp.86vGERYO70/usr/share/kimchi/ui/pages/help' /usr/bin/install: will not overwrite just-created `/tmp/tmp.86vGERYO70/usr/share/kimchi/ui/pages/help/guests.html' with `guests.html' (...)
Fix it. Add *.html to HTML_FILES directly.
Also add *.dita and dita-help.xsl to the EXTRA_DIST list.
Signed-off-by: Aline Manera <alinefm@br.ibm.com> Signed-off-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com> --- ui/pages/help/Makefile.am | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/ui/pages/help/Makefile.am b/ui/pages/help/Makefile.am index 61ea209..772917c 100644 --- a/ui/pages/help/Makefile.am +++ b/ui/pages/help/Makefile.am @@ -17,12 +17,20 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-DITA_HTML_FILES = $(patsubst %.dita,%.html,$(wildcard *.dita)) $(wildcard *.html) +helpdir = $(datadir)/kimchi/ui/pages/help + DITA_XSL_FILE = dita-help.xsl
-helpdir = $(datadir)/kimchi/ui/pages/help +HTML_FILES = *.html + +DITA_FILES = *.dita + +EXTRA_DIST = \ + $(DITA_XSL_FILE) \ + $(DITA_FILES) \ + $(NULL)
-dist_help_DATA = $(DITA_HTML_FILES) $(NULL) +dist_help_DATA = $(HTML_FILES) $(NULL)
%.html: %.dita $(DITA_XSL_FILE) xsltproc -o $@ $(DITA_XSL_FILE) $<
_______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel
-- Thanks and best regards! Sheldon Feng(冯少合)<shaohef@linux.vnet.ibm.com> IBM Linux Technology Center

On 02/18/2014 11:59 AM, Sheldon wrote:
On 02/18/2014 09:55 PM, Aline Manera wrote:
On 02/18/2014 10:36 AM, Sheldon wrote:
On 02/18/2014 08:39 PM, Aline Manera wrote:
On 02/18/2014 09:22 AM, Aline Manera wrote:
On 02/18/2014 05:28 AM, Sheldon wrote:
aline, can you try this can works on ubuntu?
No, it does not work on Ubuntu
alinefm@alinefm:~/kimchi$ dpkg --contents kimchi-1.1.0-255.gite6cabad.noarch.deb | grep help drwxr-xr-x root/root 0 2014-02-18 09:20 ./usr/share/kimchi/ui/pages/help/ -rw-r--r-- root/root 2111 2014-02-18 09:20 ./usr/share/kimchi/ui/pages/help/*.html
alinefm@alinefm:~/kimchi$ ls ui/pages/help/ dita-help.xsl guests.dita *.html Makefile Makefile.am Makefile.am.orig Makefile.in storage.dita templates.dita
I will add EXTRA_DIST you mentioned on V2.
As remembered by Cristian we don't need the EXTRA_DIST as those files are not packaged. what do you mean of packaged? RPM package or tar ball?
dita files are in git repository, why they should not in tar ball? without EXTRA_DIST, how we can not put these files into tar.gz some times, user just get code by download tar.gz not from git repository. they need integrate source code.
Are you talking about the tar.gz provided in github page? The tar.gz contains all files in git repository. We don't need to update Makefile to make it works. Make dist can not guarantee the tar.gz contains all files in git repository.
Got your point. I will update and add EXTRA_DIST to include .dita files
But here, this is a command, then automake knows *.dita and dita-help.xsl are source file. %.html: %.dita $(DITA_XSL_FILE) xsltproc -o $@ $(DITA_XSL_FILE) $<
On 02/18/2014 04:26 PM, shaohef@linux.vnet.ibm.com wrote: > From: ShaoHe Feng <shaohef@linux.vnet.ibm.com> > > To get the help html files dinamically the Makefile was using the > following code: > > DITA_HTML_FILES = $(patsubst %.dita,%.html,$(wildcard *.dita)) > $(wildcard *.html) > > But it does not well while building deb packages as it cointans > duplicated values: > > /bin/mkdir -p '/tmp/tmp.86vGERYO70/usr/share/kimchi/ui/pages/help' > /usr/bin/install -c -m 644 guests.html storage.html templates.html > guests.html index.html storage.html templates.html > '/tmp/tmp.86vGERYO70/usr/share/kimchi/ui/pages/help' > /usr/bin/install: will not overwrite just-created > `/tmp/tmp.86vGERYO70/usr/share/kimchi/ui/pages/help/guests.html' > with > `guests.html' > (...) > > Fix it. > Add *.html to HTML_FILES directly. > > Also add *.dita and dita-help.xsl to the EXTRA_DIST list. > > Signed-off-by: Aline Manera <alinefm@br.ibm.com> > Signed-off-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com> > --- > ui/pages/help/Makefile.am | 14 +++++++++++--- > 1 file changed, 11 insertions(+), 3 deletions(-) > > diff --git a/ui/pages/help/Makefile.am b/ui/pages/help/Makefile.am > index 61ea209..772917c 100644 > --- a/ui/pages/help/Makefile.am > +++ b/ui/pages/help/Makefile.am > @@ -17,12 +17,20 @@ > # License along with this library; if not, write to the Free > Software > # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA > 02110-1301 USA > > -DITA_HTML_FILES = $(patsubst %.dita,%.html,$(wildcard *.dita)) > $(wildcard *.html) > +helpdir = $(datadir)/kimchi/ui/pages/help > + > DITA_XSL_FILE = dita-help.xsl > > -helpdir = $(datadir)/kimchi/ui/pages/help > +HTML_FILES = *.html > + > +DITA_FILES = *.dita > + > +EXTRA_DIST = \ > + $(DITA_XSL_FILE) \ > + $(DITA_FILES) \ > + $(NULL) > > -dist_help_DATA = $(DITA_HTML_FILES) $(NULL) > +dist_help_DATA = $(HTML_FILES) $(NULL) > > %.html: %.dita $(DITA_XSL_FILE) > xsltproc -o $@ $(DITA_XSL_FILE) $<
_______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel

NACK This patch does not generate the HTML files when I type "make". Instead, a file named "*.html" is generated with the HTML content one of the DITA files. Am 18-02-2014 05:26, schrieb shaohef@linux.vnet.ibm.com:
From: ShaoHe Feng <shaohef@linux.vnet.ibm.com>
To get the help html files dinamically the Makefile was using the following code:
DITA_HTML_FILES = $(patsubst %.dita,%.html,$(wildcard *.dita)) $(wildcard *.html)
But it does not well while building deb packages as it cointans duplicated values:
/bin/mkdir -p '/tmp/tmp.86vGERYO70/usr/share/kimchi/ui/pages/help' /usr/bin/install -c -m 644 guests.html storage.html templates.html guests.html index.html storage.html templates.html '/tmp/tmp.86vGERYO70/usr/share/kimchi/ui/pages/help' /usr/bin/install: will not overwrite just-created `/tmp/tmp.86vGERYO70/usr/share/kimchi/ui/pages/help/guests.html' with `guests.html' (...)
Fix it. Add *.html to HTML_FILES directly.
Also add *.dita and dita-help.xsl to the EXTRA_DIST list.
Signed-off-by: Aline Manera <alinefm@br.ibm.com> Signed-off-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com> ---
+EXTRA_DIST = \ + $(DITA_XSL_FILE) \ + $(DITA_FILES) \ + $(NULL) Why do we need to add the XSL and DITA files to the distribution packages? They won't be used at all.

From: Aline Manera <alinefm@br.ibm.com> This patch generates help/index.html automatically based on all .dita files during build time. For each dita file it generates a link on index.html Signed-off-by: Aline Manera <alinefm@br.ibm.com> --- ui/pages/help/Makefile.am | 3 ++- ui/pages/help/gen-index.py | 64 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 1 deletion(-) create mode 100755 ui/pages/help/gen-index.py diff --git a/ui/pages/help/Makefile.am b/ui/pages/help/Makefile.am index 81d7e90..5146692 100644 --- a/ui/pages/help/Makefile.am +++ b/ui/pages/help/Makefile.am @@ -18,7 +18,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA DITA_HTML_FILES = $(patsubst %.dita,%.html,$(wildcard *.dita)) -HTML_FILES = $(if $(wildcard *.html), $(wildcard *.html), $(DITA_HTML_FILES)) +HTML_FILES = $(if $(wildcard *.html), $(wildcard *.html), $(DITA_HTML_FILES) index.html) DITA_XSL_FILE = dita-help.xsl helpdir = $(datadir)/kimchi/ui/pages/help @@ -27,5 +27,6 @@ dist_help_DATA = $(HTML_FILES) $(NULL) %.html: %.dita $(DITA_XSL_FILE) xsltproc -o $@ $(DITA_XSL_FILE) $< + $(shell pwd)/gen-index.py CLEANFILES = $(HTML_FILES) diff --git a/ui/pages/help/gen-index.py b/ui/pages/help/gen-index.py new file mode 100755 index 0000000..4fa7cbe --- /dev/null +++ b/ui/pages/help/gen-index.py @@ -0,0 +1,64 @@ +#!/usr/bin/python +# +# Project Kimchi +# +# Copyright IBM, Corp. 2014 +# +# Authors: +# Aline Manera <alinefm@linux.vnet.ibm.com> +# +# 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 glob +import libxml2 + + +HTML_HEAD = """ +<html> +<head> + <title>Kimchi Help</title> +</head> +<body> +<h1>Kimchi Help</h1> +""" + +HTML_TAIL = """ +</body> +</html> +""" + + +def main(): + pages = {} + files = sorted(glob.glob('*.dita')) + for f in files: + with open(f) as fd: + xml = fd.read() + doc = libxml2.parseDoc(xml) + node = doc.xpathEval('/cshelp/title')[0] + name = node.children.content + pages[f.replace('.dita', '.html')] = name + doc.freeDoc() + + with open('index.html', 'w') as fd: + fd.write(HTML_HEAD) + for page, name in pages.iteritems(): + html = ' <a href="/help/%s">%s</a><br />\n' + fd.write(html % (page, name)) + fd.write(HTML_TAIL) + + +if __name__ == '__main__': + main() -- 1.7.10.4

On 02/18/2014 03:56 AM, Aline Manera wrote:
From: Aline Manera <alinefm@br.ibm.com>
does the UI page will get the help information for these help documents? Such as: ________________________________________________________________________________ Name CPU Network I/O Disk I/O Livetile Actions When mouse hovers on CPU label, the Ui will get the CPU description from help/guests.html and display it," Percentage of processor utilization in the virtual machine" Also I want to know can we generate a help/guests.html stub from /#tabs/guests ? or DITA is not easy to write and maintain. Why we choose DITA? such as reStructuredText is more easy.
This patch generates help/index.html automatically based on all .dita files during build time. For each dita file it generates a link on index.html
Signed-off-by: Aline Manera <alinefm@br.ibm.com> --- ui/pages/help/Makefile.am | 3 ++- ui/pages/help/gen-index.py | 64 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 1 deletion(-) create mode 100755 ui/pages/help/gen-index.py
diff --git a/ui/pages/help/Makefile.am b/ui/pages/help/Makefile.am index 81d7e90..5146692 100644 --- a/ui/pages/help/Makefile.am +++ b/ui/pages/help/Makefile.am @@ -18,7 +18,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
DITA_HTML_FILES = $(patsubst %.dita,%.html,$(wildcard *.dita)) -HTML_FILES = $(if $(wildcard *.html), $(wildcard *.html), $(DITA_HTML_FILES)) +HTML_FILES = $(if $(wildcard *.html), $(wildcard *.html), $(DITA_HTML_FILES) index.html) DITA_XSL_FILE = dita-help.xsl
helpdir = $(datadir)/kimchi/ui/pages/help @@ -27,5 +27,6 @@ dist_help_DATA = $(HTML_FILES) $(NULL)
%.html: %.dita $(DITA_XSL_FILE) xsltproc -o $@ $(DITA_XSL_FILE) $< + $(shell pwd)/gen-index.py
CLEANFILES = $(HTML_FILES) diff --git a/ui/pages/help/gen-index.py b/ui/pages/help/gen-index.py new file mode 100755 index 0000000..4fa7cbe --- /dev/null +++ b/ui/pages/help/gen-index.py @@ -0,0 +1,64 @@ +#!/usr/bin/python +# +# Project Kimchi +# +# Copyright IBM, Corp. 2014 +# +# Authors: +# Aline Manera <alinefm@linux.vnet.ibm.com> +# +# 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 glob +import libxml2 + + +HTML_HEAD = """ +<html> +<head> + <title>Kimchi Help</title> +</head> +<body> +<h1>Kimchi Help</h1> +""" + +HTML_TAIL = """ +</body> +</html> +""" + + +def main(): + pages = {} + files = sorted(glob.glob('*.dita')) + for f in files: + with open(f) as fd: + xml = fd.read() + doc = libxml2.parseDoc(xml) + node = doc.xpathEval('/cshelp/title')[0] + name = node.children.content + pages[f.replace('.dita', '.html')] = name + doc.freeDoc() + + with open('index.html', 'w') as fd: + fd.write(HTML_HEAD) + for page, name in pages.iteritems(): + html = ' <a href="/help/%s">%s</a><br />\n' + fd.write(html % (page, name)) + fd.write(HTML_TAIL) + + +if __name__ == '__main__': + main()
-- Thanks and best regards! Sheldon Feng(???)<shaohef@linux.vnet.ibm.com> IBM Linux Technology Center

On 02/18/2014 05:44 AM, Sheldon wrote:
On 02/18/2014 03:56 AM, Aline Manera wrote:
From: Aline Manera<alinefm@br.ibm.com>
does the UI page will get the help information for these help documents?
We will have a link "Help" that will redirect user to the help pages
Such as: ________________________________________________________________________________ Name CPU Network I/O Disk I/O Livetile Actions
When mouse hovers on CPU label, the Ui will get the CPU description from help/guests.html and display it," Percentage of processor utilization in the virtual machine"
Also I want to know can we generate a help/guests.html stub from /#tabs/guests ?
The help pages will be like a manual. Where user can find step by step how use all Kimchi functionalities.
or DITA is not easy to write and maintain. Why we choose DITA? such as reStructuredText is more easy.
Because the people who will write it prefer to use DITA files specially when supporting multiples languages.
This patch generates help/index.html automatically based on all .dita files during build time. For each dita file it generates a link on index.html
Signed-off-by: Aline Manera<alinefm@br.ibm.com> --- ui/pages/help/Makefile.am | 3 ++- ui/pages/help/gen-index.py | 64 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 1 deletion(-) create mode 100755 ui/pages/help/gen-index.py
diff --git a/ui/pages/help/Makefile.am b/ui/pages/help/Makefile.am index 81d7e90..5146692 100644 --- a/ui/pages/help/Makefile.am +++ b/ui/pages/help/Makefile.am @@ -18,7 +18,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
DITA_HTML_FILES = $(patsubst %.dita,%.html,$(wildcard *.dita)) -HTML_FILES = $(if $(wildcard *.html), $(wildcard *.html), $(DITA_HTML_FILES)) +HTML_FILES = $(if $(wildcard *.html), $(wildcard *.html), $(DITA_HTML_FILES) index.html) DITA_XSL_FILE = dita-help.xsl
helpdir = $(datadir)/kimchi/ui/pages/help @@ -27,5 +27,6 @@ dist_help_DATA = $(HTML_FILES) $(NULL)
%.html: %.dita $(DITA_XSL_FILE) xsltproc -o $@ $(DITA_XSL_FILE) $< + $(shell pwd)/gen-index.py
CLEANFILES = $(HTML_FILES) diff --git a/ui/pages/help/gen-index.py b/ui/pages/help/gen-index.py new file mode 100755 index 0000000..4fa7cbe --- /dev/null +++ b/ui/pages/help/gen-index.py @@ -0,0 +1,64 @@ +#!/usr/bin/python +# +# Project Kimchi +# +# Copyright IBM, Corp. 2014 +# +# Authors: +# Aline Manera<alinefm@linux.vnet.ibm.com> +# +# 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 glob +import libxml2 + + +HTML_HEAD = """ +<html> +<head> + <title>Kimchi Help</title> +</head> +<body> +<h1>Kimchi Help</h1> +""" + +HTML_TAIL = """ +</body> +</html> +""" + + +def main(): + pages = {} + files = sorted(glob.glob('*.dita')) + for f in files: + with open(f) as fd: + xml = fd.read() + doc = libxml2.parseDoc(xml) + node = doc.xpathEval('/cshelp/title')[0] + name = node.children.content + pages[f.replace('.dita', '.html')] = name + doc.freeDoc() + + with open('index.html', 'w') as fd: + fd.write(HTML_HEAD) + for page, name in pages.iteritems(): + html = ' <a href="/help/%s">%s</a><br />\n' + fd.write(html % (page, name)) + fd.write(HTML_TAIL) + + +if __name__ == '__main__': + main()
-- Thanks and best regards!
Sheldon Feng(???)<shaohef@linux.vnet.ibm.com> IBM Linux Technology Center

Reviewed-by: Crístian Viana <vianac@linux.vnet.ibm.com> Am 17-02-2014 16:56, schrieb Aline Manera:
From: Aline Manera <alinefm@br.ibm.com>
It also fixes a bug found while building deb package.
Aline Manera (2): bug fix: Package doc html files into deb package doc: Generate index.html to join all help pages
ui/pages/help/Makefile.am | 8 +++--- ui/pages/help/gen-index.py | 64 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 3 deletions(-) create mode 100755 ui/pages/help/gen-index.py
participants (4)
-
Aline Manera
-
Crístian Viana
-
shaohef@linux.vnet.ibm.com
-
Sheldon