]> git.lyx.org Git - features.git/commitdiff
Now we can restore the old (and better) behavior of descriptions.
authorRichard Heck <rgheck@comcast.net>
Sat, 6 Jun 2009 04:09:14 +0000 (04:09 +0000)
committerRichard Heck <rgheck@comcast.net>
Sat, 6 Jun 2009 04:09:14 +0000 (04:09 +0000)
The CSS for lists isn't quite right, but I'm not sure what to do.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29984 a592a061-630c-0410-9148-cb99ea01b6c8

lib/layouts/stdlists.inc
src/Layout.cpp
src/insets/InsetCollapsable.cpp
src/output_xhtml.cpp

index cfa828252f4fd7a2dfb4c90aa98a0b05fc06d6b5..1cbf2cb94dc997c5e7c275f86fe62cfcbf13f36e 100644 (file)
@@ -71,10 +71,14 @@ Style Description
        LabelFont
          Series              Bold
        EndFont
-       HTMLTag               ol
-       HTMLItem              li
-       HTMLLabel             span
-       HTMLLabelAttr         class='desc'
+       HTMLTag               dl
+       HTMLAttr              class='description'
+       HTMLItem              dd
+       HTMLLabel             dt
+       HTMLLabelFirst        1
+       HTMLStyle
+               dl.description dt { font-weight: bold; }
+       EndHTMLStyle
 End
 
 
index 85af8a73fd29b2fcc8a96198f64ee41cb55d2f62..32f565297ee9a8ee4fd0354c2b12560374fc6e01 100644 (file)
@@ -139,6 +139,7 @@ Layout::Layout()
        pass_thru = false;
        toclevel = NOT_IN_TOC;
        commanddepth = 0;
+       htmllabelfirst_ = false;
 }
 
 
index ea639644793b89a22d5ea1961c7f5877f703e698..618c551a03d4b96240c5efde47d36a886096f3e4 100644 (file)
@@ -881,7 +881,6 @@ int InsetCollapsable::xhtml(odocstream & os, OutputParams const & runparams) con
        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())
index 3e212ae9452c911f78fb5b30806b471565f2ba78..5021d4bac07eea5b0c6fac28f6101d263bea33c3 100644 (file)
@@ -252,7 +252,10 @@ ParagraphList::const_iterator makeEnvironment(Buffer const & buf,
                                        closeItemTag(os, *lastlay);
                                        lastlay = 0;
                                }
-                               bool const item_tag_opened = openItemTag(os, cstyle);
+                               bool const labelfirst = cstyle.htmllabelfirst();
+                               bool item_tag_opened;
+                               if (!labelfirst)
+                                       item_tag_opened = openItemTag(os, cstyle);
                                if (cstyle.labeltype == LABEL_MANUAL) {
                                        bool const label_tag_opened = openLabelTag(os, cstyle);
                                        sep = par->firstWordLyXHTML(os, runparams);
@@ -269,9 +272,14 @@ ParagraphList::const_iterator makeEnvironment(Buffer const & buf,
                                                closeLabelTag(os, cstyle);
                                        os << '\n';
                                }
-
+                               if (labelfirst)
+                                       item_tag_opened = openItemTag(os, cstyle);
+                               else
+                                       os << "<span class='item'>";
                                par->simpleLyXHTMLOnePar(buf, os, runparams, 
                                        outerFont(distance(paragraphs.begin(), par), paragraphs), sep);
+                               if (!labelfirst)
+                                       os << "</span>";
                                ++par;
                                if (item_tag_opened) {
                                        // We may not want to close the tag yet, in particular,
@@ -361,7 +369,6 @@ void xhtmlParagraphs(ParagraphList const & paragraphs,
        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;