diff options
Diffstat (limited to 'doc/examples/WWW')
27 files changed, 1306 insertions, 0 deletions
diff --git a/doc/examples/WWW/COPYING b/doc/examples/WWW/COPYING new file mode 100644 index 00000000..0b2d09ee --- /dev/null +++ b/doc/examples/WWW/COPYING @@ -0,0 +1,8 @@ +The files in this directory provide example uses of GNU M4. +The following copyright notice applies to each of these +description files. + +Copyright (C) 2006, 2010, 2013 Free Software Foundation, Inc. +This file is free software; the Free Software Foundation +gives unlimited permission to copy and/or distribute it, +with or without modifications, as long as this notice is preserved. diff --git a/doc/examples/WWW/Makefile b/doc/examples/WWW/Makefile new file mode 100644 index 00000000..c296ccf4 --- /dev/null +++ b/doc/examples/WWW/Makefile @@ -0,0 +1,45 @@ +M4 = ./m4/src/m4 +M4OPTS = -Im4lib + +VPATH = .:m4lib + +HTM = _footer.htm _header.htm bugs.htm changelog.htm download.htm \ + features.htm feedback.htm index.htm lists.htm modules.htm \ + news.htm readme.htm thanks.htm thissite.htm todo.htm uses.htm \ + visions.htm whatis.htm + +M4LIB = m4lib/bugs.m4 m4lib/changelog.m4 m4lib/download.m4 \ + m4lib/features.m4 m4lib/feedback.m4 m4lib/html.m4 \ + m4lib/index.m4 m4lib/layout.m4 m4lib/lists.m4 m4lib/menu.m4 \ + m4lib/modules.m4 m4lib/news.m4 m4lib/readme.m4 \ + m4lib/setup.m4 m4lib/test.m4 m4lib/thanks.m4 \ + m4lib/thissite.m4 m4lib/tmpl.m4 m4lib/todo.m4 m4lib/uses.m4 \ + m4lib/visions.m4 m4lib/whatis.m4 + +all: ./m4 $(HTM) + +./m4: + ln -s ../.. m4 + +%.htm: %.m4 + @$(M4) $(M4OPTS) $< >new.htm && \ + if cmp new.htm $@ >/dev/null 2>&1; then \ + rm new.htm; \ + echo "$@ has not changed"; \ + else \ + echo "$@ updated"; \ + mv new.htm $@; \ + fi + +.FORCE: +$(HTM): .FORCE $(M4LIB) + +changelog.htm: m4/ChangeLog +readme.htm: m4/README +todo.htm: m4/TODO +news.htm: m4/NEWS +modules.htm: m4/modules/README + +.PHONY: man +man: + cd man; $(MAKE) diff --git a/doc/examples/WWW/_footer.htm b/doc/examples/WWW/_footer.htm new file mode 100644 index 00000000..6bed8f2c --- /dev/null +++ b/doc/examples/WWW/_footer.htm @@ -0,0 +1,10 @@ +</TD> + +</TR> + +</TABLE> + +</BODY> + + +</HTML> diff --git a/doc/examples/WWW/_header.htm b/doc/examples/WWW/_header.htm new file mode 100644 index 00000000..1aea7999 --- /dev/null +++ b/doc/examples/WWW/_header.htm @@ -0,0 +1,231 @@ +<!DOCTYPE html public "-//w3c//dtd html 4.0 transitional//en"> +<HTML> +<HEAD> +<TITLE>GNU m4 - Development site</TITLE> +<META NAME="AUTHOR" CONTENT="René Seindal"> +<META NAME="GENERATOR" CONTENT="GNU m4 __m4_version__"> +</HEAD> + <BODY text="#000000" bgcolor="#FFCC99" link="#0000EF" alink="#FF0000" vlink="#51188E"> +<TABLE cellpadding=5 width="100%"> +<TR align=left valign=bottom> +<TD align=center valign=middle colspan="3" width="100%" bgcolor="#FF9900"> + +<H1>GNU m4</H1> + +<H2>Discussion Forum</H2> + +</TD> + +</TR> + <TR > +<TD align=left valign=top width="15%" bgcolor="#FF9900"> + + + + + + + + + + + +<TABLE > +<TR> +<TD bgcolor="#CC6600"> +<P> +<B>General info</B> +</P> + +</TD> + +</TR> + <TR> +<TD> +<P> + +<FONT size=-1><B><A HREF="/rene/gnu/whatis.htm">What is m4</A><BR> +<A HREF="/rene/gnu/features.htm">Features</A><BR> +<A HREF="/rene/gnu/uses.htm">Uses of m4</A></B></FONT> + +</P> + +</TD> + +</TR> + <TR> +<TD height=5> + +</TD> + +</TR> + <TR> +<TD bgcolor="#CC6600"> +<P> +<B>Documentation</B> +</P> + +</TD> + +</TR> + <TR> +<TD> +<P> + +<FONT size=-1><B><A HREF="/rene/gnu/man/m4_toc.html">Manual</A></B></FONT> + +</P> + +</TD> + +</TR> + <TR> +<TD height=5> + +</TD> + +</TR> + <TR> +<TD bgcolor="#CC6600"> +<P> +<B>Source files</B> +</P> + +</TD> + +</TR> + <TR> +<TD> +<P> + +<FONT size=-1><B><A HREF="/rene/gnu/readme.htm">README</A><BR> +<A HREF="/rene/gnu/todo.htm">TODO</A><BR> +<A HREF="/rene/gnu/news.htm">NEWS</A><BR> +<A HREF="/rene/gnu/changelog.htm">ChangeLog</A><BR> +<A HREF="/rene/gnu/thanks.htm">Contributors</A><BR> +<A HREF="/rene/gnu/m4/">Browse it</A></B></FONT> + +</P> + +</TD> + +</TR> + <TR> +<TD height=5> + +</TD> + +</TR> + <TR> +<TD bgcolor="#CC6600"> +<P> +<B>The Future</B> +</P> + +</TD> + +</TR> + <TR> +<TD> +<P> + +<FONT size=-1><B><A HREF="/rene/gnu/modules.htm">Modules</A><BR> +<A HREF="/rene/gnu/visions.htm">Visions</A></B></FONT> + +</P> + +</TD> + +</TR> + <TR> +<TD height=5> + +</TD> + +</TR> + <TR> +<TD bgcolor="#CC6600"> +<P> +<B>Feedback</B> +</P> + +</TD> + +</TR> + <TR> +<TD> +<P> + +<FONT size=-1><B><A HREF="/rene/gnu/lists.htm">Mailing-lists</A><BR> +<A HREF="/rene/gnu/feedback.htm">Feedback</A><BR> + +</P> + +</TD> + +</TR> + <TR> +<TD height=5> + +</TD> + +</TR> + <TR> +<TD bgcolor="#CC6600"> +<P> +<B>Development</B> +</P> + +</TD> + +</TR> + <TR> +<TD> +<P> + +<FONT size=-1><B><A HREF="/rene/gnu/download.htm">Download</A><BR> +<A HREF="/rene/gnu/bugs.htm">Known bugs</A></B></FONT> + +</P> + +</TD> + +</TR> + <TR> +<TD height=5> + +</TD> + +</TR> + <TR> +<TD bgcolor="#CC6600"> +<P> +<B>Examples</B> +</P> + +</TD> + +</TR> + <TR> +<TD> +<P> + +<FONT size=-1><B><A HREF="/rene/gnu/thissite.htm">This site</A></B></FONT> + +</P> + +</TD> + +</TR> + +</TABLE> + + + + + + + + +</TD> + <TD align=left valign=top width="90%"> diff --git a/doc/examples/WWW/m4lib/COPYING b/doc/examples/WWW/m4lib/COPYING new file mode 100644 index 00000000..0b2d09ee --- /dev/null +++ b/doc/examples/WWW/m4lib/COPYING @@ -0,0 +1,8 @@ +The files in this directory provide example uses of GNU M4. +The following copyright notice applies to each of these +description files. + +Copyright (C) 2006, 2010, 2013 Free Software Foundation, Inc. +This file is free software; the Free Software Foundation +gives unlimited permission to copy and/or distribute it, +with or without modifications, as long as this notice is preserved. diff --git a/doc/examples/WWW/m4lib/bugs.m4 b/doc/examples/WWW/m4lib/bugs.m4 new file mode 100644 index 00000000..5d8e5f52 --- /dev/null +++ b/doc/examples/WWW/m4lib/bugs.m4 @@ -0,0 +1,53 @@ +include(`setup.m4') + +\set_author([René Seindal]) +\set_title([Known bugs in GNU m4 \__m4_version__]) + +\divert(1) +\h2([Known bugs in GNU m4]) + +\define([fixed], [\p([Fixed in version 1.4$1])]) + +\define([notme], [\p([A <A +HREF="mailto:m4-feedback@seindal.dk?subject=GNU m4: \defn([_item])" +>volunteer</A> is badly needed for this, as I have no way of testing +this myself.])]) + +\ul([ + +\item([undivert], [undivert(0) might read from standard output], + +[\p([If calling \tt(undivert(0)) when diverting to a non-zero diversion +will cause m4 to read from standard output in an attempt to bring back +diversion 0, which is not possible.]) + +\fixed(n) + +]) + +\item([sigaltstack], [failure if sigaltstack or sigstack returns ENOSYS], + +[\p([If stack overflow detection is configured but the system doesn't +support sigaltstack(2) or sigstack(2), m4 fails when the system call +returns ENOSYS. It should silently revert to default behaviour.]) + +\notme +]) + +]) + +\p([See also the \link(todo.htm, TODO) file.]) + +\print_items + +\divert(0)\dnl +\DO_LAYOUT([\undivert(1)]) +\divert(-1) + + +\item([], [], + +[\p([]) + +]) +\undivert diff --git a/doc/examples/WWW/m4lib/changelog.m4 b/doc/examples/WWW/m4lib/changelog.m4 new file mode 100644 index 00000000..cdcab269 --- /dev/null +++ b/doc/examples/WWW/m4lib/changelog.m4 @@ -0,0 +1,18 @@ +include(`setup.m4') + +\set_author([René Seindal]) +\set_title([ChangeLog]) + +\divert(1) + +<PRE>\dnl +\changesyntax([A<>])\dnl +\changequote(,)\dnl +\include(m4/ChangeLog) +\changequote([,])\dnl +\changesyntax([O<>])\dnl +</PRE> + +\divert(0)\dnl +\DO_LAYOUT([\undivert(1)]) +\divert(-1) diff --git a/doc/examples/WWW/m4lib/download.m4 b/doc/examples/WWW/m4lib/download.m4 new file mode 100644 index 00000000..d9ee4095 --- /dev/null +++ b/doc/examples/WWW/m4lib/download.m4 @@ -0,0 +1,24 @@ +include(`setup.m4') + +\set_author([René Seindal]) +\set_title([Download]) + +\divert(1) + +\p([In the download area there are usually several version +present. Please take only the latest.]) + +\p([The files are name \tt(m4-1.4\i(X).tar.gz) where X is a letter.]) + +\p([\link([ftp://ftp.seindal.dk/pub/rene/gnu/], [Download latest +development version]).]) + +\p([\link([ftp://ftp.seindal.dk/pub/rene/gnu/m4-1.4.tar.gz],[Download +latest stable version]).]) + +\p([\link([ftp://ftp.seindal.dk/pub/rene/gnu/djgpp/],[Download +DOS/Windows port of latest stable version]).]) + +\divert(0)\dnl +\DO_LAYOUT([\undivert(1)]) +\divert(-1) diff --git a/doc/examples/WWW/m4lib/features.m4 b/doc/examples/WWW/m4lib/features.m4 new file mode 100644 index 00000000..57b68c9e --- /dev/null +++ b/doc/examples/WWW/m4lib/features.m4 @@ -0,0 +1,58 @@ +include(`setup.m4') + +\set_author([René Seindal]) +\set_title([New feaures since version 1.4]) + +\divert(1) + +\p(Please look at the \link(news.htm, NEWS) and the \link(changelog.htm, +ChangeLog) for all the gory details.) + +\dl( +\dt(\b(GNU m4 uses GNU Automake and GNU Autoconf for configuration.)) + +\dd(\p(This has been long overdue, and now hit is done thanks to Erick +Branderhorst.)) + +\dt(\b(GNU m4 uses GNU gettext for internationalisation.)) + +\dd(\p(GNU m4 now speaks several languages. Translations for +german, french, italian, japanese, dutch, polish, romenian and swedish +have been made.)) + +\dt(\b(Support for multiple precision arithmetic in eval.)) + +\dd(\p(If appropriately configured, GNU m4 can now do multiple precision +arithmetic in the built in macro 'eval'. If not configured, GNU m4 +will use the largest integer available for its calculations.)) + +\dt(\b(An input syntax table to change how input is parsed.)) + +\dd(\p(A new build in macro 'changesyntax' allows finer control over how input +characters are parsed into input tokens. It is now possible to have +several one character quote strings or comment delimiters, to change the +format of macro calls, to use active characters like in TeX, and probably +most useful, to change what input characters are treated as letters when +looking for macro calls.) + +\p(See the \link(man/m4_7.html#SEC41, manual section) for more details.)) + +\dt(\b(Support for loadable modules.)) + +\dd(\p(GNU m4 now has support for dynamic loading of compiled modules at +runtime. A module can define any number of new built in macros, which +will be indistinguishable from the standard set of built in +macros. Modules can also override existing built in macros.) +) + +\dt(\b(Better control of sync-lines generation.)) + +\dd(\p(The new built in macro 'syncoutput' allows better control of the +generation of sync-lines. They can now be turned on or off at +will.)) + +) + +\divert(0)\dnl +\DO_LAYOUT([\undivert(1)]) +\divert(-1) diff --git a/doc/examples/WWW/m4lib/feedback.m4 b/doc/examples/WWW/m4lib/feedback.m4 new file mode 100644 index 00000000..f61d63e5 --- /dev/null +++ b/doc/examples/WWW/m4lib/feedback.m4 @@ -0,0 +1,20 @@ +include(`setup.m4') + +\set_author([René Seindal]) +\set_title([Feedback]) + +\divert(1) + +\p(Bug reports should be sent to \link(mailto:bug-m4@gnu.org, +bug-m4@gnu.org).) + +\p(Generel discussion about GNU m4 should take place on +\link(mailto:m4-forum@seindal.dk, m4-forum).) + +\p(Informal comments about this site and GNU m4 can be sent to +\link(mailto:m4-feedback@seindal.dk, m4-feedback).) + + +\divert(0)\dnl +\DO_LAYOUT([\undivert(1)]) +\divert(-1) diff --git a/doc/examples/WWW/m4lib/html.m4 b/doc/examples/WWW/m4lib/html.m4 new file mode 100644 index 00000000..94ed69ed --- /dev/null +++ b/doc/examples/WWW/m4lib/html.m4 @@ -0,0 +1,122 @@ +\define([n], [ +]) + +\define([concat], [\ifelse($#, 0, , + $#, 1, [$1], + [$1 \concat(\shift($@))])]) + +\define([toupper], [\translit([$*], [a-z], [A-Z])]) + +\define([container], +[\pushdef([_tag], \toupper([$1]))\dnl +\ifelse($#, 1, [<\_tag></[\_tag]>], + $#, 2, [<\_tag>$2</\_tag>], + $#, 3, [<\_tag $2>$3</\_tag>], + [<\_tag $2>\concat(\shift(\shift($@)))</\_tag>])\dnl +\popdef([_tag])\dnl +]) + +\define([large_container], +[\pushdef([_tag], \toupper([$1]))\dnl +\ifelse($#, 1, [<\_tag></\_tag>\n], + $#, 2, [<\_tag>\n[]$2\n</\_tag>\n], + $#, 3, [<\_tag $2>\n[]$3\n</\_tag>\n], + [<\_tag $2>\n\concat(\shift(\shift($@)))\n</\_tag>\n])\dnl +\popdef([_tag])\dnl +]) + +\define([large_simple_container], +[\pushdef([_tag], \toupper([$1]))\dnl +<\_tag>\n\concat(\shift($@))\n</\_tag>\n\dnl +\popdef([_tag])\dnl +]) + +\define([simple_container], +[\pushdef([_tag], \toupper([$1]))\dnl +<\_tag>\concat(\shift($@))</\_tag>\dnl +\popdef([_tag])\dnl +]) + +\define([simple_tag], +[\pushdef([_tag], \toupper([$1]))\dnl +\ifelse([$2], [], [<\_tag>], [<\_tag $2>])\dnl +\popdef([_tag])\dnl +]) + +\define([doctype], [\simple_tag([!DOCTYPE], $@)]) + +\define([html], [\large_simple_container([$0], $@)]) +\define([head], [\large_simple_container([$0], $@)]) +\define([title], [\simple_container([$0], $@)]) + +\define([meta], [\n<META NAME="[$1]" CONTENT="[$2]">]) +\define([http_equiv], [\n<META HTTP-EQUIV="[$1]" CONTENT="[$2]">]) + +\define([body], [\large_container([$0], $@)]) + +\define([center], [\large_simple_container([$0], $@)]) +\define([right], [\large_simple_container([$0], $@)]) +\define([left], [\large_simple_container([$0], $@)]) +\define([div], [\large_container([$0], $@)]) + +\define([b], [\simple_container([$0], $@)]) +\define([i], [\simple_container([$0], $@)]) +\define([tt], [\simple_container([$0], $@)]) + +\define([table], [\large_container([$0], $@)]) +\define([tr], [\large_container([$0], $@)]) +\define([td], [\large_container([$0], $@)]) +\define([th], [\large_container([$0], $@)]) + +\define([link], [<A HREF="$1">\shift($*)</A>]) +\define([target], [<A NAME="$1">\shift($*)</A>]) + +\define([font], [\n\container([$0], $@)\n]) + +\define([h1], [\n\container([$0], $@)\n]) +\define([h2], [\n\container([$0], $@)\n]) +\define([h3], [\n\container([$0], $@)\n]) +\define([h4], [\n\container([$0], $@)\n]) +\define([h5], [\n\container([$0], $@)\n]) +\define([h6], [\n\container([$0], $@)\n]) + +\define([p], [\large_simple_container([$0], $@)]) + +\define([hr], [\simple_tag([$0], $@)]) + +\define([ul], [\large_container([$0], $@)]) +\define([ol], [\large_container([$0], $@)]) + +\define([li], [\simple_tag([$0], $@)]) + +\define([blockquote], [\large_simple_container([$0], $@)]) + +\define([dl], [\large_simple_container([$0], $@)]) +\define([dt], [\simple_container([$0], $@)]) +\define([dd], [\large_simple_container([$0], $@)]) + +\define([br], [\simple_tag([$0], $@)]) +\define([hline], [\simple_tag([$0], $@)]) + +\define([pre], [\simple_container([$0], $@)]) + + + +\define([set_title], [\define([_TITLE], [$*])]) +\set_title(_TITLE) + +\define([set_author], [\define([_AUTHOR], [$*])]) +\set_author() + +\define([set_generator], [\define([_GENERATOR], [$*])]) +\set_generator([GNU m4 \__m4_version__]) + +\define([set_keywords], [\define([_KEYWORDS], [$*])]) +\set_keywords() + +\define([set_body], [\define([_BODY], [$*])]) +\set_body() + +\define([meta_if_set], + [\ifelse(\defn([_$1]), [], [], \meta([$1], \defn([_$1])))]\dnl +) diff --git a/doc/examples/WWW/m4lib/index.m4 b/doc/examples/WWW/m4lib/index.m4 new file mode 100644 index 00000000..dbccc67b --- /dev/null +++ b/doc/examples/WWW/m4lib/index.m4 @@ -0,0 +1,36 @@ +include(`setup.m4') + +\set_author([René Seindal]) +\set_title([Development site]) + +\divert(1) +\h2([Current development version is \__m4_version__.]) + +\p([Development versions contain new features and experiments that might +or might not make it into the next official release. The current +development version contains among other things (browse the +\link([features.htm], [new features]) for more detail):]) + +\ul([ + \li Uses GNU Automake and GNU Autoconf for configuration. + + \li Uses GNU gettext for internationalisation. + + \li Support for multiple precision arithmetic in eval. + + \li An input syntax table to change how input is parsed. + + \li Support for loadable modules. + + \li Better control of sync-lines generation. + + \li Various bug-fixes. +]) + +\p([A new release is expected ready for Spring 2000.]) + +\p([GNU \tt(m4) 1.4 is from october 1994 and can be considered stable.]) + +\divert(0)\dnl +\DO_LAYOUT([\undivert(1)]) +\divert(-1) diff --git a/doc/examples/WWW/m4lib/layout.m4 b/doc/examples/WWW/m4lib/layout.m4 new file mode 100644 index 00000000..e54002db --- /dev/null +++ b/doc/examples/WWW/m4lib/layout.m4 @@ -0,0 +1,65 @@ +\divert(-1); +The semicolons are just to get GNU Emacs C mode to indent properly. + +\define([C_TEXT], [text="#000000"]); +\define([C_LINK], [link="#0000EF"]); +\define([C_ALINK], [vlink="#51188E"]); +\define([C_VLINK], [alink="#FF0000"]); +\define([C_BG1], [bgcolor="#FFCC99"]); +\define([C_BG2], [bgcolor="#FF9900"]); +\define([C_BG3], [bgcolor="#CC6600"]); + +\define([DO_HEADER], + [\head([\title([GNU m4 - \defn([_TITLE])])], + [\meta_if_set([AUTHOR])], + [\meta_if_set([GENERATOR])], + [\meta_if_set([KEYWORDS])], + )]); + +\define([DO_BODY], + [\body([\C_TEXT \C_BG1 \C_LINK \C_VLINK \C_ALINK], + [\table([cellpadding=5 width="100%"], + [\tr([align=left valign=bottom], + [\td([align=center valign=middle colspan="3" width="100%" \C_BG2], + [\h1([GNU m4])], + [\h2(\defn([_TITLE]))], + )], + )], + [\tr([], + [\td([align=left valign=top width="15%" \C_BG2], + [\include([menu.m4])], + )], + [\td([align=left valign=top width="90%"], + [$*], + )], + )], + )], + )] + ); + +\define([DO_LAYOUT], + [\doctype([html public "-//w3c//dtd html 4.0 transitional//en"]) +\html([\DO_HEADER], [\DO_BODY([$*])])] + ); + +\define([<], [<]); +\define([>], [>]); + +\define([showlink], [\link($1, $1)]); +\define([mailto], [\link(mailto:$1, $1)]); + + +<!-- These macros are for having first a simple toc and later a more +thorough description of each item --> + +\define([print_items], [\undivert(2)]) + +\define([item], [\li \link([[#]$1], [$2.]) +\pushdef([_div], \divnum)\dnl +\divert(2)\dnl +\hr([align=center width="50%"])\dnl +\h2([\target([$1], [$2])])\dnl +$3\dnl +\divert(\_div)\dnl +\popdef([_div])\dnl +]) diff --git a/doc/examples/WWW/m4lib/lists.m4 b/doc/examples/WWW/m4lib/lists.m4 new file mode 100644 index 00000000..cc710eba --- /dev/null +++ b/doc/examples/WWW/m4lib/lists.m4 @@ -0,0 +1,32 @@ +include(`setup.m4') + +\set_author([René Seindal]) +\set_title([Mailing lists]) + +\define([me], \link([mailto:rene@seindal.dk], [rene@seindal.dk])) + +\divert(1) + +\h3(There are two mailing lists for GNU m4) + +\dl( + +\dt(\b(\link(mailto:m4-forum@seindal.dk, m4-forum@seindal.dk))) + +\dd(\p(This list is intended for discussions between people interested +and/or participating in the further development of m4.)) + +\dt(\b(m4-announce@seindal.dk)) + +\dd(\p(Announcements regarding GNU m4 will posted here.) +\p(The volume will certainly be very low.)) + +) + +\p(Currently these lists are maintained manually. Send a message to \me +saying whether you want to subscribe or unsubscribe to any of these +lists.) + +\divert(0)\dnl +\DO_LAYOUT([\undivert(1)]) +\divert(-1) diff --git a/doc/examples/WWW/m4lib/menu.m4 b/doc/examples/WWW/m4lib/menu.m4 new file mode 100644 index 00000000..78c8edfd --- /dev/null +++ b/doc/examples/WWW/m4lib/menu.m4 @@ -0,0 +1,74 @@ +\pushdef([header], [\tr([\td([\C_BG3], [\p([\b([$1])])])])]) + +\pushdef([separator], [\tr([\td([height=5], [])])]) + +\pushdef([_row], [\link([$1], [$2])]) + +\pushdef([_rows], + [\ifelse($#, 0, [], + $#, 1, [], + $#, 2, [\_row([$1], [$2])], + $#, 3, [\_row([$1], [$2])], + [\_row([$1], [$2])\br\n\_rows(\shift(\shift($@)))])]) + +\pushdef([rows], [\tr([\td([\p([\font([size=-1], [\b([\_rows($@)])])])])])]) + +\table([], + [\header([General info])], + [\rows( + [whatis.htm], [What is m4], + [features.htm], [Features], + [uses.htm], [Uses of m4], + )], + [\separator], + + [\header([Documentation])], + [\rows( + [man/m4_toc.html], [Manual], + )], + [\separator], + + [\header([Source files])], + [\rows( + [readme.htm], [README], + [todo.htm], [TODO], + [news.htm], [NEWS], + [changelog.htm], [ChangeLog], + [thanks.htm], [Contributors], + [m4/], [Browse it], + )], + [\separator], + + [\header([The Future])], + [\rows( + [modules.htm], [Modules], + [visions.htm], [Visions], + )], + [\separator], + + [\header([Feedback])], + [\rows( + [lists.htm], [Mailing-lists], + [feedback.htm], [Feedback], + [/forum/list.php3?num=2], [Discussion Forum], + )], + [\separator], + + [\header([Development])], + [\rows( + [download.htm], [Download], + [bugs.htm], [Known bugs], + )], + [\separator], + + [\header([Examples])], + [\rows( + [thissite.htm], [This site], + )], +) + +\popdef([header]) +\popdef([rows]) +\popdef([_rows]) +\popdef([_row]) +\popdef([separator]) diff --git a/doc/examples/WWW/m4lib/modules.m4 b/doc/examples/WWW/m4lib/modules.m4 new file mode 100644 index 00000000..b9c148f1 --- /dev/null +++ b/doc/examples/WWW/m4lib/modules.m4 @@ -0,0 +1,18 @@ +include(`setup.m4') + +\set_author([René Seindal]) +\set_title([Modules]) + +\divert(1) + +<PRE>\dnl +\changesyntax([A<>])\dnl +\changequote(,)\dnl +\include(m4/modules/README) +\changequote([,])\dnl +\changesyntax([O<>])\dnl +</PRE> + +\divert(0)\dnl +\DO_LAYOUT([\undivert(1)]) +\divert(-1) diff --git a/doc/examples/WWW/m4lib/news.m4 b/doc/examples/WWW/m4lib/news.m4 new file mode 100644 index 00000000..e5da0d89 --- /dev/null +++ b/doc/examples/WWW/m4lib/news.m4 @@ -0,0 +1,18 @@ +include(`setup.m4') + +\set_author([René Seindal]) +\set_title([NEWS - History of user-visible changes]) + +\divert(1) + +<PRE>\dnl +\changesyntax([A<>])\dnl +\changequote(,)\dnl +\include(m4/NEWS) +\changequote([,])\dnl +\changesyntax([O<>])\dnl +</PRE> + +\divert(0)\dnl +\DO_LAYOUT([\undivert(1)]) +\divert(-1) diff --git a/doc/examples/WWW/m4lib/readme.m4 b/doc/examples/WWW/m4lib/readme.m4 new file mode 100644 index 00000000..1612c7d1 --- /dev/null +++ b/doc/examples/WWW/m4lib/readme.m4 @@ -0,0 +1,18 @@ +include(`setup.m4') + +\set_author([René Seindal]) +\set_title([README]) + +\divert(1) + +<PRE>\dnl +\changesyntax([A<>])\dnl +\changequote(,)\dnl +\include(m4/README) +\changequote([,])\dnl +\changesyntax([O<>])\dnl +</PRE> + +\divert(0)\dnl +\DO_LAYOUT([\undivert(1)]) +\divert(-1) diff --git a/doc/examples/WWW/m4lib/setup.m4 b/doc/examples/WWW/m4lib/setup.m4 new file mode 100644 index 00000000..310b65f8 --- /dev/null +++ b/doc/examples/WWW/m4lib/setup.m4 @@ -0,0 +1,7 @@ +divert(-1) +changequote([,]) +changecom([<!--], [-->]) +changesyntax([@\]) + +\include([html.m4]) +\include([layout.m4]) diff --git a/doc/examples/WWW/m4lib/test.m4 b/doc/examples/WWW/m4lib/test.m4 new file mode 100644 index 00000000..110cf12b --- /dev/null +++ b/doc/examples/WWW/m4lib/test.m4 @@ -0,0 +1,29 @@ +include(`setup.m4') + +\divert(1) + +\define([_ideas], []) + +\define([register_idea], +[\define([H_$1], [$2])\dnl +\define([T_$1], [$3])\dnl +\define([_ideas], [\print_idea([$1])]\defn([_ideas]))]) + +\define([print_idea], [ +\target([$1], [\h2([\indir([H_$1])])]) +\indir([T_$1]) +]) + +\define([print_ideas], [\indir([_ideas])]) + +\define([idea], [\li \p([\link([[#]$1], [$2.])])\register_idea([$1], [$2], [$3])]) + +\idea([guile], [Guile as an extension language], [gfhjdsfsarhgew]) +\idea([pquote], [Persistent quotes],[asdffhfdghgdsfh]) +\idea([deps], [Dependencies generation],[afsdffasdf]) + +\print_ideas + +\undivert(1) + +\defn([_ideas]) diff --git a/doc/examples/WWW/m4lib/thanks.m4 b/doc/examples/WWW/m4lib/thanks.m4 new file mode 100644 index 00000000..61928d07 --- /dev/null +++ b/doc/examples/WWW/m4lib/thanks.m4 @@ -0,0 +1,18 @@ +include(`setup.m4') + +\set_author([René Seindal]) +\set_title([People who have contributed to m4]) + +\divert(1) + +<PRE>\dnl +\changesyntax([A<>])\dnl +\changequote(,)\dnl +\include(m4/THANKS) +\changequote([,])\dnl +\changesyntax([O<>])\dnl +</PRE> + +\divert(0)\dnl +\DO_LAYOUT([\undivert(1)]) +\divert(-1) diff --git a/doc/examples/WWW/m4lib/thissite.m4 b/doc/examples/WWW/m4lib/thissite.m4 new file mode 100644 index 00000000..eecfa9cf --- /dev/null +++ b/doc/examples/WWW/m4lib/thissite.m4 @@ -0,0 +1,42 @@ +include(`setup.m4') + +\set_author([René Seindal]) +\set_title([This site]) + +\divert(1) + +\p([This GNU m4 site is maintained by René Seindal, +(\mailto(rene@seindal.dk)).]) + +\p([All files are generated using GNU m4 \__m4_version__. You can view +the \link(m4lib/, source files). They are very simple. They use some +features from GNU m4 1.4l]) + +\p([The basic M4 definitions of quotes, comments, escapes are in +\showlink(m4lib/setup.m4). This is first included by all files to +configure the enviroment correctly for the other files. To avoid have +macros called by accident, an escape character is defined with +changesyntax. \i(This is a new feature in m4 1.4l).]) + +\p([Some fairly general macros to generate various HTML construct are +found in \showlink(m4lib/html.m4). There are macros for simple tags, +containers with and without attributes, links and a few utility macros.]) + +\p([The visual aspects of the pages are in \showlink(m4lib/layout.m4). +The macros herein generate the complete HTML structure for the pages. +There are macros for making the header and the body of the document.]) + +\p([The definition of the left hand menu is in \showlink(m4lib/menu.m4). +I convinced GNU Emacs to do the indentation by switching to c-mode.]) + +\p([The page body is passed to the layout definitions as an argument. As +the text can be large, it is first diverted and the text passed to the +layout macros is simply a call to undivert. That way a very large text +can be passed around with very little cost. This page is made with +\link(m4lib/thissite.m4, these definitions).]) + +\p([There is a single file for each HTML file.]) + +\divert(0)\dnl +\DO_LAYOUT([\undivert(1)]) +\divert(-1) diff --git a/doc/examples/WWW/m4lib/tmpl.m4 b/doc/examples/WWW/m4lib/tmpl.m4 new file mode 100644 index 00000000..8262d293 --- /dev/null +++ b/doc/examples/WWW/m4lib/tmpl.m4 @@ -0,0 +1,11 @@ +include(`setup.m4') + +\set_author([René Seindal]) +\set_title([]) + +\divert(1) +\h2([]) + +\divert(0)\dnl +\DO_LAYOUT([\undivert(1)]) +\divert(-1) diff --git a/doc/examples/WWW/m4lib/todo.m4 b/doc/examples/WWW/m4lib/todo.m4 new file mode 100644 index 00000000..7a22c151 --- /dev/null +++ b/doc/examples/WWW/m4lib/todo.m4 @@ -0,0 +1,18 @@ +include(`setup.m4') + +\set_author([René Seindal]) +\set_title([TODO - Things still to be done]) + +\divert(1) + +<PRE>\dnl +\changesyntax([A<>])\dnl +\changequote(,)\dnl +\include(m4/TODO) +\changequote([,])\dnl +\changesyntax([O<>])\dnl +</PRE> + +\divert(0)\dnl +\DO_LAYOUT([\undivert(1)]) +\divert(-1) diff --git a/doc/examples/WWW/m4lib/uses.m4 b/doc/examples/WWW/m4lib/uses.m4 new file mode 100644 index 00000000..e29acb7a --- /dev/null +++ b/doc/examples/WWW/m4lib/uses.m4 @@ -0,0 +1,43 @@ +include(`setup.m4') + +\set_author([René Seindal]) +\set_title([Current uses of m4]) + +\divert(1) + +\p(The MTA sendmail uses \tt(m4) for generating configuration files.) + +\p(\link(http://www.gnu.org/software/autoconf/autoconf.html, GNU +Autoconf) uses \tt(m4) to generate "configure" scripts, that are used +for configuring \link(http://www.gnu.org/, GNU) software for a +particular platform.) + +\p(Htm4l is a set of macros for generating HTML. Html4 is written by +Terry Jones (terry@cliffs.ucsd.edu). See +\showlink(http://cliffs.ucsd.edu/terry/htm4l/htm4l/main.html) for +details. ) + +\p(Various programs uses m4 to preprocess configuration files, for +example the X11 window manager fvwm.) + +\p(There is an \link(http://www.ssc.com/lg/issue22/using_m4.html, +article in the Linux Gazette) about writing HTML with GNU m4 written by +\link(mailto:bhepple@bit.net.au, Bob Hepple) . More recent versions +are kept at \link(http://www.bit.net.au/~bhepple, Bob's home site). +The macros are used to maintain a large commercial site at +\showlink(http://www.finder.com.au).) + +\p(Other examples of GNU m4 generated HTML pages, written by +\link(mailto:max@alcyone.com, Erik Max Francis) can be found at the sites +\showlink(http://www.alcyone.com/max/), +\showlink(http://www.catcam.com/), +\showlink(http://www.crank.net/) and +\showlink(http://www.pollywannacracka.com/). +) + +\p(\link(thissite.htm, These files are created with GNU m4 \__m4_version__).) + + +\divert(0)\dnl +\DO_LAYOUT([\undivert(1)]) +\divert(-1) diff --git a/doc/examples/WWW/m4lib/visions.m4 b/doc/examples/WWW/m4lib/visions.m4 new file mode 100644 index 00000000..ba238ca9 --- /dev/null +++ b/doc/examples/WWW/m4lib/visions.m4 @@ -0,0 +1,232 @@ +include(`setup.m4') + +\set_author([René Seindal]) +\set_title([The Road Ahead]) + +\define([originator], +[\p([Idea contributed by [$1]]\ifelse($#, 2, [ (\mailto([$2]))])[.])]) + +\define([noone], [\p([There is no-one working on this now. Do you want +to <A HREF="mailto:m4-feedback@seindal.dk?subject=GNU m4: \defn([_item])" >volunteer</A>?])]) + + +\define([done], [\p([Done in version 1.4$1])]) + + +\divert(1) +\h2([Ideas for future versions of GNU m4]) + +\p([Here are some ideas and suggestion for the future of GNU m4, large +and small. The order here is fairly random.]) + +\ul([ + +\item([guile], [Guile as an extension language], + +[\p([\link([http://www.red-bean.com/guile/], [Guile]) can be used as an +extension language so complicated macros can be written in Scheme while +still maintaining the m4 interface. It will require some changes to the +base code, as guile cannot be used from a module.]) + +\noone <!-- \originator([René Seindal], [rene@seindal]) --> +]) + + +\item([utf8], [UTF-8 or wide characters], + +[\p([GNU m4 should be able to handle UTF-8 input or wide characters so +it can be more usable for different environments.]) + +\noone <!-- \originator([François Pinard]) --> +]) + + +\item([pquote], [Syntax: persistent quotes], + +[\p([Persistent quotes is a way of getting text unharmed through m4's +processing. While normal quotes are stripped when a quoted string is +read, the persistent quotes are removed just before being output. This +will ensure that the quoted text is always output verbatim.]) + +\p([The bulk of the changes will be in the parser (in input.c function +next_token). Persistent quotes cannot be nested, they must balance +within a normally quoted string, but normal quotes need not balance +within persistent quotes (neither within persistent quotes within normal +quotes). The quotes should be removed before being shipped out (in +macro.c).]) + +\noone <!-- \originator([Keith Bostic]) --> +]) + + + + +\item([comment2], [Syntax: removable comments], + +[\p([With the syntax table a category for discardable comments can be +defined, causing that type of comments to be discarded.]) + +\noone +]) + + + + +\item([comment1], [Option: remove comments], + +[\p([There should be an option (--discard-comments) to get m4 to discard +comments instead of passing them to the output.]) + +\done(n) +]) + + + +\item([deps], [Option: show dependencies], + +[\p([There should be an options to generate makefile dependencies for an +M4 input file.]) + +\p([It is not enough to scan the files for includes, as file names can +be generated and builtins renamed. To make it work, m4 will have to do +a complete run of the input file, discard the output and print the +dependencies instead.]) + +\p([It cannot be made to work in all cases when input file names are +generated on the fly.]) + +\noone <!-- \originator([Erick Branderhorst]) --> +]) + + +\item([safer], [Option: render GNU m4 safer], + +[\p([There should be a --safer option that disables all functions, that +could compromise system security if used by root. It will have to +include various functions, such as file inclusion, sub shells, module +loading, ...]) + +\noone <!-- \originator([Santiago Vila]) --> +]) + + + +\item([import], [Option: import environment], + +[\p([An option to defined each environment variable as a macro on +startup would be useful in many cases.]) + +\done(n) <!-- \originator([René Seindal]) --> +]) + + + +\item([m4expand], [Builtin: quote expanded text], + +[\p([A builtin to quote expanded text would be useful. Now it is not +possible to quote the expansion of a macro; the macro itself has to +provide the quotes. Some builtins return quoted strings, others +don't.]) + +\p([A possible solution is a build in macro that takes one argument. It +expands this argument fully and returns the quoted expansion.]) + +\p([It will require changes to input handling and macro expansion code.]) + +\noone <!-- \originator([Axel Boldt]) --> +]) + + + +\item([perl], [Module: embedded perl], + +[\p([Perl could be embedded in m4, giving users a powerful programming +language for writing macros. A single builtin "perleval" could do the +job. First argument could be a perl function and the rest arguments. +The return value of the function as a string would be the expansion.]) + +\p([The perl interpreter should be set up when the module is loaded and +closed down before m4 exits, using the appropriate hooks in the module +interface.]) + +\p([A perl module could potentially give users access to any facility +perl has access to, such as databases.]) + +\p([On systems with perl compiled as a shared library the size penalty +would be minimal.]) + +\p([(It might not be workable as a module, as it will need to link with non-shared libraries. Don't know how it can be fixed. (RS))]) + +\noone <!-- \originator([René Seindal]) --> +]) + + + +\item([output], [Module: better output control], + +[\p([It has been suggested a couple of times that it should be possible +to divert to named files, in order to create several output files.]) + +\p([I think this a bit a misunderstanding. Diversion are inteded to be +brought back later, ie, they are temporary and recoverable. Output +text, on the other hand, once output it is lost (for m4). Therefore +better output control should be made in a different way.]) + +\p([My suggestion is a set of builtins defined by a module:]) + +\pre([setoutput(file) +appendoutput(file) +pipeoutput(command)]) + +\p([With these output can be directed better, diversion can be sent to +different files, and groups of files can be built by a single m4 run. +Calling \tt(setoutput) without arguments should resume output to +standard output.]) + +\p([(Admittedly, diversion 0 (standard output) has always been +different, as it cannot be undiverted.)]) + +\noone <!-- \originator([René Seindal]) --> +]) + + + +\item([require], [Module: require/provide functionality], + +[\p([Two new builtins \tt(require) and \tt(provide) could provide a +handy interface to include. It has proven difficult to write these +robustly as normal macros. As an example, the files \tt(test.m4) and +\tt(../test.m4) could be the same file or different files depending on +the search path.]) + +\noone <!-- \originator([Terry Jones]) --> +]) + + +]) + + + +\p([See also the \link(todo.htm, TODO) file.]) + +\print_items + + + +\divert(0)\dnl +\DO_LAYOUT([\undivert(1)]) +\divert(-1) + +\divert(3)saljdfnaskdjfndsa\divert(-1) + + + + +\item([], [], + +[\p([]) + +\noone +]) + +\undivert diff --git a/doc/examples/WWW/m4lib/whatis.m4 b/doc/examples/WWW/m4lib/whatis.m4 new file mode 100644 index 00000000..2fa1c426 --- /dev/null +++ b/doc/examples/WWW/m4lib/whatis.m4 @@ -0,0 +1,48 @@ +include(`setup.m4') + +\set_author([René Seindal]) +\set_title([What is GNU m4]) + +\divert(1) + +\p([GNU \tt(m4) is an implementation of the traditional Unix macro +processor. GNU m4 is mostly compatible with the System V, Release 3 +version, and SVR4, although it has some extensions (for example, +handling more than 9 positional parameters to macros). GNU \tt(m4) +also has built-in functions for including files, running shell +commands, doing arithmetic, etc.]) + +\p([GNU \tt(m4) is a macro processor, in the sense that it copies its +input to the output, expanding macros as it goes. Macros are either +builtin or user-defined, and can take any number of arguments. Besides +just doing macro expansion, m4 has builtin functions for including named +files, running UNIX commands, doing integer arithmetic, manipulating +text in various ways, recursion, etc... m4 can be used either as a +front-end to a compiler, or as a macro processor in its own right.]) + +\p([The m4 macro processor is widely available on all UNIXes. Usually, +only a small percentage of users are aware of its existence. However, +those who do often become commited users. The growing popularity of GNU +Autoconf, which prerequires GNU m4 for generating the `configure' +scripts, is an incentive for many to install it, while these people will +not themselves program in m4.]) + +\p([Some people found m4 to be fairly addictive. They first use m4 for +simple problems, then take bigger and bigger challenges, learning how to +write complex m4 sets of macros along the way. Once really addicted, +users pursue writing of sophisticated m4 applications even to solve +simple problems, devoting more time debugging their m4 scripts than +doing real work. Beware that m4 may be dangerous for the health of +compulsive programmers.]) + +\p([Autoconf needs GNU m4 for generating `configure' scripts, but not for +running them.]) + +\p([GNU m4 is a Unix program. It is designed to work in a Unix-like +environment. GNU m4 1.4 has, however, been ported to DJGPP, the GNU C +compiler for DOS/Windows. These files are present in the +\link(download.htm, download area).]) + +\divert(0)\dnl +\DO_LAYOUT([\undivert(1)]) +\divert(-1) |