pike.git / src / modules / Image / mkdoc.pike

version» Context lines:

pike.git/src/modules/Image/mkdoc.pike:1: - /* $Id: mkdoc.pike,v 1.11 1997/10/27 22:40:34 mirar Exp $ */ + /* $Id: mkdoc.pike,v 1.12 1997/10/29 02:57:06 mirar Exp $ */      import Stdio;   import Array;      mapping parse=([]);   int illustration_counter; -  + object illustration_source;      string illustration_code=read_bytes("illustration.pike");   object lena_image=Image.image()->fromppm(read_file("doc/lena.ppm"));      /*      module : mapping <- moduleM    "desc" : text    "see also" : array of references    "note" : mapping of "desc": text
pike.git/src/modules/Image/mkdoc.pike:183:    }    object f=File();    if (!f->open(filename,"wtc"))    {    stdout->write("failed.");    exit(1);    }    return f;   }    + mapping ills=([]); +    string fixdesc(string s,string prefix)   {    s=stripws(s);       string t,u,v;       t=s; s="";    while (sscanf(t,"%s<ref>%s</ref>%s",t,u,v)==3)    {    s+=t+make_nice_reference(u,prefix);    t=v;    }    s+=t;       t=s; s="";    while (sscanf(t,"%s<illustration>%s</illustration>%s",t,u,v)==3)    {    s+=t; -  +     array err=catch {    object x=compile_string(replace(illustration_code,"***the string***",u))();    x->lena_image=lena_image; -  u=x->doit("illustration_"+illustration_counter+++".gif"); +  u=x->doit("illustration_"+illustration_counter+++".gif", +  ills,illustration_source,u);    };    if (err)    {    stderr->write("error while compiling and running\n"+u+"\n");    stderr->write(master()->describe_backtrace(err)+"\n");    }    else s+=u;    t=v;    }    s+=t;
pike.git/src/modules/Image/mkdoc.pike:468:    module+"."+clas);       foreach (sort(indices(mod->modules||([]))),clas)    document_module(mod->modules[clas],module+"."+clas,dir);   }      void make_doc_files(string dir)   {    stdout->write("modules: "+sort(indices(parse))*", "+"\n");    +  illustration_source=File(); +  illustration_source->open(dir+"illustrations.html","wct"); +     string module;       foreach (sort(indices(parse)),module)    document_module(parse[module],module,dir);   }      int main(int ac,string *files)   {    string s,t;    int line;