Re: [dev-context] context commands in lua-files

2010-07-17 Thread Taco Hoekwater

On 07/16/2010 04:41 PM, Peter Münster wrote:

Hello,

Here some new ideas:

http://pmrb.free.fr/tmp/context-commands/

All feedback is welcome!


FWIW, I actually like this: I find it more readable
than the XML version, and the inline descriptions and
comments are clearly helpful.

Best wishes,
Taco
___
dev-context mailing list
dev-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/dev-context


Re: [dev-context] context commands in lua-files

2010-07-17 Thread luigi scarso
On Fri, Jul 16, 2010 at 4:41 PM, Peter Münster pmli...@free.fr wrote:

 Hello,

 Here some new ideas:

 http://pmrb.free.fr/tmp/context-commands/

 All feedback is welcome!

 Cheers, Peter

 --
 Contact information: http://pmrb.free.fr/contact/


 ___
 dev-context mailing list
 dev-context@ntg.nl
 http://www.ntg.nl/mailman/listinfo/dev-context

Why don't put them into a table as is in
http://www.lua.org/pil/10.1.html
For exampl e placefloat.lua should be
placefloat ={
props = {
generated = true,   -- default = false
fixpart = place,
varpart = float,
generator = definefloat,
categories = {Structure, Graphic}
-- first category is main category, in the other categories, there are
-- just references
}
-- ... more data
}

It's very powerful then to manage this file with lua functions.


-- 
luigi
___
dev-context mailing list
dev-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/dev-context


Re: [dev-context] context commands in lua-files

2010-07-17 Thread Peter Münster
On Sat, Jul 17 2010, luigi scarso wrote:

 Why don't put them into a table as is in
 http://www.lua.org/pil/10.1.html
 For exampl e placefloat.lua should be
 placefloat ={
 props = {
 [...]

Because I like to avoid redundancy.

It's easy to do things like this automatically:

local placefloat = {}
setfenv(0, placefloat)
dofile(placefloat.lua)
setfenv(0, _G)
print(placefloat.props.fixpart)


Or like this:

placefloat.lua:

entry = {   -- or command
  props = ...,
  args = ...,
  ...
}

And then:

local commands = {}
dofile(placefloat.lua)
commands.placefloat = entry (or command)
print(placefloat.props.fixpart)

Cheers, Peter

-- 
Contact information: http://pmrb.free.fr/contact/


___
dev-context mailing list
dev-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/dev-context


Re: [dev-context] context commands in lua-files

2010-07-17 Thread Mojca Miklavec
On Fri, Jul 16, 2010 at 16:41, Peter Münster pmli...@free.fr wrote:
 Hello,

 Here some new ideas:

 http://pmrb.free.fr/tmp/context-commands/

Wow! I like it very much.

Mojca
___
dev-context mailing list
dev-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/dev-context


Re: [dev-context] context commands in lua-files

2010-07-17 Thread Peter Münster
On Sat, Jul 17 2010, luigi scarso wrote:

 Why don't put them into a table as is in
 http://www.lua.org/pil/10.1.html

Ok, now one file defines exactly one command table.
I added also other minor enhancements.

Cheers, Peter

-- 
Contact information: http://pmrb.free.fr/contact/


___
dev-context mailing list
dev-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/dev-context


Re: [dev-context] context commands in lua-files

2010-07-17 Thread Hans Hagen

On 17-7-2010 7:39, Mojca Miklavec wrote:

On Fri, Jul 16, 2010 at 16:41, Peter Münsterpmli...@free.fr  wrote:

Hello,

Here some new ideas:

http://pmrb.free.fr/tmp/context-commands/


Wow! I like it very much.


i'll come back to this later, just a few comments now:

- props - properties (or whatever, but no shortcuts)
- args - arguments
- [=[ looks rather bad but anyhow, examples should probably not be done 
this way (examples can be go into tex files)


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
dev-context mailing list
dev-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/dev-context