pike.git / bin / htmlify_docs.lpc

version» Context lines:

pike.git/bin/htmlify_docs.lpc:198:   string html_quote(string s)   {    return replace(s,({"&","<",">"}),({"&amp;","&lt;","&gt;"}));   }      string html_unquote(string s)   {    return replace(s,({"&amp;","&lt;","&gt;"}),({"&","<",">"}));   }    + string mkdocument(string s,string title) + { +  return ("<html>"+ +  "<title>"+ +  html_quote(title)+ +  "</title>"+ +  "<body bgcolor=\"#A0E0C0\">"+ +  s+ +  "</body>"+ +  "</html>"); + } +    string convert_page(string path, string fname)   {    string output, short;    int headno;    string cont, section, name, part;       output="";       cont=read_bytes(path);   
pike.git/bin/htmlify_docs.lpc:325:    "<dd>\n"+rest+"\n<p>";    }    parts[partno]="<dl>\n"+implode(sections,"\n")+"\n</dl>\n";    if(part_name)    {    parts[partno]="<a name="+part_name+">\n"+    parts[partno]+    "\n</a>\n";    }    } -  output="<html><title>uLPC: "+name+"</title>"+ -  implode(parts,"<hr noshade size=1>\n"); +  output=mkdocument(implode(parts,"<hr noshade size=1>\n"),"uLPC: "+name);    }    return output;   }      void scanfiles(string path, string fname)   {    string nf,np;    nf=convert_page(path, fname);       if(nf && strlen(nf))
pike.git/bin/htmlify_docs.lpc:401:   }      string mkindex()   {    string ret;    string a,b;    mapping tmp=pages+([]);       ret="";    -  ret+="<H1>"+version()+"</h1>\n"; +  ret+="<H1>"+version()+" index</h1>\n";    -  ret+="<H1>Keyword lists</H1>\n<dl>\n"; +  ret+="<H2><b>Keyword lists</b></H2>\n<dl>\n";    foreach(sort_array(m_indices(keywords)),b)    {    ret+="<a name="+b+">";    ret+="<dt><h2>"+capitalize(b);    if(short_descs[b]) ret+=" - "+short_descs[b];    ret+="</h2><dd>\n";    ret+="<ul>\n";    foreach(keywords[b],a)    {    ret+="<li><a href="+pages[a]+">"+a+"</a> - "+short_descs[a]+"\n";
pike.git/bin/htmlify_docs.lpc:453:       ret+="</ul>\n";       ret+="<H1>Other pages</H1>\n<ul>\n";    foreach(sort_array(m_indices(tmp)),a)    {    ret+="<li><a href="+pages[a]+">"+a+"</a> - "+short_descs[a]+"\n";    }       ret+="</ul>\n"; -  return ret; +  return mkdocument(ret,"uLPC documentation index");   }      int main(int argc, string *argv)   {    string np;       megamagic::create("^(.*)&lt;([a-z_0-9][a-z_0-9]*)&gt;(.*)$");    lastident::create("^(.*[^<>a-z_0-9])([a-z_0-9][a-z_0-9]*)([^<>a-z_0-9]*)$");       write("Scanning links.\n");