Better TOC output for XHTML, per Rob and Pavel.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38354 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2011-04-12 17:33:18 +00:00
parent f567dd2bc1
commit bfddee97e1
2 changed files with 12 additions and 1 deletions

View File

@ -34,6 +34,11 @@ AddToHTMLPreamble
div.lyxtoc-4 { margin: 0em 0em 0em 1em; }
div.lyxtoc-5 { margin: 0em 0em 0em 1em; }
div.lyxtoc-6 { margin: 0em 0em 0em 1em; }
a.tocentry {
text-decoration: none;
color: black;
}
a.tocentry:visited { color: black; }
a.tocarrow {
font-weight: bold;
text-decoration: none;

View File

@ -159,6 +159,10 @@ docstring InsetTOC::xhtml(XHTMLStream &, OutputParams const & op) const
// Now output TOC info for this entry
Paragraph const & par = it->dit().innerParagraph();
string const attr = "href='#" + par.magicLabel() + "' class='tocentry'";
xs << html::StartTag("a", attr);
// First the label, if there is one
docstring const & label = par.params().labelString();
if (!label.empty())
@ -168,7 +172,9 @@ docstring InsetTOC::xhtml(XHTMLStream &, OutputParams const & op) const
ours.for_toc = true;
Font const dummy;
par.simpleLyXHTMLOnePar(buffer(), xs, ours, dummy);
xs << " ";
xs << html::EndTag("a") << " ";
// Now a link to that paragraph
string const parattr = "href='#" + par.magicLabel() + "' class='tocarrow'";
xs << html::StartTag("a", parattr);