diff options
author | Michi Henning <michi@zeroc.com> | 2007-01-08 08:02:53 +0000 |
---|---|---|
committer | Michi Henning <michi@zeroc.com> | 2007-01-08 08:02:53 +0000 |
commit | a83f822a46fa5f9a26bf52575d9b0be4748ded96 (patch) | |
tree | 998b3069bf7a2dea646a9ddc7e773b1a51019c4b /cpp | |
parent | Added ObejctAdapter::destroy (diff) | |
download | ice-a83f822a46fa5f9a26bf52575d9b0be4748ded96.tar.bz2 ice-a83f822a46fa5f9a26bf52575d9b0be4748ded96.tar.xz ice-a83f822a46fa5f9a26bf52575d9b0be4748ded96.zip |
Added TOC generation to slice2html.
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/doc/Makefile | 2 | ||||
-rw-r--r-- | cpp/include/Slice/Parser.h | 1 | ||||
-rw-r--r-- | cpp/src/Slice/Parser.cpp | 6 | ||||
-rw-r--r-- | cpp/src/slice2html/Gen.cpp | 356 | ||||
-rw-r--r-- | cpp/src/slice2html/Gen.h | 62 | ||||
-rw-r--r-- | cpp/src/slice2html/Main.cpp | 22 |
6 files changed, 338 insertions, 111 deletions
diff --git a/cpp/doc/Makefile b/cpp/doc/Makefile index 55016ad0ebb..bb56d1b6488 100644 --- a/cpp/doc/Makefile +++ b/cpp/doc/Makefile @@ -24,7 +24,7 @@ include $(top_srcdir)/config/Make.rules reference/index.html: $(SLICEFILES) rm -rf reference - slice2html --ice -I../slice --header=htmlHeader --output-dir=reference --index=3 --summary=120 $(SLICEFILES) + slice2html --ice -I../slice --hdr=htmlHeader --output-dir=reference --index=3 --summary=120 $(SLICEFILES) clean:: rm -rf reference diff --git a/cpp/include/Slice/Parser.h b/cpp/include/Slice/Parser.h index bb69b8c3036..5616a50f14a 100644 --- a/cpp/include/Slice/Parser.h +++ b/cpp/include/Slice/Parser.h @@ -412,6 +412,7 @@ public: SequenceList sequences() const; DictionaryList dictionaries() const; EnumList enums() const; + ContainedList contents() const; bool hasNonLocalClassDecls() const; bool hasNonLocalClassDefs() const; bool hasNonLocalSequences() const; diff --git a/cpp/src/Slice/Parser.cpp b/cpp/src/Slice/Parser.cpp index 305f927d947..931f5a8c206 100644 --- a/cpp/src/Slice/Parser.cpp +++ b/cpp/src/Slice/Parser.cpp @@ -1417,6 +1417,12 @@ Slice::Container::enums() const return result; } +ContainedList +Slice::Container::contents() const +{ + return _contents; +} + bool Slice::Container::hasNonLocalClassDecls() const { diff --git a/cpp/src/slice2html/Gen.cpp b/cpp/src/slice2html/Gen.cpp index 7a8e8847f02..ccab207775f 100644 --- a/cpp/src/slice2html/Gen.cpp +++ b/cpp/src/slice2html/Gen.cpp @@ -33,7 +33,9 @@ namespace Slice void generate(const UnitPtr& unit, const ::std::string& dir, - const ::std::string& header, const ::std::string& footer, unsigned indexCount, unsigned warnSummary) + const ::std::string& header, const ::std::string& footer, + const ::std::string& indexHeader, const ::std::string& indexFooter, + unsigned indexCount, unsigned warnSummary) { unit->mergeModules(); @@ -50,28 +52,34 @@ generate(const UnitPtr& unit, const ::std::string& dir, GeneratorBase::warnSummary(warnSummary); // - // The types visitor first runs over the tree and records + // The file visitor first runs over the tree and records // the names of all files in this documentation set. // This information is used later to check whether a referenced - // symbol is defined in this documentation set (as opposed to - // being defined in an included fiel that is not part of this + // symbol is defined in this documentation set, as opposed to + // being defined in an included file that is not part of this // documentation set. If the former, we can generate a link // to the symbol; if the latter, we cannot. // Files files; - TypesVisitor tv(files); + FileVisitor tv(files); unit->visit(&tv, false); // - // Generate the main module index. + // Generate the start page. // - IndexVisitor iv(files); - unit->visit(&iv, false); + StartPageVisitor spv(files); + unit->visit(&spv, false); + + // + // Generate the table of contents. + // + TOCVisitor tocv(files, indexHeader, indexFooter); + unit->visit(&tocv, false); // // Generate the individual HTML pages. // - Visitor v(files); + PageVisitor v(files); unit->visit(&v, false); } @@ -99,67 +107,26 @@ Slice::GeneratorBase::setOutputDir(const string& dir) } // -// Set a header. If "header" is empty, use a default header. +// Get the headers. If "header" is empty, use a default header. // If a header file is specified, it is expected to end in <body> // and to contain a "TITLE" placeholder line (in column 1, no leading // or trailing white space). The actual document title is later substituted // where that TITLE placeholder appears. // - void Slice::GeneratorBase::setHeader(const string& header) { - if(header.empty()) - { - ostringstream hdr1; - XMLOutput O1(hdr1); - O1 << "<!-- Generated by Ice version " << ICE_STRING_VERSION << " -->"; - O1 << sp; - O1 << nl << "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">"; - O1 << se("html"); - O1 << se("head"); - O1 << se("title") << nl; - _header1 = hdr1.str(); - - // _header1 and _header2 store the bit preceding and following the title. - // _header1, the title text, and _header2 are written by openDoc(). - - ostringstream hdr2; - XMLOutput O2(hdr2); - O2.inc(); - O2.inc(); - O2 << nl << "</title>"; - O2.dec(); - O2 << nl << "</head>"; - O2 << nl << "<body>"; - _header2 = hdr2.str(); - } - else - { - readFile(header, _header1, _header2); - } + getHeaders(header, _header1, _header2); } // -// Set a footer. If "footer" is empty, use a default footer. +// Get the footer. If "footer" is empty, use a default footer. // The footer is expected to start with </body>. // - void Slice::GeneratorBase::setFooter(const string& footer) { - ostringstream ftr; - XMLOutput O(ftr); - if(footer.empty()) - { - O << " </body>"; - } - else - { - O << readFile(footer); - } - O << nl << "</html>"; - _footer = ftr.str(); + _footer = getFooter(footer); } // @@ -168,7 +135,6 @@ Slice::GeneratorBase::setFooter(const string& footer) // sub-index. (For example, with "ic" set to 3, we generate // a sub-index only if, say, a structure has 3 or more members. // - void Slice::GeneratorBase::setIndexCount(int ic) { @@ -178,7 +144,6 @@ Slice::GeneratorBase::setIndexCount(int ic) // // If n > 0, we print a warning if a summary sentence exceeds n characters. // - void Slice::GeneratorBase::warnSummary(int n) { @@ -198,16 +163,32 @@ Slice::GeneratorBase::~GeneratorBase() // Open a file for writing in the output directory (the output directory // is created if necessary) and write the HTML header into the file. // - void -Slice::GeneratorBase::openDoc(const string& file, const string& title) +Slice::GeneratorBase::openDoc(const string& file, const string& title, const string& header, const string& footer) { makeDir(_dir); openStream(_dir + "/" + file); - _out << _header1; + string h1; + string h2; + if(header.empty()) + { + _out << _header1; + } + else + { + getHeaders(header, h1, h2); + _out << h1; + } _out << title; - _out << _header2; + if(header.empty()) + { + _out << _header2; + } + else + { + _out << h2; + } _out.inc(); _out.inc(); } @@ -218,7 +199,6 @@ Slice::GeneratorBase::openDoc(const string& file, const string& title) // is constructed from the Slice scoped name. Sub-directories are // created as needed and the header is written to the file. // - void Slice::GeneratorBase::openDoc(const ContainedPtr& c) { @@ -248,7 +228,6 @@ Slice::GeneratorBase::openDoc(const ContainedPtr& c) // // Close an open HTML file after writing the footer. // - void Slice::GeneratorBase::closeDoc() { @@ -858,7 +837,16 @@ Slice::GeneratorBase::getLinkPath(const SyntaxTreeBasePtr& p, const ContainerPtr // Find the first component where the two scopes differ. // bool commonEnclosingScope = false; - StringList target = getContainer(p); + StringList target; + EnumeratorPtr enumerator = EnumeratorPtr::dynamicCast(p); + if(enumerator) + { + target = toStringList(enumerator->type()); + } + else + { + target = getContainer(p); + } StringList from = getContainer(c); while(!target.empty() && !from.empty() && target.front() == from.front()) { @@ -1144,6 +1132,57 @@ Slice::GeneratorBase::readFile(const string& file) } void +Slice::GeneratorBase::getHeaders(const string& header, string& h1, string& h2) +{ + if(header.empty()) + { + ostringstream hdr1; + XMLOutput O1(hdr1); + O1 << "<!-- Generated by Ice version " << ICE_STRING_VERSION << " -->"; + O1 << sp; + O1 << nl << "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">"; + O1 << se("html"); + O1 << se("head"); + O1 << se("title") << nl; + h1 = hdr1.str(); + + // _header1 and _header2 store the bit preceding and following the title. + // _header1, the title text, and _header2 are written by openDoc(). + + ostringstream hdr2; + XMLOutput O2(hdr2); + O2.inc(); + O2.inc(); + O2 << nl << "</title>"; + O2.dec(); + O2 << nl << "</head>"; + O2 << nl << "<body>"; + h2 = hdr2.str(); + } + else + { + readFile(header, h1, h2); + } +} + +string +Slice::GeneratorBase::getFooter(const string& footer) +{ + ostringstream ftr; + XMLOutput O(ftr); + if(footer.empty()) + { + O << " </body>"; + } + else + { + O << readFile(footer); + } + O << nl << "</html>"; + return ftr.str(); +} + +void Slice::GeneratorBase::readFile(const string& file, string& part1, string& part2) { ifstream in(file.c_str()); @@ -1185,18 +1224,18 @@ Slice::GeneratorBase::readFile(const string& file, string& part1, string& part2) part2 = p2.str(); } -Slice::IndexGenerator::IndexGenerator(const Files& files) +Slice::StartPageGenerator::StartPageGenerator(const Files& files) : GeneratorBase(_out, files) { - openDoc("index.html", "Slice Documentation Index"); + openDoc("index.html", "Slice API Documentation"); } -Slice::IndexGenerator::~IndexGenerator() +Slice::StartPageGenerator::~StartPageGenerator() { ::std::sort(_modules.begin(), _modules.end()); start("h1"); - _out << "Slice Documentation Index"; + _out << "Slice API Documentation"; end(); start("h2"); _out << "Modules"; @@ -1217,91 +1256,228 @@ Slice::IndexGenerator::~IndexGenerator() } void -Slice::IndexGenerator::generate(const ModulePtr& m) +Slice::StartPageGenerator::generate(const ModulePtr& m) { string name = toString(m, 0, false); string comment = getComment(m, 0, true); _modules.push_back(make_pair(name, comment)); } -Slice::TypesVisitor::TypesVisitor(Files& files) +Slice::FileVisitor::FileVisitor(Files& files) : _files(files) { } bool -Slice::TypesVisitor::visitUnitStart(const UnitPtr& u) +Slice::FileVisitor::visitUnitStart(const UnitPtr& u) { return true; } bool -Slice::TypesVisitor::visitModuleStart(const ModulePtr& m) +Slice::FileVisitor::visitModuleStart(const ModulePtr& m) { _files.insert(m->definitionContext()->filename()); return true; } bool -Slice::TypesVisitor::visitExceptionStart(const ExceptionPtr& e) +Slice::FileVisitor::visitExceptionStart(const ExceptionPtr& e) { _files.insert(e->definitionContext()->filename()); return false; } bool -Slice::TypesVisitor::visitClassDefStart(const ClassDefPtr& c) +Slice::FileVisitor::visitClassDefStart(const ClassDefPtr& c) { _files.insert(c->definitionContext()->filename()); return false; } void -Slice::TypesVisitor::visitClassDecl(const ClassDeclPtr& c) +Slice::FileVisitor::visitClassDecl(const ClassDeclPtr& c) { _files.insert(c->definitionContext()->filename()); } bool -Slice::TypesVisitor::visitStructStart(const StructPtr& s) +Slice::FileVisitor::visitStructStart(const StructPtr& s) { _files.insert(s->definitionContext()->filename()); return false; } void -Slice::TypesVisitor::visitSequence(const SequencePtr& s) +Slice::FileVisitor::visitSequence(const SequencePtr& s) { _files.insert(s->definitionContext()->filename()); } void -Slice::TypesVisitor::visitDictionary(const DictionaryPtr& d) +Slice::FileVisitor::visitDictionary(const DictionaryPtr& d) { _files.insert(d->definitionContext()->filename()); } void -Slice::TypesVisitor::visitEnum(const EnumPtr& e) +Slice::FileVisitor::visitEnum(const EnumPtr& e) { _files.insert(e->definitionContext()->filename()); } -Slice::IndexVisitor::IndexVisitor(const Files& files) - : _ig(files) +Slice::StartPageVisitor::StartPageVisitor(const Files& files) + : _spg(files) +{ +} + +bool +Slice::StartPageVisitor::visitUnitStart(const UnitPtr& unit) +{ + return true; +} + +bool +Slice::StartPageVisitor::visitModuleStart(const ModulePtr& m) +{ + _spg.generate(m); + return false; +} + +TOCGenerator::TOCGenerator(const Files& files, const string& header, const string& footer) + : GeneratorBase(_out, files) +{ + openDoc("toc.html", "Index", header, footer); + start("H1"); + _out << "Index"; + end(); +} + +TOCGenerator::~TOCGenerator() +{ + _modules.sort(); + writeTOC(); + closeDoc(); +} + +void +TOCGenerator::generate(const ModulePtr& m) +{ + _modules.push_back(m); +} + +void +TOCGenerator::writeTOC() +{ + start("ul"); + for(ModuleList::const_iterator i = _modules.begin(); i != _modules.end(); ++i) + { + writeEntry(*i); + } + end(); +} + +void +TOCGenerator::writeEntry(const ContainedPtr& c) +{ + ContainedList cl; + + ModulePtr m = ModulePtr::dynamicCast(c); + if(m) + { + cl = m->contents(); + } + + EnumPtr en = EnumPtr::dynamicCast(c); + if(en) + { + EnumeratorList enumerators = en->getEnumerators(); + for(EnumeratorList::const_iterator i = enumerators.begin(); i != enumerators.end(); ++i) + { + cl.push_back(*i); + } + } + + StructPtr s = StructPtr::dynamicCast(c); + if(s) + { + DataMemberList dml = s->dataMembers(); + for(DataMemberList::const_iterator i = dml.begin(); i != dml.end(); ++i) + { + cl.push_back(*i); + } + } + + ExceptionPtr e = ExceptionPtr::dynamicCast(c); + if(e) + { + DataMemberList dml = e->dataMembers(); + for(DataMemberList::const_iterator i = dml.begin(); i != dml.end(); ++i) + { + cl.push_back(*i); + } + } + + ClassDefPtr cdef = ClassDefPtr::dynamicCast(c); + if(!cdef) + { + ClassDeclPtr cdecl = ClassDeclPtr::dynamicCast(c); + if(cdecl) + { + cdef = cdecl->definition(); + } + } + + if(cdef) + { + DataMemberList dml = cdef->dataMembers(); + for(DataMemberList::const_iterator i = dml.begin(); i != dml.end(); ++i) + { + cl.push_back(*i); + } + OperationList ol = cdef->operations(); + for(OperationList::const_iterator j = ol.begin(); j != ol.end(); ++j) + { + cl.push_back(*j); + } + } + + start("li"); + if(!cl.empty()) + { + cl.sort(); + cl.unique(); + + _out << toString(c, 0, false, true); + start("ul"); + for(ContainedList::const_iterator i = cl.begin(); i != cl.end(); ++i) + { + writeEntry(*i); + } + end(); + } + else + { + _out << toString(c, 0, false, true); + } + end(); +} + +TOCVisitor::TOCVisitor(const Files& files, const string& header, const string& footer) + : _tg(files, header, footer) { } bool -Slice::IndexVisitor::visitUnitStart(const UnitPtr& unit) +TOCVisitor::visitUnitStart(const UnitPtr&) { return true; } bool -Slice::IndexVisitor::visitModuleStart(const ModulePtr& m) +TOCVisitor::visitModuleStart(const ModulePtr& m) { - _ig.generate(m); + _tg.generate(m); return false; } @@ -2106,19 +2282,19 @@ Slice::EnumGenerator::generate(const EnumPtr& e) assert(_out.currIndent() == indent); } -Slice::Visitor::Visitor(const Files& files) +Slice::PageVisitor::PageVisitor(const Files& files) : _files(files) { } bool -Slice::Visitor::visitUnitStart(const UnitPtr& unit) +Slice::PageVisitor::visitUnitStart(const UnitPtr& unit) { return true; } bool -Slice::Visitor::visitModuleStart(const ModulePtr& m) +Slice::PageVisitor::visitModuleStart(const ModulePtr& m) { XMLOutput O; ModuleGenerator mg(O, _files); @@ -2127,7 +2303,7 @@ Slice::Visitor::visitModuleStart(const ModulePtr& m) } bool -Slice::Visitor::visitExceptionStart(const ExceptionPtr& e) +Slice::PageVisitor::visitExceptionStart(const ExceptionPtr& e) { XMLOutput O; ExceptionGenerator eg(O, _files); @@ -2136,7 +2312,7 @@ Slice::Visitor::visitExceptionStart(const ExceptionPtr& e) } bool -Slice::Visitor::visitClassDefStart(const ClassDefPtr& c) +Slice::PageVisitor::visitClassDefStart(const ClassDefPtr& c) { XMLOutput O; ClassGenerator cg(O, _files); @@ -2145,7 +2321,7 @@ Slice::Visitor::visitClassDefStart(const ClassDefPtr& c) } bool -Slice::Visitor::visitStructStart(const StructPtr& s) +Slice::PageVisitor::visitStructStart(const StructPtr& s) { XMLOutput O; StructGenerator sg(O, _files); @@ -2154,7 +2330,7 @@ Slice::Visitor::visitStructStart(const StructPtr& s) } void -Slice::Visitor::visitEnum(const EnumPtr& e) +Slice::PageVisitor::visitEnum(const EnumPtr& e) { XMLOutput O; EnumGenerator eg(O, _files); diff --git a/cpp/src/slice2html/Gen.h b/cpp/src/slice2html/Gen.h index a4a2ad1edbc..843f010bb02 100644 --- a/cpp/src/slice2html/Gen.h +++ b/cpp/src/slice2html/Gen.h @@ -16,7 +16,8 @@ namespace Slice { -void generate(const UnitPtr&, const ::std::string&, const ::std::string&, const ::std::string&, unsigned, unsigned); +void generate(const UnitPtr&, const ::std::string&, const ::std::string&, const ::std::string&, const std::string&, + const ::std::string&, unsigned, unsigned); typedef ::std::set< ::std::string> Files; @@ -35,7 +36,7 @@ protected: GeneratorBase(::IceUtil::XMLOutput&, const Files&); virtual ~GeneratorBase() = 0; - void openDoc(const ::std::string&, const std::string&); + void openDoc(const ::std::string&, const std::string&, const std::string& = "", const std::string& = ""); void openDoc(const ContainedPtr&); void closeDoc(); @@ -71,6 +72,8 @@ private: static void makeDir(const ::std::string&); static ::std::string readFile(const ::std::string&); static void readFile(const ::std::string&, ::std::string&, ::std::string&); + static void getHeaders(const ::std::string&, ::std::string&, ::std::string&); + static ::std::string getFooter(const ::std::string&); const Files& _files; @@ -78,14 +81,17 @@ private: static ::std::string _header1; static ::std::string _header2; static ::std::string _footer; + static ::std::string _indexHeader1; + static ::std::string _indexHeader2; + static ::std::string _indexFooter; }; -class IndexGenerator : private GeneratorBase +class StartPageGenerator : private GeneratorBase { public: - IndexGenerator(const Files&); - ~IndexGenerator(); + StartPageGenerator(const Files&); + ~StartPageGenerator(); void generate(const ModulePtr&); private: @@ -95,11 +101,11 @@ private: ::IceUtil::XMLOutput _out; }; -class TypesVisitor : private ::IceUtil::noncopyable, public ParserVisitor +class FileVisitor : private ::IceUtil::noncopyable, public ParserVisitor { public: - TypesVisitor(Files&); + FileVisitor(Files&); virtual bool visitUnitStart(const UnitPtr&); virtual bool visitModuleStart(const ModulePtr&); @@ -116,18 +122,49 @@ private: Files& _files; }; -class IndexVisitor : private ::IceUtil::noncopyable, public ParserVisitor +class StartPageVisitor : private ::IceUtil::noncopyable, public ParserVisitor { public: - IndexVisitor(const Files&); + StartPageVisitor(const Files&); virtual bool visitUnitStart(const UnitPtr&); virtual bool visitModuleStart(const ModulePtr&); private: - IndexGenerator _ig; + StartPageGenerator _spg; +}; + +class TOCGenerator : private GeneratorBase +{ +public: + + TOCGenerator(const Files&, const ::std::string&, const ::std::string&); + ~TOCGenerator(); + void generate(const ModulePtr&); + +private: + + void writeTOC(); + void writeEntry(const ContainedPtr&); + + ModuleList _modules; + ::IceUtil::XMLOutput _out; +}; + +class TOCVisitor : private ::IceUtil::noncopyable, public ParserVisitor +{ +public: + + TOCVisitor(const Files&, const ::std::string&, const ::std::string&); + + virtual bool visitUnitStart(const UnitPtr&); + virtual bool visitModuleStart(const ModulePtr&); + +private: + + TOCGenerator _tg; }; class ModuleGenerator : private GeneratorBase @@ -140,7 +177,6 @@ public: private: virtual void visitContainer(const ContainerPtr&); - }; class ExceptionGenerator : private GeneratorBase @@ -175,11 +211,11 @@ public: void generate(const EnumPtr&); }; -class Visitor : private ::IceUtil::noncopyable, public ParserVisitor +class PageVisitor : private ::IceUtil::noncopyable, public ParserVisitor { public: - Visitor(const Files&); + PageVisitor(const Files&); virtual bool visitUnitStart(const UnitPtr&); virtual bool visitModuleStart(const ModulePtr&); diff --git a/cpp/src/slice2html/Main.cpp b/cpp/src/slice2html/Main.cpp index 546ed59fe5d..7a98234f1fe 100644 --- a/cpp/src/slice2html/Main.cpp +++ b/cpp/src/slice2html/Main.cpp @@ -30,8 +30,10 @@ usage(const char* n) "-IDIR Put DIR in the include file search path.\n" "-E Print preprocessor output on stdout.\n" "--output-dir DIR Create files in the directory DIR.\n" - "--header FILE Use the contents of FILE as the header.\n" - "--footer FILe Use the contents of FILE as the footer.\n" + "--hdr FILE Use the contents of FILE as the header.\n" + "--ftr FILe Use the contents of FILE as the footer.\n" + "--indexhdr FILE Use the contents of FILE as the header of the index/toc page (default=--hdr).\n" + "--indexftr FILE Use the contents of FILE as the footer of the index/toc page (default=--ftr).\n" "--index NUM Generate subindex if it has at least NUM entries (0 for no index, default=1).\n" "--summary NUM Print a warning if a summary sentence exceeds NUM characters.\n" "-d, --debug Print debug messages.\n" @@ -50,8 +52,10 @@ main(int argc, char* argv[]) opts.addOpt("I", "", IceUtil::Options::NeedArg, "", IceUtil::Options::Repeat); opts.addOpt("E"); opts.addOpt("", "output-dir", IceUtil::Options::NeedArg, "."); - opts.addOpt("", "header", IceUtil::Options::NeedArg); - opts.addOpt("", "footer", IceUtil::Options::NeedArg); + opts.addOpt("", "hdr", IceUtil::Options::NeedArg); + opts.addOpt("", "ftr", IceUtil::Options::NeedArg); + opts.addOpt("", "indexhdr", IceUtil::Options::NeedArg); + opts.addOpt("", "indexftr", IceUtil::Options::NeedArg); opts.addOpt("", "index", IceUtil::Options::NeedArg, "1"); opts.addOpt("", "summary", IceUtil::Options::NeedArg, "0"); opts.addOpt("d", "debug"); @@ -105,9 +109,13 @@ main(int argc, char* argv[]) string output = opts.optArg("output-dir"); - string header = opts.optArg("header"); + string header = opts.optArg("hdr"); - string footer = opts.optArg("footer"); + string footer = opts.optArg("ftr"); + + string indexHeader = opts.optArg("indexhdr"); + + string indexFooter = opts.optArg("indexftr"); string ind = opts.optArg("index"); unsigned indexCount; @@ -190,7 +198,7 @@ main(int argc, char* argv[]) { try { - Slice::generate(p, output, header, footer, indexCount, summaryCount); + Slice::generate(p, output, header, footer, indexHeader, indexFooter, indexCount, summaryCount); } catch(const string& err) { |