Re: How to get a valid HTML output from Mallard files?



On Sun, 2009-11-01 at 00:47 +0100, Mario Blättermann wrote:
> Hi,
> I've played a bit with Mallard. The Tetravex manual seems to be a good
> test area. I have created three *.page files and tried to convert them
> to HTML with the following commands:
> 
> xsltproc /usr/share/xml/gnome/xslt/mallard/html/mal2html.xsl index.page
> > index.html
> 
> xsltproc /usr/share/xml/gnome/xslt/mallard/html/mal2html.xsl
> introduction.page > introduction.html
> 
> xsltproc /usr/share/xml/gnome/xslt/mallard/html/mal2html.xsl usage.page
> > usage.html
> 
> As a result I've got three files named as expected. But when I try to
> open index.html, there only appears the content of index.page, and no
> links to the subpages are provided. Seems that the normal xsltproc
> doesn't work here. Is there a universal command to get a matching HTML
> structure from multiple Mallard pages?
> 
> I'm using Fedora 11 (with an upgraded gnome-doc-utils package v0.18),
> that's why I cannot view the Mallard pages directly with Yelp.

Hi Mario,

You have to generate a cache file first, which gets passed
to each xsltproc call.  In the next stable version of g-d-u,
I'll have gnome-doc-tool able to do this automatically, but
right now it has to be generated by hand.

I've attached a simple Makefile you can drop into a directory
containing Mallard page files.  You don't have to plug this
into a full build system.  Just type 'make'.

The format of the cache files is probably going to change a
bit in 0.18.  But with 0.18, you should be able to drop this
and just use gnome-doc-tool instead.

--
Shaun

pages=$(wildcard *.page)
htmls=$(patsubst %.page,%.html,$(pages))

all: $(htmls) index.cache

index.cache : $(pages)
	echo '<cache xmlns="http://projectmallard.org/1.0/";>' > $  in
	for page in $(pages); do \
	  echo "<page href='$$page'/>" >> $  in; \
	done
	echo '</cache>' >> $  in
	xsltproc `pkg-config --variable xsltdir gnome-doc-utils`/mallard/utils/mal2cache.xsl $  in | xmllint --format - > $@
	rm $  in

$(htmls) : index.cache
$(htmls) : %.html : %.page
	xsltproc \
	  --stringparam mal.cache.file `pwd`/index.cache \
	  --param mal.chunk.chunk_top 1 \
	  `pkg-config --variable mal2html gnome-doc-utils` $<

.PHONY: clean
clean:
	rm index.cache *.html


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]