pike.git / bin / mkxml.pike

version» Context lines:

pike.git/bin/mkxml.pike:1: - /* $Id: mkxml.pike,v 1.21 2001/05/09 12:42:04 grubba Exp $ */ + /* $Id: mkxml.pike,v 1.22 2001/05/09 12:54:44 grubba Exp $ */      import Stdio;   import Array;      mapping parse=([]);   int illustration_counter;      mapping manpage_suffix=   ([    "Image":"i",
pike.git/bin/mkxml.pike:305:    t=s; s="";    for (;;)    {    string a,b,c;    if (sscanf(t,"%s<%s>%s",a,b,c)<3) break;       if (b[..11]=="illustration" &&    sscanf(t,"%s<illustration%s>%s</illustration>%s",t,q,u,v)==4)    {    s+=replace(t,"\n\n","\n\n<p>")+ -  "<illustration "+where+" src=image_ill.pnm"+q+">\n" +  "<illustration "+where+" src='image_ill.pnm"+q+"'>\n"    +replace(u,"lena()","src")+"</illustration>";    t=v;    }    else if (b[..2]=="pre" &&    sscanf(t,"%s<pre%s>%s</pre>%s",t,q,u,v)==4)    {    s+=replace(t,"\n\n","\n\n<p>")+    "<pre"+q+">\n"+u+"</pre>";    t=v;    }
pike.git/bin/mkxml.pike:823:    break;    }   }      void make_doc_files()   {    html2xml=Parser.HTML();    html2xml->add_tag("p",lambda(mixed...) { return ({"</p><p>"}); });    html2xml->add_tag("br",lambda(mixed...) { return ({"<br/>"}); });    html2xml->add_tag("wbr",lambda(mixed...) { return ({"<wbr/>"}); }); +  html2xml->add_tag("dl", +  lambda(Parser.HTML p, mapping args) +  { +  return ({ sprintf("<dl%{ %s='%s'%}>", (array)args) }); +  }); +  html2xml->add_tag("dt", +  lambda(Parser.HTML p, mapping args) +  { +  return ({ sprintf("<dt%{ %s='%s'%}>", (array)args) }); +  });    html2xml->add_container(    "text",    lambda(Parser.HTML p,mapping args,string cont)    {   // werror("%O\n",cont);    cont=p->clone()->finish(cont)->read();   // werror("---\n");   // werror("%O\n",cont);    string res="<text><p>"+cont+"</p></text>";    string t;