#include "Language.h"
#include "MetricsInfo.h"
#include "output_latex.h"
+#include "output_xhtml.h"
#include "OutputParams.h"
#include "Paragraph.h"
#include "TextClass.h"
}
+docstring InsetCaption::name() const
+{
+ if (type_.empty())
+ return from_ascii("Caption");
+ return from_utf8("Caption:" + type_);
+}
+
+
void InsetCaption::read(Lexer & lex)
{
#if 0
bool InsetCaption::insetAllowed(InsetCode code) const
{
switch (code) {
+ // code that is not allowed in a caption
case FLOAT_CODE:
case TABULAR_CODE:
case WRAP_CODE:
}
-docstring InsetCaption::xhtml(odocstream & os,
- OutputParams const & rp) const
+docstring InsetCaption::xhtml(XHTMLStream & xs, OutputParams const & rp) const
{
if (rp.html_disable_captions)
return docstring();
- os << "<div class='float-caption'>\n";
- docstring def = getCaptionAsHTML(os, rp);
- os << "</div>\n";
+ string attr = "class='float-caption";
+ if (!type_.empty())
+ attr += " float-caption-" + type_;
+ attr += "'";
+ xs << StartTag("div", attr);
+ docstring def = getCaptionAsHTML(xs, rp);
+ xs << EndTag("div");
return def;
}
+
int InsetCaption::getArgument(odocstream & os,
OutputParams const & runparams) const
{
}
-docstring InsetCaption::getCaptionAsHTML(odocstream & os,
+docstring InsetCaption::getCaptionAsHTML(XHTMLStream & xs,
OutputParams const & runparams) const
{
- os << full_label_ << ' ';
- return InsetText::xhtml(os, runparams);
+ xs << full_label_ << ' ';
+ InsetText::XHTMLOptions const opts =
+ InsetText::WriteLabel | InsetText::WriteInnerTag;
+ return InsetText::insetAsXHTML(xs, runparams, opts);
}
-void InsetCaption::updateLabels(ParIterator const & it)
+void InsetCaption::updateLabels(ParIterator const & it, bool out)
{
Buffer const & master = *buffer().masterBuffer();
DocumentClass const & tclass = master.params().documentClass();
}
// Do the real work now.
- InsetText::updateLabels(it);
+ InsetText::updateLabels(it, out);
}