Introduce BufferParam to control whether CSS is output in the header of

the XHTML file or to a separate style file.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37682 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2011-02-15 17:44:17 +00:00
parent d77fc1668c
commit 6127141d4b
4 changed files with 18 additions and 6 deletions

View File

@ -2456,6 +2456,10 @@ def revert_tabularwidth(document):
if document.body[features].find('alignment="tabularwidth"') != -1: if document.body[features].find('alignment="tabularwidth"') != -1:
remove_option(document.body, features, 'tabularwidth') remove_option(document.body, features, 'tabularwidth')
def revert_html_css_as_file(document):
if not del_token(document.header, '\\html_css_as_file', 0):
document.warning("Malformed LyX document: Missing \\html_css_as_file.")
## ##
# Conversion hub # Conversion hub
@ -2528,10 +2532,12 @@ convert = [[346, []],
[409, [convert_use_xetex]], [409, [convert_use_xetex]],
[410, []], [410, []],
[411, [convert_langpack]], [411, [convert_langpack]],
[412, []] [412, []],
[413, []],
] ]
revert = [[411, [revert_tabularwidth]], revert = [[412, [revert_html_css_as_file]],
[411, [revert_tabularwidth]],
[410, [revert_langpack]], [410, [revert_langpack]],
[409, [revert_labeling]], [409, [revert_labeling]],
[408, [revert_use_xetex]], [408, [revert_use_xetex]],

View File

@ -127,7 +127,7 @@ namespace {
// Do not remove the comment below, so we get merge conflict in // Do not remove the comment below, so we get merge conflict in
// independent branches. Instead add your own. // independent branches. Instead add your own.
int const LYX_FORMAT = 412; // edwin: set tabular width int const LYX_FORMAT = 413; // rgh: html_css_as_file
typedef map<string, bool> DepClean; typedef map<string, bool> DepClean;
typedef map<docstring, pair<InsetLabel const *, Buffer::References> > RefCache; typedef map<docstring, pair<InsetLabel const *, Buffer::References> > RefCache;

View File

@ -414,6 +414,7 @@ BufferParams::BufferParams()
html_be_strict = false; html_be_strict = false;
html_math_output = MathML; html_math_output = MathML;
html_math_img_scale = 1.0; html_math_img_scale = 1.0;
html_css_as_file = false;
output_sync = false; output_sync = false;
use_refstyle = true; use_refstyle = true;
@ -850,6 +851,8 @@ string BufferParams::readToken(Lexer & lex, string const & token,
html_math_output = static_cast<MathOutput>(temp); html_math_output = static_cast<MathOutput>(temp);
} else if (token == "\\html_be_strict") { } else if (token == "\\html_be_strict") {
lex >> html_be_strict; lex >> html_be_strict;
} else if (token == "\\html_css_as_file") {
lex >> html_css_as_file;
} else if (token == "\\html_math_img_scale") { } else if (token == "\\html_math_img_scale") {
lex >> html_math_img_scale; lex >> html_math_img_scale;
} else if (token == "\\html_latex_start") { } else if (token == "\\html_latex_start") {
@ -1090,6 +1093,7 @@ void BufferParams::writeFile(ostream & os) const
os << "\\tracking_changes " << convert<string>(trackChanges) << '\n' os << "\\tracking_changes " << convert<string>(trackChanges) << '\n'
<< "\\output_changes " << convert<string>(outputChanges) << '\n' << "\\output_changes " << convert<string>(outputChanges) << '\n'
<< "\\html_math_output " << html_math_output << '\n' << "\\html_math_output " << html_math_output << '\n'
<< "\\html_css_as_file" << html_css_as_file << '\n'
<< "\\html_be_strict " << convert<string>(html_be_strict) << '\n'; << "\\html_be_strict " << convert<string>(html_be_strict) << '\n';
if (html_math_img_scale != 1.0) if (html_math_img_scale != 1.0)

View File

@ -405,6 +405,8 @@ public:
std::string html_latex_start; std::string html_latex_start;
/// ///
std::string html_latex_end; std::string html_latex_end;
///
bool html_css_as_file;
/// generate output usable for reverse/forward search /// generate output usable for reverse/forward search
bool output_sync; bool output_sync;
/// custom LaTeX macro from user instead our own /// custom LaTeX macro from user instead our own