Apparently the file that I attached is interpreted (in my OS/browser) as a
.bin file when I try to download it.  I'm assuming that's because firefox is
choking on it due to the lack of a file extension, or it's Linux and the
file starts with a period and that's a magic number...?  I've made a couple
of changes that should clear that up and attached the result.

David
Specification for the .plyx file format
=======================================

.plyx, a zipped or tarred portable LyX file.  Presently does not include style 
or
class files, but could be extended for that.  Perhaps an option should be 
available
to include the bibliography.  The goal of this format is to ease colaboration.

Structure
=========
document.lyx
compiled.<ext>
manifest.xml
<image-file-1>
<image-file-2>
<sub-doc1.lyx>
<sub-doc2.lyx>
...
/thumbs
  <image-file-1>.thumb.png
  <image-file-2>.thumb.png
...


Internal vs External management
===============================
The .lyx file format would remain unchaged and all of the image paths would 
point
to the internal (relative) image names.  That way, if the user were to 
unzip/untar
the archive, they would be able to open document.lyx and all of its images would
point to the internal images automatically, and lyx would handle all of the 
images
and other external documents as it presently does.  However, LyX would handle 
the
external documents of .plyx files in a bit more subtle fashion, as guided by the
manifest file.

Manifest file specification
===========================
manifest.xml would contain all of the settings and whatnot necessary for 
managing
the .plyx internal files.

When LyX opens a .plyx file, it would read document.lyx and scan for all of the
internal (relative) path names.  It would then scan the manifest for all of the
external paths associated with a given internal file and display the highest
priority file that it finds.  That is, if an internal file had the highest
priority, it would be loaded and displayed by default.  If the user had a given
external file on their HD then it would be loaded and if it had a higher 
priority
than the internal file, LyX would display that instead of the internal file.

Example manifest:
--------------------------------------------------------------------------------
<plyx-manifest>
        <compiled-doc>ps</compiled-doc>
                <!-- NOTE: if no compiled document, this flag would be absent 
-->
                <!-- this flag only indicates the file extension -->
        <image path="blah.eps">
                <path priority="1" type="external">
                        ../images/blah.eps
                        <!-- relative paths are allowed -->
                </path>
                <path priority="2" type="external">
                        C:\Documents and Settings\my-name\My 
Documents\images\cow.jpg
                        <!-- absolute paths are also allowed -->
                </path>
                <path priority="3" type="internal"\>
        </image>
        <sub-doc path="chapter-1.lyx">
                <path priority="1" type="external">
                        /home/my-name/chapter-1.lyx
                </path>
                <path priority="2" type="internal"\>
        </sub-doc>
        
        <!-- for external-only, use priority=0 for the internal file -->
        <image path="bigfile.eps">
                <path priority="1" type="external">
                        /home/my-name/bigfile.eps
                </path
                <path priority="0" type="internal"\>
        </image
</plyx-manifest>
--------------------------------------------------------------------------------

In order for the user to compare internal and external images, it would be nice
for LyX to have some sort of toggle functionality (or scroll functionality), 
like
a side arrow next to the image, so that the user could view all of the images 
and
compare them by just clicking on the arrow button.  Compilation would use the
image that was in current view, not necessarily the highest priority.  When 
saved,
if the image in current view was not the internal image and the images differ,
LyX would ask if the file should replace the current internal file.


File Management
===============
When a user decides to save a .lyx file as a .plyx file, LyX would create a
temporary directory and populate it with the files as listed in the Structure
section.  The original manifest would contain paths to the original files; 
whether
the internal or external files would have higher priority could be an option.

When a user opens a .plyx file, LyX would unpack the file into a temporary di-
rectory and process the manifest file as discussed above.

Reply via email to