Branch: Tag:

1998-03-07

1998-03-07 20:02:02 by Fredrik Noring <noring@nocrew.org>

Improved doc handling.

Rev: server/modules/graphics/graphic_text.pike:1.114
Rev: server/modules/tags/doc/graphic_text:1.1

1: - constant cvs_version="$Id: graphic_text.pike,v 1.113 1998/03/06 11:12:10 per Exp $"; + constant cvs_version="$Id: graphic_text.pike,v 1.114 1998/03/07 20:01:03 noring Exp $";   constant thread_safe=1;      #include <module.h>
10:   #define VAR_MORE 0   #endif /* VAR_MORE */    + static private int loaded; +  + static private string doc() + { +  return !loaded?"":replace(Stdio.read_bytes("modules/tags/doc/graphic_text") +  ||"", ({ "{", "}" }), ({ "&lt;", "&gt;" })); + } +    array register_module()   {    return ({ MODULE_LOCATION | MODULE_PARSER,    "Graphics text", -  +  ("Generates graphical texts.<p>" +  "See <tt>&lt;gtext help&gt;&lt;/gtext&gt;</tt> for " +  "more information.\n<p>"+doc()), + #if 0    "Defines a few new containers, which all render text to gifs "    "using the image module in pike.\n<p>"    "<b>&lt;gh1&gt;</b> to <b>&lt;gh6&gt;:</b> Headers<br>\n"
108:    " target=...\n"    " onClick=...\n"    "</pre>\n", + #endif    0,    1,    });
710:      void start(int|void val, object|void conf)   { +  loaded = 1; +     if(conf)    {    mkdirhier( query( "cache_dir" )+".foo" );
1245:   //Allow <accessed> and others inside <gtext>.       if(t=="gtext" && arg->help) -  return register_module()[2]; +  return doc();    else if(arg->help)    return "This tag calls &lt;gtext&gt; with different default values.";    if(arg->background)