On 06/12/2015 09:27 AM, Liviu Andronic wrote:
On Fri, Jun 12, 2015 at 3:16 PM, Richard Heck <rgh...@lyx.org> wrote:
On 06/12/2015 04:09 AM, Liviu Andronic wrote:
On Fri, Jun 12, 2015 at 9:13 AM, Jürgen Spitzmüller <sp...@lyx.org> wrote:
2015-06-12 0:00 GMT+02:00 Liviu Andronic:
Before I distribute the fixed module on the Wiki, should I expect such
a change to break any backwards compatibility for existing documents
using the old module?

lyx2lyx takes care about _some_ Flex: prefix changes that have been done
within the layouts shippped with LyX. It might cover your case as well,
but
you can only find out by testing.

Thanks. I suspect "Custom:" prefix renamed to "Flex:" is common and
handled already by LyX, as here all seems to work OK with existing
documents.


Since your module is not included in the distribution, you can do not
much,
except documenting the change.

Should I be using the:
Format 2

convention? I suspect it won't make a difference since the module
isn't in the distribution, but I'm wondering about "good practice"...

You should use whatever format tag is correct for your particular module.
This is what Lyx
uses to determine whether it needs to do a layout2layout conversion.

Oh, so this is the format supported by LyX, not some internal module
numbering. If missing, it's assumed to be 1. Current LyX (2.1.x I
presume) is 35.

Yes, that is right.

As per our docs:

"5.3.3 Format number

The first non-comment line of any layout file, included file, or
module must contain the file format number:

Format [int] The format number of the layout file.

This tag was introduced with LyX 1.4.0. Layout files from older LyX
versions do not have an explicit file format and are considered to
have Format 1. The format for the present version of LyX is format 35.
But each version of LyX is capable of reading earlier versions' layout
files, just as they are capable of reading files produced by earlier
versions of LyX. There is, however, no provision for converting to
earlier formats."


But then I'm confused. Why does litinsets.inc have Format 54 (in GIT;
it's 49 in 2.1.3)?

For stable releases, all layout files will have the same format number (just as LyX files themselves have a stable format within a release cycle). In the development branch, they may not. There is a script, updatelayouts.sh, that can be used to update all layouts to the current format, but it doesn't always get run when the layout format is incremented. But
it will get run before 2.2.0 is released.

And how does one decide which format number is appropriate?

If the script is intended for 2.1.x, then it should use format 49---and, more importantly, it should *adhere* to format 49: Use exactly the resources provided by format 49, with exactly that syntax. E.g., it should not use the ToggleIndent tag introduced at format 51 (the changes are documented in layout2layout.py). It should also use the new syntax for arguments that
was introduced at format 41.

Note that the "current format" is what is documented in the Customization manual.

In fact, of course, the module can use any prior format, since layout2layout will convert it. (The script does NOT convert newer formats to older versions, however.) Of course, then it must follow the rules of whatever that format is. But it's best to keep it up to date (and
layout2layout can be used to convert older scripts to newer versions).

Richard

Reply via email to