Skip to contentSkip to conversation

generate main index page when building 'htmldocs'

PATCH In review Borislav Petkov 2 participants 4 messages Apr 10, 2007 – Apr 11, 2007 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 generate main index page when building 'htmldocs'

Here's a patch for kernel-doc that enables the generation of a global, TOC-like index.html page after building 'htmldocs'

Documentation/DocBook/Makefile +9 -1
Index: 21-rc6/Documentation/DocBook/Makefile
===================================================================
@@ -44,6 +44,7 @@
 
 HTML := $(patsubst %.xml, %.html, $(BOOKS))
 htmldocs: $(HTML)
+	$(call build_main_index)
 
 MAN := $(patsubst %.xml, %.9, $(BOOKS))
 mandocs: $(MAN)
@@ -133,10 +134,17 @@
 %.pdf : %.xml
 	$(call cmd,db2pdf)
 
+
+main_idx = Documentation/DocBook/index.html
+build_main_index = rm -rf $(main_idx) && \
+		   echo '<h1>Linux Kernel HTML Documentation</h1>' >> $(main_idx) && \
+		   echo '<h2>Kernel Version: $(KERNELVERSION)</h2>' >> $(main_idx) && \
+		   cat $(HTML) >> $(main_idx)
+
 quiet_cmd_db2html = HTML   $@
       cmd_db2html = xmlto xhtml $(XMLTOFLAGS) -o $(patsubst %.html,%,$@) $< && \
 		echo '<a HREF="$(patsubst %.html,%,$(notdir $@))/index.html"> \
-         Goto $(patsubst %.html,%,$(notdir $@))</a><p>' > $@
+        $(patsubst %.html,%,$(notdir $@))</a><p>' > $@
 
 %.html:	%.xml
 	@(which xmlto > /dev/null 2>&1) || \
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · On Wed, 11 Apr 2007 01:44:22 +0200 Borislav Petkov wrote:

Here's a patch for kernel-doc that enables the generation of a global, TOC-like index.html page after building 'htmldocs'

Nice idea. However, the order of entries in index.html is suboptimal, due to the order of DOCBOOKS in the Makefile. You could submit a patch for that, or I'll change it.

Thanks.

Quoted 22 lines

Index: 21-rc6/Documentation/DocBook/Makefile
===================================================================

Documentation/DocBook/Makefile +7 -0
@@ -44,6 +44,7 @@
 
 HTML := $(patsubst %.xml, %.html, $(BOOKS))
 htmldocs: $(HTML)
+	$(call build_main_index)
 
 MAN := $(patsubst %.xml, %.9, $(BOOKS))
 mandocs: $(MAN)
@@ -133,10 +134,17 @@
 %.pdf : %.xml
 	$(call cmd,db2pdf)
 
+
+main_idx = Documentation/DocBook/index.html
+build_main_index = rm -rf $(main_idx) && \
+		   echo '<h1>Linux Kernel HTML Documentation</h1>' >> $(main_idx) && \
+		   echo '<h2>Kernel Version: $(KERNELVERSION)</h2>' >> $(main_idx) && \
+		   cat $(HTML) >> $(main_idx)

Documentation/DocBook/Makefile

Quoted 10 lines
Documentation/DocBook/Makefile +2 -2
+
 quiet_cmd_db2html = HTML   $@
       cmd_db2html = xmlto xhtml $(XMLTOFLAGS) -o $(patsubst %.html,%,$@) $< && \
 		echo '<a HREF="$(patsubst %.html,%,$(notdir $@))/index.html"> \
-         Goto $(patsubst %.html,%,$(notdir $@))</a><p>' > $@
+        $(patsubst %.html,%,$(notdir $@))</a><p>' > $@
 
 %.html:	%.xml
 	@(which xmlto > /dev/null 2>&1) || \
-

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

#2 lore raw

PATCH 1/1 alphabetically-sorted entries in index.html of 'htmldocs'

This patch sorts the DOCBOOKS entries in Documentation/DocBook/Makefile alphabetically.

Documentation/DocBook/Makefile +6 -7
Index: 21-rc6/Documentation/DocBook/Makefile
===================================================================
@@ -4,14 +4,13 @@
 # See Documentation/kernel-doc-nano-HOWTO.txt for instruction in how
 # to document the SRC - and how to read it.
 # To add a new book the only step required is to add the book to the
-# list of DOCBOOKS.
+# alphabetically-sorted (^^hint) list of DOCBOOKS
 
-DOCBOOKS := wanbook.xml z8530book.xml mcabook.xml videobook.xml \
-	    kernel-hacking.xml kernel-locking.xml deviceiobook.xml \
-	    procfs-guide.xml writing_usb_driver.xml \
-	    kernel-api.xml filesystems.xml lsm.xml usb.xml \
-	    gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml \
-	    genericirq.xml
+DOCBOOKS := deviceiobook.xml filesystems.xml gadget.xml genericirq.xml \
+	    kernel-api.xml kernel-hacking.xml kernel-locking.xml libata.xml \
+	    librs.xml lsm.xml mcabook.xml mtdnand.xml procfs-guide.xml \
+	    rapidio.xml usb.xml videobook.xml wanbook.xml \
+	    writing_usb_driver.xml z8530book.xml
 
 ###
 # The build process is as follows (targets):
Signature · 2 lines
Regards/Gruß,
    Boris.
#3 lore raw

Re: [PATCH] [KERNEL-DOC] alphabetically-sorted entries in index.html of 'htmldocs'

Quoted 2 lines · On Wed, 11 Apr 2007 10:02:12 +0200 Borislav Petkov wrote:

This patch sorts the DOCBOOKS entries in Documentation/DocBook/Makefile alphabetically.

---
From: Randy Dunlap <[email protected]>

Make docbook index.html contain sorted output.

I prefer to let the computer do it. This also avoids people not reading the comment(s).

---
 Documentation/DocBook/Makefile |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/DocBook/Makefile +1 -1
@@ -41,7 +41,7 @@ psdocs: $(PS)
 PDF := $(patsubst %.xml, %.pdf, $(BOOKS))
 pdfdocs: $(PDF)
 
-HTML := $(patsubst %.xml, %.html, $(BOOKS))
+HTML := $(sort $(patsubst %.xml, %.html, $(BOOKS)))
 htmldocs: $(HTML)
 	$(call build_main_index)