On Sat, 31 Jul 1999, Yoni Elhanani wrote:
> Hello.
Hello.
>
> I am not familiar with LyX sources, (I'm barely familiar with LyX
> itself) but last night I peeked around, and noticed that LyX uses
> layout files for commands and enviroment (and command-enviroment such
> as a list), but insets are hardcoded.
[snipped summary of many of our less well documented future plans]
> I think that moving all functionality into a ".layout" type of files
> will allow more flexibility in the future, and it will be much easier
> to add new things.
Excellent! Up to this point in your email your descriptions match many of
our future plans. I don't think we've actually got a design document for
the layout files in the lyx cvs but we have had several discussions on the
list in the last 12 months about a number of areas that the layout files
need to be extended in.
Two areas you didn't cover are document structure enforcement (I
couldn't think of a better term so I'll use DSE in future) and scripting.
DSE is about knowing what types of paragraphs can appear in different
places in a document -- not just the required ordering like Title at the
front and so on but what paragraph styles can appear in other paragraph
styles (can a footnote appear in section for example?). This info would
be a cutdown version of that provided in a DTD for example.
Scripting is the likely way we'll be able to achieve these grand plans.
Much of the intelligence for handling a particular document class can be
put into the layout files themselves. I'd say we'll end up with a
combination of scripting and our current layout format in future.
> This can also be the case for per-document settings. A file containing
> many special cases and their latex commands (ie: DraftCopy =
> "\usepackage[sideoptions]{draftcopy}). The cases will be checkboxes
> and inputs on the "document layout" page. Again - this can make LyX
> very flexible in the future.
This is an interesting idea. I think John Weiss proposed a scheme that
could be extended to support something like this. He proposed a generic
popup that could be "programmed" from within the layout files and used for
entering the paragraph style specific data such as the optional arguement
fields and was mostly aimed at the standard paragraph styles not other
external packages.
You may also have noticed that we have support for certain packages
hardcoded in LyX (geometry.sty for example). Hmmm... it would be an
interesting exercise to come up with a scheme for packages similar to that
for layouts. Packages though would definitely need some scripting
support.
> Tell me what you think. (maybe it's very stupid and you've discussed
> it before, but again, I think it can add a lot)
We have discussed much of this and they are not stupid ideas. Thank you
for independently arriving at many of the same conclusions and thanks
for sharing these ideas.
When can you start?
You are most welcome to familiarize yourself with the sources and help us
get the layout changes underway in the development branch. You'll need to
checkout the 'lyx' cvs tree to do that. What is probably even more
necessary at present is to skim through the past discussions and create a
design document or two. Scripting and layouts have been recurring topics
of conversation for the last 18 months but I don't think any of the
developers has actually gathered this info together.
As far a scripting goes we seem to have settled on siod
(scheme-in-one-defun) as the default scripting language but will also
provide hooks so other languages like Python can be used.
Allan. (ARRae)