]> git.lyx.org Git - features.git/commitdiff
New layout tags specifically for CSS information.
authorRichard Heck <rgheck@comcast.net>
Tue, 6 Dec 2011 22:38:46 +0000 (22:38 +0000)
committerRichard Heck <rgheck@comcast.net>
Tue, 6 Dec 2011 22:38:46 +0000 (22:38 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40411 a592a061-630c-0410-9148-cb99ea01b6c8

lib/scripts/layout2layout.py
src/LaTeXFeatures.cpp
src/TextClass.cpp
src/TextClass.h

index 66caa57ece0bd931603309ad71b062d4325e01f8..fe7c4e175cc6700d3c64b151f7ecdc6ecc960809 100644 (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:
index 4caa066688ddf07a9e9a31771aa94dc2987746ee..b72054d9ffd7c56ec291cea5ebf14ad82c9bb6be 100644 (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)
index 70390da289fcf7d1223aae4db8178a037885c47a..92adfdc7507dd7173dfa7c9bfe6f764baff46fcc 100644 (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();
index b3354898d553c40de46c313e53dc7df18323dde9..a25338f111dab5169848338da9a133f03e0fc662 100644 (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;