New layout tags specifically for CSS information.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40411 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2011-12-06 22:38:46 +00:00
parent b0601b540e
commit 157319b3f6
4 changed files with 26 additions and 3 deletions

View File

@ -129,7 +129,7 @@ import os, re, string, sys
# development/tools/updatelayouts.sh script to update all
# layout files to the new format.
currentFormat = 35
currentFormat = 36
def usage(prog_name):
@ -314,6 +314,10 @@ def convert(lines):
i += 1
continue
if format == 35:
i += 1
continue
if format == 34:
match = re_InsetLayout2.match(lines[i])
if not match:

View File

@ -1121,10 +1121,13 @@ docstring const LaTeXFeatures::getTClassHTMLPreamble() const
}
docstring const LaTeXFeatures::getTClassHTMLStyles() const {
docstring const LaTeXFeatures::getTClassHTMLStyles() const
{
DocumentClass const & tclass = params_.documentClass();
odocstringstream tcpreamble;
tcpreamble << tclass.htmlstyles();
list<docstring>::const_iterator cit = usedLayouts_.begin();
list<docstring>::const_iterator end = usedLayouts_.end();
for (; cit != end; ++cit)

View File

@ -60,7 +60,7 @@ namespace lyx {
// development/updatelayouts.sh script, to update the format of
// all of our layout files.
//
int const LAYOUT_FORMAT = 35;
int const LAYOUT_FORMAT = 36;
namespace {
@ -190,6 +190,7 @@ enum TextClassTags {
TC_CLASSOPTIONS,
TC_PREAMBLE,
TC_HTMLPREAMBLE,
TC_HTMLSTYLES,
TC_PROVIDES,
TC_REQUIRES,
TC_LEFTMARGIN,
@ -204,6 +205,7 @@ enum TextClassTags {
TC_FORMAT,
TC_ADDTOPREAMBLE,
TC_ADDTOHTMLPREAMBLE,
TC_ADDTOHTMLSTYLES,
TC_DEFAULTMODULE,
TC_PROVIDESMODULE,
TC_EXCLUDESMODULE,
@ -216,6 +218,7 @@ namespace {
LexerKeyword textClassTags[] = {
{ "addtohtmlpreamble", TC_ADDTOHTMLPREAMBLE },
{ "addtohtmlstyles", TC_ADDTOHTMLSTYLES },
{ "addtopreamble", TC_ADDTOPREAMBLE },
{ "citeformat", TC_CITEFORMAT },
{ "classoptions", TC_CLASSOPTIONS },
@ -228,6 +231,7 @@ namespace {
{ "float", TC_FLOAT },
{ "format", TC_FORMAT },
{ "htmlpreamble", TC_HTMLPREAMBLE },
{ "htmlstyles", TC_HTMLSTYLES },
{ "htmltocsection", TC_HTMLTOCSECTION },
{ "ifcounter", TC_IFCOUNTER },
{ "ifstyle", TC_IFSTYLE },
@ -568,6 +572,10 @@ TextClass::ReturnValues TextClass::read(Lexer & lexrc, ReadType rt)
htmlpreamble_ = from_utf8(lexrc.getLongString("EndPreamble"));
break;
case TC_HTMLSTYLES:
htmlstyles_ = from_utf8(lexrc.getLongString("EndStyles"));
break;
case TC_HTMLTOCSECTION:
html_toc_section_ = from_utf8(trim(lexrc.getString()));
break;
@ -580,6 +588,10 @@ TextClass::ReturnValues TextClass::read(Lexer & lexrc, ReadType rt)
htmlpreamble_ += from_utf8(lexrc.getLongString("EndPreamble"));
break;
case TC_ADDTOHTMLSTYLES:
htmlstyles_ += from_utf8(lexrc.getLongString("EndStyles"));
break;
case TC_PROVIDES: {
lexrc.next();
string const feature = lexrc.getString();

View File

@ -264,6 +264,8 @@ protected:
/// same, but for HTML output
/// this is output as is to the header
docstring htmlpreamble_;
/// same, but specifically for CSS information
docstring htmlstyles_;
/// the paragraph style to use for TOCs, Bibliography, etc
mutable docstring html_toc_section_;
/// latex packages loaded by document class.
@ -401,6 +403,8 @@ public:
docstring const & preamble() const { return preamble_; }
///
docstring const & htmlpreamble() const { return htmlpreamble_; }
///
docstring const & htmlstyles() const { return htmlstyles_; }
/// the paragraph style to use for TOCs, Bibliography, etc
/// we will attempt to calculate this if it was not given
Layout const & htmlTOCLayout() const;