diff options
| author | fukachan <fukachan> | 2005-06-25 10:03:37 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2005-06-25 10:03:37 +0000 |
| commit | 123012f8a54c9aa5ca5d0e21fa98385dff8c7152 (patch) | |
| tree | 9079b6738202c3c3ddad1b2528771f2a48b44b84 | |
| parent | f7cbfec74df8f8fd7e135c16de75b2fa6f5ab6a3 (diff) | |
| download | fml8-123012f8a54c9aa5ca5d0e21fa98385dff8c7152.tar.gz fml8-123012f8a54c9aa5ca5d0e21fa98385dff8c7152.tar.bz2 fml8-123012f8a54c9aa5ca5d0e21fa98385dff8c7152.zip | |
use sgml_compile.sh instead of sgmltools
| -rw-r--r-- | fml/doc/en/Makefile.template | 20 | ||||
| -rw-r--r-- | fml/doc/ja/Makefile.template | 16 | ||||
| -rwxr-xr-x | fml/utils/bin/sgml_compile.sh | 118 |
3 files changed, 148 insertions, 6 deletions
diff --git a/fml/doc/en/Makefile.template b/fml/doc/en/Makefile.template index b80fa2ce..6e0eb29f 100644 --- a/fml/doc/en/Makefile.template +++ b/fml/doc/en/Makefile.template @@ -1,5 +1,5 @@ # -# $FML: Makefile.template,v 1.1 2003/07/24 15:37:33 fukachan Exp $ +# $FML: Makefile.template,v 1.2 2003/07/24 16:23:16 fukachan Exp $ # TMP_DIR = /tmp/sgmltools @@ -12,6 +12,7 @@ TARGET_HTML_DIR = ../../../../Documentation/en/$(BOOK) TARGET_TEXT_DIR = ../../../../Documentation/en/text # programs (except for /bin/*) +SGML_CC = ../../../../fml/utils/bin/sgml_compile.sh UNIQ = uniq PERL = perl FIND = find @@ -36,7 +37,12 @@ ENV_VARS = TMPDIR=$(TMP_DIR) SGML_CATALOG_FILES=$(SGML_CATALOG_FILES) COLS=72 all: export -html: +html: _init + $(SGML_CC) $(SOURCE).sgml 2>&1 | $(UNIQ) + @ $(PERL) -i.bak $(FIX_CHARSET) $(SOURCE)/$(BOOK_ID).html + @ rm -f $(SOURCE)/@*/*.html.bak + +html.old: _init $(ENV) $(ENV_VARS) $(HTMLify) -b html $(SOURCE).sgml 2>&1 | $(UNIQ) @ $(PERL) -i.bak $(FIX_CHARSET) $(SOURCE)/$(BOOK_ID).html @ rm -f $(SOURCE)/@*/*.html.bak @@ -44,7 +50,13 @@ html: txt: $(ENV) $(ENV_VARS) $(TEXTify) -b txt $(SOURCE).sgml 2>&1 | $(UNIQ) -lynx: +w3m: _init + $(SGML_CC) -m w3m $(SOURCE).sgml 2>&1 | $(UNIQ) + +lynx: _init + $(SGML_CC) -m lynx $(SOURCE).sgml 2>&1 | $(UNIQ) + +lynx.old: _init $(ENV) $(ENV_VARS) $(TEXTify) -b lynx $(SOURCE).sgml 2>&1 | $(UNIQ) ps: @@ -52,7 +64,7 @@ ps: clean: $(FIND) . -type f -print |$(GREP) '~' |$(PERL) -nple unlink - rm -f book.txt + rm -f book.txt book.html rm -fr $(SOURCE) export: _init html lynx diff --git a/fml/doc/ja/Makefile.template b/fml/doc/ja/Makefile.template index c5023ee7..88d45b2c 100644 --- a/fml/doc/ja/Makefile.template +++ b/fml/doc/ja/Makefile.template @@ -1,5 +1,5 @@ # -# $FML: Makefile.template,v 1.5 2001/06/05 13:28:44 fukachan Exp $ +# $FML: Makefile.template,v 1.6 2004/04/07 11:17:37 fukachan Exp $ # TMP_DIR = /tmp/sgmltools @@ -12,6 +12,7 @@ TARGET_HTML_DIR = ../../../../Documentation/ja/$(BOOK) TARGET_TEXT_DIR = ../../../../Documentation/ja/text # programs (except for /bin/*) +SGML_CC = ../../../../fml/utils/bin/sgml_compile.sh UNIQ = uniq PERL = perl FIND = find @@ -37,6 +38,11 @@ ENV_VARS = TMPDIR=$(TMP_DIR) SGML_CATALOG_FILES=$(SGML_CATALOG_FILES) COLS=72 all: export html: _init + $(SGML_CC) $(SOURCE).sgml 2>&1 | $(UNIQ) + @ $(PERL) -i.bak $(FIX_CHARSET) $(SOURCE)/$(BOOK_ID).html + @ rm -f $(SOURCE)/@*/*.html.bak + +html.old: _init $(ENV) $(ENV_VARS) $(HTMLify) -b html $(SOURCE).sgml 2>&1 | $(UNIQ) @ $(PERL) -i.bak $(FIX_CHARSET) $(SOURCE)/$(BOOK_ID).html @ rm -f $(SOURCE)/@*/*.html.bak @@ -44,7 +50,13 @@ html: _init txt: _init $(ENV) $(ENV_VARS) $(TEXTify) -b txt $(SOURCE).sgml 2>&1 | $(UNIQ) +w3m: _init + $(SGML_CC) -m w3m $(SOURCE).sgml 2>&1 | $(UNIQ) + lynx: _init + $(SGML_CC) -m lynx $(SOURCE).sgml 2>&1 | $(UNIQ) + +lynx.old: _init $(ENV) $(ENV_VARS) $(TEXTify) -b lynx $(SOURCE).sgml 2>&1 | $(UNIQ) ps: _init @@ -52,7 +64,7 @@ ps: _init clean: $(FIND) . -type f -print |$(GREP) '~' |$(PERL) -nple unlink - rm -f book.txt + rm -f book.txt book.html rm -fr $(SOURCE) export: _init html lynx diff --git a/fml/utils/bin/sgml_compile.sh b/fml/utils/bin/sgml_compile.sh new file mode 100755 index 00000000..8b435668 --- /dev/null +++ b/fml/utils/bin/sgml_compile.sh @@ -0,0 +1,118 @@ +#!/bin/sh +# +# $FML$ +# + +# +# initialize variables +# +mode=html + +fml_dir=`dirname $0`/../.. +gnu_dir=`dirname $0`/../../../gnu +cur_dir=`pwd` +out_dir=$cur_dir/book +out_html=$cur_dir/book.html +out_txt=$cur_dir/book.txt +out_rtf=$cur_dir/book.rtf +tmp_dir=/var/tmp +tmp_file=$tmp_dir/tmpfile.$$ + +fml_sgml_dir=$fml_dir/doc/share/sgml +fml_catalog_path=$fml_sgml_dir/catalog +sgmltoolslite_catalog_path=$gnu_dir/dist/sgmltools-lite/dsssl/sgmltools.cat +pkg_catalog=/usr/pkg/etc/sgml/catalog +sgml_catalog_files=$SGML_CATALOG_FILES:$pkg_catalog:$sgmltoolslite_catalog_path +sgml_search_path=$SGML_SEARCH_PATH:$fml_catalog_path:$cur_dir; + +for path in /usr/pkg/bin/openjade /usr/pkg/bin/lynx /usr/pkg/bin/w3m +do + if [ ! -x $path ];then + echo "error: $path not found" + exit 1 + fi +done + +# +# getopts +# +set -- `getopt dm: $*` + +if test $? != 0; then echo 'Usage: ...'; exit 2; fi + +for i +do + case $i + in + -d) + debug=1; + shift;; + -m) + mode=$2; shift; + shift;; + --) + shift; break;; + esac +done + +source=$cur_dir/$1 + + +# +# fix environment +# +TMPDIR=$tmp_dir ; export TMPDIR +COLS=72 ; export COLS +SGML_SEARCH_PATH=$sgml_search_path ; export SGML_SEARCH_PATH +SGML_CATALOG_FILES=$sgml_catalog_files; export SGML_CATALOG_FILES + +# +# main: go! +# +common_options="\ + -v \ + -o $tmp_file \ + -c $fml_catalog_path " + +if [ "X$mode" = "Xhtml" -o "X$mode" = "Xonehtml" ];then + test -d $out_dir || mkdir $out_dir + chdir $out_dir || exit 1 + + dsssl=$gnu_dir/dist/sgmltools-lite/dsssl/html.dsl + + /usr/pkg/bin/openjade $common_options \ + -t sgml \ + -c $fml_catalog_path \ + -d $dsssl#$mode \ + -d $fml_sgml_dir/fml.dsl \ + > $out_html < $source + +elif [ "X$mode" = "Xlynx" ];then + + dsssl=$gnu_dir/dist/sgmltools-lite/dsssl/ascii-lynx.dsl + + /usr/pkg/bin/openjade $common_options \ + -t sgml \ + -d $dsssl#html \ + > $out_html < $source + + /usr/pkg/bin/lynx -dump -nolist -force_html $out_html > $out_txt + mv $out_html $tmp_dir + +elif [ "X$mode" = "Xw3m" ];then + + dsssl=$gnu_dir/dist/sgmltools-lite/dsssl/ascii-w3m.dsl + + /usr/pkg/bin/openjade $common_options \ + -t sgml \ + -d $dsssl#html \ + > $out_html < $source + + /usr/pkg/bin/w3m -T text/html -dump $out_html > $out_txt + mv $out_html $tmp_dir + +else + echo "error: unknown mode: $mode" +fi + +exit 0; |
