LabelString foot
LatexType command
LatexName footnote
+ Counter footnote
Font
Color foreground
Size Small
EndFont
MultiPar true
HTMLTag span
- HTMLAttr class='footnote'
+ HTMLAttr class='footwrapper'
+ HTMLLabel "<span class='notenum'>\arabic{footnote}</span>"
+ HTMLInnerTag span
+ HTMLInnerAttr class='footnote'
HTMLStyle
span.notenum {
vertical-align: super;
int InsetCollapsable::xhtml(odocstream & os, OutputParams const & runparams) const
{
InsetLayout const & il = getLayout();
- bool opened = false;
- if (!undefined())
- opened = html::openTag(os, il.htmltag(), il.htmlattr());
+ if (undefined())
+ return InsetText::xhtml(os, runparams);
+
+ bool const opened = html::openTag(os, il.htmltag(), il.htmlattr());
+ if (!il.counter().empty()) {
+ // FIXME Master buffer?
+ LYXERR0(il.counter());
+ Counters & cntrs = buffer().params().documentClass().counters();
+ cntrs.step(il.counter());
+ if (!il.htmllabel().empty())
+ os << cntrs.counterLabel(translateIfPossible(from_ascii(il.htmllabel())));
+ }
+ bool innertag_opened = false;
+ if (!il.htmlinnertag().empty())
+ innertag_opened = html::openTag(os, il.htmlinnertag(), il.htmlinnerattr());
InsetText::xhtml(os, runparams);
- if (opened && !undefined())
+ if (innertag_opened)
+ html::closeTag(os, il.htmlinnertag());
+ if (opened)
html::closeTag(os, il.htmltag());
return 0;
}
int latex(odocstream &, OutputParams const &) const;
///
int docbook(odocstream &, OutputParams const &) const;
- ///
+ /// It will rarely be right to call this from subclasses, due
+ /// to the fact that it steps counters, etc. Instead, call
+ /// InsetText::xhtml().
int xhtml(odocstream &, OutputParams const &) const;
///
void validate(LaTeXFeatures &) const;
return i;
}
-
-int InsetFoot::xhtml(odocstream & os, OutputParams const & runparams) const
-{
- // FIXME It'd be nice to output the note number, but we'd need to save
- // that when we go through updateLabels.
- os << "<span class='footwrapper'><span class='notenum'>Note</span>\n";
- InsetCollapsable::xhtml(os, runparams);
- os << "\n</span>\n";
- return 0;
-}
-
} // namespace lyx
///
int docbook(odocstream &, OutputParams const &) const;
///
- int xhtml(odocstream &, OutputParams const &) const;
- ///
docstring editMessage() const;
/// Update the counters of this inset and of its contents
void updateLabels(ParIterator const &);
enum {
IL_BGCOLOR,
IL_COPYSTYLE,
+ IL_COUNTER,
IL_CUSTOMPARS,
IL_DECORATION,
IL_FONT,
IL_FREESPACING,
IL_HTMLTAG,
IL_HTMLATTR,
+ IL_HTMLINNERTAG,
+ IL_HTMLINNERATTR,
+ IL_HTMLLABEL,
IL_HTMLSTYLE,
IL_HTMLPREAMBLE,
IL_INTOC,
LexerKeyword elementTags[] = {
{ "bgcolor", IL_BGCOLOR },
{ "copystyle", IL_COPYSTYLE },
+ { "counter", IL_COUNTER},
{ "custompars", IL_CUSTOMPARS },
{ "decoration", IL_DECORATION },
{ "end", IL_END },
{ "forceplain", IL_FORCEPLAIN },
{ "freespacing", IL_FREESPACING },
{ "htmlattr", IL_HTMLATTR },
+ { "htmlinnerattr", IL_HTMLINNERATTR},
+ { "htmlinnertag", IL_HTMLINNERTAG},
+ { "htmllabel", IL_HTMLLABEL },
{ "htmlpreamble", IL_HTMLPREAMBLE },
{ "htmlstyle", IL_HTMLSTYLE },
{ "htmltag", IL_HTMLTAG },
custompars_ = multipar_;
forceplain_ = !multipar_;
break;
+ case IL_COUNTER:
+ lex >> counter_;
+ break;
case IL_CUSTOMPARS:
lex >> custompars_;
readCustomOrPlain = true;
case IL_HTMLATTR:
lex >> htmlattr_;
break;
+ case IL_HTMLINNERTAG:
+ lex >> htmlinnertag_;
+ break;
+ case IL_HTMLINNERATTR:
+ lex >> htmlinnerattr_;
+ break;
+ case IL_HTMLLABEL:
+ lex >> htmllabel_;
+ break;
case IL_HTMLSTYLE:
htmlstyle_ = from_utf8(lex.getLongString("EndHTMLStyle"));
break;
///
bool read(Lexer & lexrc, TextClass const & tclass);
///
- docstring name() const { return name_; };
+ docstring name() const { return name_; }
///
void setName(docstring const & n) { name_ = n; }
///
- InsetLyXType lyxtype() const { return lyxtype_; };
+ InsetLyXType lyxtype() const { return lyxtype_; }
///
- docstring labelstring() const { return labelstring_; };
+ docstring labelstring() const { return labelstring_; }
///
- InsetDecoration decoration() const { return decoration_; };
+ InsetDecoration decoration() const { return decoration_; }
///
- InsetLaTeXType latextype() const { return latextype_; };
+ InsetLaTeXType latextype() const { return latextype_; }
///
- std::string latexname() const { return latexname_; };
+ std::string latexname() const { return latexname_; }
///
- std::string latexparam() const { return latexparam_; };
+ std::string latexparam() const { return latexparam_; }
///
- FontInfo font() const { return font_; };
+ FontInfo font() const { return font_; }
///
- FontInfo labelfont() const { return labelfont_; };
+ FontInfo labelfont() const { return labelfont_; }
///
- ColorCode bgcolor() const { return bgcolor_; };
+ ColorCode bgcolor() const { return bgcolor_; }
///
- docstring preamble() const { return preamble_; };
+ docstring preamble() const { return preamble_; }
+ ///
+ docstring counter() const { return counter_; }
+ ///
+ std::string const & htmlinnertag() const { return htmlinnertag_; }
///
+ std::string const & htmlinnerattr() const { return htmlinnerattr_; }
+ ///
std::string const & htmltag() const { return htmltag_; }
///
std::string const & htmlattr() const { return htmlattr_; }
+ ///
+ std::string const & htmllabel() const { return htmllabel_; }
///
docstring htmlstyle() const { return htmlstyle_; }
///
///
ColorCode bgcolor_;
///
+ docstring counter_;
+ ///
docstring preamble_;
///
std::string htmltag_;
///
std::string htmlattr_;
+ ///
+ std::string htmlinnertag_;
+ ///
+ std::string htmlinnerattr_;
+ ///
+ std::string htmllabel_;
///
docstring htmlstyle_;
///
///
virtual bool allowMultiPar() const { return true; }
- // Update the counters of this inset and of its contents
- void updateLabels(ParIterator const &);
+ /// Update the counters of this inset and of its contents
+ virtual void updateLabels(ParIterator const &);
///
void addToToc(DocIterator const &);
///
ParagraphList::const_iterator par = pbegin;
for (; par != pend; ++par) {
Layout const & lay = par->layout();
- if (!lay.counter.empty())
- buf.params().documentClass().counters().step(lay.counter);
if (par != pbegin)
os << '\n';
bool const opened = openTag(os, lay);
while (par != pend) {
Layout const & style = par->layout();
- if (!style.counter.empty())
- buf.params().documentClass().counters().step(style.counter);
ParagraphList::const_iterator send;
// this will be positive, if we want to skip the initial word
// (if it's been taken for the label).
switch (style.latextype) {
case LATEX_ENVIRONMENT:
- case LATEX_LIST_ENVIRONMENT:
+ // case LATEX_LIST_ENVIRONMENT??
case LATEX_ITEM_ENVIRONMENT: {
- // FIXME Factor this out.
// There are two possiblities in this case.
// One is that we are still in the environment in which we
// started---which we will be if the depth is the same.
if (par->params().depth() == origdepth) {
- Layout const & cstyle = par->layout();
if (lastlay != 0) {
closeItemTag(os, *lastlay);
lastlay = 0;
}
- bool const item_tag_opened = openItemTag(os, cstyle);
+ Layout const & cstyle = par->layout();
if (cstyle.labeltype == LABEL_MANUAL) {
bool const label_tag_opened = openLabelTag(os, cstyle);
sep = par->firstWordLyXHTML(os, runparams);
if (label_tag_opened)
closeLabelTag(os, cstyle);
os << '\n';
- }
- // FIXME Why did I put that first condition??
- else if (style.latextype == LATEX_ENVIRONMENT
+ } else if (style.latextype == LATEX_ENVIRONMENT
&& style.labeltype != LABEL_NO_LABEL) {
bool const label_tag_opened = openLabelTag(os, cstyle);
+ if (!style.counter.empty())
+ buf.params().documentClass().counters().step(cstyle.counter);
os << pbegin->expandLabel(style, buf.params(), false);
if (label_tag_opened)
closeLabelTag(os, cstyle);
os << '\n';
}
+ bool const item_tag_opened = openItemTag(os, cstyle);
par->simpleLyXHTMLOnePar(buf, os, runparams,
outerFont(distance(paragraphs.begin(), par), paragraphs), sep);
++par;
// FIXME
case LATEX_BIB_ENVIRONMENT:
case LATEX_COMMAND:
- ++par;
break;
}
}
ParagraphList::const_iterator const & pbegin)
{
Layout const & style = pbegin->layout();
- if (!style.counter.empty())
- buf.params().documentClass().counters().step(style.counter);
bool const main_tag_opened = openTag(os, style);
// Label around sectioning number:
- // FIXME Probably need to account for LABEL_MANUAL
if (style.labeltype != LABEL_NO_LABEL) {
bool const label_tag_opened = openLabelTag(os, style);
+ if (!style.counter.empty())
+ buf.params().documentClass().counters().step(style.counter);
os << pbegin->expandLabel(style, buf.params(), false);
if (label_tag_opened)
closeLabelTag(os, style);
ParagraphList::const_iterator pend = paragraphs.end();
while (par != pend) {
- LYXERR0(par->id());
Layout const & style = par->layout();
ParagraphList::const_iterator lastpar = par;
ParagraphList::const_iterator send;
break;
}
case LATEX_ENVIRONMENT:
- case LATEX_LIST_ENVIRONMENT:
case LATEX_ITEM_ENVIRONMENT: {
send = searchEnvironment(par, pend);
par = makeEnvironment(buf, os, runparams, paragraphs, par,send);
send = searchParagraph(par, pend);
par = makeParagraphs(buf, os, runparams, paragraphs, par,send);
break;
- case LATEX_BIB_ENVIRONMENT:
- // FIXME
- ++par;
+ default:
break;
}
- // FIXME??
// makeEnvironment may process more than one paragraphs and bypass pend
if (distance(lastpar, par) >= distance(lastpar, pend))
break;