diff --git a/tutorial/Wmml.pmod b/tutorial/Wmml.pmod index 1f611165a2b12c261248d7e19a407c99f090d902..b5e7c1c7767454b16d72d57eff83334a5b387d4e 100644 --- a/tutorial/Wmml.pmod +++ b/tutorial/Wmml.pmod @@ -805,18 +805,20 @@ SGML low_make_concrete_wmml(SGML data) foreach(reserved_pike,string keyword) reswords[keyword]="ex_keyword"; - ret+=({parse_pike_code(tag->data[0], - tag->pos, - reswords)}); + ret+=({Sgml.Tag("pre",([]),tag->pos, + ({parse_pike_code(tag->data[0], + tag->pos, + reswords)}))}); continue; case "c": foreach(reserved_c,string keyword) reswords[keyword]="ex_keyword"; - ret+=({parse_pike_code(tag->data[0], - tag->pos, - reswords)}); + ret+=({Sgml.Tag("pre",([]),tag->pos, + ({parse_pike_code(tag->data[0], + tag->pos, + reswords)}))}); continue; } } diff --git a/tutorial/html.pike b/tutorial/html.pike index 46b69e2d404c2ee7e232ba26206dd62d782ebcd6..1a956923a32b784d88f978b91115d5635284e6a9 100644 --- a/tutorial/html.pike +++ b/tutorial/html.pike @@ -404,6 +404,38 @@ SGML data_description(mapping arg,int pos,array(object) data, ret+=({" ",Sgml.Tag("b",([]),t[3],preify(t[4],id)),"\n"}); return ({Sgml.Tag("pre",([]),pos,({"({\n"})+ret+({"})\n"}))}); } + + case "mapping": + { + SGML ret=({}); + int ns,id,nl,ins; + ns=max(@Array.map(d, + lambda(array z) + { + if (z[0] && z[2]) + return strlen(z[0])+ + strlen(z[1])+ + strlen(z[2])+1; + return strlen(z[0]||z[2]||"")+strlen(z[1]||""); + }))+5; + if (ns>30) id=8,nl=1; else id=ns+2,nl=0; + foreach (d,array t) + if (t[1]) + { + if (t[0] && t[2]) + ret+=({sprintf(" %-*s ", + ns,"\""+t[1]+"\" : "+t[0]+" "+t[2],ins)}); + else + ret+=({sprintf(" %-*s ", + ns,"\""+t[1]+"\" : "+(t[2]||t[0]),ins)}); + ret+=({Sgml.Tag("i",([]),t[3], + (nl?({"\n"+" "*id}):({}))+ + preify(t[4],id)),"\n"}); + } + else /* group title */ + ret+=({" ",Sgml.Tag("b",([]),t[3],preify(t[4],id)),"\n"}); + return ({Sgml.Tag("pre",([]),pos,({"([\n"})+ret+({"])\n"}))}); + } default: werror("Warning: Illegal/unimplemented data type %O" " (near "+orig->location()+")\n",type); diff --git a/tutorial/tutorial.wmml b/tutorial/tutorial.wmml index e40399ab3235eabcb35c157c8f06e7eeb8806df3..4d80084864098f49b732de8cde787cc4544bfcec 100644 --- a/tutorial/tutorial.wmml +++ b/tutorial/tutorial.wmml @@ -11230,9 +11230,9 @@ about the file. Currently file_stat returns 7 entries:<br> <data_description type=array(int)> <elem value=mode>file mode, protection bits etc. etc. </elem> <elem value=size>file size for regular files, <br> --2 for dirs,<br> --3 for links,<br> --4 for otherwise </elem> + -2 for dirs,<br> + -3 for links,<br> + -4 for otherwise </elem> <elem value=atime>last access time </elem> <elem value=mtime>last modify time </elem> <elem value=ctime>last status time change </elem> @@ -11651,24 +11651,24 @@ mapping(string:int) localtime(int <I>time</I>); Given a time represented as second since 1970, as returned by the function time(), this function returns a mapping with the following components: -<p><table border=0 cellpadding=0 cellspacing=0> -<tr valign=top><td> sec </td><td> seconds over the minute </td><td> 0 - 59 </td></tr> -<tr valign=top><td> min </td><td> minutes over the hour </td><td> 0 - 59 </td></tr> -<tr valign=top><td> hour </td><td> what hour in the day </td><td> 0 - 23 </td></tr> -<tr valign=top><td> mday </td><td> day of the month </td><td> 1 - 31 </td></tr> -<tr valign=top><td> mon </td><td> what month </td><td> 0 - 11 </td></tr> -<tr valign=top><td> year </td><td> years since 1900 </td><td> 0 - </td></tr> -<tr valign=top><td> wday </td><td> day of week (0=Sunday) </td><td> 0 - 6 </td></tr> -<tr valign=top><td> yday </td><td> day of year </td><td> 0 - 365 </td></tr> -<tr valign=top><td> isdst </td><td> is daylight saving time </td><td> 0/1 </td></tr> -<tr valign=top><td> timezone </td><td> difference between local time and UTC </td></tr> -</table> +<data_description type=mapping> +<elem type=int(0..59) name=sec >seconds over the minute </elem> +<elem type=int(0..59) name=min >minutes over the hour </elem> +<elem type=int(0..59) name=hour >what hour in the day </elem> +<elem type=int(1..31) name=mday >day of the month </elem> +<elem type=int(0..11) name=mon >what month </elem> +<elem type=int(0..) name=year >years since 1900 </elem> +<elem type=int(0..6) name=wday >day of week (0=Sunday) </elem> +<elem type=int(0..365) name=yday>day of year </elem> +<elem type=int(0..1) name=isdst>is daylight saving time </elem> +<elem type=int name=timezone>difference between local time and UTC </elem> +</data_description> </man_description> <man_note> The 'timezone' might not be available on all platforms. </man_note> <man_see> -gmtime, time, ctime, mktime +Calendar, gmtime, time, ctime, mktime </man_see> </function> diff --git a/tutorial/wmml.wmml b/tutorial/wmml.wmml index 31a42526372530bc8d50c2690cbe9d01710fb184..6ea6562cbd89f1d9b3a53ddd53d056807b1ddfd1 100644 --- a/tutorial/wmml.wmml +++ b/tutorial/wmml.wmml @@ -35,13 +35,13 @@ This is a terse documentation about WMML. </man_syntax> <man_arguments> <aargdesc><aarg>language</aarg> - <adesc>what language the example is written in - (pike is the only supported)</adesc></aargdesc> + <adesc>what language the example is written in; + pike and c are supported</adesc></aargdesc> <aargdesc><aarg>meta</aarg> <adesc>comma-separated list of ?</adesc></aargdesc> <man_description> This tag marks an area as an example. If <tt>language</tt> equals -"<tt>pike</tt>", the are will count as preformatted. +"<tt>pike</tt>" or "<tt>c</tt>", the are will count as preformatted. </man_description> <man_see>man_example, data_description</man_see> </method>