]> git.lyx.org Git - features.git/commitdiff
XHTML for InsetWrap.
authorRichard Heck <rgheck@comcast.net>
Fri, 12 Jun 2009 17:26:48 +0000 (17:26 +0000)
committerRichard Heck <rgheck@comcast.net>
Fri, 12 Jun 2009 17:26:48 +0000 (17:26 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30080 a592a061-630c-0410-9148-cb99ea01b6c8

development/HTML/HTML.notes
lib/layouts/stdinsets.inc
src/insets/InsetWrap.cpp
src/insets/InsetWrap.h

index e9427d5cfca87aa07508eb3c0a7b32c7f6ab6d36..fddefb120996f33cbb3c08bcdb56063b53695e1a 100644 (file)
@@ -12,7 +12,7 @@ Known issues:
 These insets are basically done, though there are probably issues here and there,
        and there are even some FIXMEs:
        Bibitem, Branch, Collapsable, Footnote, Hyperlink, Info, Label, Line, 
 These insets are basically done, though there are probably issues here and there,
        and there are even some FIXMEs:
        Bibitem, Branch, Collapsable, Footnote, Hyperlink, Info, Label, Line, 
-       Marginal, Note, Newline, Newpage, Quotes, Space, SpecialChar
+       Marginal, Note, Newline, Newpage, Quotes, Space, SpecialChar, Wrap
 
 These insets do nothing for XHTML:
        ERT, OptArg, Phantom
 
 These insets do nothing for XHTML:
        ERT, OptArg, Phantom
@@ -70,8 +70,6 @@ These do not yet work and need some attention:
        InsetTOC: We should just be able to use what we have in the TOC. To get links to
                work, though, we'll need to co-ordinate the writing of anchors in the sections,
                which won't actually happen until later.
        InsetTOC: We should just be able to use what we have in the TOC. To get links to
                work, though, we'll need to co-ordinate the writing of anchors in the sections,
                which won't actually happen until later.
-       InsetWrap: This should be simple enough, probably a div and some CSS, but I'm not sure
-               precisely what this is supposed to do.
 
 MATH
        Regarding math, the view seems to be that we should in the first instance just use what
 
 MATH
        Regarding math, the view seems to be that we should in the first instance just use what
index 438cead752a68c7725da1d34f3bde42df03d0f90..060d4da2711026bae332d626c5c0bb2b65be60b6 100644 (file)
@@ -294,6 +294,15 @@ InsetLayout Wrap
          Size                Small
        EndFont
        MultiPar              true
          Size                Small
        EndFont
        MultiPar              true
+       HTMLStyle
+               span.wrap { 
+                       float: right;
+                       width: 40%;
+                       border: 2px solid black;
+                       padding: 1ex;
+                       margin: 1ex;
+               }
+       EndHTMLStyle
 End
 
 InsetLayout URL
 End
 
 InsetLayout URL
index 3aec8c2aa26a8632824854827b9f1431bf66bb19..4a3e8f7550b7621d3975bd94b8f3fa967d0eced4 100644 (file)
@@ -222,6 +222,20 @@ int InsetWrap::docbook(odocstream & os, OutputParams const & runparams) const
 }
 
 
 }
 
 
+docstring InsetWrap::xhtml(odocstream &, OutputParams const & rp) const
+{
+       string const len = params_.width.asHTMLString();
+       docstring retval = from_ascii("<div class='wrap'");
+       if (!len.empty())
+               retval += from_ascii(" style='width: " + len + ";");
+       retval += from_ascii("'>");
+       odocstringstream os;
+       docstring const deferred = InsetText::xhtml(os, rp);
+       retval += os.str() + from_ascii("</div>");
+       retval += deferred;
+}
+
+
 bool InsetWrap::insetAllowed(InsetCode code) const
 {
        switch(code) {
 bool InsetWrap::insetAllowed(InsetCode code) const
 {
        switch(code) {
index 17e3b2b7b1d268bad4d22f50506b74ea46563e17..aa21ebf4cf4592030e0e8fd23d975ad296e58ff7 100644 (file)
@@ -71,6 +71,8 @@ private:
        ///
        int docbook(odocstream &, OutputParams const &) const;
        ///
        ///
        int docbook(odocstream &, OutputParams const &) const;
        ///
+       docstring xhtml(odocstream &, OutputParams const &) const;
+       ///
        docstring editMessage() const;
        ///
        bool insetAllowed(InsetCode) const;
        docstring editMessage() const;
        ///
        bool insetAllowed(InsetCode) const;