margin: 1ex;
}
EndHTMLStyle
- HTMLAttr "class='float-caption float-caption-figcaption'"
+ HTMLClass "float-caption float-caption-figcaption"
End
margin: 1ex;
}
EndHTMLStyle
- HTMLAttr "class='float-caption float-caption-table'"
+ HTMLClass "float-caption float-caption-table"
End
margin: 1ex;
}
EndHTMLStyle
- HTMLAttr "class='float-caption float-caption-centered'"
+ HTMLClass "float-caption float-caption-centered"
End
margin: 1ex;
}
EndHTMLStyle
- HTMLAttr "class='float-caption float-caption-centered'"
+ HTMLClass "float-caption float-caption-centered"
End
margin: 1ex;
}
EndHTMLStyle
- HTMLAttr "class='float-caption float-caption-bicaption'"
+ HTMLClass "float-caption float-caption-bicaption"
End
Requires noun
InToc true
HTMLTag span
- HTMLAttr "class='noun'"
+ HTMLClass "noun"
HTMLStyle
span.noun {
font-family: sans-serif;
margin: 1ex;
}
EndHTMLStyle
- HTMLAttr "class='float-caption float-caption-above'"
+ HTMLClass "float-caption float-caption-above"
End
margin: 1ex;
}
EndHTMLStyle
- HTMLAttr "class='float-caption float-caption-below'"
+ HTMLClass "float-caption float-caption-below"
End
Font
Family sans
EndFont
- HTMLAttr "class='info menu'"
+ HTMLClass "info menu"
HTMLStyle
span.menu { font-family: sans-serif; }
EndHTMLStyle
Font
Family sans
EndFont
- HTMLAttr "class='info shortcut'"
+ HTMLClass "info shortcut"
HTMLStyle
span.shortcut { font-family: sans-serif; }
EndHTMLStyle
Font
Family sans
EndFont
- HTMLAttr "class='info shortcut'"
+ HTMLClass "info shortcut"
HTMLStyle
span.shortcuts { font-family: sans-serif; }
EndHTMLStyle
margin: 1ex;
}
EndHTMLStyle
- HTMLAttr "class='float-caption float-caption-standard'"
+ HTMLClass "float-caption float-caption-standard"
End
# This script will update a .layout file to current format
# The latest layout format is also defined in src/TextClass.cpp
-currentFormat = 97
+currentFormat = 98
# Incremented to format 4, 6 April 2007, lasgouttes
# Incremented to format 97, 4 December 2022 by rikiheck
# Add HTMLClass
+# Incremented to format 98, 5 December 2022 by rikiheck
+# Add HTMLClass for InsetLayout
+
# Do not forget to document format change in Customization
# Manual (section "Declaring a new text class").
}
-string const & Layout::htmlattr() const
-{
- return htmlattr_;
-}
-
-
string const & Layout::htmlclass() const
{
// If it's an enumeration or itemize list, then we recalculate the class each
return htmlfullattrs_;
}
+
string const & Layout::htmlitemtag() const
{
if (htmlitemtag_.empty())
///
std::string const & htmltag() const;
///
- std::string const & htmlattr() const;
+ std::string const & htmlattr() const { return htmlattr_; }
///
std::string const & htmlclass() const;
/// Returns a complete attribute string, including class, etc.
// You should also run the development/tools/updatelayouts.py script,
// to update the format of all of our layout files.
//
-int const LAYOUT_FORMAT = 97; // rikiheck: HTMLClass
+int const LAYOUT_FORMAT = 98; // rikiheck: HTMLClass for InsetLayout
// Layout format for the current lyx file format. Controls which format is
return docstring();
InsetLayout const & il = getLayout();
string const & tag = il.htmltag();
- string attr = il.htmlattr();
+ string attr = il.htmlGetAttrString();
if (!type_.empty()) {
string const our_class = "float-caption-" + type_;
size_t const loc = attr.find("class='");
IL_FREESPACING,
IL_HTMLTAG,
IL_HTMLATTR,
+ IL_HTMLCLASS,
IL_HTMLFORCECSS,
IL_HTMLINNERTAG,
IL_HTMLINNERATTR,
{ "forceplain", IL_FORCEPLAIN },
{ "freespacing", IL_FREESPACING },
{ "htmlattr", IL_HTMLATTR },
+ { "htmlclass", IL_HTMLCLASS },
{ "htmlforcecss", IL_HTMLFORCECSS },
{ "htmlinnerattr", IL_HTMLINNERATTR},
{ "htmlinnertag", IL_HTMLINNERTAG},
case IL_HTMLATTR:
lex >> htmlattr_;
break;
+ case IL_HTMLCLASS:
+ lex >> htmlclass_;
+ break;
case IL_HTMLFORCECSS:
lex >> htmlforcecss_;
break;
}
-string const & InsetLayout::htmlattr() const
+string const & InsetLayout::htmlclass() const
{
- if (htmlattr_.empty())
- htmlattr_ = "class=\"" + defaultCSSClass() + "\"";
- return htmlattr_;
+ if (htmlclass_.empty())
+ htmlclass_ = defaultCSSClass();
+ return htmlclass_;
+}
+
+
+std::string const & InsetLayout::htmlGetAttrString() const {
+ if (!htmlfullattrs_.empty())
+ return htmlfullattrs_;
+ htmlfullattrs_ = htmlclass();
+ if (!htmlfullattrs_.empty())
+ htmlfullattrs_ = "class='" + htmlfullattrs_ + "'";
+ if (!htmlattr_.empty())
+ htmlfullattrs_ += " " + htmlattr_;
+ return htmlfullattrs_;
}
std::string const & htmltag() const;
/// Additional attributes for inclusion with the start tag. Default (if
/// a tag is provided) is: class="name".
- std::string const & htmlattr() const;
+ std::string const & htmlattr() const { return htmlattr_; }
+ ///
+ std::string const & htmlclass() const;
+ ///
+ std::string const & htmlGetAttrString() const;
/// Tag for individual paragraphs in the inset. Default is none.
std::string const & htmlinnertag() const { return htmlinnertag_; }
/// Attributes for that tag. Default (if a tag is provided) is:
///
mutable std::string htmlattr_;
///
+ mutable std::string htmlclass_;
+ /// cache
+ mutable std::string htmlfullattrs_;
+ ///
std::string htmlinnertag_;
///
mutable std::string htmlinnerattr_;
InsetLayout const & il = getLayout();
if (opts & WriteOuterTag)
- xs << xml::StartTag(il.htmltag(), il.htmlattr());
+ xs << xml::StartTag(il.htmltag(), il.htmlGetAttrString());
if ((opts & WriteLabel) && !il.counter().empty()) {
BufferParams const & bp = buffer().masterBuffer()->params();
string const width = len.empty() ? "50%" : len;
InsetLayout const & il = getLayout();
string const & tag = il.htmltag();
- string const attr = il.htmlattr() + " style='width:" + width + ";'";
+ string const attr = il.htmlGetAttrString() + " style='width:" + width + ";'";
xs << xml::StartTag(tag, attr);
docstring const deferred =
InsetText::insetAsXHTML(xs, rp, InsetText::WriteInnerTag);