#include "tlib.hh"
#include "eval.hh"
Go to the source code of this file.
Functions | |
Tree | docTxt (const char *) |
Tree | docEqn (Tree x) |
Tree | docDgm (Tree x) |
Tree | docNtc () |
Tree | docLst () |
Tree | docMtd (Tree x) |
bool | isDocTxt (Tree t) |
bool | isDocTxt (Tree t, const char **) |
bool | isDocEqn (Tree t, Tree &x) |
bool | isDocDgm (Tree t, Tree &x) |
bool | isDocNtc (Tree t) |
bool | isDocLst (Tree t) |
bool | isDocMtd (Tree t) |
void | printDoc (const char *projname, const char *docdev, const char *faustversion) |
The entry point to generate faust doc files. |
Tree docLst | ( | ) |
Tree docNtc | ( | ) |
Tree docTxt | ( | const char * | ) |
Definition at line 191 of file doc.cpp.
References isTree().
Referenced by collectDocEqns(), and printdoccontent().
bool isDocLst | ( | Tree | t | ) |
bool isDocMtd | ( | Tree | t | ) |
bool isDocNtc | ( | Tree | t | ) |
bool isDocTxt | ( | Tree | t, | |
const char ** | ||||
) |
Definition at line 178 of file doc.cpp.
References isSym(), isTree(), name(), and CTree::node().
00179 { 00180 Tree t1; Sym s; 00181 if ( isTree(t0, DOCTXT, t1) && isSym(t1->node(), &s) ) { 00182 *str = name(s); 00183 return true; 00184 } else { 00185 return false; 00186 } 00187 }
bool isDocTxt | ( | Tree | t | ) |
Definition at line 177 of file doc.cpp.
References CTree::node().
Referenced by printdoccontent().
void printDoc | ( | const char * | projname, | |
const char * | docdev, | |||
const char * | faustversion | |||
) |
The entry point to generate faust doc files.
The entry point to generate the output LaTeX file, stored in the directory "<projname>-math/". This file eventually references images for diagrams, generated in SVG subdirectories. The device system was adapted from drawSchema's device system.
[in] | projname | Basename of the new doc directory ("*-math"). |
[in] | docdev | The doc device; only ".tex" is supported for the moment. |
[in] | faustversion | The current version of this Faust compiler. |
File stuff : create doc directories and a tex file.
Create THE mathdoc tex file.
Init and load translation file.
Simulate a default doc if no <mdoc> tag detected.
Printing stuff : in the '.tex' ouptut file, eventually including SVG files.
< Faust version and compilation date (comment).
< Static LaTeX header (packages and setup).
< Generate math contents (main stuff!).
< Static LaTeX footer.
Definition at line 229 of file doc.cpp.
References cholddir(), copyFaustSources(), declareAutoDoc(), gDocDevSuffix, gDocLang, gDocName, gDocVector, gLatexheaderfilename, SourceReader::listSrcFiles(), loadTranslationFile(), makedir(), mkchdir(), openArchFile(), printdoccontent(), printfaustdocstamp(), printlatexfooter(), printlatexheader(), and subst().
Referenced by main().
00230 { 00231 gDocDevSuffix = docdev; 00232 00234 //cerr << "Documentator : printDoc : gFaustDirectory = '" << gFaustDirectory << "'" << endl; 00235 //cerr << "Documentator : printDoc : gFaustSuperDirectory = '" << gFaustSuperDirectory << "'" << endl; 00236 //cerr << "Documentator : printDoc : gFaustSuperSuperDirectory = '" << gFaustSuperSuperDirectory << "'" << endl; 00237 //cerr << "Documentator : printDoc : gCurrentDir = '" << gCurrentDir << "'" << endl; 00238 00239 makedir(projname); // create a top directory to store files 00240 00241 string svgTopDir = subst("$0/svg", projname); 00242 makedir(svgTopDir.c_str()); // create a directory to store svg-* subdirectories. 00243 00244 string cppdir = subst("$0/cpp", projname); 00245 makedir(cppdir.c_str()); // create a cpp directory. 00246 00247 string pdfdir = subst("$0/pdf", projname); 00248 makedir(pdfdir.c_str()); // create a pdf directory. 00249 00250 /* Copy all Faust source files into an 'src' sub-directory. */ 00251 vector<string> pathnames = gReader.listSrcFiles(); 00252 copyFaustSources(projname, pathnames); 00253 00254 string texdir = subst("$0/tex", projname); 00255 mkchdir(texdir.c_str()); // create a directory and move into. 00256 00258 ofstream docout(subst("$0.$1", gDocName, docdev).c_str()); 00259 cholddir(); // return to current directory 00260 00262 loadTranslationFile(gDocLang); 00263 00265 if (gDocVector.empty()) { declareAutoDoc(); } 00266 00268 printfaustdocstamp(faustversion, docout); 00269 istream* latexheader = openArchFile(gLatexheaderfilename); 00270 printlatexheader(*latexheader, faustversion, docout); 00271 printdoccontent(svgTopDir.c_str(), gDocVector, faustversion, docout); 00272 printlatexfooter(docout); 00273 }