mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] [KERNEL-DOC] generate main index page when building 'htmldocs'
@ 2007-04-10 23:44 Borislav Petkov
  2007-04-11  4:21 ` Randy Dunlap
  0 siblings, 1 reply; 4+ messages in thread
From: Borislav Petkov @ 2007-04-10 23:44 UTC (permalink / raw)
  To: Andrew Morton; +Cc: lkml, randy.dunlap

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

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>


Index: 21-rc6/Documentation/DocBook/Makefile
===================================================================
--- 21-rc6.orig/Documentation/DocBook/Makefile	2007-04-11 00:02:02.000000000 +0200
+++ 21-rc6/Documentation/DocBook/Makefile	2007-04-11 01:00:21.000000000 +0200
@@ -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) || \

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] [KERNEL-DOC] generate main index page when building 'htmldocs'
  2007-04-10 23:44 [PATCH] [KERNEL-DOC] generate main index page when building 'htmldocs' Borislav Petkov
@ 2007-04-11  4:21 ` Randy Dunlap
  2007-04-11  8:02   ` [PATCH] [KERNEL-DOC] alphabetically-sorted entries in index.html of 'htmldocs' Borislav Petkov
  0 siblings, 1 reply; 4+ messages in thread
From: Randy Dunlap @ 2007-04-11  4:21 UTC (permalink / raw)
  To: Borislav Petkov; +Cc: Andrew Morton, lkml

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'
> 
> Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>

Acked-by: Randy Dunlap <randy.dunlap@oracle.com>

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.


> Index: 21-rc6/Documentation/DocBook/Makefile
> ===================================================================
> --- 21-rc6.orig/Documentation/DocBook/Makefile	2007-04-11 00:02:02.000000000 +0200
> +++ 21-rc6/Documentation/DocBook/Makefile	2007-04-11 01:00:21.000000000 +0200
> @@ -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) || \
> -

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] [KERNEL-DOC] alphabetically-sorted entries in index.html of 'htmldocs'
  2007-04-11  4:21 ` Randy Dunlap
@ 2007-04-11  8:02   ` Borislav Petkov
  2007-04-11 15:44     ` Randy Dunlap
  0 siblings, 1 reply; 4+ messages in thread
From: Borislav Petkov @ 2007-04-11  8:02 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: Andrew Morton, lkml

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

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>


Index: 21-rc6/Documentation/DocBook/Makefile
===================================================================
--- 21-rc6.orig/Documentation/DocBook/Makefile
+++ 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):

-- 
Regards/Gruß,
    Boris.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] [KERNEL-DOC] alphabetically-sorted entries in index.html of 'htmldocs'
  2007-04-11  8:02   ` [PATCH] [KERNEL-DOC] alphabetically-sorted entries in index.html of 'htmldocs' Borislav Petkov
@ 2007-04-11 15:44     ` Randy Dunlap
  0 siblings, 0 replies; 4+ messages in thread
From: Randy Dunlap @ 2007-04-11 15:44 UTC (permalink / raw)
  To: bbpetkov; +Cc: Andrew Morton, lkml

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 <randy.dunlap@oracle.com>

Make docbook index.html contain sorted output.

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

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
 Documentation/DocBook/Makefile |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2621-rc6.orig/Documentation/DocBook/Makefile
+++ linux-2621-rc6/Documentation/DocBook/Makefile
@@ -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)
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-04-11 15:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-10 23:44 [PATCH] [KERNEL-DOC] generate main index page when building 'htmldocs' Borislav Petkov
2007-04-11  4:21 ` Randy Dunlap
2007-04-11  8:02   ` [PATCH] [KERNEL-DOC] alphabetically-sorted entries in index.html of 'htmldocs' Borislav Petkov
2007-04-11 15:44     ` Randy Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®