|
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;
159 local=localtime(&now);
160 strftime(buffer,80, "%Y.%m.%d",local);
161 return std::string(buffer);
171 std::string ppage = page;
172 std::size_t upos = ppage.find_first_of( "_");
173 std::size_t spos = ppage.find_first_of( " ");
174 std::size_t dpos = 0;
175 for(; dpos < ppage.size();dpos++)
176 if(!isdigit(ppage.at(dpos))) break;
177 if(upos!=std::string::npos)
179 if(upos+1<ppage.size())
180 ppage=ppage.substr(upos+1,ppage.size()-upos-1);
181 if(spos!=std::string::npos)
183 if(spos+1<ppage.size())
184 ppage=ppage.substr(spos+1,ppage.size()-spos-1);
197 *pStream << "<p class=\"bottom_line\"> " << std::endl;
199 *pStream << "--- " << TimeStamp() << " " << std::endl;
201 *pStream << "--- with "" << PluginsString() << "" " << std::endl;
203 *pStream << "--- c++ api documentaion by <a href=\"http://www.doxygen.org\" target=\"_top\">doxygen</a>" << std::endl;
204 *pStream << "</p>" << std::endl;
206 *pStream << "<!--[if IE]>" << std::endl;
207 *pStream << "<p class=\"bottom_line_warning\">" << std::endl;
208 *pStream << "If MS Internet Explorer fails to display certain mathematical symbols," << std::endl;
209 *pStream << "your system misses the corresponding unicode fonts." << std::endl;
210 *pStream << "<br>" << std::endl;
211 *pStream << "You may either install "Arial Unicode MS" from a recent MS Office package" << std::endl;
212 *pStream << "or the freely available" << std::endl;
213 *pStream << ""<a href=\"http://greekfonts.teilar.gr/\">Symbola</a>"" << std::endl;
214 *pStream << "<br>" << std::endl;
215 *pStream << "See also <a href=\"http://www.alanwood.net/\">Allan Woods</a> unicode page." << std::endl;
216 *pStream << "B.t.w.: <a href=\"http://www.mozilla.com\">Firefox</a> will display" << std::endl;
217 *pStream << "all relevant symbols out-of-the-box and nicely render SVG diagrams." << std::endl;
218 *pStream << "<br>" << std::endl;
219 *pStream << "<br>" << std::endl;
220 *pStream << "</p>" << std::endl;
221 *pStream << "<![endif]-->" << std::endl;
231 *pStream << "<!doctype html>" << std::endl;
232 *pStream << "<html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
233 *pStream << "<head>" << std::endl;
234 *pStream << "<title>" << mFrefTitle << "</title>" << std::endl;
235 *pStream << "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />" << std::endl;
236 *pStream << "<meta name=\"contents\" content=\"discrete event systems, libFAUDES, supervisory control, controller synthesis, automata, software library, regular languages, open source, GPL.\"/>" << std::endl;
237 *pStream << "<link href=\"" << mCssFile << "\" rel=\"stylesheet\" type=\"text/css\" />" << std::endl;
238 *pStream << "<link rel=\"shortcut icon\" href=\""<< mImagePrefix << "des.ico\">" << std::endl;
239 *pStream << "</head>" << std::endl;
240 *pStream << "<body>" << std::endl;
241 *pStream << "<div id=\"cwrapper1000\">" << std::endl;
242 *pStream << "<div id=\"dwrapper1000\">" << std::endl;
250 *pStream << "</div>" << std::endl;
251 *pStream << "</div>" << std::endl;
252 *pStream << "</body>" << std::endl;
253 *pStream << "</html>" << std::endl;
260 void ImageHtml(std::ostream* pStream, const std::string& rFileName) {
261 *pStream << "<a class=\"faudes_image\" href=\"" << mImagePrefix << rFileName << ".html\">";
262 *pStream << "<img src=\"" << mImagePrefix << rFileName << ".png\"/>";
271 void ListItemHtml(std::ostream* pStream, const std::string& rLink, const std::string& rText) {
272 *pStream << "<li class=\"registry_item\">" << std::endl
273 << "<a href=\"" << rLink << "\">" << rText << "</a>" << std::endl
274 << "<a href=\"" << rLink << "\" class=\"registry_blinda\"> </a>" << std::endl
275 << "</li>" << std::endl;
282 void TypeHtml(std::ostream* pStream, const std::string& rTypeName) {
286 *pStream << rTypeName;
292 std::string tyname = tdef. Name();
293 std::string tyhtml = tdef. HtmlDoc();
294 if(tyhtml== "" || tyhtml== "none") {
297 *pStream << "<a href=\"" << mReferencePrefix << tyhtml << "\">" << tyname << "</a>";
306 void FunctionHtml(std::ostream* pStream, const std::string& rFunctionName) {
310 *pStream << rFunctionName;
316 std::string fname = fdef. Name();
317 std::string fhtml = fdef. HtmlDoc();
318 if(fhtml== "" || fhtml== "none") {
321 *pStream << "<a href=\"" << mReferencePrefix << fhtml << "\">" << fname << "</a>";
329 void TextHtml(std::ostream* pStream, const std::string& rText) {
343 std::string TexMacroSubstitute1( const std::string& rTexString, const std::string& rMacro, const std::string& rSubst) {
348 while(pos<rTexString.length()) {
349 std::size_t next=rTexString.find(rMacro,pos);
350 if(next==std::string::npos) break;
351 res.append(rTexString.substr(pos,next-pos));
353 pos=next+rMacro.length();
354 if(!(pos+1<rTexString.length())) continue;
355 if(rTexString.at(pos)!= '{') continue;
356 std::size_t aend=rTexString.find( '}',pos);
357 if(aend==std::string::npos) break;
358 arg=rTexString.substr(pos+1,aend-pos-1);
364 if(pos<rTexString.length())
365 res.append(rTexString.substr(pos));
378 while(pos<rTexString.length()) {
380 if(pos+1 < rTexString.length())
381 if(rTexString.substr(pos,2)== "\\ ")
382 {pos+=2; res.append( " "); continue;}
384 if(pos+1 < rTexString.length())
385 if(rTexString.substr(pos,2)== "\\,")
386 {pos+=2; res.append( " "); continue;}
388 if(pos+1 < rTexString.length())
389 if(rTexString.substr(pos,2)== "\\;")
390 {pos+=2; res.append( " "); continue;}
392 if(pos+4 < rTexString.length())
393 if(rTexString.substr(pos,5)== "\\quad")
394 {pos+=5; res.append( " "); continue;}
397 if(isspace(rTexString.at(pos)))
401 if(pos+5 < rTexString.length())
402 if(rTexString.substr(pos,6)== "\\text{")
403 {pos+=6; math= false; continue;};
406 if(rTexString.at(pos)== '}')
407 { pos+=1; math= true; continue;}
409 res.append(1,rTexString.at(pos));
424 while(pos<rTexString.length()) {
426 cm2=cm1; cm1=c0; c0=rTexString.at(pos);
428 if(cm1== '^' || cm1== '_')
430 std::size_t aend=rTexString.find( '}',pos);
431 if(aend==std::string::npos) break;
432 std::string script=rTexString.substr(pos+1,aend-pos-1);
435 cm1=-1; cm2=-1; pos=aend+1;
441 size_t mpos=rTexString.find( "\\uparrow",pos);
443 res.append( "<span class=\"faudes_sup\">↑</span>");
444 cm1=-1; cm2=-1; pos+=8;
451 size_t mpos=rTexString.find( "\\Uparrow",pos);
453 res.append( "<span class=\"faudes_sup\">⇧</span>");
454 cm1=-1; cm2=-1; pos+=8;
463 cm1=-1; cm2=-1; pos+=1;
471 cm1=-1; cm2=-1; pos+=1;
476 if(c0== '*' || c0== '+') {
478 cm1=-1; cm2=-1; pos+=1;
482 if(cm1== '^' || cm1== '_') {
485 cm1=-1; cm2=-1; pos+=1;
501 void MathHtml(std::ostream* pStream, const std::string& rMathString) {
502 std::string buff=rMathString;
630 std::map< std::string , std::map< std::string , PageRecord > > mRefSectPages;
635 int clevel = rTr. Level();
642 if(text.size()>0) continue;
645 if(!rTr. Peek(token)) break;
649 if(!token. IsBegin( "ReferencePage")) {
681 std::transform(indexfile.begin(), indexfile.end(), indexfile.begin(), tolower);
695 std::size_t spos = title.find(section);
696 if(spos==0 && title.size()>section.size())
698 for(spos=0; spos< mFrefPage.size(); spos++){
741 std::vector<PageRecord>::iterator pit;
751 if(pit->mSummary== "") {
773 *pIndexFile << "<table class=\"registry_toc\">" << std::endl;
780 std::string section= tit->second->Name();
781 std::transform(section.begin(), section.end(), section.begin(), tolower);
782 if(section!=key) continue;
785 if(tit->second->TextDoc()== "") continue;
787 *pIndexFile << "<tr><td valign=\"top\">";
788 TypeHtml(pIndexFile,tit->second->Name());
789 *pIndexFile << "</td><td valign=\"top\">";
790 TypeHtml(pIndexFile,tit->second->TextDoc());
791 *pIndexFile << "</td></tr>" << std::endl;
796 if(!found) *pIndexFile << "<tr><td><i>no matches found</i></td></tr>" << std::endl;
798 *pIndexFile << "</table>" << std::endl;
808 *pIndexFile << "<table class=\"registry_toc\">" << std::endl;
815 std::string section= fit->second->Name();
816 std::transform(section.begin(), section.end(), section.begin(), tolower);
817 if(section!=key) continue;
820 if(fit->second->TextDoc()== "") continue;
822 *pIndexFile << "<tr><td valign=\"top\">";
824 *pIndexFile << "</td><td valign=\"top\">";
825 TypeHtml(pIndexFile,fit->second->TextDoc());
826 *pIndexFile << "</td></tr>" << std::endl;
831 if(!found) *pIndexFile << "<tr><td><i>no matches found</i></td></tr>" << std::endl;
833 *pIndexFile << "</table>" << std::endl;
845 std::set< std::string > sections;
846 std::map< std::string , std::string > link;
847 std::map< std::string , std::string > summary;
848 std::vector< PageRecord >::iterator pit;
850 std::string chap=pit->mChapter;
851 std::transform(chap.begin(), chap.end(), chap.begin(), tolower);
852 std::string sect=pit->mSection;
853 std::transform(sect.begin(), sect.end(), sect.begin(), tolower);
854 std::string page=pit->mPage;
855 std::transform(page.begin(), page.end(), page.begin(), tolower);
858 if(chap!= "reference") continue;
859 if(sect== "none") continue;
860 if(sect== "") continue;
861 if(page!= "index") continue;
868 std::string pname = pit->mSection;
870 std::string psumm = pit->mSummary;
871 if(psumm== "") psumm = pit->mTitle;
873 sections.insert(pname);
874 link[pname]=pit->mLink;
875 summary[pname]=psumm;
879 std::vector< std::string > sortvec;
880 if(sections.find( "CoreFaudes")!=sections.end())
881 sortvec.push_back( "CoreFaudes");
882 std::set< std::string >::iterator sit;
883 for(sit=sections.begin(); sit != sections.end(); sit++) {
884 if(*sit== "CoreFaudes") continue;
885 sortvec.push_back(*sit);
889 *pIndexFile << "<table class=\"registry_toc\">" << std::endl;
892 std::vector< std::string >::iterator vit;
894 for(vit=sortvec.begin(); vit != sortvec.end(); vit++) {
896 std::string sname = *vit;
898 std::string ssumm = summary[sname];
900 *pIndexFile << "<tr>" << std::endl;
901 *pIndexFile << "<td valign=\"top\"><a href=\"" << shtml << "\">" << sname << "</a></td>";
902 *pIndexFile << "<td valign=\"top\">";
903 *pIndexFile << ssumm;
904 *pIndexFile << "</td></tr>"<< std::endl;
909 if(!found) *pIndexFile << "<tr><td><i>no matches found</i></td></tr>" << std::endl;
912 *pIndexFile << "</table>" << std::endl;
932 std::string section= tit->second->KeywordAt(0);
933 std::transform(section.begin(), section.end(), section.begin(), tolower);
934 if(section!=key) continue;
937 std::string tyname = tit->second->Name();
938 std::string tyhtml = tit->second->HtmlDoc();
940 if(tyhtml== "") continue;
941 if(tyhtml== "none") continue;
945 *pIndexFile << "<li class=\"registry_heading\">Types</li>" << std::endl;
951 if(head) *pIndexFile << "<li class=\"registry_blanc\"> </li>" << std::endl;
961 std::string lkey=key;
962 std::transform(lkey.begin(), lkey.end(), lkey.begin(), tolower);
971 std::string section= fit->second->KeywordAt(0);
972 std::transform(section.begin(), section.end(), section.begin(), tolower);
973 if(section!=lkey) continue;
976 if(fit->second->TextDoc()== "") continue;
978 std::string fname = fit->second->Name();
979 std::string fhtml = fit->second->HtmlDoc();
980 if(fhtml== "") continue;
984 *pIndexFile << "<li class=\"registry_heading\">Functions</li>" << std::endl;
988 *pIndexFile << "<li class=\"registry_item\"> "<< fname << "</li>" << std::endl;
996 if(head) *pIndexFile << "<li class=\"registry_blanc\"> </li>" << std::endl;
1007 std::map< std::string , std::string > sectlink;
1008 std::vector< PageRecord >::iterator pit;
1010 std::string chap=pit->mChapter;
1011 std::transform(chap.begin(), chap.end(), chap.begin(), tolower);
1012 std::string sect=pit->mSection;
1013 std::transform(sect.begin(), sect.end(), sect.begin(), tolower);
1015 if(chap!= "reference") continue;
1016 if(sect== "none") continue;
1017 if(sect== "") continue;
1019 std::string pname = pit->mSection;
1021 std::string phtml = sect+ "_index.html";
1023 sectlink[pname]=phtml;
1027 std::vector< std::string > sections;
1028 if(sectlink[ "CoreFaudes"]!= "") sections.push_back( "CoreFaudes");
1029 std::map< std::string , std::string >::iterator sit;
1030 for(sit=sectlink.begin(); sit!=sectlink.end(); sit++) {
1031 std::string psect=sit->first;
1032 if(psect== "CoreFaudes") continue;
1033 sections.push_back(psect);
1037 if(sections.size()!=0)
1038 *pIndexFile << "<li class=\"registry_heading\">Sections</li>" << std::endl;
1042 for(vit=0; vit<sections.size(); vit++) {
1043 std::string psect=sections.at(vit);
1044 std::string plink=sectlink[psect];
1045 if(plink== "") continue;
1047 std::string sect=psect;
1048 std::transform(sect.begin(), sect.end(), sect.begin(), tolower);
1049 std::map< std::string , std::map< std::string , PageRecord > > ::iterator spit = mRefSectPages.find(sect);
1052 std::map< std::string , PageRecord >::iterator pit = spit->second.begin();
1053 for(;pit!=spit->second.end();pit++) {
1054 std::string ppage = pit->second.mPage;
1055 std::transform(ppage.begin(), ppage.end(), ppage.begin(), tolower);
1056 if(ppage== "index") continue;
1057 if(ppage== "0_index") continue;
1058 if(ppage== "00_index") continue;
1068 *pIndexFile << "<li class=\"registry_pitem\">" << std::endl
1069 << "<a href=\"" << plink << "\">" << psect << "</a>" << std::endl
1070 << "<a href=\"" << plink << "\" class=\"registry_blinda\"> </a>" << std::endl
1071 << "<ul>" << std::endl
1072 << "<li class=\"registry_heading\">" << psect << "</li>" << std::endl;
1073 std::map< std::string , PageRecord >::iterator pit = spit->second.begin();
1074 for(;pit!=spit->second.end();pit++) {
1076 std::string ppage = PrettyPage(pit->second.mPage);
1078 std::string ipage = ppage;
1079 std::transform(ipage.begin(), ipage.end(), ipage.begin(), tolower);
1081 if(ipage== "index") ppage= "Introduction";
1083 *pIndexFile << "<li class=\"registry_item\"><a href=\"" << pit->second.mLink << "\">"
1084 << ppage << "</a></li>" << std::endl;
1087 *pIndexFile << "</ul></li>" << std::endl;
1091 if(sections.size()!=0)
1092 *pIndexFile << "<li class=\"registry_blanc\"> </li>" << std::endl;
1110 std::string sect=key;
1111 std::transform(sect.begin(), sect.end(), sect.begin(), tolower);
1112 std::string plink=sect+ "_index.html";
1113 std::string psect=key;
1114 std::map< std::string , std::map< std::string , PageRecord > > ::iterator spit = mRefSectPages.find(sect);
1117 std::map< std::string , PageRecord >::iterator pit = spit->second.begin();
1118 for(;pit!=spit->second.end();pit++) {
1119 std::string ppage = pit->second.mPage;
1120 psect=pit->second.mSection;
1121 std::transform(ppage.begin(), ppage.end(), ppage.begin(), tolower);
1122 if(ppage== "index") continue;
1123 if(ppage== "0_index") continue;
1124 if(ppage== "00_index") continue;
1133 if(key== "") psect= "Reference";
1136 *pIndexFile << "<li class=\"registry_heading\">" << psect << "</li>" << std::endl;
1137 std::map< std::string , PageRecord >::iterator pit = spit->second.begin();
1138 for(;pit!=spit->second.end();pit++) {
1140 std::string ppage = PrettyPage(pit->second.mPage);
1142 std::string ipage = ppage;
1143 std::transform(ipage.begin(), ipage.end(), ipage.begin(), tolower);
1145 if(ipage== "index") ppage= "Introduction";
1147 *pIndexFile << "<li class=\"registry_item\"><a href=\"" << pit->second.mLink << "\">"
1148 << ppage << "</a></li>" << std::endl;
1169 *pOutFile << "<div class=\"registry_signature\">" << std::endl;
1170 *pOutFile << "<h5><strong>Signature:</strong></h5>" << std::endl;
1175 *pOutFile << "<p>" << fdef. Name() << "(";
1177 for( int j=0; j < sigi. Size(); j++) {
1178 if(j!=0) *pOutFile << ", ";
1182 *pOutFile << " <i>" << parj. Name() << "</i></span>";
1184 *pOutFile << ")</p>" << std::endl;
1189 *pOutFile << std::endl << "</div>" << std::endl;
1206 *pOutFile << "<p>" << fdef. TextDoc() << "</p>" << std::endl;
1221 *pOutFile << "<p>" << tdef. TextDoc() << "<p>" << std::endl;
1253 int clevel = rTr. Level();
1260 if(text.size()>0) continue;
1263 if(!rTr. Peek(token)) break;
1267 if(token. IsBegin( "ReferencePage")) {
1280 if(!token. IsBegin( "fliterature")) {
1292 while(!rTr. Eos( "fliterature")) {
1296 if(token. IsBegin( "fauthors")) {
1308 if(token. IsBegin( "fjournal")) {
1345 std::map<std::string,LiteratureRecord>::iterator lit;
1351 if(lit->second.mAuthors!= "") {
1356 if(lit->second.mTitle!= "") {
1361 if(lit->second.mJournal!= "") {
1366 if(lit->second.mPublisher!= "") {
1371 if(lit->second.mYear!= "") {
1376 if(lit->second.mLink!= "") {
1390 std::map<std::string,LiteratureRecord>::iterator lit;
1394 if(rLabel!=lit->second.mLabel) continue;
1396 *pStream << "<p>" << std::endl;
1397 *pStream << "<a id=\"" << "lit_" << lit->second.mLabel << "\">[" << lit->second.mLabel << "]</a>" << std::endl;
1398 *pStream << lit->second.mAuthors << ": ";
1399 *pStream << "<i>" << lit->second.mTitle << "</i>";
1400 if(lit->second.mJournal!= "") *pStream << ", " << lit->second.mJournal;
1401 if(lit->second.mPublisher!= "") *pStream << ", " << lit->second.mPublisher;
1402 if(lit->second.mYear!= "") *pStream << ", " << lit->second.mYear;
1403 *pStream << ".</p>" << std::endl;
1409 void CiteHtml(std::ostream* pStream, const std::string& rLabel) {
1411 std::string link= "reference_literature.html";
1413 std::map<std::string,LiteratureRecord>::iterator lit;
1415 if(lit!= mLiterature.end()) link=lit->second.mLink;
1417 *pStream << "<a href=\"" << link << "\">[" << rLabel << "]</a>";
1429 while(src. Peek(btag)) {
1431 if(!btag. IsBegin( "ReferencePage")) {
1452 std::cerr << "ref2html: skipping undefined page at " << src. FileLine() << std::endl;
1462 std::cerr << "ref2html: extracting page to \"" << dstfile << "\"" << std::endl;
1466 std::string srctext;
1483 while(src. Peek(btag)) {
1485 if(!btag. IsBegin( "ImageFile")) {
1493 std::cerr << "ref2html: skipping undefined image file at " << src. FileLine() << std::endl;
1501 std::cerr << "ref2html: skipping invalid image file at " << src. FileLine() << std::endl;
1506 std::string dstfile;
1507 std::transform(name.begin(), name.end(), name.begin(), tolower);
1510 std::cerr << "ref2html: extracting image file to \"" << dstfile << "\"" << std::endl;
1513 fsout.exceptions(std::ios::badbit|std::ios::failbit);
1515 fsout.open(dstfile.c_str(), std::ios::out | std::ios::binary);
1519 catch (std::ios::failure&) {
1520 std::cerr << "ref2html: file io error when writing \"" << dstfile << "\"" << std::endl;
1534 std::map< std::string , std::string > pages;
1535 std::vector< PageRecord >::iterator pit;
1538 if(pit->mChapter!= "luafaudes") continue;
1539 if(pit->mSection== "none") continue;
1540 if(pit->mSection== "") continue;
1541 if(pit->mPage== "") continue;
1543 std::string pname = pit->mPage;
1545 std::string phtml = pit->mLink;
1550 std::map< std::string , std::string >::iterator sit;
1551 for(sit=pages.begin(); sit!=pages.end(); sit++) {
1556 if(pages.size()==0) {
1557 *pIndexFile << "<li class=\"registry_item\">" << "none" << "</li>" << std::endl;
1568 int clevel = rTr. Level();
1584 if(!rTr. Peek(token)) break;
1616 *rTw. Streamp() << "<span class=\"faudes_dmath\">";
1627 *rTw. Streamp()<< "<span class=\"faudes_imath\">";
1634 if(token. IsBegin( "ffnct_reference")) {
1635 rTr. ReadBegin( "ffnct_reference", token);
1637 *rTw. Streamp() << "<div class=\"registry_function\"> " << std::endl;
1638 *rTw. Streamp() << "<h2>" << "<a id=\"" << ffnct << "\">" << ffnct << "</a></h2>" << std::endl;
1641 *rTw. Streamp() << "</div>" << std::endl;
1642 rTr. ReadEnd( "ffnct_reference");
1646 if(token. IsBegin( "ftype_reference")) {
1647 rTr. ReadBegin( "ftype_reference", token);
1649 *rTw. Streamp() << "<div class=\"registry_type\"> " << std::endl;
1650 *rTw. Streamp() << "<h2>" << "<a id=\"" << ftype << "\">" << ftype << "</a></h2>" << std::endl;
1653 *rTw. Streamp() << "</div>" << std::endl;
1654 rTr. ReadEnd( "ftype_reference");
1658 if(token. IsBegin( "fdetails")) {
1660 *rTw. Streamp() << "<h5>Detailed description:</h5>";
1665 if(token. IsBegin( "fconditions")) {
1667 *rTw. Streamp() << "<h5>Parameter Conditions:</h5>";
1672 if(token. IsBegin( "fexample")) {
1674 *rTw. Streamp() << "<h5>Example:</h5>";
1679 if(token. IsBegin( "falltypes")) {
1686 if(token. IsBegin( "fallfncts")) {
1693 if(token. IsBegin( "fallsects")) {
1700 if(token. IsBegin( "fluasects")) {
1707 if(token. IsBegin( "falllit")) {
1714 if(token. IsBegin( "fliterature")) {
1722 if(token. IsBegin( "fcontributors")) {
1748 if(token. IsBegin( "fsummary")) {
1872 *pOutFile << "<table id=\"registry_page\">" << std::endl;
1873 *pOutFile << "<tr id=\"registry_row\">" << std::endl;
1874 *pOutFile << "<td id=\"registry_index\">" << std::endl;
1875 *pOutFile << "<ul class=\"registry_list\">" << std::endl;
1876 *pOutFile << "<li class=\"registry_heading\">libFAUDES</li>" << std::endl;
1877 ListItemHtml(pOutFile, "reference_index.html", "Reference");
1878 ListItemHtml(pOutFile, "reference_types.html", "Type Index");
1879 ListItemHtml(pOutFile, "reference_functions.html", "Function Index");
1880 ListItemHtml(pOutFile, "reference_literature.html", "Literature");
1881 *pOutFile << "<li class=\"registry_blanc\"> </li>" << std::endl;
1883 *pOutFile << "</ul></td>" << std::endl;
1884 *pOutFile << "<td id=\"registry_content\">" << std::endl;
1889 *pOutFile << "<table id=\"registry_page\">" << std::endl;
1890 *pOutFile << "<tr id=\"registry_row\">" << std::endl;
1891 *pOutFile << "<td id=\"registry_index\">" << std::endl;
1892 *pOutFile << "<ul class=\"registry_list\">" << std::endl;
1893 *pOutFile << "<li class=\"registry_heading\">luafaudes</li>" << std::endl;
1895 << "<script language=\"JavaScript\"> var luafaudes=function() { "
1896 << " popupWin = window.open('luafaudes_repl.html','open_window',"
1897 << " 'resizable,dependent, width=720, height=480, left=0, top=0'); } "
1898 << "</script>" << std::endl;
1900 ListItemHtml(pOutFile, "javascript:luafaudes();", "Lua-Console");
1901 ListItemHtml(pOutFile, "faudes_luaext.html", "Lua-Extensions");
1902 ListItemHtml(pOutFile, "faudes_luatech.html", "Technical Detail");
1903 *pOutFile << "<li class=\"registry_blanc\"> </li>" << std::endl;
1904 *pOutFile << "<li class=\"registry_heading\">Tutorials</li>" << std::endl;
1906 *pOutFile << "</ul></td>" << std::endl;
1907 *pOutFile << "<td id=\"registry_content\">" << std::endl;
1922 *pOutFile << "</td>" << std::endl;
1923 *pOutFile << "</tr>" << std::endl;
1924 *pOutFile << "</table>" << std::endl;
1931 *pOutFile << "</td>" << std::endl;
1932 *pOutFile << "</tr>" << std::endl;
1933 *pOutFile << "</table>" << std::endl;
1938 *pOutFile << "</div>" << std::endl << "</div>" << std::endl;
1939 *pOutFile << "<div id=\"cxwrapper1000\">" << std::endl;
1940 *pOutFile << "<div id=\"dxwrapper1000\">" << std::endl;
1941 *pOutFile << "<div class=\"registry_trigger\"> <span>>></span>" << std::endl;
1942 *pOutFile << "<ul class=\"registry_list\">" << std::endl;
1944 *pOutFile << "<li class=\"registry_blanc\"> </li>" << std::endl;
1946 *pOutFile << "</ul></div>" << std::endl;
1951 *pOutFile << "</div>" << std::endl << "</div>" << std::endl;
1952 *pOutFile << "<div id=\"cxwrapper1000\">" << std::endl;
1953 *pOutFile << "<div id=\"dxwrapper1000\">" << std::endl;
1954 *pOutFile << "<div class=\"registry_trigger\"> <span>>></span>" << std::endl;
1955 *pOutFile << "<ul class=\"registry_list\">" << std::endl;
1956 *pOutFile << "<li class=\"registry_heading\">luafaudes</li>" << std::endl;
1957 *pOutFile << "<li class=\"registry_item\"><a href=\"faudes_luafaudes.html\">Introduction</a></li>" << std::endl;
1958 *pOutFile << "<li class=\"registry_item\"><a href=\"faudes_luaext.html\">Lua-Extansions</a></li>" << std::endl;
1959 *pOutFile << "<li class=\"registry_item\"><a href=\"faudes_luatech.html\">Techn. Details</a></li>" << std::endl;
1960 *pOutFile << "<li class=\"registry_blanc\"> </li>" << std::endl;
1961 *pOutFile << "<li class=\"registry_item\"><a href=\"#\">Top of Page</a></li>" << std::endl;
1962 *pOutFile << "</ul></div>" << std::endl;
2000 *pOutFile << "<table id=\"registry_page\">" << std::endl;
2001 *pOutFile << "<tr id=\"registry_row\">" << std::endl;
2002 *pOutFile << "<td id=\"registry_index\">" << std::endl;
2003 *pOutFile << "<ul class=\"registry_list\">" << std::endl;
2004 *pOutFile << "<li class=\"registry_heading\">libFAUDES</li>" << std::endl;
2006 *pOutFile << "<li class=\"registry_blanc\"> </li>" << std::endl;
2007 *pOutFile << "<li class=\"registry_heading\">Sections</li>" << std::endl;
2008 ListItemHtml(pOutFile, "group__ContainerClasses.html", "Sets");
2009 ListItemHtml(pOutFile, "group__GeneratorClasses.html", "Generators");
2010 ListItemHtml(pOutFile, "group__GeneratorFunctions.html", "Functions");
2011 ListItemHtml(pOutFile, "group__AllPlugins.html", "PlugIns");
2012 ListItemHtml(pOutFile, "group__Tutorials.html", "Tutorials");
2013 *pOutFile << "<li class=\"registry_blanc\"> </li>" << std::endl;
2014 *pOutFile << "<li class=\"registry_heading\">Index</li>" << std::endl;
2017 *pOutFile << "<li class=\"registry_blanc\"> </li>" << std::endl;
2018 *pOutFile << "</ul></td>" << std::endl;
2019 *pOutFile << "<td id=\"registry_content\">" << std::endl;
2035 *pOutFile << "</td>" << std::endl;
2036 *pOutFile << "</tr>" << std::endl;
2037 *pOutFile << "</table>" << std::endl;
2040 *pOutFile << "</div>" << std::endl << "</div>" << std::endl;
2041 *pOutFile << "<div id=\"cxwrapper1000\">" << std::endl;
2042 *pOutFile << "<div id=\"dxwrapper1000\">" << std::endl;
2043 *pOutFile << "<div class=\"registry_trigger\"> <span>>></span>" << std::endl;
2044 *pOutFile << "<ul class=\"registry_list\">" << std::endl;
2045 *pOutFile << "<li class=\"registry_heading\">C++ API</li>" << std::endl;
2046 *pOutFile << "<li class=\"registry_item\"><a href=\"index.html\">Introduction</a></li>" << std::endl;
2047 *pOutFile << "<li class=\"registry_item\"><a href=\"group__ContainerClasses.html\">Sets</a></li>" << std::endl;
2048 *pOutFile << "<li class=\"registry_item\"><a href=\"group__GeneratorClasses.html\">Generators</a></li>" << std::endl;
2049 *pOutFile << "<li class=\"registry_item\"><a href=\"group__GeneratorFunctions.html\">Functions</a></li>" << std::endl;
2050 *pOutFile << "<li class=\"registry_item\"><a href=\"group__AllPlugins.html\">PlugIns</a></li>" << std::endl;
2051 *pOutFile << "<li class=\"registry_item\"><a href=\"group__Tutorials.html\">Tutorials</a></li>" << std::endl;
2052 *pOutFile << "<li class=\"registry_item\"><a href=\"classes.html\">Classes</a></li>" << std::endl;
2053 *pOutFile << "<li class=\"registry_item\"><a href=\"files.html\">Files</a></li>" << std::endl;
2054 *pOutFile << "<li class=\"registry_blanc\"> </li>" << std::endl;
2055 *pOutFile << "<li class=\"registry_item\"><a href=\"#\">Top of Page</a></li>" << std::endl;
2056 *pOutFile << "</ul></div>" << std::endl;
2082 for(i=1; i<argc; i++) {
2083 std::string option(argv[i]);
2085 if(option== "-rti") {
2091 if(option== "-flx") {
2097 if(option== "-css") {
2103 if(option== "-cnav") {
2109 if(option== "-inc") {
2115 if(option== "-rel") {
2121 if(option== "-chapter") {
2127 if(option== "-section") {
2133 if(option== "-extract") {
2139 if(option== "-toc") {
2146 if(option== "-doxheader") {
2153 if(option== "-doxfooter") {
2160 if(option== "-app") {
2165 if((option== "-?") || (option== "--help")) {
2171 if(option.at(0)== '-') {
2180 for(;i<argc-1; i++) {
2181 std::string option(argv[i]);
2183 if(option.at(0)== '-') {
2184 usage_exit( "missplaced/unknown option " + option);
2192 std::string option(argv[i]);
2194 if(option.at(0)== '-') {
2195 usage_exit( "missplaced/unknown option " + option);
2215 std::string section=fit->second->KeywordAt(0);
2216 std::transform(section.begin(), section.end(), section.begin(), tolower);
2228 std::string section=fit->second->KeywordAt(0);
2229 std::transform(section.begin(), section.end(), section.begin(), tolower);
2246 usage_exit( "extract mode requires one source file");
2249 usage_exit( "extract mode requires destination directory");
2251 std::cerr << "ref2html: extract pages from " << * mSrcFiles.begin() << std::endl;
2263 usage_exit( "toc mode requires destination file");
2266 std::ostream* hout= &std::cout;
2269 fout.open( mDstFile.c_str(), std::ios::out);
2273 std::set< std::string >::iterator sit= mSrcFiles.begin();
2275 std::cerr << "ref2html: process toc " << *sit << std::endl;
2290 if(dodhd || dodft) {
2292 usage_exit( "header-footer mode requires destination file");
2295 std::ostream* hout= &std::cout;
2298 fout.open( mDstFile.c_str(), std::ios::out);
2309 std::set< std::string > srcfiles;
2310 std::set< std::string >::iterator sit= mSrcFiles.begin();
2314 std::set< std::string >::iterator dit=dirfiles.begin();
2315 for(;dit!=dirfiles.end();++dit) {
2318 std::string src= PrependPath(*sit,base + ".fref");
2320 if(ext!= "fref") continue;
2322 srcfiles.insert(src);
2329 usage_exit( "multiple source files require destination directory");
2337 std::string src= *sit;
2342 std::cout << "ref2html: processing " << src << " to " << dst << std::endl;
2344 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)
int main(int argc, char *argv[])
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 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 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)
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.33l
--- 2025.09.16
--- c++ api documentaion by doxygen
|