|
Go to the documentation of this file.
44 using namespace faudes;
53 std::cerr << rMessage << std::endl;
54 std::cout << "" << std::endl;
57 std::cout << "" << std::endl;
58 std::cerr << "utility to generate HTML from libFAUDES reference pages (*.fref)" << std::endl;
59 std::cerr << std::endl << "usage: " << std::endl;
60 std::cerr << " ref2html [options...] <fref-file> <html-file>" << std::endl;
61 std::cerr << " ref2html [options...] <fref-file 1> [...] <fref-file n> <html-dir>" << std::endl;
62 std::cerr << " ref2html [options...] <fref-dir> <html-dir>" << std::endl;
63 std::cerr << "with options as follows:" << std::endl;
64 std::cerr << " -rti <rti-file> use specified run-time-interface definition" << std::endl;
65 std::cerr << " -flx <flx-file> use specified lua-extension file" << std::endl;
66 std::cerr << " -css <css-file> use specified style sheet" << std::endl;
67 std::cerr << " -cnav <fref-file> use specified chapter navigation file" << std::endl;
68 std::cerr << " -chapter <label> overwrite chapter label" << std::endl;
69 std::cerr << " -section <label> overwrite section label" << std::endl;
70 std::cerr << " -rel <prefix> prefix to chapter documentation base" << std::endl;
71 std::cerr << " -inc <fref-file> include table of contents" << std::endl;
72 std::cerr << std::endl << std::endl;
73 std::cerr << " ref2html -toc <fref-files> <output-file>" << std::endl;
74 std::cerr << "to generate table of contents file" << std::endl;
75 std::cerr << std::endl << std::endl;
76 std::cerr << " ref2html -doxheader <output-file>" << std::endl;
77 std::cerr << " ref2html -doxfooter <output-file>" << std::endl;
78 std::cerr << "to generate header/footer for c++ api documentation" << std::endl;
79 std::cerr << std::endl << std::endl;
80 std::cerr << " ref2html -extract <input-file> <output-directory>" << std::endl;
81 std::cerr << "to extract multiple reference pages from one file" << std::endl;
82 std::cerr << std::endl;
83 std::cerr << std::endl << "note: use \"-\" as output file for console output" << std::endl;
124 std::string mDownloadLink= "http://www.rt.techfak.fau.de/FGdes/download.html";
125 std::string mFaudesLink= "http://www.rt.techfak.fau.de/FGdes/faudes";
127 std::string mLuafaudesLink= "http://www.rt.techfak.fau.de/FGdes/faudes/luafaudes/";
128 std::string mCsourceLink= "http://www.rt.techfak.fau.de/FGdes/faudes/csource/";
158 local=localtime(&now);
159 strftime(buffer,80, "%Y.%m.%d",local);
160 return std::string(buffer);
170 std::string ppage = page;
171 std::size_t upos = ppage.find_first_of( "_");
172 std::size_t spos = ppage.find_first_of( " ");
173 std::size_t dpos = 0;
174 for(; dpos < ppage.size();dpos++)
175 if(!isdigit(ppage.at(dpos))) break;
176 if(upos!=std::string::npos)
178 if(upos+1<ppage.size())
179 ppage=ppage.substr(upos+1,ppage.size()-upos-1);
180 if(spos!=std::string::npos)
182 if(spos+1<ppage.size())
183 ppage=ppage.substr(spos+1,ppage.size()-spos-1);
196 *pStream << "<p class=\"bottom_line\"> " << std::endl;
198 *pStream << "--- " << TimeStamp() << " " << std::endl;
200 *pStream << "--- with "" << PluginsString() << "" " << std::endl;
202 *pStream << "--- c++ api documentaion by <a href=\"http://www.doxygen.org\" target=\"_top\">doxygen</a>" << std::endl;
203 *pStream << "</p>" << std::endl;
205 *pStream << "<!--[if IE]>" << std::endl;
206 *pStream << "<p class=\"bottom_line_warning\">" << std::endl;
207 *pStream << "If MS Internet Explorer fails to display certain mathematical symbols," << std::endl;
208 *pStream << "your system misses the corresponding unicode fonts." << std::endl;
209 *pStream << "<br>" << std::endl;
210 *pStream << "You may either install "Arial Unicode MS" from a recent MS Office package" << std::endl;
211 *pStream << "or the freely available" << std::endl;
212 *pStream << ""<a href=\"http://greekfonts.teilar.gr/\">Symbola</a>"" << std::endl;
213 *pStream << "<br>" << std::endl;
214 *pStream << "See also <a href=\"http://www.alanwood.net/\">Allan Woods</a> unicode page." << std::endl;
215 *pStream << "B.t.w.: <a href=\"http://www.mozilla.com\">Firefox</a> will display" << std::endl;
216 *pStream << "all relevant symbols out-of-the-box and nicely render SVG diagrams." << std::endl;
217 *pStream << "<br>" << std::endl;
218 *pStream << "<br>" << std::endl;
219 *pStream << "</p>" << std::endl;
220 *pStream << "<![endif]-->" << std::endl;
230 *pStream << "<!doctype html>" << std::endl;
231 *pStream << "<html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
232 *pStream << "<head>" << std::endl;
233 *pStream << "<title>" << mFrefTitle << "</title>" << std::endl;
234 *pStream << "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />" << std::endl;
235 *pStream << "<meta name=\"contents\" content=\"discrete event systems, libFAUDES, supervisory control, controller synthesis, automata, software library, regular languages, open source, GPL.\"/>" << std::endl;
236 *pStream << "<link href=\"" << mCssFile << "\" rel=\"stylesheet\" type=\"text/css\" />" << std::endl;
237 *pStream << "<link rel=\"shortcut icon\" href=\""<< mImagePrefix << "des.ico\">" << std::endl;
238 *pStream << "</head>" << std::endl;
239 *pStream << "<body>" << std::endl;
240 *pStream << "<div id=\"cwrapper1000\">" << std::endl;
241 *pStream << "<div id=\"dwrapper1000\">" << std::endl;
249 *pStream << "</div>" << std::endl;
250 *pStream << "</div>" << std::endl;
251 *pStream << "</body>" << std::endl;
252 *pStream << "</html>" << std::endl;
259 void ImageHtml(std::ostream* pStream, const std::string& rFileName) {
260 *pStream << "<a class=\"faudes_image\" href=\"" << mImagePrefix << rFileName << ".html\">";
261 *pStream << "<img src=\"" << mImagePrefix << rFileName << ".png\"/>";
262 *pStream << "</a>" << std::endl;
270 void ListItemHtml(std::ostream* pStream, const std::string& rLink, const std::string& rText) {
271 *pStream << "<li class=\"registry_item\">" << std::endl
272 << "<a href=\"" << rLink << "\">" << rText << "</a>" << std::endl
273 << "<a href=\"" << rLink << "\" class=\"registry_blinda\"> </a>" << std::endl
274 << "</li>" << std::endl;
281 void TypeHtml(std::ostream* pStream, const std::string& rTypeName) {
285 *pStream << rTypeName;
291 std::string tyname = tdef. Name();
292 std::string tyhtml = tdef. HtmlDoc();
293 if(tyhtml== "" || tyhtml== "none") {
296 *pStream << "<a href=\"" << mReferencePrefix << tyhtml << "\">" << tyname << "</a>";
305 void FunctionHtml(std::ostream* pStream, const std::string& rFunctionName) {
309 *pStream << rFunctionName;
315 std::string fname = fdef. Name();
316 std::string fhtml = fdef. HtmlDoc();
317 if(fhtml== "" || fhtml== "none") {
320 *pStream << "<a href=\"" << mReferencePrefix << fhtml << "\">" << fname << "</a>";
328 void TextHtml(std::ostream* pStream, const std::string& rText) {
342 std::string TexMacroSubstitute1( const std::string& rTexString, const std::string& rMacro, const std::string& rSubst) {
347 while(pos<rTexString.length()) {
348 std::size_t next=rTexString.find(rMacro,pos);
349 if(next==std::string::npos) break;
350 res.append(rTexString.substr(pos,next-pos));
352 pos=next+rMacro.length();
353 if(!(pos+1<rTexString.length())) continue;
354 if(rTexString.at(pos)!= '{') continue;
355 std::size_t aend=rTexString.find( '}',pos);
356 if(aend==std::string::npos) break;
357 arg=rTexString.substr(pos+1,aend-pos-1);
363 if(pos<rTexString.length())
364 res.append(rTexString.substr(pos));
377 while(pos<rTexString.length()) {
379 if(pos+1 < rTexString.length())
380 if(rTexString.substr(pos,2)== "\\ ")
381 {pos+=2; res.append( " "); continue;}
383 if(pos+1 < rTexString.length())
384 if(rTexString.substr(pos,2)== "\\,")
385 {pos+=2; res.append( " "); continue;}
387 if(pos+1 < rTexString.length())
388 if(rTexString.substr(pos,2)== "\\;")
389 {pos+=2; res.append( " "); continue;}
391 if(pos+4 < rTexString.length())
392 if(rTexString.substr(pos,5)== "\\quad")
393 {pos+=5; res.append( " "); continue;}
396 if(isspace(rTexString.at(pos)))
400 if(pos+5 < rTexString.length())
401 if(rTexString.substr(pos,6)== "\\text{")
402 {pos+=6; math= false; continue;};
405 if(rTexString.at(pos)== '}')
406 { pos+=1; math= true; continue;}
408 res.append(1,rTexString.at(pos));
423 while(pos<rTexString.length()) {
425 cm2=cm1; cm1=c0; c0=rTexString.at(pos);
427 if(cm1== '^' || cm1== '_')
429 std::size_t aend=rTexString.find( '}',pos);
430 if(aend==std::string::npos) break;
431 std::string script=rTexString.substr(pos+1,aend-pos-1);
434 cm1=-1; cm2=-1; pos=aend+1;
440 size_t mpos=rTexString.find( "\\uparrow",pos);
442 res.append( "<span class=\"faudes_sup\">↑</span>");
443 cm1=-1; cm2=-1; pos+=8;
450 size_t mpos=rTexString.find( "\\Uparrow",pos);
452 res.append( "<span class=\"faudes_sup\">⇧</span>");
453 cm1=-1; cm2=-1; pos+=8;
462 cm1=-1; cm2=-1; pos+=1;
470 cm1=-1; cm2=-1; pos+=1;
475 if(c0== '*' || c0== '+') {
477 cm1=-1; cm2=-1; pos+=1;
481 if(cm1== '^' || cm1== '_') {
484 cm1=-1; cm2=-1; pos+=1;
500 void MathHtml(std::ostream* pStream, const std::string& rMathString) {
501 std::string buff=rMathString;
573 buff= StringSubstitute(buff, "∈", "<span class=\"faudes_fmath\">∈</span>");
574 buff= StringSubstitute(buff, "∉", "<span class=\"faudes_fmath\">∉</span>");
575 buff= StringSubstitute(buff, "∃", "<span class=\"faudes_fmath\">∃</span>");
576 buff= StringSubstitute(buff, "∀", "<span class=\"faudes_fmath\">∀</span>");
577 buff= StringSubstitute(buff, "∪", "<span class=\"faudes_fmath\">∪</span>");
578 buff= StringSubstitute(buff, "&dcup;", "<span class=\"faudes_fmath\">∪</span>");
579 buff= StringSubstitute(buff, "∩", "<span class=\"faudes_fmath\">∩</span>");
580 buff= StringSubstitute(buff, "←", "<span class=\"faudes_fmath\">←</span>");
581 buff= StringSubstitute(buff, "→", "<span class=\"faudes_fmath\">→</span>");
582 buff= StringSubstitute(buff, "↔", "<span class=\"faudes_fmath\">↔</span>");
583 buff= StringSubstitute(buff, "⇐", "<span class=\"faudes_fmath\">⇐</span>");
584 buff= StringSubstitute(buff, "⇒", "<span class=\"faudes_fmath\">⇒</span>");
585 buff= StringSubstitute(buff, "⇔", "<span class=\"faudes_fmath\">⇔</span>");
586 buff= StringSubstitute(buff, "⊂", "<span class=\"faudes_fmath\">⊂</span>");
587 buff= StringSubstitute(buff, "⊆", "<span class=\"faudes_fmath\">⊆</span>");
588 buff= StringSubstitute(buff, "⊃", "<span class=\"faudes_fmath\">⊃</span>");
589 buff= StringSubstitute(buff, "⊇", "<span class=\"faudes_fmath\">⊇</span>");
620 std::map< std::string , std::map< std::string , PageRecord > > mRefSectPages;
625 int clevel = rTr. Level();
631 if(text.size()>0) continue;
634 if(!rTr. Peek(token)) break;
638 if(!token. IsBegin( "ReferencePage")) {
670 std::transform(indexfile.begin(), indexfile.end(), indexfile.begin(), tolower);
684 std::size_t spos = title.find(section);
685 if(spos==0 && title.size()>section.size())
687 for(spos=0; spos< mFrefPage.size(); spos++){
730 std::vector<PageRecord>::iterator pit;
740 if(pit->mSummary== "") {
763 *pIndexFile << "<table class=\"registry_toc\">" << std::endl;
770 std::string section= tit->second->Name();
771 std::transform(section.begin(), section.end(), section.begin(), tolower);
772 if(section!=key) continue;
775 if(tit->second->TextDoc()== "") continue;
777 *pIndexFile << "<tr><td valign=\"top\">";
778 TypeHtml(pIndexFile,tit->second->Name());
779 *pIndexFile << "</td><td valign=\"top\">";
780 TypeHtml(pIndexFile,tit->second->TextDoc());
781 *pIndexFile << "</td></tr>" << std::endl;
786 if(!found) *pIndexFile << "<tr><td><i>no matches found</i></td></tr>" << std::endl;
788 *pIndexFile << "</table>" << std::endl;
798 *pIndexFile << "<table class=\"registry_toc\">" << std::endl;
805 std::string section= fit->second->Name();
806 std::transform(section.begin(), section.end(), section.begin(), tolower);
807 if(section!=key) continue;
810 if(fit->second->TextDoc()== "") continue;
812 *pIndexFile << "<tr><td valign=\"top\">";
814 *pIndexFile << "</td><td valign=\"top\">";
815 TypeHtml(pIndexFile,fit->second->TextDoc());
816 *pIndexFile << "</td></tr>" << std::endl;
821 if(!found) *pIndexFile << "<tr><td><i>no matches found</i></td></tr>" << std::endl;
823 *pIndexFile << "</table>" << std::endl;
835 std::set< std::string > sections;
836 std::map< std::string , std::string > link;
837 std::map< std::string , std::string > summary;
838 std::vector< PageRecord >::iterator pit;
840 std::string chap=pit->mChapter;
841 std::transform(chap.begin(), chap.end(), chap.begin(), tolower);
842 std::string sect=pit->mSection;
843 std::transform(sect.begin(), sect.end(), sect.begin(), tolower);
844 std::string page=pit->mPage;
845 std::transform(page.begin(), page.end(), page.begin(), tolower);
848 if(chap!= "reference") continue;
849 if(sect== "none") continue;
850 if(sect== "") continue;
851 if(page!= "index") continue;
858 std::string pname = pit->mSection;
860 std::string psumm = pit->mSummary;
861 if(psumm== "") psumm = pit->mTitle;
863 sections.insert(pname);
864 link[pname]=pit->mLink;
865 summary[pname]=psumm;
869 std::vector< std::string > sortvec;
870 if(sections.find( "CoreFaudes")!=sections.end())
871 sortvec.push_back( "CoreFaudes");
872 std::set< std::string >::iterator sit;
873 for(sit=sections.begin(); sit != sections.end(); sit++) {
874 if(*sit== "CoreFaudes") continue;
875 sortvec.push_back(*sit);
879 *pIndexFile << "<table class=\"registry_toc\">" << std::endl;
882 std::vector< std::string >::iterator vit;
884 for(vit=sortvec.begin(); vit != sortvec.end(); vit++) {
886 std::string sname = *vit;
888 std::string ssumm = summary[sname];
890 *pIndexFile << "<tr>" << std::endl;
891 *pIndexFile << "<td valign=\"top\"><a href=\"" << shtml << "\">" << sname << "</a></td>";
892 *pIndexFile << "<td valign=\"top\">";
893 *pIndexFile << ssumm;
894 *pIndexFile << "</td></tr>"<< std::endl;
899 if(!found) *pIndexFile << "<tr><td><i>no matches found</i></td></tr>" << std::endl;
902 *pIndexFile << "</table>" << std::endl;
922 std::string section= tit->second->KeywordAt(0);
923 std::transform(section.begin(), section.end(), section.begin(), tolower);
924 if(section!=key) continue;
927 std::string tyname = tit->second->Name();
928 std::string tyhtml = tit->second->HtmlDoc();
930 if(tyhtml== "") continue;
931 if(tyhtml== "none") continue;
935 *pIndexFile << "<li class=\"registry_heading\">Types</li>" << std::endl;
941 if(head) *pIndexFile << "<li class=\"registry_blanc\"> </li>" << std::endl;
951 std::string lkey=key;
952 std::transform(lkey.begin(), lkey.end(), lkey.begin(), tolower);
961 std::string section= fit->second->KeywordAt(0);
962 std::transform(section.begin(), section.end(), section.begin(), tolower);
963 if(section!=lkey) continue;
966 if(fit->second->TextDoc()== "") continue;
968 std::string fname = fit->second->Name();
969 std::string fhtml = fit->second->HtmlDoc();
970 if(fhtml== "") continue;
974 *pIndexFile << "<li class=\"registry_heading\">Functions</li>" << std::endl;
978 *pIndexFile << "<li class=\"registry_item\"> "<< fname << "</li>" << std::endl;
986 if(head) *pIndexFile << "<li class=\"registry_blanc\"> </li>" << std::endl;
997 std::map< std::string , std::string > sectlink;
998 std::vector< PageRecord >::iterator pit;
1000 std::string chap=pit->mChapter;
1001 std::transform(chap.begin(), chap.end(), chap.begin(), tolower);
1002 std::string sect=pit->mSection;
1003 std::transform(sect.begin(), sect.end(), sect.begin(), tolower);
1005 if(chap!= "reference") continue;
1006 if(sect== "none") continue;
1007 if(sect== "") continue;
1009 std::string pname = pit->mSection;
1011 std::string phtml = sect+ "_index.html";
1013 sectlink[pname]=phtml;
1017 std::vector< std::string > sections;
1018 if(sectlink[ "CoreFaudes"]!= "") sections.push_back( "CoreFaudes");
1019 std::map< std::string , std::string >::iterator sit;
1020 for(sit=sectlink.begin(); sit!=sectlink.end(); sit++) {
1021 std::string psect=sit->first;
1022 if(psect== "CoreFaudes") continue;
1023 sections.push_back(psect);
1027 if(sections.size()!=0)
1028 *pIndexFile << "<li class=\"registry_heading\">Sections</li>" << std::endl;
1032 for(vit=0; vit<sections.size(); vit++) {
1033 std::string psect=sections.at(vit);
1034 std::string plink=sectlink[psect];
1035 if(plink== "") continue;
1037 std::string sect=psect;
1038 std::transform(sect.begin(), sect.end(), sect.begin(), tolower);
1039 std::map< std::string , std::map< std::string , PageRecord > > ::iterator spit = mRefSectPages.find(sect);
1042 std::map< std::string , PageRecord >::iterator pit = spit->second.begin();
1043 for(;pit!=spit->second.end();pit++) {
1044 std::string ppage = pit->second.mPage;
1045 std::transform(ppage.begin(), ppage.end(), ppage.begin(), tolower);
1046 if(ppage== "index") continue;
1047 if(ppage== "0_index") continue;
1048 if(ppage== "00_index") continue;
1058 *pIndexFile << "<li class=\"registry_pitem\">" << std::endl
1059 << "<a href=\"" << plink << "\">" << psect << "</a>" << std::endl
1060 << "<a href=\"" << plink << "\" class=\"registry_blinda\"> </a>" << std::endl
1061 << "<ul>" << std::endl
1062 << "<li class=\"registry_heading\">" << psect << "</li>" << std::endl;
1063 std::map< std::string , PageRecord >::iterator pit = spit->second.begin();
1064 for(;pit!=spit->second.end();pit++) {
1066 std::string ppage = PrettyPage(pit->second.mPage);
1068 std::string ipage = ppage;
1069 std::transform(ipage.begin(), ipage.end(), ipage.begin(), tolower);
1071 if(ipage== "index") ppage= "Introduction";
1073 *pIndexFile << "<li class=\"registry_item\"><a href=\"" << pit->second.mLink << "\">"
1074 << ppage << "</a></li>" << std::endl;
1077 *pIndexFile << "</ul></li>" << std::endl;
1081 if(sections.size()!=0)
1082 *pIndexFile << "<li class=\"registry_blanc\"> </li>" << std::endl;
1100 std::string sect=key;
1101 std::transform(sect.begin(), sect.end(), sect.begin(), tolower);
1102 std::string plink=sect+ "_index.html";
1103 std::string psect=key;
1104 std::map< std::string , std::map< std::string , PageRecord > > ::iterator spit = mRefSectPages.find(sect);
1107 std::map< std::string , PageRecord >::iterator pit = spit->second.begin();
1108 for(;pit!=spit->second.end();pit++) {
1109 std::string ppage = pit->second.mPage;
1110 psect=pit->second.mSection;
1111 std::transform(ppage.begin(), ppage.end(), ppage.begin(), tolower);
1112 if(ppage== "index") continue;
1113 if(ppage== "0_index") continue;
1114 if(ppage== "00_index") continue;
1123 if(key== "") psect= "Reference";
1126 *pIndexFile << "<li class=\"registry_heading\">" << psect << "</li>" << std::endl;
1127 std::map< std::string , PageRecord >::iterator pit = spit->second.begin();
1128 for(;pit!=spit->second.end();pit++) {
1130 std::string ppage = PrettyPage(pit->second.mPage);
1132 std::string ipage = ppage;
1133 std::transform(ipage.begin(), ipage.end(), ipage.begin(), tolower);
1135 if(ipage== "index") ppage= "Introduction";
1137 *pIndexFile << "<li class=\"registry_item\"><a href=\"" << pit->second.mLink << "\">"
1138 << ppage << "</a></li>" << std::endl;
1159 *pOutFile << "<div class=\"registry_signature\">" << std::endl;
1160 *pOutFile << "<h5><strong>Signature:</strong></h5>" << std::endl;
1165 *pOutFile << "<p>" << fdef. Name() << "(";
1167 for( int j=0; j < sigi. Size(); j++) {
1168 if(j!=0) *pOutFile << ", ";
1172 *pOutFile << " <i>" << parj. Name() << "</i></span>";
1174 *pOutFile << ")</p>" << std::endl;
1179 *pOutFile << std::endl << "</div>" << std::endl;
1196 *pOutFile << "<p>" << fdef. TextDoc() << "</p>" << std::endl;
1211 *pOutFile << "<p>" << tdef. TextDoc() << "<p>" << std::endl;
1243 int clevel = rTr. Level();
1249 if(text.size()>0) continue;
1252 if(!rTr. Peek(token)) break;
1256 if(token. IsBegin( "ReferencePage")) {
1269 if(!token. IsBegin( "fliterature")) {
1281 while(!rTr. Eos( "fliterature")) {
1285 if(token. IsBegin( "fauthors")) {
1297 if(token. IsBegin( "fjournal")) {
1334 std::map<std::string,LiteratureRecord>::iterator lit;
1339 rTw << btag << "\n";
1340 if(lit->second.mAuthors!= "") {
1346 if(lit->second.mTitle!= "") {
1352 if(lit->second.mJournal!= "") {
1358 if(lit->second.mPublisher!= "") {
1364 if(lit->second.mYear!= "") {
1370 if(lit->second.mLink!= "") {
1376 rTw. WriteEnd( "fliterature"); rTw << "\n";
1385 std::map<std::string,LiteratureRecord>::iterator lit;
1389 if(rLabel!=lit->second.mLabel) continue;
1391 *pStream << "<p>" << std::endl;
1392 *pStream << "<a id=\"" << "lit_" << lit->second.mLabel << "\">[" << lit->second.mLabel << "]</a>" << std::endl;
1393 *pStream << lit->second.mAuthors << ": ";
1394 *pStream << "<i>" << lit->second.mTitle << "</i>";
1395 if(lit->second.mJournal!= "") *pStream << ", " << lit->second.mJournal;
1396 if(lit->second.mPublisher!= "") *pStream << ", " << lit->second.mPublisher;
1397 if(lit->second.mYear!= "") *pStream << ", " << lit->second.mYear;
1398 *pStream << ".</p>" << std::endl;
1404 void CiteHtml(std::ostream* pStream, const std::string& rLabel) {
1406 std::string link= "reference_literature.html";
1408 std::map<std::string,LiteratureRecord>::iterator lit;
1410 if(lit!= mLiterature.end()) link=lit->second.mLink;
1412 *pStream << "<a href=\"" << link << "\">[" << rLabel << "]</a>";
1424 while(src. Peek(btag)) {
1426 if(!btag. IsBegin( "ReferencePage")) {
1447 std::cerr << "ref2html: skipping undefined page at " << src. FileLine() << std::endl;
1457 std::cerr << "ref2html: extracting page to \"" << dstfile << "\"" << std::endl;
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;
1502 std::transform(dstfile.begin(), dstfile.end(), dstfile.begin(), tolower);
1503 std::cerr << "ref2html: extracting image file to \"" << dstfile << "\"" << std::endl;
1506 fsout.exceptions(std::ios::badbit|std::ios::failbit);
1508 fsout.open(dstfile.c_str(), std::ios::out | std::ios::binary);
1512 catch (std::ios::failure&) {
1513 std::cerr << "ref2html: file io error when writing \"" << dstfile << "\"" << std::endl;
1527 std::map< std::string , std::string > pages;
1528 std::vector< PageRecord >::iterator pit;
1531 if(pit->mChapter!= "luafaudes") continue;
1532 if(pit->mSection== "none") continue;
1533 if(pit->mSection== "") continue;
1534 if(pit->mPage== "") continue;
1536 std::string pname = pit->mPage;
1538 std::string phtml = pit->mLink;
1543 std::map< std::string , std::string >::iterator sit;
1544 for(sit=pages.begin(); sit!=pages.end(); sit++) {
1549 if(pages.size()==0) {
1550 *pIndexFile << "<li class=\"registry_item\">" << "none" << "</li>" << std::endl;
1561 int clevel = rTr. Level();
1576 if(!rTr. Peek(token)) break;
1609 *rTw. Streamp()<< "<span class=\"faudes_dmath\">";
1619 *rTw. Streamp()<< "<span class=\"faudes_imath\">";
1626 if(token. IsBegin( "ffnct_reference")) {
1627 rTr. ReadBegin( "ffnct_reference", token);
1629 *rTw. Streamp() << "<div class=\"registry_function\"> <h2>"
1630 << "<a id=\"" << ffnct << "\">" << ffnct << "</a></h2>" << std::endl;
1633 *rTw. Streamp() << "</div>" << std::endl;
1634 rTr. ReadEnd( "ffnct_reference");
1638 if(token. IsBegin( "ftype_reference")) {
1639 rTr. ReadBegin( "ftype_reference", token);
1641 *rTw. Streamp() << "<div class=\"registry_type\"> <h2>"
1642 << "<a id=\"" << ffnct << "\">" << ffnct << "</a></h2>" << std::endl;
1645 *rTw. Streamp() << "</div>" << std::endl;
1646 rTr. ReadEnd( "ftype_reference");
1650 if(token. IsBegin( "fdetails")) {
1652 *rTw. Streamp() << "<h5>Detailed description:</h5>" << std::endl;
1657 if(token. IsBegin( "fconditions")) {
1659 *rTw. Streamp() << "<h5>Parameter Conditions:</h5>" << std::endl;
1664 if(token. IsBegin( "fexample")) {
1666 *rTw. Streamp() << "<h5>Example:</h5>" << std::endl;
1671 if(token. IsBegin( "falltypes")) {
1678 if(token. IsBegin( "fallfncts")) {
1685 if(token. IsBegin( "fallsects")) {
1692 if(token. IsBegin( "fluasects")) {
1699 if(token. IsBegin( "falllit")) {
1706 if(token. IsBegin( "fliterature")) {
1714 if(token. IsBegin( "fcontributors")) {
1739 if(token. IsBegin( "fsummary")) {
1862 *pOutFile << "<table id=\"registry_page\">" << std::endl;
1863 *pOutFile << "<tr id=\"registry_row\">" << std::endl;
1864 *pOutFile << "<td id=\"registry_index\">" << std::endl;
1865 *pOutFile << "<ul class=\"registry_list\">" << std::endl;
1866 *pOutFile << "<li class=\"registry_heading\">libFAUDES</li>" << std::endl;
1867 ListItemHtml(pOutFile, "reference_index.html", "Reference");
1868 ListItemHtml(pOutFile, "reference_types.html", "Type Index");
1869 ListItemHtml(pOutFile, "reference_functions.html", "Function Index");
1870 ListItemHtml(pOutFile, "reference_literature.html", "Literature");
1871 *pOutFile << "<li class=\"registry_blanc\"> </li>" << std::endl;
1873 *pOutFile << "</ul></td>" << std::endl;
1874 *pOutFile << "<td id=\"registry_content\">" << std::endl;
1879 *pOutFile << "<table id=\"registry_page\">" << std::endl;
1880 *pOutFile << "<tr id=\"registry_row\">" << std::endl;
1881 *pOutFile << "<td id=\"registry_index\">" << std::endl;
1882 *pOutFile << "<ul class=\"registry_list\">" << std::endl;
1883 *pOutFile << "<li class=\"registry_heading\">luafaudes</li>" << std::endl;
1885 << "<script language=\"JavaScript\"> var luafaudes=function() { "
1886 << " popupWin = window.open('luafaudes_repl.html','open_window',"
1887 << " 'resizable,dependent, width=720, height=480, left=0, top=0'); } "
1888 << "</script>" << std::endl;
1890 ListItemHtml(pOutFile, "javascript:luafaudes();", "Lua-Console");
1891 ListItemHtml(pOutFile, "faudes_luaext.html", "Lua-Extensions");
1892 ListItemHtml(pOutFile, "faudes_luatech.html", "Technical Detail");
1893 *pOutFile << "<li class=\"registry_blanc\"> </li>" << std::endl;
1894 *pOutFile << "<li class=\"registry_heading\">Tutorials</li>" << std::endl;
1896 *pOutFile << "</ul></td>" << std::endl;
1897 *pOutFile << "<td id=\"registry_content\">" << std::endl;
1912 *pOutFile << "</td>" << std::endl;
1913 *pOutFile << "</tr>" << std::endl;
1914 *pOutFile << "</table>" << std::endl;
1921 *pOutFile << "</td>" << std::endl;
1922 *pOutFile << "</tr>" << std::endl;
1923 *pOutFile << "</table>" << std::endl;
1928 *pOutFile << "</div>" << std::endl << "</div>" << std::endl;
1929 *pOutFile << "<div id=\"cxwrapper1000\">" << std::endl;
1930 *pOutFile << "<div id=\"dxwrapper1000\">" << std::endl;
1931 *pOutFile << "<div class=\"registry_trigger\"> <span>>></span>" << std::endl;
1932 *pOutFile << "<ul class=\"registry_list\">" << std::endl;
1934 *pOutFile << "<li class=\"registry_blanc\"> </li>" << std::endl;
1936 *pOutFile << "</ul></div>" << std::endl;
1941 *pOutFile << "</div>" << std::endl << "</div>" << std::endl;
1942 *pOutFile << "<div id=\"cxwrapper1000\">" << std::endl;
1943 *pOutFile << "<div id=\"dxwrapper1000\">" << std::endl;
1944 *pOutFile << "<div class=\"registry_trigger\"> <span>>></span>" << std::endl;
1945 *pOutFile << "<ul class=\"registry_list\">" << std::endl;
1946 *pOutFile << "<li class=\"registry_heading\">luafaudes</li>" << std::endl;
1947 *pOutFile << "<li class=\"registry_item\"><a href=\"faudes_luafaudes.html\">Introduction</a></li>" << std::endl;
1948 *pOutFile << "<li class=\"registry_item\"><a href=\"faudes_luaext.html\">Lua-Extansions</a></li>" << std::endl;
1949 *pOutFile << "<li class=\"registry_item\"><a href=\"faudes_luatech.html\">Techn. Details</a></li>" << std::endl;
1950 *pOutFile << "<li class=\"registry_blanc\"> </li>" << std::endl;
1951 *pOutFile << "<li class=\"registry_item\"><a href=\"#\">Top of Page</a></li>" << std::endl;
1952 *pOutFile << "</ul></div>" << std::endl;
1990 *pOutFile << "<table id=\"registry_page\">" << std::endl;
1991 *pOutFile << "<tr id=\"registry_row\">" << std::endl;
1992 *pOutFile << "<td id=\"registry_index\">" << std::endl;
1993 *pOutFile << "<ul class=\"registry_list\">" << std::endl;
1994 *pOutFile << "<li class=\"registry_heading\">libFAUDES</li>" << std::endl;
1996 *pOutFile << "<li class=\"registry_blanc\"> </li>" << std::endl;
1997 *pOutFile << "<li class=\"registry_heading\">Sections</li>" << std::endl;
1998 ListItemHtml(pOutFile, "group__ContainerClasses.html", "Sets");
1999 ListItemHtml(pOutFile, "group__GeneratorClasses.html", "Generators");
2000 ListItemHtml(pOutFile, "group__GeneratorFunctions.html", "Functions");
2001 ListItemHtml(pOutFile, "group__AllPlugins.html", "PlugIns");
2002 ListItemHtml(pOutFile, "group__Tutorials.html", "Tutorials");
2003 *pOutFile << "<li class=\"registry_blanc\"> </li>" << std::endl;
2004 *pOutFile << "<li class=\"registry_heading\">Index</li>" << std::endl;
2007 *pOutFile << "<li class=\"registry_blanc\"> </li>" << std::endl;
2008 *pOutFile << "</ul></td>" << std::endl;
2009 *pOutFile << "<td id=\"registry_content\">" << std::endl;
2025 *pOutFile << "</td>" << std::endl;
2026 *pOutFile << "</tr>" << std::endl;
2027 *pOutFile << "</table>" << std::endl;
2030 *pOutFile << "</div>" << std::endl << "</div>" << std::endl;
2031 *pOutFile << "<div id=\"cxwrapper1000\">" << std::endl;
2032 *pOutFile << "<div id=\"dxwrapper1000\">" << std::endl;
2033 *pOutFile << "<div class=\"registry_trigger\"> <span>>></span>" << std::endl;
2034 *pOutFile << "<ul class=\"registry_list\">" << std::endl;
2035 *pOutFile << "<li class=\"registry_heading\">C++ API</li>" << std::endl;
2036 *pOutFile << "<li class=\"registry_item\"><a href=\"index.html\">Introduction</a></li>" << std::endl;
2037 *pOutFile << "<li class=\"registry_item\"><a href=\"group__ContainerClasses.html\">Sets</a></li>" << std::endl;
2038 *pOutFile << "<li class=\"registry_item\"><a href=\"group__GeneratorClasses.html\">Generators</a></li>" << std::endl;
2039 *pOutFile << "<li class=\"registry_item\"><a href=\"group__GeneratorFunctions.html\">Functions</a></li>" << std::endl;
2040 *pOutFile << "<li class=\"registry_item\"><a href=\"group__AllPlugins.html\">PlugIns</a></li>" << std::endl;
2041 *pOutFile << "<li class=\"registry_item\"><a href=\"group__Tutorials.html\">Tutorials</a></li>" << std::endl;
2042 *pOutFile << "<li class=\"registry_item\"><a href=\"classes.html\">Classes</a></li>" << std::endl;
2043 *pOutFile << "<li class=\"registry_item\"><a href=\"files.html\">Files</a></li>" << std::endl;
2044 *pOutFile << "<li class=\"registry_blanc\"> </li>" << std::endl;
2045 *pOutFile << "<li class=\"registry_item\"><a href=\"#\">Top of Page</a></li>" << std::endl;
2046 *pOutFile << "</ul></div>" << std::endl;
2072 for(i=1; i<argc; i++) {
2073 std::string option(argv[i]);
2075 if(option== "-rti") {
2081 if(option== "-flx") {
2087 if(option== "-css") {
2093 if(option== "-cnav") {
2099 if(option== "-inc") {
2105 if(option== "-rel") {
2111 if(option== "-chapter") {
2117 if(option== "-section") {
2123 if(option== "-extract") {
2129 if(option== "-toc") {
2136 if(option== "-doxheader") {
2143 if(option== "-doxfooter") {
2150 if(option== "-app") {
2155 if((option== "-?") || (option== "--help")) {
2161 if(option.at(0)== '-') {
2170 for(;i<argc-1; i++) {
2171 std::string option(argv[i]);
2173 if(option.at(0)== '-') {
2174 usage_exit( "missplaced/unknown option " + option);
2182 std::string option(argv[i]);
2184 if(option.at(0)== '-') {
2185 usage_exit( "missplaced/unknown option " + option);
2205 std::string section=fit->second->KeywordAt(0);
2206 std::transform(section.begin(), section.end(), section.begin(), tolower);
2218 std::string section=fit->second->KeywordAt(0);
2219 std::transform(section.begin(), section.end(), section.begin(), tolower);
2236 usage_exit( "extract mode requires one source file");
2239 usage_exit( "extract mode requires destination directory");
2241 std::cerr << "ref2html: extract pages from " << * mSrcFiles.begin() << std::endl;
2253 usage_exit( "toc mode requires destination file");
2256 std::ostream* hout= &std::cout;
2259 fout.open( mDstFile.c_str(), std::ios::out);
2263 std::set< std::string >::iterator sit= mSrcFiles.begin();
2265 std::cerr << "ref2html: process toc " << *sit << std::endl;
2280 if(dodhd || dodft) {
2282 usage_exit( "header-footer mode requires destination file");
2285 std::ostream* hout= &std::cout;
2288 fout.open( mDstFile.c_str(), std::ios::out);
2299 std::set< std::string > srcfiles;
2300 std::set< std::string >::iterator sit= mSrcFiles.begin();
2304 std::set< std::string >::iterator dit=dirfiles.begin();
2305 for(;dit!=dirfiles.end();++dit) {
2310 if(ext!= "fref") continue;
2312 srcfiles.insert(src);
2319 usage_exit( "multiple source files require destination directory");
2327 std::string src= *sit;
2332 std::cout << "ref2html: processing " << src << " to " << dst << std::endl;
2334 fout.open(dst.c_str(), std::ios::out);
libFAUDES 2.26g
--- 2015.08.17
--- c++ api documentaion by doxygen
|