Implementation of documentation trees support and printing. More...
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <sys/stat.h>
#include <time.h>
#include <algorithm>
#include <functional>
#include <iostream>
#include <fstream>
#include <sstream>
#include <map>
#include <string>
#include <vector>
#include "ppbox.hh"
#include "prim2.hh"
#include "doc.hh"
#include "eval.hh"
#include "errormsg.hh"
#include "doc_Text.hh"
#include "sigprint.hh"
#include "propagate.hh"
#include "enrobage.hh"
#include "drawschema.hh"
#include "names.hh"
#include "simplify.hh"
#include "privatise.hh"
#include "recursivness.hh"
#include "sourcereader.hh"
#include "lateq.hh"
#include "doc_compile.hh"
#include "doc_lang.hh"
#include "doc_notice.hh"
#include "doc_autodoc.hh"
#include "compatibility.hh"
Go to the source code of this file.
Defines | |
#define | MAXIDCHARS 5 |
max numbers (characters) to represent ids (e.g. for directories). | |
Functions | |
void | printDoc (const char *projname, const char *docdev, const char *faustversion) |
The entry point to generate faust doc files. | |
Variables | |
string | gDocName |
Contains the filename for out documentation. | |
vector< Tree > | gDocVector |
Contains <mdoc> parsed trees: DOCTXT, DOCEQN, DOCDGM. |
Implementation of documentation trees support and printing.
Definition in file doc.cpp.
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).
< Dynamic visible header (maketitle).
< Generate math contents (main stuff!).
< Static LaTeX footer.
Definition at line 216 of file doc.cpp.
References gDocName, and gDocVector.
00217 { 00218 gDocDevSuffix = docdev; 00219 00221 //cerr << "Documentator : printDoc : gFaustDirectory = '" << gFaustDirectory << "'" << endl; 00222 //cerr << "Documentator : printDoc : gFaustSuperDirectory = '" << gFaustSuperDirectory << "'" << endl; 00223 //cerr << "Documentator : printDoc : gFaustSuperSuperDirectory = '" << gFaustSuperSuperDirectory << "'" << endl; 00224 //cerr << "Documentator : printDoc : gCurrentDir = '" << gCurrentDir << "'" << endl; 00225 00226 makedir(projname); // create a top directory to store files 00227 00228 string svgTopDir = subst("$0/svg", projname); 00229 makedir(svgTopDir.c_str()); // create a directory to store svg-* subdirectories. 00230 00231 string cppdir = subst("$0/cpp", projname); 00232 makedir(cppdir.c_str()); // create a cpp directory. 00233 00234 string pdfdir = subst("$0/pdf", projname); 00235 makedir(pdfdir.c_str()); // create a pdf directory. 00236 00237 /* Copy all Faust source files into an 'src' sub-directory. */ 00238 vector<string> pathnames = gReader.listSrcFiles(); 00239 copyFaustSources(projname, pathnames); 00240 00241 string texdir = subst("$0/tex", projname); 00242 mkchdir(texdir.c_str()); // create a directory and move into. 00243 00245 ofstream docout(subst("$0.$1", gDocName, docdev).c_str()); 00246 cholddir(); // return to current directory 00247 00249 loadTranslationFile(gDocLang); 00250 00252 if (gDocVector.empty()) { declareAutoDoc(); } 00253 00255 printfaustdocstamp(faustversion, docout); 00256 istream* latexheader = openArchFile(gLatexheaderfilename); 00257 printlatexheader(*latexheader, docout); 00258 printdocheader(docout); 00259 printdoccontent(svgTopDir.c_str(), gDocVector, faustversion, docout); 00260 printlatexfooter(docout); 00261 00262 }