#include "Buffer.h"
#include "BufferParams.h"
-#include "OutputParams.h"
+#include "output_docbook.h"
#include "TocBackend.h"
#include "support/docstream.h"
#include "support/gettext.h"
+#include "support/lstrings.h"
namespace lyx {
}
-int InsetMarginal::docbook(odocstream & os,
- OutputParams const & runparams) const
+void InsetMarginal::docbook(XMLStream & xs, OutputParams const & runparams) const
{
- os << "<note role=\"margin\">";
- int const i = InsetText::docbook(os, runparams);
- os << "</note>";
-
- return i;
+ // Implementation as per http://www.sagehill.net/docbookxsl/SideFloats.html
+ // Unfortunately, only for XSL-FO output with the default style sheets, hence the role.
+ xs << xml::StartTag("sidebar", "role=\"margin\"");
+ xs << xml::CR();
+ xs << XMLStream::ESCAPE_NONE << "<?dbfo float-type=\"margin.note\"?>";
+ xs << xml::CR();
+ InsetText::docbook(xs, runparams);
+ xs << xml::EndTag("sidebar");
}
-void InsetMarginal::addToToc(DocIterator const & cpit, bool output_active) const
-{
- DocIterator pit = cpit;
- pit.push_back(CursorSlice(const_cast<InsetMarginal &>(*this)));
-
- Toc & toc = buffer().tocBackend().toc("marginalnote");
- docstring str;
- text().forToc(str, TOC_ENTRY_LENGTH);
- toc.push_back(TocItem(pit, 0, str, output_active, toolTipText(docstring(), 3, 60)));
- // Proceed with the rest of the inset.
- InsetFootlike::addToToc(cpit, output_active);
-}
-
} // namespace lyx