Re: Need help to get started with Mallard

On Tue, 2009-10-27 at 23:00 -0200, Leonardo Ferreira Fontenelle wrote:
> I wrote an index page, mostly the same as the one in the Ten Minutes
> Tour, and I can't have it converted to a (x)html page. What else
> should I do?
> $ cat
> <page xmlns=""; type="guide" id="index">
> <title>Referência Médica</title>
> </page>
> $ gnome-doc-tool xhtml
> Unmatched element: page
> Unmatched element: title
> For me it seems that the syntax is correct. Isn't gnome-doc-utils
> (0.18) recognizing it as a Mallard page? Do I need to set up autottool
> files and the GNOME help  directories hierarchy? I'd like to try
> Mallard outside software documentation...

Unfortunately, I didn't get Mallard support into gnome-doc-tool
in gnome-doc-utils 0.18.  The stylesheets were added, and the
build magic was added, but not the quick-fire command line tool.

I've attached a quick Makefile you can use to build XHTML for
a Mallard document.  It doesn't need to be integrated into a
full build system.  Just drop it in the same directory as your
page files and type 'make'.

The stylesheets rely on a cache file being generated first, and
this Makefile will take care of that for you.  The format of the
cache file is probably going to change slightly, so be aware that
this Makefile may not work as-is with gnome-doc-utils 0.20.  (But
then, gnome-doc-tool should do the right thing in 0.20.)


pages=$(wildcard *.page)

all: $(htmls) index.cache

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

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

.PHONY: clean
	rm index.cache *.xhtml

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