|
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;
629 std::map< std::string , std::map< std::string , PageRecord > > mRefSectPages;
634 int clevel = rTr. Level();
641 if(text.size()>0) continue;
644 if(!rTr. Peek(token)) break;
648 if(!token. IsBegin( "ReferencePage")) {
680 std::transform(indexfile.begin(), indexfile.end(), indexfile.begin(), tolower);
694 std::size_t spos = title.find(section);
695 if(spos==0 && title.size()>section.size())
697 for(spos=0; spos< mFrefPage.size(); spos++){
740 std::vector<PageRecord>::iterator pit;
750 if(pit->mSummary== "") {
772 *pIndexFile << "<table class=\"registry_toc\">" << std::endl;
779 std::string section= tit->second->Name();
780 std::transform(section.begin(), section.end(), section.begin(), tolower);
781 if(section!=key) continue;
784 if(tit->second->TextDoc()== "") continue;
786 *pIndexFile << "<tr><td valign=\"top\">";
787 TypeHtml(pIndexFile,tit->second->Name());
788 *pIndexFile << "</td><td valign=\"top\">";
789 TypeHtml(pIndexFile,tit->second->TextDoc());
790 *pIndexFile << "</td></tr>" << std::endl;
795 if(!found) *pIndexFile << "<tr><td><i>no matches found</i></td></tr>" << std::endl;
797 *pIndexFile << "</table>" << std::endl;
807 *pIndexFile << "<table class=\"registry_toc\">" << std::endl;
814 std::string section= fit->second->Name();
815 std::transform(section.begin(), section.end(), section.begin(), tolower);
816 if(section!=key) continue;
819 if(fit->second->TextDoc()== "") continue;
821 *pIndexFile << "<tr><td valign=\"top\">";
823 *pIndexFile << "</td><td valign=\"top\">";
824 TypeHtml(pIndexFile,fit->second->TextDoc());
825 *pIndexFile << "</td></tr>" << std::endl;
830 if(!found) *pIndexFile << "<tr><td><i>no matches found</i></td></tr>" << std::endl;
832 *pIndexFile << "</table>" << std::endl;
844 std::set< std::string > sections;
845 std::map< std::string , std::string > link;
846 std::map< std::string , std::string > summary;
847 std::vector< PageRecord >::iterator pit;
849 std::string chap=pit->mChapter;
850 std::transform(chap.begin(), chap.end(), chap.begin(), tolower);
851 std::string sect=pit->mSection;
852 std::transform(sect.begin(), sect.end(), sect.begin(), tolower);
853 std::string page=pit->mPage;
854 std::transform(page.begin(), page.end(), page.begin(), tolower);
857 if(chap!= "reference") continue;
858 if(sect== "none") continue;
859 if(sect== "") continue;
860 if(page!= "index") continue;
867 std::string pname = pit->mSection;
869 std::string psumm = pit->mSummary;
870 if(psumm== "") psumm = pit->mTitle;
872 sections.insert(pname);
873 link[pname]=pit->mLink;
874 summary[pname]=psumm;
878 std::vector< std::string > sortvec;
879 if(sections.find( "CoreFaudes")!=sections.end())
880 sortvec.push_back( "CoreFaudes");
881 std::set< std::string >::iterator sit;
882 for(sit=sections.begin(); sit != sections.end(); sit++) {
883 if(*sit== "CoreFaudes") continue;
884 sortvec.push_back(*sit);
888 *pIndexFile << "<table class=\"registry_toc\">" << std::endl;
891 std::vector< std::string >::iterator vit;
893 for(vit=sortvec.begin(); vit != sortvec.end(); vit++) {
895 std::string sname = *vit;
897 std::string ssumm = summary[sname];
899 *pIndexFile << "<tr>" << std::endl;
900 *pIndexFile << "<td valign=\"top\"><a href=\"" << shtml << "\">" << sname << "</a></td>";
901 *pIndexFile << "<td valign=\"top\">";
902 *pIndexFile << ssumm;
903 *pIndexFile << "</td></tr>"<< std::endl;
908 if(!found) *pIndexFile << "<tr><td><i>no matches found</i></td></tr>" << std::endl;
911 *pIndexFile << "</table>" << std::endl;
931 std::string section= tit->second->KeywordAt(0);
932 std::transform(section.begin(), section.end(), section.begin(), tolower);
933 if(section!=key) continue;
936 std::string tyname = tit->second->Name();
937 std::string tyhtml = tit->second->HtmlDoc();
939 if(tyhtml== "") continue;
940 if(tyhtml== "none") continue;
944 *pIndexFile << "<li class=\"registry_heading\">Types</li>" << std::endl;
950 if(head) *pIndexFile << "<li class=\"registry_blanc\"> </li>" << std::endl;
960 std::string lkey=key;
961 std::transform(lkey.begin(), lkey.end(), lkey.begin(), tolower);
970 std::string section= fit->second->KeywordAt(0);
971 std::transform(section.begin(), section.end(), section.begin(), tolower);
972 if(section!=lkey) continue;
975 if(fit->second->TextDoc()== "") continue;
977 std::string fname = fit->second->Name();
978 std::string fhtml = fit->second->HtmlDoc();
979 if(fhtml== "") continue;
983 *pIndexFile << "<li class=\"registry_heading\">Functions</li>" << std::endl;
987 *pIndexFile << "<li class=\"registry_item\"> "<< fname << "</li>" << std::endl;
995 if(head) *pIndexFile << "<li class=\"registry_blanc\"> </li>" << std::endl;
1006 std::map< std::string , std::string > sectlink;
1007 std::vector< PageRecord >::iterator pit;
1009 std::string chap=pit->mChapter;
1010 std::transform(chap.begin(), chap.end(), chap.begin(), tolower);
1011 std::string sect=pit->mSection;
1012 std::transform(sect.begin(), sect.end(), sect.begin(), tolower);
1014 if(chap!= "reference") continue;
1015 if(sect== "none") continue;
1016 if(sect== "") continue;
1018 std::string pname = pit->mSection;
1020 std::string phtml = sect+ "_index.html";
1022 sectlink[pname]=phtml;
1026 std::vector< std::string > sections;
1027 if(sectlink[ "CoreFaudes"]!= "") sections.push_back( "CoreFaudes");
1028 std::map< std::string , std::string >::iterator sit;
1029 for(sit=sectlink.begin(); sit!=sectlink.end(); sit++) {
1030 std::string psect=sit->first;
1031 if(psect== "CoreFaudes") continue;
1032 sections.push_back(psect);
1036 if(sections.size()!=0)
1037 *pIndexFile << "<li class=\"registry_heading\">Sections</li>" << std::endl;
1041 for(vit=0; vit<sections.size(); vit++) {
1042 std::string psect=sections.at(vit);
1043 std::string plink=sectlink[psect];
1044 if(plink== "") continue;
1046 std::string sect=psect;
1047 std::transform(sect.begin(), sect.end(), sect.begin(), tolower);
1048 std::map< std::string , std::map< std::string , PageRecord > > ::iterator spit = mRefSectPages.find(sect);
1051 std::map< std::string , PageRecord >::iterator pit = spit->second.begin();
1052 for(;pit!=spit->second.end();pit++) {
1053 std::string ppage = pit->second.mPage;
1054 std::transform(ppage.begin(), ppage.end(), ppage.begin(), tolower);
1055 if(ppage== "index") continue;
1056 if(ppage== "0_index") continue;
1057 if(ppage== "00_index") continue;
1067 *pIndexFile << "<li class=\"registry_pitem\">" << std::endl
1068 << "<a href=\"" << plink << "\">" << psect << "</a>" << std::endl
1069 << "<a href=\"" << plink << "\" class=\"registry_blinda\"> </a>" << std::endl
1070 << "<ul>" << std::endl
1071 << "<li class=\"registry_heading\">" << psect << "</li>" << std::endl;
1072 std::map< std::string , PageRecord >::iterator pit = spit->second.begin();
1073 for(;pit!=spit->second.end();pit++) {
1075 std::string ppage = PrettyPage(pit->second.mPage);
1077 std::string ipage = ppage;
1078 std::transform(ipage.begin(), ipage.end(), ipage.begin(), tolower);
1080 if(ipage== "index") ppage= "Introduction";
1082 *pIndexFile << "<li class=\"registry_item\"><a href=\"" << pit->second.mLink << "\">"
1083 << ppage << "</a></li>" << std::endl;
1086 *pIndexFile << "</ul></li>" << std::endl;
1090 if(sections.size()!=0)
1091 *pIndexFile << "<li class=\"registry_blanc\"> </li>" << std::endl;
1109 std::string sect=key;
1110 std::transform(sect.begin(), sect.end(), sect.begin(), tolower);
1111 std::string plink=sect+ "_index.html";
1112 std::string psect=key;
1113 std::map< std::string , std::map< std::string , PageRecord > > ::iterator spit = mRefSectPages.find(sect);
1116 std::map< std::string , PageRecord >::iterator pit = spit->second.begin();
1117 for(;pit!=spit->second.end();pit++) {
1118 std::string ppage = pit->second.mPage;
1119 psect=pit->second.mSection;
1120 std::transform(ppage.begin(), ppage.end(), ppage.begin(), tolower);
1121 if(ppage== "index") continue;
1122 if(ppage== "0_index") continue;
1123 if(ppage== "00_index") continue;
1132 if(key== "") psect= "Reference";
1135 *pIndexFile << "<li class=\"registry_heading\">" << psect << "</li>" << std::endl;
1136 std::map< std::string , PageRecord >::iterator pit = spit->second.begin();
1137 for(;pit!=spit->second.end();pit++) {
1139 std::string ppage = PrettyPage(pit->second.mPage);
1141 std::string ipage = ppage;
1142 std::transform(ipage.begin(), ipage.end(), ipage.begin(), tolower);
1144 if(ipage== "index") ppage= "Introduction";
1146 *pIndexFile << "<li class=\"registry_item\"><a href=\"" << pit->second.mLink << "\">"
1147 << ppage << "</a></li>" << std::endl;
1168 *pOutFile << "<div class=\"registry_signature\">" << std::endl;
1169 *pOutFile << "<h5><strong>Signature:</strong></h5>" << std::endl;
1174 *pOutFile << "<p>" << fdef. Name() << "(";
1176 for( int j=0; j < sigi. Size(); j++) {
1177 if(j!=0) *pOutFile << ", ";
1181 *pOutFile << " <i>" << parj. Name() << "</i></span>";
1183 *pOutFile << ")</p>" << std::endl;
1188 *pOutFile << std::endl << "</div>" << std::endl;
1205 *pOutFile << "<p>" << fdef. TextDoc() << "</p>" << std::endl;
1220 *pOutFile << "<p>" << tdef. TextDoc() << "<p>" << std::endl;
1252 int clevel = rTr. Level();
1259 if(text.size()>0) continue;
1262 if(!rTr. Peek(token)) break;
1266 if(token. IsBegin( "ReferencePage")) {
1279 if(!token. IsBegin( "fliterature")) {
1291 while(!rTr. Eos( "fliterature")) {
1295 if(token. IsBegin( "fauthors")) {
1307 if(token. IsBegin( "fjournal")) {
1344 std::map<std::string,LiteratureRecord>::iterator lit;
1350 if(lit->second.mAuthors!= "") {
1355 if(lit->second.mTitle!= "") {
1360 if(lit->second.mJournal!= "") {
1365 if(lit->second.mPublisher!= "") {
1370 if(lit->second.mYear!= "") {
1375 if(lit->second.mLink!= "") {
1389 std::map<std::string,LiteratureRecord>::iterator lit;
1393 if(rLabel!=lit->second.mLabel) continue;
1395 *pStream << "<p>" << std::endl;
1396 *pStream << "<a id=\"" << "lit_" << lit->second.mLabel << "\">[" << lit->second.mLabel << "]</a>" << std::endl;
1397 *pStream << lit->second.mAuthors << ": ";
1398 *pStream << "<i>" << lit->second.mTitle << "</i>";
1399 if(lit->second.mJournal!= "") *pStream << ", " << lit->second.mJournal;
1400 if(lit->second.mPublisher!= "") *pStream << ", " << lit->second.mPublisher;
1401 if(lit->second.mYear!= "") *pStream << ", " << lit->second.mYear;
1402 *pStream << ".</p>" << std::endl;
1408 void CiteHtml(std::ostream* pStream, const std::string& rLabel) {
1410 std::string link= "reference_literature.html";
1412 std::map<std::string,LiteratureRecord>::iterator lit;
1414 if(lit!= mLiterature.end()) link=lit->second.mLink;
1416 *pStream << "<a href=\"" << link << "\">[" << rLabel << "]</a>";
1428 while(src. Peek(btag)) {
1430 if(!btag. IsBegin( "ReferencePage")) {
1451 std::cerr << "ref2html: skipping undefined page at " << src. FileLine() << std::endl;
1461 std::cerr << "ref2html: extracting page to \"" << dstfile << "\"" << std::endl;
1465 std::string srctext;
1482 while(src. Peek(btag)) {
1484 if(!btag. IsBegin( "ImageFile")) {
1492 std::cerr << "ref2html: skipping undefined image file at " << src. FileLine() << std::endl;
1500 std::cerr << "ref2html: skipping invalid image file at " << src. FileLine() << std::endl;
1505 std::string dstfile;
1506 std::transform(name.begin(), name.end(), name.begin(), tolower);
1509 std::cerr << "ref2html: extracting image file to \"" << dstfile << "\"" << std::endl;
1512 fsout.exceptions(std::ios::badbit|std::ios::failbit);
1514 fsout.open(dstfile.c_str(), std::ios::out | std::ios::binary);
1518 catch (std::ios::failure&) {
1519 std::cerr << "ref2html: file io error when writing \"" << dstfile << "\"" << std::endl;
1533 std::map< std::string , std::string > pages;
1534 std::vector< PageRecord >::iterator pit;
1537 if(pit->mChapter!= "luafaudes") continue;
1538 if(pit->mSection== "none") continue;
1539 if(pit->mSection== "") continue;
1540 if(pit->mPage== "") continue;
1542 std::string pname = pit->mPage;
1544 std::string phtml = pit->mLink;
1549 std::map< std::string , std::string >::iterator sit;
1550 for(sit=pages.begin(); sit!=pages.end(); sit++) {
1555 if(pages.size()==0) {
1556 *pIndexFile << "<li class=\"registry_item\">" << "none" << "</li>" << std::endl;
1567 int clevel = rTr. Level();
1583 if(!rTr. Peek(token)) break;
1615 *rTw. Streamp() << "<span class=\"faudes_dmath\">";
1626 *rTw. Streamp()<< "<span class=\"faudes_imath\">";
1633 if(token. IsBegin( "ffnct_reference")) {
1634 rTr. ReadBegin( "ffnct_reference", token);
1636 *rTw. Streamp() << "<div class=\"registry_function\"> " << std::endl;
1637 *rTw. Streamp() << "<h2>" << "<a id=\"" << ffnct << "\">" << ffnct << "</a></h2>" << std::endl;
1640 *rTw. Streamp() << "</div>" << std::endl;
1641 rTr. ReadEnd( "ffnct_reference");
1645 if(token. IsBegin( "ftype_reference")) {
1646 rTr. ReadBegin( "ftype_reference", token);
1648 *rTw. Streamp() << "<div class=\"registry_type\"> " << std::endl;
1649 *rTw. Streamp() << "<h2>" << "<a id=\"" << ftype << "\">" << ftype << "</a></h2>" << std::endl;
1652 *rTw. Streamp() << "</div>" << std::endl;
1653 rTr. ReadEnd( "ftype_reference");
1657 if(token. IsBegin( "fdetails")) {
1659 *rTw. Streamp() << "<h5>Detailed description:</h5>";
1664 if(token. IsBegin( "fconditions")) {
1666 *rTw. Streamp() << "<h5>Parameter Conditions:</h5>";
1671 if(token. IsBegin( "fexample")) {
1673 *rTw. Streamp() << "<h5>Example:</h5>";
1678 if(token. IsBegin( "falltypes")) {
1685 if(token. IsBegin( "fallfncts")) {
1692 if(token. IsBegin( "fallsects")) {
1699 if(token. IsBegin( "fluasects")) {
1706 if(token. IsBegin( "falllit")) {
1713 if(token. IsBegin( "fliterature")) {
1721 if(token. IsBegin( "fcontributors")) {
1747 if(token. IsBegin( "fsummary")) {
1871 *pOutFile << "<table id=\"registry_page\">" << std::endl;
1872 *pOutFile << "<tr id=\"registry_row\">" << std::endl;
1873 *pOutFile << "<td id=\"registry_index\">" << std::endl;
1874 *pOutFile << "<ul class=\"registry_list\">" << std::endl;
1875 *pOutFile << "<li class=\"registry_heading\">libFAUDES</li>" << std::endl;
1876 ListItemHtml(pOutFile, "reference_index.html", "Reference");
1877 ListItemHtml(pOutFile, "reference_types.html", "Type Index");
1878 ListItemHtml(pOutFile, "reference_functions.html", "Function Index");
1879 ListItemHtml(pOutFile, "reference_literature.html", "Literature");
1880 *pOutFile << "<li class=\"registry_blanc\"> </li>" << std::endl;
1882 *pOutFile << "</ul></td>" << std::endl;
1883 *pOutFile << "<td id=\"registry_content\">" << std::endl;
1888 *pOutFile << "<table id=\"registry_page\">" << std::endl;
1889 *pOutFile << "<tr id=\"registry_row\">" << std::endl;
1890 *pOutFile << "<td id=\"registry_index\">" << std::endl;
1891 *pOutFile << "<ul class=\"registry_list\">" << std::endl;
1892 *pOutFile << "<li class=\"registry_heading\">luafaudes</li>" << std::endl;
1894 << "<script language=\"JavaScript\"> var luafaudes=function() { "
1895 << " popupWin = window.open('luafaudes_repl.html','open_window',"
1896 << " 'resizable,dependent, width=720, height=480, left=0, top=0'); } "
1897 << "</script>" << std::endl;
1899 ListItemHtml(pOutFile, "javascript:luafaudes();", "Lua-Console");
1900 ListItemHtml(pOutFile, "faudes_luaext.html", "Lua-Extensions");
1901 ListItemHtml(pOutFile, "faudes_luatech.html", "Technical Detail");
1902 *pOutFile << "<li class=\"registry_blanc\"> </li>" << std::endl;
1903 *pOutFile << "<li class=\"registry_heading\">Tutorials</li>" << std::endl;
1905 *pOutFile << "</ul></td>" << std::endl;
1906 *pOutFile << "<td id=\"registry_content\">" << std::endl;
1921 *pOutFile << "</td>" << std::endl;
1922 *pOutFile << "</tr>" << std::endl;
1923 *pOutFile << "</table>" << std::endl;
1930 *pOutFile << "</td>" << std::endl;
1931 *pOutFile << "</tr>" << std::endl;
1932 *pOutFile << "</table>" << std::endl;
1937 *pOutFile << "</div>" << std::endl << "</div>" << std::endl;
1938 *pOutFile << "<div id=\"cxwrapper1000\">" << std::endl;
1939 *pOutFile << "<div id=\"dxwrapper1000\">" << std::endl;
1940 *pOutFile << "<div class=\"registry_trigger\"> <span>>></span>" << std::endl;
1941 *pOutFile << "<ul class=\"registry_list\">" << std::endl;
1943 *pOutFile << "<li class=\"registry_blanc\"> </li>" << std::endl;
1945 *pOutFile << "</ul></div>" << std::endl;
1950 *pOutFile << "</div>" << std::endl << "</div>" << std::endl;
1951 *pOutFile << "<div id=\"cxwrapper1000\">" << std::endl;
1952 *pOutFile << "<div id=\"dxwrapper1000\">" << std::endl;
1953 *pOutFile << "<div class=\"registry_trigger\"> <span>>></span>" << std::endl;
1954 *pOutFile << "<ul class=\"registry_list\">" << std::endl;
1955 *pOutFile << "<li class=\"registry_heading\">luafaudes</li>" << std::endl;
1956 *pOutFile << "<li class=\"registry_item\"><a href=\"faudes_luafaudes.html\">Introduction</a></li>" << std::endl;
1957 *pOutFile << "<li class=\"registry_item\"><a href=\"faudes_luaext.html\">Lua-Extansions</a></li>" << std::endl;
1958 *pOutFile << "<li class=\"registry_item\"><a href=\"faudes_luatech.html\">Techn. Details</a></li>" << std::endl;
1959 *pOutFile << "<li class=\"registry_blanc\"> </li>" << std::endl;
1960 *pOutFile << "<li class=\"registry_item\"><a href=\"#\">Top of Page</a></li>" << std::endl;
1961 *pOutFile << "</ul></div>" << std::endl;
1999 *pOutFile << "<table id=\"registry_page\">" << std::endl;
2000 *pOutFile << "<tr id=\"registry_row\">" << std::endl;
2001 *pOutFile << "<td id=\"registry_index\">" << std::endl;
2002 *pOutFile << "<ul class=\"registry_list\">" << std::endl;
2003 *pOutFile << "<li class=\"registry_heading\">libFAUDES</li>" << std::endl;
2005 *pOutFile << "<li class=\"registry_blanc\"> </li>" << std::endl;
2006 *pOutFile << "<li class=\"registry_heading\">Sections</li>" << std::endl;
2007 ListItemHtml(pOutFile, "group__ContainerClasses.html", "Sets");
2008 ListItemHtml(pOutFile, "group__GeneratorClasses.html", "Generators");
2009 ListItemHtml(pOutFile, "group__GeneratorFunctions.html", "Functions");
2010 ListItemHtml(pOutFile, "group__AllPlugins.html", "PlugIns");
2011 ListItemHtml(pOutFile, "group__Tutorials.html", "Tutorials");
2012 *pOutFile << "<li class=\"registry_blanc\"> </li>" << std::endl;
2013 *pOutFile << "<li class=\"registry_heading\">Index</li>" << std::endl;
2016 *pOutFile << "<li class=\"registry_blanc\"> </li>" << std::endl;
2017 *pOutFile << "</ul></td>" << std::endl;
2018 *pOutFile << "<td id=\"registry_content\">" << std::endl;
2034 *pOutFile << "</td>" << std::endl;
2035 *pOutFile << "</tr>" << std::endl;
2036 *pOutFile << "</table>" << std::endl;
2039 *pOutFile << "</div>" << std::endl << "</div>" << std::endl;
2040 *pOutFile << "<div id=\"cxwrapper1000\">" << std::endl;
2041 *pOutFile << "<div id=\"dxwrapper1000\">" << std::endl;
2042 *pOutFile << "<div class=\"registry_trigger\"> <span>>></span>" << std::endl;
2043 *pOutFile << "<ul class=\"registry_list\">" << std::endl;
2044 *pOutFile << "<li class=\"registry_heading\">C++ API</li>" << std::endl;
2045 *pOutFile << "<li class=\"registry_item\"><a href=\"index.html\">Introduction</a></li>" << std::endl;
2046 *pOutFile << "<li class=\"registry_item\"><a href=\"group__ContainerClasses.html\">Sets</a></li>" << std::endl;
2047 *pOutFile << "<li class=\"registry_item\"><a href=\"group__GeneratorClasses.html\">Generators</a></li>" << std::endl;
2048 *pOutFile << "<li class=\"registry_item\"><a href=\"group__GeneratorFunctions.html\">Functions</a></li>" << std::endl;
2049 *pOutFile << "<li class=\"registry_item\"><a href=\"group__AllPlugins.html\">PlugIns</a></li>" << std::endl;
2050 *pOutFile << "<li class=\"registry_item\"><a href=\"group__Tutorials.html\">Tutorials</a></li>" << std::endl;
2051 *pOutFile << "<li class=\"registry_item\"><a href=\"classes.html\">Classes</a></li>" << std::endl;
2052 *pOutFile << "<li class=\"registry_item\"><a href=\"files.html\">Files</a></li>" << std::endl;
2053 *pOutFile << "<li class=\"registry_blanc\"> </li>" << std::endl;
2054 *pOutFile << "<li class=\"registry_item\"><a href=\"#\">Top of Page</a></li>" << std::endl;
2055 *pOutFile << "</ul></div>" << std::endl;
2081 for(i=1; i<argc; i++) {
2082 std::string option(argv[i]);
2084 if(option== "-rti") {
2090 if(option== "-flx") {
2096 if(option== "-css") {
2102 if(option== "-cnav") {
2108 if(option== "-inc") {
2114 if(option== "-rel") {
2120 if(option== "-chapter") {
2126 if(option== "-section") {
2132 if(option== "-extract") {
2138 if(option== "-toc") {
2145 if(option== "-doxheader") {
2152 if(option== "-doxfooter") {
2159 if(option== "-app") {
2164 if((option== "-?") || (option== "--help")) {
2170 if(option.at(0)== '-') {
2179 for(;i<argc-1; i++) {
2180 std::string option(argv[i]);
2182 if(option.at(0)== '-') {
2183 usage_exit( "missplaced/unknown option " + option);
2191 std::string option(argv[i]);
2193 if(option.at(0)== '-') {
2194 usage_exit( "missplaced/unknown option " + option);
2214 std::string section=fit->second->KeywordAt(0);
2215 std::transform(section.begin(), section.end(), section.begin(), tolower);
2227 std::string section=fit->second->KeywordAt(0);
2228 std::transform(section.begin(), section.end(), section.begin(), tolower);
2245 usage_exit( "extract mode requires one source file");
2248 usage_exit( "extract mode requires destination directory");
2250 std::cerr << "ref2html: extract pages from " << * mSrcFiles.begin() << std::endl;
2262 usage_exit( "toc mode requires destination file");
2265 std::ostream* hout= &std::cout;
2268 fout.open( mDstFile.c_str(), std::ios::out);
2272 std::set< std::string >::iterator sit= mSrcFiles.begin();
2274 std::cerr << "ref2html: process toc " << *sit << std::endl;
2289 if(dodhd || dodft) {
2291 usage_exit( "header-footer mode requires destination file");
2294 std::ostream* hout= &std::cout;
2297 fout.open( mDstFile.c_str(), std::ios::out);
2308 std::set< std::string > srcfiles;
2309 std::set< std::string >::iterator sit= mSrcFiles.begin();
2313 std::set< std::string >::iterator dit=dirfiles.begin();
2314 for(;dit!=dirfiles.end();++dit) {
2317 std::string src= PrependPath(*sit,base + ".fref");
2319 if(ext!= "fref") continue;
2321 srcfiles.insert(src);
2328 usage_exit( "multiple source files require destination directory");
2336 std::string src= *sit;
2341 std::cout << "ref2html: processing " << src << " to " << dst << std::endl;
2343 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.33h
--- 2025.06.18
--- c++ api documentaion by doxygen
|