Le 31/03/2016 23:35, Scott Kostyshak a écrit :
On Tue, Mar 29, 2016 at 12:53:15PM -0400, Richard Heck wrote:

How about a "LyX layout repository" with supported¹ layouts at an
"official" URL (something like www.lyx.org/ressources/layouts/ or
similar, maybe with subdirs for major LyX versions, ...) as a first step?

Yes, this is exactly what I had in mind, and I've been thinking about
how best to do it. We do not want to have to manage that directory
manually. The files are in the git repo, so we just have to figure out
how to access them. Some trickery using modrewrite might work. Or some
PHP code.

Regarding version detection, do you have an idea for the implementation?
(if you want, you can make a trac ticket regarding versioning and we can
move the discussion there)

Here is  raw sketch of a possible scheme:

Create a tree of layouts like
www.lyx.org/ressources/layouts/2.2.1/
www.lyx.org/ressources/layouts/2.2.2/
...

This tree could be a checkout of a special git tree.

Each directory will contain the layouts available at current time for the given version. This means that when we release, say, 2.2.3, we will run a script that adds the new files to the 2.2.2, 2.2.1 and 2.2.0 directories. In this way, each directory is self contained.

Each directory will contain a contents.txt directory, containing lines like
  <file name> <hash>

The LyX version will then be able to fetch this list and decide which files needs to be downloaded (probably because it has its own copy of the "current" contents.txt file).

I guess it would not be terribly difficult to create a python script that populates the directories for the different versions. Of course, there may be situations where we do not want some version to update to a given layout file (because it triggers a bug, for example). Therefore we need a scheme here a script generates a lis of files that can be later modified by hand.

I think it is safer to have separate directories for each version rather than a single layout directory and version-specific contents files that point to this common pool.

JMarc



Reply via email to