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

Note about setting the WML variable



First the good new. Looking into the problem below led me
to discover how to set the output file directly in the Makefile.
This means we will be able to get rid of the annoying
    #!wml -o ../../debian.org/%BASE.html.ja
lines at the top of all the .wml files. One less place for
things to go wrong.

The line
WML=wml -q -o $(@D)/$(@F)
in Make.lang should do the trick. I have changed the english/Make.lang
like this.

There is no reason to delete the #wml lines right away. Simply do it
whenever you modify a .wml file so the pages don't have to be mirrored
unnecessarily.

Now for the bad news. If you want to use tcs in the epilog things
are not as simple. Using
WML=wml -q --prolog="/usr/bin/tcs -f jis-kanji -t ujis" \
           --epilog="/usr/bin/tcs -f ujis -t jis-kanji" \
           -o $(@D)/$(@F)
doesn't quite do what you want. tcs writes to stdout so what this
does is create the output file and then runs tcs on it putting
the result on stdout. I believe the following works. I have modified
the Makefiles in the japanese dir to do this, but need someone who
reads japanese to take a look at the japanese pages to tell me if
it really does work.

In Make.lang
WML=wml -q --prolog="/usr/bin/tcs -f jis-kanji -t ujis" \
           --epilog="/usr/bin/tcs -f ujis -t jis-kanji > $(@D)/$(@F)" \
           -o $(@F)

In Make.templ.inc
$(HTMLDIR)/%.html.$(LANGUAGE) : %.wml $(TEMPLDIR)/template.wml $(TEMPLDIR)/languages.wml
	$(WML) $(EPILOG) $(<F)
	-rm -f $(@F)

An example will help clarify this. Suppose we want to compile japanese/intro/about.wml .
In japanese/intro
wml -q --prolog="/usr/bin/tcs -f jis-kanji -t ujis" \
           --epilog="/usr/bin/tcs -f ujis -t jis-kanji > ../../../debian.org/intro/about.html.ja" \
           -o about.html.ja
is run. This creates intro/about.html.ja before epilog is run and 
../../../debian.org/intro/about.html.ja as output from tcs, just
as we wanted. The extra line in Make.templ.inc just cleans things up for us.

Jay Treacy


Reply to: