]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetMarginal.cpp
New DocBook support
[lyx.git] / src / insets / InsetMarginal.cpp
index 3dfcf7d048ff8eb4f19888db620567ff7306fbd7..54922fced5acec533d95d8d254c0775b7474fb6a 100644 (file)
@@ -10,6 +10,7 @@
  */
 
 #include <config.h>
+#include <output_docbook.h>
 
 #include "InsetMarginal.h"
 
@@ -41,14 +42,15 @@ int InsetMarginal::plaintext(odocstringstream & os,
 }
 
 
-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 << "<?dbfo float-type=\"margin.note\"?>";
+       InsetText::docbook(xs, runparams);
+       xs << xml::EndTag("sidebar");
 }