[Request/idea] Preamble generalization

Lorenzo Bertini lorenzobertini97 at gmail.com
Sat Sep 19 22:36:03 UTC 2020


Sorry for the old bump, but I managed to make a tabbed menu with
"LaTeX" and "HTML" as tabs for the "Preamble" section:

What I managed to do:
1) Buffer params received a new variable <htmlpreamble> that can be
written to and read from a LyX file just as old <preamble>;
2) "Preamble" section now has two tabs, each with a text box that
saves what's inside into <params.preamble> and <params.htmlpreamble>
respectively when the <PreambleModule::apply> function is called;
3) "find text" box and button work for the current selected tab;

What I couldn't do:
1) find out how to write <params.htmlpreamble> when outputting HTML;
I've been looking into "output_xhtml" and "output_latex" without luck;
where should I look?
2) check if <htmlpreamble> contains illegal characters (this should be
a simple copy-paste from the latex one, I'll look into it later);
3) make it so when the text box for the HTML tab is modified the
<Apply> button activates, just like the LaTeX tab does; where should I
look to learn how to notify that "settings have changed" when the tab
receives text?
4) avoid hardcoding some things: for example to make the "find" work
in the current tab I have explicitly used tab names; how does one make
this name or tab independent, in the perspective of adding more
preamble options? Should one?

Thank you in advance, I'm moving my first steps in this codebase and I
need a little starting kick. I started here because I thought I would
have been easier that attempting easyfixes, let me know if I'm wrong.


More information about the lyx-devel mailing list