* ini -> C -> lua -> context -> pdf
@ 2008-02-22 8:26 Peter Münster
2008-02-22 10:19 ` Hans Hagen
0 siblings, 1 reply; 5+ messages in thread
From: Peter Münster @ 2008-02-22 8:26 UTC (permalink / raw)
To: ConTeXt list
Hello,
I have to convert an "ini"-file to pdf. On the one hand, it's easy for me
to do most things in C, on the other hand, I would like to enlarge my
experience with lua and ConTeXt.
So here my question to the experts: what languages would you use for the
different tasks?
In fact, I believe lua could do a good job for some tasks, but I'm not
really sure.
Here the details:
Example "ini"-file with 2 entries (the real file has about 200 entries):
[temp_room]
comment = the room temperature in °C
description = This value must be sent at least once per 15 minutes, \
but only if a local sensor is connected to the device.
size = 16
channel = master
fb = RTS
dpt = 2.009
dir = o
[power]
comment = the actual power available in %
description = This value is only used to calculate the energy \
consumption.
size = 8
channel = slave
fb = HVA
dpt = 4.307
dir = i
The tasks:
- put theses entries into a structured table (easy to do in C and the
iniparser library http://ndevilla.free.fr/iniparser/ but it could be nice
to do it in lua)
- sorting (several PDF-documents with different sorting: by name, size,
channel or other values)
- filtering, for example _ must be converted to \_ and % to \% (same
question: C, lua or ConTeXt)
- formatting with nice layout (certainly with ConTeXt)
For example, the first entry could become:
1.) temp_room, the room temperature in °C
-----------------------------------------
______________________________________________________________________
| Master | RTS | Output with datapoint type 2.009 (16 bits) |
|___________|_________|______________________________________________|
This value must be sent at least once per 15 minutes, but only if a
local sensor is connected to the device.
(Until now, I've coded just one line of lua-code in my life...)
Perhaps, with your help, the subject line could become:
ini -> MKIV -> pdf
Thanks in advance for any hints and encouragements!
Cheers, Peter
--
http://pmrb.free.fr/contact/
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: ini -> C -> lua -> context -> pdf
2008-02-22 8:26 ini -> C -> lua -> context -> pdf Peter Münster
@ 2008-02-22 10:19 ` Hans Hagen
2008-02-22 18:49 ` Peter Münster
0 siblings, 1 reply; 5+ messages in thread
From: Hans Hagen @ 2008-02-22 10:19 UTC (permalink / raw)
To: ConTeXt list
Peter Münster wrote:
> - put theses entries into a structured table (easy to do in C and the
> iniparser library http://ndevilla.free.fr/iniparser/ but it could be nice
> to do it in lua)
this kind of parsing is rather trival in lua
> - sorting (several PDF-documents with different sorting: by name, size,
> channel or other values)
sorting is also easy
> - filtering, for example _ must be converted to \_ and % to \% (same
> question: C, lua or ConTeXt)
depends, if the font has _ no conversion is needed (otf fonts have this)
> - formatting with nice layout (certainly with ConTeXt)
ini parsing ... look into string.find; loop over the lines and triugger
on [...] and ...=...
Hans
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
| www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: ini -> C -> lua -> context -> pdf
2008-02-22 10:19 ` Hans Hagen
@ 2008-02-22 18:49 ` Peter Münster
2008-02-22 20:14 ` Aditya Mahajan
2008-02-22 20:48 ` Hans Hagen
0 siblings, 2 replies; 5+ messages in thread
From: Peter Münster @ 2008-02-22 18:49 UTC (permalink / raw)
To: mailing list for ConTeXt users
On Fri, Feb 22 2008, Hans Hagen wrote:
> > - filtering, for example _ must be converted to \_ and % to \% (same
> > question: C, lua or ConTeXt)
>
> depends, if the font has _ no conversion is needed (otf fonts have this)
Since I'm using MKIV, I think the default font should be the lm otf
version, isn't it?
What setup is needed, to make "_" behave like a real underscore?
> ini parsing ... look into string.find; loop over the lines and triugger
> on [...] and ...=...
Thanks, I've spent some minutes today looking into the string, io and table
libraries, and indeed lua looks very powerful.
Perhaps, this will result in a module.
Cheers, Peter
--
http://pmrb.free.fr/contact/
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: ini -> C -> lua -> context -> pdf
2008-02-22 18:49 ` Peter Münster
@ 2008-02-22 20:14 ` Aditya Mahajan
2008-02-22 20:48 ` Hans Hagen
1 sibling, 0 replies; 5+ messages in thread
From: Aditya Mahajan @ 2008-02-22 20:14 UTC (permalink / raw)
To: ntg-context
Quoting Peter Münster <pmlists@free.fr>:
> On Fri, Feb 22 2008, Hans Hagen wrote:
>
>> > - filtering, for example _ must be converted to \_ and % to \% (same
>> > question: C, lua or ConTeXt)
>>
>> depends, if the font has _ no conversion is needed (otf fonts have this)
>
> Since I'm using MKIV, I think the default font should be the lm otf
> version, isn't it?
> What setup is needed, to make "_" behave like a real underscore?
\nonknuthmode (and there is \donknuthmode to get the default behaviour)
Aditya
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: ini -> C -> lua -> context -> pdf
2008-02-22 18:49 ` Peter Münster
2008-02-22 20:14 ` Aditya Mahajan
@ 2008-02-22 20:48 ` Hans Hagen
1 sibling, 0 replies; 5+ messages in thread
From: Hans Hagen @ 2008-02-22 20:48 UTC (permalink / raw)
To: mailing list for ConTeXt users
Peter Münster wrote:
> On Fri, Feb 22 2008, Hans Hagen wrote:
>
>>> - filtering, for example _ must be converted to \_ and % to \% (same
>>> question: C, lua or ConTeXt)
>> depends, if the font has _ no conversion is needed (otf fonts have this)
>
> Since I'm using MKIV, I think the default font should be the lm otf
> version, isn't it?
> What setup is needed, to make "_" behave like a real underscore?
\nonknuthmode
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
| www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-02-22 20:48 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-22 8:26 ini -> C -> lua -> context -> pdf Peter Münster
2008-02-22 10:19 ` Hans Hagen
2008-02-22 18:49 ` Peter Münster
2008-02-22 20:14 ` Aditya Mahajan
2008-02-22 20:48 ` Hans Hagen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).