};
// Keep the changes documented in the Customization manual.
-int const FORMAT = 20;
+int const FORMAT = 23;
bool layout2layout(FileName const & filename, FileName const & tempfile)
TC_ADDTOHTMLPREAMBLE,
TC_DEFAULTMODULE,
TC_PROVIDESMODULE,
- TC_EXCLUDESMODULE
+ TC_EXCLUDESMODULE,
+ TC_HTMLTOCSECTION
};
{ "float", TC_FLOAT },
{ "format", TC_FORMAT },
{ "htmlpreamble", TC_HTMLPREAMBLE },
+ { "htmltocsection", TC_HTMLTOCSECTION },
{ "ifcounter", TC_IFCOUNTER },
{ "ifstyle", TC_IFSTYLE },
{ "input", TC_INPUT },
case TC_HTMLPREAMBLE:
htmlpreamble_ = from_utf8(lexrc.getLongString("EndPreamble"));
break;
+
+ case TC_HTMLTOCSECTION:
+ html_toc_section_ = from_utf8(trim(lexrc.getString()));
+ break;
case TC_ADDTOPREAMBLE:
preamble_ += from_utf8(lexrc.getLongString("EndPreamble"));
return *defaultLayout;
}
+
/////////////////////////////////////////////////////////////////////////
//
// DocumentClassBundle
}
+Layout const & DocumentClass::htmlTOCLayout() const
+{
+ if (html_toc_section_.empty()) {
+ // we're going to look for the layout with the minimum toclevel
+ TextClass::LayoutList::const_iterator lit = begin();
+ TextClass::LayoutList::const_iterator const len = end();
+ int minlevel = 1000;
+ Layout const * lay = NULL;
+ for (; lit != len; ++lit) {
+ int const level = lit->toclevel;
+ // we don't want Part
+ if (level == Layout::NOT_IN_TOC || level < 0 || level >= minlevel)
+ continue;
+ lay = &*lit;
+ minlevel = level;
+ }
+ if (lay)
+ html_toc_section_ = lay->name();
+ else
+ // hmm. that is very odd, so we'll do our best
+ html_toc_section_ = defaultLayoutName();
+ }
+ return operator[](html_toc_section_);
+}
+
+
/////////////////////////////////////////////////////////////////////////
//
// PageSides