Use InsetLayout to get the tag type for TOC-like things.

This commit is contained in:
Richard Heck 2013-03-27 19:51:49 -04:00
parent df1af5df47
commit 79f428d201
4 changed files with 12 additions and 5 deletions

View File

@ -51,6 +51,7 @@ End
InsetLayout FloatList
HTMLTag h2
HTMLStyle
a.lyxtoc-floats {
text-decoration: none;

View File

@ -181,6 +181,7 @@ InsetLayout IPADeco
End
InsetLayout TOC
HTMLTag h2
HTMLStyle
div.toc {
margin: 2em 0em;
@ -188,7 +189,7 @@ InsetLayout TOC
border-width: 2px 0px;
padding: 1em 0em;
}
div.tochead { font-size: x-large; font-weight: bold; }
h2.tochead { font-size: x-large; font-weight: bold; }
div.lyxtoc-0 {
margin: 2em 0em 0em 0em;
font-size: xx-large;
@ -231,6 +232,7 @@ InsetLayout TOC:Listings
LangPreamble
\renewcommand{\lstlistlistingname}{_(Listings[[List of Listings]])}
EndLangPreamble
HTMLTag h2
HTMLStyle
div.lyxtoc-flat {
margin: 0em 0em 0em 1em;

View File

@ -242,10 +242,12 @@ docstring InsetFloatList::xhtml(XHTMLStream &, OutputParams const & op) const {
odocstringstream ods;
XHTMLStream xs(ods);
InsetLayout const & il = getLayout();
string const & tag = il.htmltag();
xs << html::StartTag("div", "class='toc toc-floats'");
xs << html::StartTag("div", tocattr)
xs << html::StartTag(tag, tocattr)
<< toclabel
<< html::EndTag("div");
<< html::EndTag(tag);
Toc::const_iterator it = toc.begin();
Toc::const_iterator const en = toc.end();

View File

@ -249,13 +249,15 @@ docstring InsetTOC::xhtml(XHTMLStream &, OutputParams const & op) const
xs << html::StartTag("div", "class='toc'");
// Title of TOC
InsetLayout const & il = getLayout();
string const & tag = il.htmltag();
docstring title = screenLabel();
Layout const & lay = buffer().params().documentClass().htmlTOCLayout();
string const & tocclass = lay.defaultCSSClass();
string const tocattr = "class='tochead " + tocclass + "'";
xs << html::StartTag("div", tocattr)
xs << html::StartTag(tag, tocattr)
<< title
<< html::EndTag("div");
<< html::EndTag(tag);
// with lists of listings, at least, there is no depth
// to worry about. so the code can be simpler.