|
|
Go to the documentation of this file.
54 std::cerr << rMessage << std::endl;
55 std::cout << "" << std::endl;
58 std::cout << "" << std::endl;
59 std::cerr << "utility to generate HTML from libFAUDES reference pages (*.fref)" << std::endl;
60 std::cerr << std::endl << "usage: " << std::endl;
61 std::cerr << " ref2html [options...] <fref-file> <html-file>" << std::endl;
62 std::cerr << " ref2html [options...] <fref-file 1> [...] <fref-file n> <html-dir>" << std::endl;
63 std::cerr << " ref2html [options...] <fref-dir> <html-dir>" << std::endl;
64 std::cerr << "with options as follows:" << std::endl;
65 std::cerr << " -rti <rti-file> use specified run-time-interface definition" << std::endl;
66 std::cerr << " -flx <flx-file> use specified lua-extension file" << std::endl;
67 std::cerr << " -css <css-file> use specified style sheet" << std::endl;
68 std::cerr << " -cnav <fref-file> use specified chapter navigation file" << std::endl;
69 std::cerr << " -chapter <label> overwrite chapter label" << std::endl;
70 std::cerr << " -section <label> overwrite section label" << std::endl;
71 std::cerr << " -rel <prefix> prefix to chapter documentation base" << std::endl;
72 std::cerr << " -inc <fref-file> include table of contents" << std::endl;
73 std::cerr << std::endl << std::endl;
74 std::cerr << " ref2html -toc <fref-files> <output-file>" << std::endl;
75 std::cerr << "to generate table of contents file" << std::endl;
76 std::cerr << std::endl << std::endl;
77 std::cerr << " ref2html -doxheader <output-file>" << std::endl;
78 std::cerr << " ref2html -doxfooter <output-file>" << std::endl;
79 std::cerr << "to generate header/footer for c++ api documentation" << std::endl;
80 std::cerr << std::endl << std::endl;
81 std::cerr << " ref2html -extract <input-file> <output-directory>" << std::endl;
82 std::cerr << "to extract multiple reference pages from one file" << std::endl;
83 std::cerr << std::endl;
84 std::cerr << std::endl << "note: use \"-\" as output file for console output" << std::endl;
153 local=localtime(&now);
154 strftime(buffer,80, "%Y.%m.%d",local);
155 return std::string(buffer);
165 std::string ppage = page;
166 std::size_t upos = ppage.find_first_of( "_");
167 std::size_t spos = ppage.find_first_of( " ");
168 std::size_t dpos = 0;
169 for(; dpos < ppage.size();dpos++)
170 if(!isdigit(ppage.at(dpos))) break;
171 if(upos!=std::string::npos)
173 if(upos+1<ppage.size())
174 ppage=ppage.substr(upos+1,ppage.size()-upos-1);
175 if(spos!=std::string::npos)
177 if(spos+1<ppage.size())
178 ppage=ppage.substr(spos+1,ppage.size()-spos-1);
191 *pStream << "<p class=\"bottom_line\"> " << std::endl;
193 *pStream << "--- " << TimeStamp() << " " << std::endl;
195 *pStream << "--- with "" << PluginsString() << "" " << std::endl;
197 *pStream << "--- c++ api documentaion by <a href=\"http://www.doxygen.org\" target=\"_top\">doxygen</a>" << std::endl;
198 *pStream << "</p>" << std::endl;
200 *pStream << "<!--[if IE]>" << std::endl;
201 *pStream << "<p class=\"bottom_line_warning\">" << std::endl;
202 *pStream << "If MS Internet Explorer fails to display certain mathematical symbols," << std::endl;
203 *pStream << "your system misses the corresponding unicode fonts." << std::endl;
204 *pStream << "<br>" << std::endl;
205 *pStream << "You may either install "Arial Unicode MS" from a recent MS Office package" << std::endl;
206 *pStream << "or the freely available" << std::endl;
207 *pStream << ""<a href=\"http://greekfonts.teilar.gr/\">Symbola</a>"" << std::endl;
208 *pStream << "<br>" << std::endl;
209 *pStream << "See also <a href=\"http://www.alanwood.net/\">Allan Woods</a> unicode page." << std::endl;
210 *pStream << "B.t.w.: <a href=\"http://www.mozilla.com\">Firefox</a> will display" << std::endl;
211 *pStream << "all relevant symbols out-of-the-box and nicely render SVG diagrams." << std::endl;
212 *pStream << "<br>" << std::endl;
213 *pStream << "<br>" << std::endl;
214 *pStream << "</p>" << std::endl;
215 *pStream << "<![endif]-->" << std::endl;
225 *pStream << "<!doctype html>" << std::endl;
226 *pStream << "<html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
227 *pStream << "<head>" << std::endl;
228 *pStream << "<title>" << mFrefTitle << "</title>" << std::endl;
229 *pStream << "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />" << std::endl;
230 *pStream << "<meta name=\"contents\" content=\"discrete event systems, libFAUDES, supervisory control, controller synthesis, automata, software library, regular languages, open source, GPL.\"/>" << std::endl;
231 *pStream << "<link href=\"" << mCssFile << "\" rel=\"stylesheet\" type=\"text/css\" />" << std::endl;
232 *pStream << "<link rel=\"shortcut icon\" href=\""<< mImagePrefix << "des.ico\">" << std::endl;
233 *pStream << "</head>" << std::endl;
234 *pStream << "<body>" << std::endl;
235 *pStream << "<div id=\"cwrapper1000\">" << std::endl;
236 *pStream << "<div id=\"dwrapper1000\">" << std::endl;
244 *pStream << "</div>" << std::endl;
245 *pStream << "</div>" << std::endl;
246 *pStream << "</body>" << std::endl;
247 *pStream << "</html>" << std::endl;
254void ImageHtml(std::ostream* pStream, const std::string& rFileName) {
255 *pStream << "<a class=\"faudes_image\" href=\"" << mImagePrefix << rFileName << ".html\">";
256 *pStream << "<img src=\"" << mImagePrefix << rFileName << ".png\"/>";
265void ListItemHtml(std::ostream* pStream, const std::string& rLink, const std::string& rText) {
266 *pStream << "<li class=\"registry_item\">" << std::endl
267 << "<a href=\"" << rLink << "\">" << rText << "</a>" << std::endl
268 << "<a href=\"" << rLink << "\" class=\"registry_blinda\"> </a>" << std::endl
269 << "</li>" << std::endl;
276void TypeHtml(std::ostream* pStream, const std::string& rTypeName) {
280 *pStream << rTypeName;
286 std::string tyname = tdef. Name();
287 std::string tyhtml = tdef. HtmlDoc();
288 if(tyhtml== "" || tyhtml== "none") {
291 *pStream << "<a href=\"" << mReferencePrefix << tyhtml << "\">" << tyname << "</a>";
300void FunctionHtml(std::ostream* pStream, const std::string& rFunctionName) {
304 *pStream << rFunctionName;
310 std::string fname = fdef. Name();
311 std::string fhtml = fdef. HtmlDoc();
312 if(fhtml== "" || fhtml== "none") {
315 *pStream << "<a href=\"" << mReferencePrefix << fhtml << "\">" << fname << "</a>";
323void TextHtml(std::ostream* pStream, const std::string& rText) {
337std::string TexMacroSubstitute1( const std::string& rTexString, const std::string& rMacro, const std::string& rSubst) {
342 while(pos<rTexString.length()) {
343 std::size_t next=rTexString.find(rMacro,pos);
344 if(next==std::string::npos) break;
345 res.append(rTexString.substr(pos,next-pos));
347 pos=next+rMacro.length();
348 if(!(pos+1<rTexString.length())) continue;
349 if(rTexString.at(pos)!= '{') continue;
350 std::size_t aend=rTexString.find( '}',pos);
351 if(aend==std::string::npos) break;
352 arg=rTexString.substr(pos+1,aend-pos-1);
358 if(pos<rTexString.length())
359 res.append(rTexString.substr(pos));
372 while(pos<rTexString.length()) {
374 if(pos+1 < rTexString.length())
375 if(rTexString.substr(pos,2)== "\\ ")
376 {pos+=2; res.append( " "); continue;}
378 if(pos+1 < rTexString.length())
379 if(rTexString.substr(pos,2)== "\\,")
380 {pos+=2; res.append( " "); continue;}
382 if(pos+1 < rTexString.length())
383 if(rTexString.substr(pos,2)== "\\;")
384 {pos+=2; res.append( " "); continue;}
386 if(pos+4 < rTexString.length())
387 if(rTexString.substr(pos,5)== "\\quad")
388 {pos+=5; res.append( " "); continue;}
391 if(isspace(rTexString.at(pos)))
395 if(pos+5 < rTexString.length())
396 if(rTexString.substr(pos,6)== "\\text{")
397 {pos+=6; math= false; continue;};
400 if(rTexString.at(pos)== '}')
401 { pos+=1; math= true; continue;}
403 res.append(1,rTexString.at(pos));
418 while(pos<rTexString.length()) {
420 cm2=cm1; cm1=c0; c0=rTexString.at(pos);
422 if(cm1== '^' || cm1== '_')
424 std::size_t aend=rTexString.find( '}',pos);
425 if(aend==std::string::npos) break;
426 std::string script=rTexString.substr(pos+1,aend-pos-1);
429 cm1=-1; cm2=-1; pos=aend+1;
435 size_t mpos=rTexString.find( "\\uparrow",pos);
437 res.append( "<span class=\"faudes_sup\">↑</span>");
438 cm1=-1; cm2=-1; pos+=8;
445 size_t mpos=rTexString.find( "\\Uparrow",pos);
447 res.append( "<span class=\"faudes_sup\">⇧</span>");
448 cm1=-1; cm2=-1; pos+=8;
457 cm1=-1; cm2=-1; pos+=1;
465 cm1=-1; cm2=-1; pos+=1;
470 if(c0== '*' || c0== '+') {
472 cm1=-1; cm2=-1; pos+=1;
476 if(cm1== '^' || cm1== '_') {
479 cm1=-1; cm2=-1; pos+=1;
495void MathHtml(std::ostream* pStream, const std::string& rMathString) {
496 std::string buff=rMathString;
624std::map< std::string , std::map< std::string , PageRecord > > mRefSectPages;
629 int clevel = rTr. Level();
636 if(text.size()>0) continue;
639 if(!rTr. Peek(token)) break;
643 if(!token. IsBegin( "ReferencePage")) {
675 std::transform(indexfile.begin(), indexfile.end(), indexfile.begin(), tolower);
689 std::size_t spos = title.find(section);
690 if(spos==0 && title.size()>section.size())
692 for(spos=0; spos< mFrefPage.size(); spos++){
735 std::vector<PageRecord>::iterator pit;
745 if(pit->mSummary== "") {
767 *pIndexFile << "<table class=\"registry_toc\">" << std::endl;
774 std::string section= tit->second->Name();
775 std::transform(section.begin(), section.end(), section.begin(), tolower);
776 if(section!=key) continue;
779 if(tit->second->TextDoc()== "") continue;
781 *pIndexFile << "<tr><td valign=\"top\">";
782 TypeHtml(pIndexFile,tit->second->Name());
783 *pIndexFile << "</td><td valign=\"top\">";
784 TypeHtml(pIndexFile,tit->second->TextDoc());
785 *pIndexFile << "</td></tr>" << std::endl;
790 if(!found) *pIndexFile << "<tr><td><i>no matches found</i></td></tr>" << std::endl;
792 *pIndexFile << "</table>" << std::endl;
802 *pIndexFile << "<table class=\"registry_toc\">" << std::endl;
809 std::string section= fit->second->Name();
810 std::transform(section.begin(), section.end(), section.begin(), tolower);
811 if(section!=key) continue;
814 if(fit->second->TextDoc()== "") continue;
816 *pIndexFile << "<tr><td valign=\"top\">";
818 *pIndexFile << "</td><td valign=\"top\">";
819 TypeHtml(pIndexFile,fit->second->TextDoc());
820 *pIndexFile << "</td></tr>" << std::endl;
825 if(!found) *pIndexFile << "<tr><td><i>no matches found</i></td></tr>" << std::endl;
827 *pIndexFile << "</table>" << std::endl;
839 std::set< std::string > sections;
840 std::map< std::string , std::string > link;
841 std::map< std::string , std::string > summary;
842 std::vector< PageRecord >::iterator pit;
844 std::string chap=pit->mChapter;
845 std::transform(chap.begin(), chap.end(), chap.begin(), tolower);
846 std::string sect=pit->mSection;
847 std::transform(sect.begin(), sect.end(), sect.begin(), tolower);
848 std::string page=pit->mPage;
849 std::transform(page.begin(), page.end(), page.begin(), tolower);
852 if(chap!= "reference") continue;
853 if(sect== "none") continue;
854 if(sect== "") continue;
855 if(page!= "index") continue;
862 std::string pname = pit->mSection;
864 std::string psumm = pit->mSummary;
865 if(psumm== "") psumm = pit->mTitle;
867 sections.insert(pname);
868 link[pname]=pit->mLink;
869 summary[pname]=psumm;
873 std::vector< std::string > sortvec;
874 if(sections.find( "CoreFaudes")!=sections.end())
875 sortvec.push_back( "CoreFaudes");
876 std::set< std::string >::iterator sit;
877 for(sit=sections.begin(); sit != sections.end(); sit++) {
878 if(*sit== "CoreFaudes") continue;
879 sortvec.push_back(*sit);
883 *pIndexFile << "<table class=\"registry_toc\">" << std::endl;
886 std::vector< std::string >::iterator vit;
888 for(vit=sortvec.begin(); vit != sortvec.end(); vit++) {
890 std::string sname = *vit;
892 std::string ssumm = summary[sname];
894 *pIndexFile << "<tr>" << std::endl;
895 *pIndexFile << "<td valign=\"top\"><a href=\"" << shtml << "\">" << sname << "</a></td>";
896 *pIndexFile << "<td valign=\"top\">";
897 *pIndexFile << ssumm;
898 *pIndexFile << "</td></tr>"<< std::endl;
903 if(!found) *pIndexFile << "<tr><td><i>no matches found</i></td></tr>" << std::endl;
906 *pIndexFile << "</table>" << std::endl;
926 std::string section= tit->second->KeywordAt(0);
927 std::transform(section.begin(), section.end(), section.begin(), tolower);
928 if(section!=key) continue;
931 std::string tyname = tit->second->Name();
932 std::string tyhtml = tit->second->HtmlDoc();
934 if(tyhtml== "") continue;
935 if(tyhtml== "none") continue;
939 *pIndexFile << "<li class=\"registry_heading\">Types</li>" << std::endl;
945 if(head) *pIndexFile << "<li class=\"registry_blanc\"> </li>" << std::endl;
955 std::string lkey=key;
956 std::transform(lkey.begin(), lkey.end(), lkey.begin(), tolower);
965 std::string section= fit->second->KeywordAt(0);
966 std::transform(section.begin(), section.end(), section.begin(), tolower);
967 if(section!=lkey) continue;
970 if(fit->second->TextDoc()== "") continue;
972 std::string fname = fit->second->Name();
973 std::string fhtml = fit->second->HtmlDoc();
974 if(fhtml== "") continue;
978 *pIndexFile << "<li class=\"registry_heading\">Functions</li>" << std::endl;
982 *pIndexFile << "<li class=\"registry_item\"> "<< fname << "</li>" << std::endl;
990 if(head) *pIndexFile << "<li class=\"registry_blanc\"> </li>" << std::endl;
1001 std::map< std::string , std::string > sectlink;
1002 std::vector< PageRecord >::iterator pit;
1004 std::string chap=pit->mChapter;
1005 std::transform(chap.begin(), chap.end(), chap.begin(), tolower);
1006 std::string sect=pit->mSection;
1007 std::transform(sect.begin(), sect.end(), sect.begin(), tolower);
1009 if(chap!= "reference") continue;
1010 if(sect== "none") continue;
1011 if(sect== "") continue;
1013 std::string pname = pit->mSection;
1015 std::string phtml = sect+ "_index.html";
1017 sectlink[pname]=phtml;
1021 std::vector< std::string > sections;
1022 if(sectlink[ "CoreFaudes"]!= "") sections.push_back( "CoreFaudes");
1023 std::map< std::string , std::string >::iterator sit;
1024 for(sit=sectlink.begin(); sit!=sectlink.end(); sit++) {
1025 std::string psect=sit->first;
1026 if(psect== "CoreFaudes") continue;
1027 sections.push_back(psect);
1031 if(sections.size()!=0)
1032 *pIndexFile << "<li class=\"registry_heading\">Sections</li>" << std::endl;
1036 for(vit=0; vit<sections.size(); vit++) {
1037 std::string psect=sections.at(vit);
1038 std::string plink=sectlink[psect];
1039 if(plink== "") continue;
1041 std::string sect=psect;
1042 std::transform(sect.begin(), sect.end(), sect.begin(), tolower);
1043 std::map< std::string , std::map< std::string , PageRecord > > ::iterator spit = mRefSectPages.find(sect);
1046 std::map< std::string , PageRecord >::iterator pit = spit->second.begin();
1047 for(;pit!=spit->second.end();pit++) {
1048 std::string ppage = pit->second.mPage;
1049 std::transform(ppage.begin(), ppage.end(), ppage.begin(), tolower);
1050 if(ppage== "index") continue;
1051 if(ppage== "0_index") continue;
1052 if(ppage== "00_index") continue;
1062 *pIndexFile << "<li class=\"registry_pitem\">" << std::endl
1063 << "<a href=\"" << plink << "\">" << psect << "</a>" << std::endl
1064 << "<a href=\"" << plink << "\" class=\"registry_blinda\"> </a>" << std::endl
1065 << "<ul>" << std::endl
1066 << "<li class=\"registry_heading\">" << psect << "</li>" << std::endl;
1067 std::map< std::string , PageRecord >::iterator pit = spit->second.begin();
1068 for(;pit!=spit->second.end();pit++) {
1070 std::string ppage = PrettyPage(pit->second.mPage);
1072 std::string ipage = ppage;
1073 std::transform(ipage.begin(), ipage.end(), ipage.begin(), tolower);
1075 if(ipage== "index") ppage= "Introduction";
1077 *pIndexFile << "<li class=\"registry_item\"><a href=\"" << pit->second.mLink << "\">"
1078 << ppage << "</a></li>" << std::endl;
1081 *pIndexFile << "</ul></li>" << std::endl;
1085 if(sections.size()!=0)
1086 *pIndexFile << "<li class=\"registry_blanc\"> </li>" << std::endl;
1104 std::string sect=key;
1105 std::transform(sect.begin(), sect.end(), sect.begin(), tolower);
1106 std::string plink=sect+ "_index.html";
1107 std::string psect=key;
1108 std::map< std::string , std::map< std::string , PageRecord > > ::iterator spit = mRefSectPages.find(sect);
1111 std::map< std::string , PageRecord >::iterator pit = spit->second.begin();
1112 for(;pit!=spit->second.end();pit++) {
1113 std::string ppage = pit->second.mPage;
1114 psect=pit->second.mSection;
1115 std::transform(ppage.begin(), ppage.end(), ppage.begin(), tolower);
1116 if(ppage== "index") continue;
1117 if(ppage== "0_index") continue;
1118 if(ppage== "00_index") continue;
1127 if(key== "") psect= "Reference";
1130 *pIndexFile << "<li class=\"registry_heading\">" << psect << "</li>" << std::endl;
1131 std::map< std::string , PageRecord >::iterator pit = spit->second.begin();
1132 for(;pit!=spit->second.end();pit++) {
1134 std::string ppage = PrettyPage(pit->second.mPage);
1136 std::string ipage = ppage;
1137 std::transform(ipage.begin(), ipage.end(), ipage.begin(), tolower);
1139 if(ipage== "index") ppage= "Introduction";
1141 *pIndexFile << "<li class=\"registry_item\"><a href=\"" << pit->second.mLink << "\">"
1142 << ppage << "</a></li>" << std::endl;
1163 *pOutFile << "<div class=\"registry_signature\">" << std::endl;
1164 *pOutFile << "<h5><strong>Signature:</strong></h5>" << std::endl;
1169 *pOutFile << "<p>" << fdef. Name() << "(";
1171 for( int j=0; j < sigi. Size(); j++) {
1172 if(j!=0) *pOutFile << ", ";
1176 *pOutFile << " <i>" << parj. Name() << "</i></span>";
1178 *pOutFile << ")</p>" << std::endl;
1183 *pOutFile << std::endl << "</div>" << std::endl;
1200 *pOutFile << "<p>" << fdef. TextDoc() << "</p>" << std::endl;
1215 *pOutFile << "<p>" << tdef. TextDoc() << "<p>" << std::endl;
1247 int clevel = rTr. Level();
1254 if(text.size()>0) continue;
1257 if(!rTr. Peek(token)) break;
1261 if(token. IsBegin( "ReferencePage")) {
1274 if(!token. IsBegin( "fliterature")) {
1286 while(!rTr. Eos( "fliterature")) {
1290 if(token. IsBegin( "fauthors")) {
1302 if(token. IsBegin( "fjournal")) {
1339 std::map<std::string,LiteratureRecord>::iterator lit;
1345 if(lit->second.mAuthors!= "") {
1350 if(lit->second.mTitle!= "") {
1355 if(lit->second.mJournal!= "") {
1360 if(lit->second.mPublisher!= "") {
1365 if(lit->second.mYear!= "") {
1370 if(lit->second.mLink!= "") {
1384 std::map<std::string,LiteratureRecord>::iterator lit;
1388 if(rLabel!=lit->second.mLabel) continue;
1390 *pStream << "<p>" << std::endl;
1391 *pStream << "<a id=\"" << "lit_" << lit->second.mLabel << "\">[" << lit->second.mLabel << "]</a>" << std::endl;
1392 *pStream << lit->second.mAuthors << ": ";
1393 *pStream << "<i>" << lit->second.mTitle << "</i>";
1394 if(lit->second.mJournal!= "") *pStream << ", " << lit->second.mJournal;
1395 if(lit->second.mPublisher!= "") *pStream << ", " << lit->second.mPublisher;
1396 if(lit->second.mYear!= "") *pStream << ", " << lit->second.mYear;
1397 *pStream << ".</p>" << std::endl;
1403void CiteHtml(std::ostream* pStream, const std::string& rLabel) {
1405 std::string link= "reference_literature.html";
1407 std::map<std::string,LiteratureRecord>::iterator lit;
1409 if(lit!= mLiterature.end()) link=lit->second.mLink;
1411 *pStream << "<a href=\"" << link << "\">[" << rLabel << "]</a>";
1423 while(src. Peek(btag)) {
1425 if(!btag. IsBegin( "ReferencePage")) {
1446 std::cerr << "ref2html: skipping undefined page at " << src. FileLine() << std::endl;
1456 std::cerr << "ref2html: extracting page to \"" << dstfile << "\"" << std::endl;
1460 std::string srctext;
1477 while(src. Peek(btag)) {
1479 if(!btag. IsBegin( "ImageFile")) {
1487 std::cerr << "ref2html: skipping undefined image file at " << src. FileLine() << std::endl;
1495 std::cerr << "ref2html: skipping invalid image file at " << src. FileLine() << std::endl;
1500 std::string dstfile;
1501 std::transform(name.begin(), name.end(), name.begin(), tolower);
1504 std::cerr << "ref2html: extracting image file to \"" << dstfile << "\"" << std::endl;
1507 fsout.exceptions(std::ios::badbit|std::ios::failbit);
1509 fsout.open(dstfile.c_str(), std::ios::out | std::ios::binary);
1513 catch (std::ios::failure&) {
1514 std::cerr << "ref2html: file io error when writing \"" << dstfile << "\"" << std::endl;
1528 std::map< std::string , std::string > pages;
1529 std::vector< PageRecord >::iterator pit;
1532 if(pit->mChapter!= "luafaudes") continue;
1533 if(pit->mSection== "none") continue;
1534 if(pit->mSection== "") continue;
1535 if(pit->mPage== "") continue;
1537 std::string pname = pit->mPage;
1539 std::string phtml = pit->mLink;
1544 std::map< std::string , std::string >::iterator sit;
1545 for(sit=pages.begin(); sit!=pages.end(); sit++) {
1550 if(pages.size()==0) {
1551 *pIndexFile << "<li class=\"registry_item\">" << "none" << "</li>" << std::endl;
1562 std::map< std::string , std::string > pages;
1563 std::vector< PageRecord >::iterator pit;
1566 if(pit->mChapter!= "pythonmod") continue;
1567 if(pit->mSection== "none") continue;
1568 if(pit->mSection== "") continue;
1569 if(pit->mPage== "") continue;
1571 std::string pname = pit->mPage;
1573 std::string phtml = pit->mLink;
1578 std::map< std::string , std::string >::iterator sit;
1579 for(sit=pages.begin(); sit!=pages.end(); sit++) {
1584 if(pages.size()==0) {
1585 *pIndexFile << "<li class=\"registry_item\">" << "none" << "</li>" << std::endl;
1597 int clevel = rTr. Level();
1613 if(!rTr. Peek(token)) break;
1645 *rTw. Streamp() << "<span class=\"faudes_dmath\">";
1656 *rTw. Streamp()<< "<span class=\"faudes_imath\">";
1663 if(token. IsBegin( "ffnct_reference")) {
1664 rTr. ReadBegin( "ffnct_reference", token);
1666 *rTw. Streamp() << "<div class=\"registry_function\"> " << std::endl;
1667 *rTw. Streamp() << "<h2>" << "<a id=\"" << ffnct << "\">" << ffnct << "</a></h2>" << std::endl;
1670 *rTw. Streamp() << "</div>" << std::endl;
1671 rTr. ReadEnd( "ffnct_reference");
1675 if(token. IsBegin( "ftype_reference")) {
1676 rTr. ReadBegin( "ftype_reference", token);
1678 *rTw. Streamp() << "<div class=\"registry_type\"> " << std::endl;
1679 *rTw. Streamp() << "<h2>" << "<a id=\"" << ftype << "\">" << ftype << "</a></h2>" << std::endl;
1682 *rTw. Streamp() << "</div>" << std::endl;
1683 rTr. ReadEnd( "ftype_reference");
1687 if(token. IsBegin( "fdetails")) {
1689 *rTw. Streamp() << "<h5>Detailed description:</h5>";
1694 if(token. IsBegin( "fconditions")) {
1696 *rTw. Streamp() << "<h5>Parameter Conditions:</h5>";
1701 if(token. IsBegin( "fexample")) {
1703 *rTw. Streamp() << "<h5>Example:</h5>";
1708 if(token. IsBegin( "falltypes")) {
1715 if(token. IsBegin( "fallfncts")) {
1722 if(token. IsBegin( "fallsects")) {
1729 if(token. IsBegin( "fluasects")) {
1736 if(token. IsBegin( "falllit")) {
1743 if(token. IsBegin( "fliterature")) {
1751 if(token. IsBegin( "fcontributors")) {
1777 if(token. IsBegin( "fsummary")) {
1908 *pOutFile << "<table id=\"registry_page\">" << std::endl;
1909 *pOutFile << "<tr id=\"registry_row\">" << std::endl;
1910 *pOutFile << "<td id=\"registry_index\">" << std::endl;
1911 *pOutFile << "<ul class=\"registry_list\">" << std::endl;
1912 *pOutFile << "<li class=\"registry_heading\">libFAUDES</li>" << std::endl;
1913 ListItemHtml(pOutFile, "reference_index.html", "Reference");
1914 ListItemHtml(pOutFile, "reference_types.html", "Type Index");
1915 ListItemHtml(pOutFile, "reference_functions.html", "Function Index");
1916 ListItemHtml(pOutFile, "reference_literature.html", "Literature");
1917 *pOutFile << "<li class=\"registry_blanc\"> </li>" << std::endl;
1919 *pOutFile << "</ul></td>" << std::endl;
1920 *pOutFile << "<td id=\"registry_content\">" << std::endl;
1925 *pOutFile << "<table id=\"registry_page\">" << std::endl;
1926 *pOutFile << "<tr id=\"registry_row\">" << std::endl;
1927 *pOutFile << "<td id=\"registry_index\">" << std::endl;
1928 *pOutFile << "<ul class=\"registry_list\">" << std::endl;
1929 *pOutFile << "<li class=\"registry_heading\">luafaudes</li>" << std::endl;
1931 << "<script language=\"JavaScript\"> var luafaudes=function() { "
1932 << " popupWin = window.open('luafaudes_repl.html','open_window',"
1933 << " 'resizable,dependent, width=720, height=480, left=0, top=0'); } "
1934 << "</script>" << std::endl;
1936 ListItemHtml(pOutFile, "javascript:luafaudes();", "Lua-Console");
1937 ListItemHtml(pOutFile, "faudes_luaext.html", "Lua-Extensions");
1938 ListItemHtml(pOutFile, "faudes_luatech.html", "Technical Detail");
1939 *pOutFile << "<li class=\"registry_blanc\"> </li>" << std::endl;
1940 *pOutFile << "<li class=\"registry_heading\">Tutorials</li>" << std::endl;
1942 *pOutFile << "</ul></td>" << std::endl;
1943 *pOutFile << "<td id=\"registry_content\">" << std::endl;
1948 *pOutFile << "<table id=\"registry_page\">" << std::endl;
1949 *pOutFile << "<tr id=\"registry_row\">" << std::endl;
1950 *pOutFile << "<td id=\"registry_index\">" << std::endl;
1951 *pOutFile << "<ul class=\"registry_list\">" << std::endl;
1952 *pOutFile << "<li class=\"registry_heading\">Python Module</li>" << std::endl;
1954 *pOutFile << "<li class=\"registry_blanc\"> </li>" << std::endl;
1955 *pOutFile << "<li class=\"registry_heading\">Tutorials</li>" << std::endl;
1957 *pOutFile << "</ul></td>" << std::endl;
1958 *pOutFile << "<td id=\"registry_content\">" << std::endl;
1973 *pOutFile << "</td>" << std::endl;
1974 *pOutFile << "</tr>" << std::endl;
1975 *pOutFile << "</table>" << std::endl;
1982 *pOutFile << "</td>" << std::endl;
1983 *pOutFile << "</tr>" << std::endl;
1984 *pOutFile << "</table>" << std::endl;
1991 *pOutFile << "</td>" << std::endl;
1992 *pOutFile << "</tr>" << std::endl;
1993 *pOutFile << "</table>" << std::endl;
1998 *pOutFile << "</div>" << std::endl << "</div>" << std::endl;
1999 *pOutFile << "<div id=\"cxwrapper1000\">" << std::endl;
2000 *pOutFile << "<div id=\"dxwrapper1000\">" << std::endl;
2001 *pOutFile << "<div class=\"registry_trigger\"> <span>>></span>" << std::endl;
2002 *pOutFile << "<ul class=\"registry_list\">" << std::endl;
2004 *pOutFile << "<li class=\"registry_blanc\"> </li>" << std::endl;
2006 *pOutFile << "</ul></div>" << std::endl;
2011 *pOutFile << "</div>" << std::endl << "</div>" << std::endl;
2012 *pOutFile << "<div id=\"cxwrapper1000\">" << std::endl;
2013 *pOutFile << "<div id=\"dxwrapper1000\">" << std::endl;
2014 *pOutFile << "<div class=\"registry_trigger\"> <span>>></span>" << std::endl;
2015 *pOutFile << "<ul class=\"registry_list\">" << std::endl;
2016 *pOutFile << "<li class=\"registry_heading\">luafaudes</li>" << std::endl;
2017 *pOutFile << "<li class=\"registry_item\"><a href=\"faudes_luafaudes.html\">Introduction</a></li>" << std::endl;
2018 *pOutFile << "<li class=\"registry_item\"><a href=\"faudes_luaext.html\">Lua-Extansions</a></li>" << std::endl;
2019 *pOutFile << "<li class=\"registry_item\"><a href=\"faudes_luatech.html\">Techn. Details</a></li>" << std::endl;
2020 *pOutFile << "<li class=\"registry_blanc\"> </li>" << std::endl;
2021 *pOutFile << "<li class=\"registry_item\"><a href=\"#\">Top of Page</a></li>" << std::endl;
2022 *pOutFile << "</ul></div>" << std::endl;
2027 *pOutFile << "</div>" << std::endl << "</div>" << std::endl;
2028 *pOutFile << "<div id=\"cxwrapper1000\">" << std::endl;
2029 *pOutFile << "<div id=\"dxwrapper1000\">" << std::endl;
2030 *pOutFile << "<div class=\"registry_trigger\"> <span>>></span>" << std::endl;
2031 *pOutFile << "<ul class=\"registry_list\">" << std::endl;
2032 *pOutFile << "<li class=\"registry_heading\">Python Module</li>" << std::endl;
2033 *pOutFile << "<li class=\"registry_item\"><a href=\"faudes_pythonmod.html\">Introduction</a></li>" << std::endl;
2034 *pOutFile << "<li class=\"registry_blanc\"> </li>" << std::endl;
2035 *pOutFile << "<li class=\"registry_item\"><a href=\"#\">Top of Page</a></li>" << std::endl;
2036 *pOutFile << "</ul></div>" << std::endl;
2074 *pOutFile << "<table id=\"registry_page\">" << std::endl;
2075 *pOutFile << "<tr id=\"registry_row\">" << std::endl;
2076 *pOutFile << "<td id=\"registry_index\">" << std::endl;
2077 *pOutFile << "<ul class=\"registry_list\">" << std::endl;
2078 *pOutFile << "<li class=\"registry_heading\">libFAUDES</li>" << std::endl;
2080 *pOutFile << "<li class=\"registry_blanc\"> </li>" << std::endl;
2081 *pOutFile << "<li class=\"registry_heading\">Sections</li>" << std::endl;
2082 ListItemHtml(pOutFile, "group__ContainerClasses.html", "Sets");
2083 ListItemHtml(pOutFile, "group__GeneratorClasses.html", "Generators");
2084 ListItemHtml(pOutFile, "group__GeneratorFunctions.html", "Functions");
2085 ListItemHtml(pOutFile, "group__AllPlugins.html", "PlugIns");
2086 ListItemHtml(pOutFile, "group__Tutorials.html", "Tutorials");
2087 *pOutFile << "<li class=\"registry_blanc\"> </li>" << std::endl;
2088 *pOutFile << "<li class=\"registry_heading\">Index</li>" << std::endl;
2091 *pOutFile << "<li class=\"registry_blanc\"> </li>" << std::endl;
2092 *pOutFile << "</ul></td>" << std::endl;
2093 *pOutFile << "<td id=\"registry_content\">" << std::endl;
2109 *pOutFile << "</td>" << std::endl;
2110 *pOutFile << "</tr>" << std::endl;
2111 *pOutFile << "</table>" << std::endl;
2114 *pOutFile << "</div>" << std::endl << "</div>" << std::endl;
2115 *pOutFile << "<div id=\"cxwrapper1000\">" << std::endl;
2116 *pOutFile << "<div id=\"dxwrapper1000\">" << std::endl;
2117 *pOutFile << "<div class=\"registry_trigger\"> <span>>></span>" << std::endl;
2118 *pOutFile << "<ul class=\"registry_list\">" << std::endl;
2119 *pOutFile << "<li class=\"registry_heading\">C++ API</li>" << std::endl;
2120 *pOutFile << "<li class=\"registry_item\"><a href=\"index.html\">Introduction</a></li>" << std::endl;
2121 *pOutFile << "<li class=\"registry_item\"><a href=\"group__ContainerClasses.html\">Sets</a></li>" << std::endl;
2122 *pOutFile << "<li class=\"registry_item\"><a href=\"group__GeneratorClasses.html\">Generators</a></li>" << std::endl;
2123 *pOutFile << "<li class=\"registry_item\"><a href=\"group__GeneratorFunctions.html\">Functions</a></li>" << std::endl;
2124 *pOutFile << "<li class=\"registry_item\"><a href=\"group__AllPlugins.html\">PlugIns</a></li>" << std::endl;
2125 *pOutFile << "<li class=\"registry_item\"><a href=\"group__Tutorials.html\">Tutorials</a></li>" << std::endl;
2126 *pOutFile << "<li class=\"registry_item\"><a href=\"classes.html\">Classes</a></li>" << std::endl;
2127 *pOutFile << "<li class=\"registry_item\"><a href=\"files.html\">Files</a></li>" << std::endl;
2128 *pOutFile << "<li class=\"registry_blanc\"> </li>" << std::endl;
2129 *pOutFile << "<li class=\"registry_item\"><a href=\"#\">Top of Page</a></li>" << std::endl;
2130 *pOutFile << "</ul></div>" << std::endl;
2156 for(i=1; i<argc; i++) {
2157 std::string option(argv[i]);
2159 if(option== "-rti") {
2165 if(option== "-flx") {
2171 if(option== "-css") {
2177 if(option== "-cnav") {
2183 if(option== "-inc") {
2189 if(option== "-rel") {
2195 if(option== "-chapter") {
2201 if(option== "-section") {
2207 if(option== "-extract") {
2213 if(option== "-toc") {
2220 if(option== "-doxheader") {
2227 if(option== "-doxfooter") {
2234 if(option== "-app") {
2239 if((option== "-?") || (option== "--help")) {
2245 if(option.at(0)== '-') {
2254 for(;i<argc-1; i++) {
2255 std::string option(argv[i]);
2257 if(option.at(0)== '-') {
2258 usage_exit( "missplaced/unknown option " + option);
2266 std::string option(argv[i]);
2268 if(option.at(0)== '-') {
2269 usage_exit( "missplaced/unknown option " + option);
2289 std::string section=fit->second->KeywordAt(0);
2290 std::transform(section.begin(), section.end(), section.begin(), tolower);
2302 std::string section=fit->second->KeywordAt(0);
2303 std::transform(section.begin(), section.end(), section.begin(), tolower);
2320 usage_exit( "extract mode requires one source file");
2323 usage_exit( "extract mode requires destination directory");
2325 std::cerr << "ref2html: extract pages from " << * mSrcFiles.begin() << std::endl;
2337 usage_exit( "toc mode requires destination file");
2340 std::ostream* hout= &std::cout;
2343 fout.open( mDstFile.c_str(), std::ios::out);
2347 std::set< std::string >::iterator sit= mSrcFiles.begin();
2349 std::cerr << "ref2html: process toc " << *sit << std::endl;
2364 if(dodhd || dodft) {
2366 usage_exit( "header-footer mode requires destination file");
2369 std::ostream* hout= &std::cout;
2372 fout.open( mDstFile.c_str(), std::ios::out);
2383 std::set< std::string > srcfiles;
2384 std::set< std::string >::iterator sit= mSrcFiles.begin();
2388 std::set< std::string >::iterator dit=dirfiles.begin();
2389 for(;dit!=dirfiles.end();++dit) {
2392 std::string src= PrependPath(*sit,base + ".fref");
2394 if(ext!= "fref") continue;
2396 srcfiles.insert(src);
2403 usage_exit( "multiple source files require destination directory");
2411 std::string src= *sit;
2416 std::cout << "ref2html: processing " << src << " to " << dst << std::endl;
2418 fout.open(dst.c_str(), std::ios::out);
const std::string & HtmlDoc(void) const
const std::string & Name(void) const
const std::string & TextDoc(void) const
const Signature & Variant(const std::string &rName) const
int VariantsSize(void) const
static FunctionRegistry * G()
std::map< std::string, FunctionDefinition * >::const_iterator Iterator
const FunctionDefinition & Definition(const std::string &rFunctionName) const
void MergeDocumentation(TokenReader &rTr)
const std::string & Type(void) const
const ParamAttr & Attribute(void) const
static std::string AStr(Parameter::ParamAttr attr)
const std::string & Name(void) const
const Parameter & At(int n) const
std::string FileLine(void) const
void ReadCharacterData(std::string &rData)
void ReadText(const std::string &rLabel, std::string &rText)
bool Eos(const std::string &rLabel)
void SeekBegin(const std::string &rLabel)
void ReadEnd(const std::string &rLabel)
void ReadSection(std::string &rSectionString)
void ReadBegin(const std::string &rLabel)
bool ExistsBegin(const std::string &rLabel)
std::string FileName(void) const
void WriteCharacterData(const std::string &rCharData)
void Write(Token &rToken)
std::ostream * Streamp(void)
void WriteEnd(const std::string &rLabel)
void WriteBegin(const std::string &rLabel)
bool IsBinary(void) const
const std::string & PreceedingSpace(void) const
const std::string & StringValue(void) const
bool ExistsAttributeString(const std::string &name)
void SetEmpty(const std::string &rName)
void ClrAttribute(const std::string &name)
void SetBegin(const std::string &rName)
void InsAttributeString(const std::string &name, const std::string &value)
const std::string & AttributeStringValue(const std::string &name)
const TypeDefinition & Definition(const std::string &rTypeName) const
static TypeRegistry * G()
std::map< std::string, TypeDefinition * >::const_iterator Iterator
void LoadRegistry(const std::string &rPath)
std::string VersionString()
std::string PrependPath(const std::string &rLeft, const std::string &rRight)
std::string PluginsString()
std::string ExtractFilename(const std::string &rFullPath)
std::string ContributorsString()
std::set< std::string > ReadDirectory(const std::string &rDirectory)
std::string StringSubstitute(const std::string &rString, const std::string &rFrom, const std::string &rTo)
std::string ExtractBasename(const std::string &rFullPath)
bool DirectoryExists(const std::string &rDirectory)
std::string ExtractSuffix(const std::string &rFullPath)
void SectionIndexHtml(std::ostream *pIndexFile, const std::string &key)
std::string mExitChapterClass
void ChaptersPrefix(const std::string &prefix)
void DoxygenHeader(std::ostream *pOutFile)
std::set< std::string > mSrcFiles
void RecordPages(TokenReader &rTr)
void RefpageHtml(std::ostream *pOutFile, std::string inputfile)
std::map< std::string, std::map< std::string, PageRecord > > mRefSectPages
std::string TimeStamp(void)
void XtractFiles(TokenReader &src, const std::string &rDstDir)
std::vector< PageRecord > mAllPages
std::string mReferencePrefix
void ShortdocHtml(std::ostream *pOutFile, std::string fname)
std::string mThisChapterClass
std::string mPythonmodPrefix
std::string mLuafaudesPrefix
void FooterHtml(std::ostream *pStream)
std::string TexScripts(const std::string &rTexString)
std::string mChaptersPrefix
void ListItemHtml(std::ostream *pStream, const std::string &rLink, const std::string &rText)
void DumpLiterature(TokenWriter &rTw)
void BottomLineHtml(std::ostream *pStream)
void ListFunctionsHtml(std::ostream *pIndexFile, const std::string &key="")
void RecordLiterature(TokenReader &rTr)
std::map< std::string, LiteratureRecord > mLiterature
std::string mOtherChapterClass
void FunctionIndexHtml(std::ostream *pIndexFile, const std::string &key="")
void MathHtml(std::ostream *pStream, const std::string &rMathString)
std::set< std::string > mInclLuaSections
std::string mPythonmodLink
std::string mLuafaudesLink
void LiteratureHtml(std::ostream *pStream, const std::string &rLabel="")
void TypeIndexHtml(std::ostream *pIndexFile, const std::string &key="")
std::string TexSpacing(const std::string &rTexString)
void SignatureHtml(std::ostream *pOutFile, std::string function)
std::string mDownloadLink
void DumpPages(TokenWriter &rTw)
std::string PrettyPage(const std::string page)
void TextHtml(std::ostream *pStream, const std::string &rText)
std::string mCsourcePrefix
void ImageHtml(std::ostream *pStream, const std::string &rFileName)
void ReferenceIndexHtml(std::ostream *pIndexFile, const std::string &key="")
void usage_exit(const std::string &rMessage="")
void HeaderHtml(std::ostream *pStream)
void CiteHtml(std::ostream *pStream, const std::string &rLabel)
void LuafaudesIndexHtml(std::ostream *pIndexFile)
std::string TexMacroSubstitute1(const std::string &rTexString, const std::string &rMacro, const std::string &rSubst)
void PythonmodIndexHtml(std::ostream *pIndexFile)
bool mStandaloneReference
void ListSectionsHtml(std::ostream *pIndexFile, const std::string &key="")
void FunctionHtml(std::ostream *pStream, const std::string &rFunctionName)
void XtractPages(TokenReader &src, const std::string &rDstDir)
void DoxygenFooter(std::ostream *pOutFile)
void ProcessSection(TokenWriter &rTw, TokenReader &rTr)
void TypeHtml(std::ostream *pStream, const std::string &rTypeName)
std::set< std::string > mExclLuaSections
void ListTypesHtml(std::ostream *pIndexFile, const std::string &key="")
libFAUDES 2.34e
--- 2026.03.16
--- c++ api documentaion by doxygen
|