Re: LyX2YAML: was Re: Word won't open simplest LyXHTML file

2013-01-23 Thread Nico Williams
On Wed, Jan 23, 2013 at 1:57 PM, Steve Litt sl...@troubleshooters.com wrote:
 On Wed, 23 Jan 2013 15:15:15 + (UTC), Guenter Milde said:
 Please don't be discouraged to continue the work on and publication of
 the lyx2xml script. I think it is a useful addition to LyX.

 I have a question for you...

 When is somebody going to write a lyx2yaml script?

 Another question: Instead of having LyX's native format being
 human-opaque XML, why not make it YAML, the ultimate in human
 readability and writeability?

I want XML because of XSLT (and XPath, and XQuery): I can write XSLs
to convert from one schema to another, and this then gets to be
completely external to LyX.  If the LyX XML schema changes, of course,
the XSLs need updating, but it's XSLT code, not C++ or what have you
-- it's a simpler update.  It's more than that.  You can serve XML and
XSLs from some web server and let the browser apply the XSLs to create
XHTML.  And more.  There's lots of databases that specialize in XML
documents and make it easy to search them in regular ways (i.e., with
XPath or XQuery).  I'm probably only scratching the surface here.

Also, properly formatted XML is not human-opaque, but merely annoying.

Don't get me wrong: I'm *not* a fan of XML.  I'm a fan of the DSLs and
tooling that has been built around XML, which -for me- overcome the
downsides to XML itself.

Of course, if our world had been built on programming languages with
hygienic macro facilities with all the power expect of a Scheme, then
we could write these DSLs as needed.  XML is so much wheel
re-invention, but there's a ton of value in standardizing these DSLs:
you can write portable code in them, and you need only know those
standard DSLs instead of having to learn and hack on ad-hoc DSLs.

In a sense YAML saddens me: it's even more wheel re-invention, but
without the DSLs to go with it that XML has.  Why would I want this
for any purpose other than UI?  And why would I want it even for that
purpose when LyX *is* the UI?

 http://en.wikipedia.org/wiki/Yaml

I don't really care what it is as long as there's a trivial,
*lossless* mapping onto XML.  (My script's translation of .lyx to XML
is lossless, though the return trip will not obtain the same original
.lyx because some things in .lyx content need to get normalized in the
conversion to XML.  But no data and metadata get lost in the
conversion.)

 As I understand, the LyX project's preferred scripting language is
 Python, and PyYaml is an excellent YAML parser and emitter.

 I don't have time or knowledge to write a lyx2yaml script, but if
 somebody else takes the captain's chair, I'll for sure help.

Well, there's http://yaxml.rubyforge.org/ , which is a tool that
converts between (in both directions) YAXML and YAML.  Pair this with
my lyx2xml script and you have a way to convert to YAML.

I don't think converting directly from .lyx to YAML is going to be any
easier than converting directly to XML is, but if it's *as* easy then
FYI you'll still run into pretty much the same issues I did in
lyx2xml.

Nico
--


Re: LyX2YAML: was Re: Word won't open simplest LyXHTML file

2013-01-23 Thread Steve Litt
On Wed, 23 Jan 2013 14:20:57 -0600, Nico Williams said:

 Well, there's http://yaxml.rubyforge.org/ , which is a tool that
 converts between (in both directions) YAXML and YAML.  Pair this with
 my lyx2xml script and you have a way to convert to YAML.

Well cool, I guess that's one less program I have to write. How close
to finished is your converter?

Thanks

SteveT

Steve Litt*  http://www.troubleshooters.com/
  *  http://twitter.com/stevelitt
Troubleshooting Training  *  Human Performance



Re: LyX2YAML: was Re: Word won't open simplest LyXHTML file

2013-01-23 Thread Nico Williams
On Wed, Jan 23, 2013 at 5:01 PM, Steve Litt sl...@troubleshooters.com wrote:
 On Wed, 23 Jan 2013 14:20:57 -0600, Nico Williams said:

 Well, there's http://yaxml.rubyforge.org/ , which is a tool that
 converts between (in both directions) YAXML and YAML.  Pair this with
 my lyx2xml script and you have a way to convert to YAML.

 Well cool, I guess that's one less program I have to write. How close
 to finished is your converter?

It... works.  For that subset of LyX that I use.  This includes
tables, but not math (someone needs to port to Python the
LaTeX-MathML code that can be found all over), and who knows what
else.

You can find it at
https://github.com/nicowilliams/lyx/tree/lyxml/lib/lyx2lyx  -- look
for lyx2xml*.  Forgive the sloppy code.

If this is of use to you and you need more features and want to
contribute them, or maybe tell me what they'd be...  we can make this
better.

Nico
--


Re: LyX2YAML: was Re: Word won't open simplest LyXHTML file

2013-01-23 Thread Nico Williams
On Wed, Jan 23, 2013 at 1:57 PM, Steve Litt sl...@troubleshooters.com wrote:
 On Wed, 23 Jan 2013 15:15:15 + (UTC), Guenter Milde said:
 Please don't be discouraged to continue the work on and publication of
 the lyx2xml script. I think it is a useful addition to LyX.

 I have a question for you...

 When is somebody going to write a lyx2yaml script?

 Another question: Instead of having LyX's native format being
 human-opaque XML, why not make it YAML, the ultimate in human
 readability and writeability?

I want XML because of XSLT (and XPath, and XQuery): I can write XSLs
to convert from one schema to another, and this then gets to be
completely external to LyX.  If the LyX XML schema changes, of course,
the XSLs need updating, but it's XSLT code, not C++ or what have you
-- it's a simpler update.  It's more than that.  You can serve XML and
XSLs from some web server and let the browser apply the XSLs to create
XHTML.  And more.  There's lots of databases that specialize in XML
documents and make it easy to search them in regular ways (i.e., with
XPath or XQuery).  I'm probably only scratching the surface here.

Also, properly formatted XML is not human-opaque, but merely annoying.

Don't get me wrong: I'm *not* a fan of XML.  I'm a fan of the DSLs and
tooling that has been built around XML, which -for me- overcome the
downsides to XML itself.

Of course, if our world had been built on programming languages with
hygienic macro facilities with all the power expect of a Scheme, then
we could write these DSLs as needed.  XML is so much wheel
re-invention, but there's a ton of value in standardizing these DSLs:
you can write portable code in them, and you need only know those
standard DSLs instead of having to learn and hack on ad-hoc DSLs.

In a sense YAML saddens me: it's even more wheel re-invention, but
without the DSLs to go with it that XML has.  Why would I want this
for any purpose other than UI?  And why would I want it even for that
purpose when LyX *is* the UI?

 http://en.wikipedia.org/wiki/Yaml

I don't really care what it is as long as there's a trivial,
*lossless* mapping onto XML.  (My script's translation of .lyx to XML
is lossless, though the return trip will not obtain the same original
.lyx because some things in .lyx content need to get normalized in the
conversion to XML.  But no data and metadata get lost in the
conversion.)

 As I understand, the LyX project's preferred scripting language is
 Python, and PyYaml is an excellent YAML parser and emitter.

 I don't have time or knowledge to write a lyx2yaml script, but if
 somebody else takes the captain's chair, I'll for sure help.

Well, there's http://yaxml.rubyforge.org/ , which is a tool that
converts between (in both directions) YAXML and YAML.  Pair this with
my lyx2xml script and you have a way to convert to YAML.

I don't think converting directly from .lyx to YAML is going to be any
easier than converting directly to XML is, but if it's *as* easy then
FYI you'll still run into pretty much the same issues I did in
lyx2xml.

Nico
--


Re: LyX2YAML: was Re: Word won't open simplest LyXHTML file

2013-01-23 Thread Steve Litt
On Wed, 23 Jan 2013 14:20:57 -0600, Nico Williams said:

 Well, there's http://yaxml.rubyforge.org/ , which is a tool that
 converts between (in both directions) YAXML and YAML.  Pair this with
 my lyx2xml script and you have a way to convert to YAML.

Well cool, I guess that's one less program I have to write. How close
to finished is your converter?

Thanks

SteveT

Steve Litt*  http://www.troubleshooters.com/
  *  http://twitter.com/stevelitt
Troubleshooting Training  *  Human Performance



Re: LyX2YAML: was Re: Word won't open simplest LyXHTML file

2013-01-23 Thread Nico Williams
On Wed, Jan 23, 2013 at 5:01 PM, Steve Litt sl...@troubleshooters.com wrote:
 On Wed, 23 Jan 2013 14:20:57 -0600, Nico Williams said:

 Well, there's http://yaxml.rubyforge.org/ , which is a tool that
 converts between (in both directions) YAXML and YAML.  Pair this with
 my lyx2xml script and you have a way to convert to YAML.

 Well cool, I guess that's one less program I have to write. How close
 to finished is your converter?

It... works.  For that subset of LyX that I use.  This includes
tables, but not math (someone needs to port to Python the
LaTeX-MathML code that can be found all over), and who knows what
else.

You can find it at
https://github.com/nicowilliams/lyx/tree/lyxml/lib/lyx2lyx  -- look
for lyx2xml*.  Forgive the sloppy code.

If this is of use to you and you need more features and want to
contribute them, or maybe tell me what they'd be...  we can make this
better.

Nico
--


Re: LyX2YAML: was Re: Word won't open simplest LyXHTML file

2013-01-23 Thread Nico Williams
On Wed, Jan 23, 2013 at 1:57 PM, Steve Litt  wrote:
> On Wed, 23 Jan 2013 15:15:15 + (UTC), Guenter Milde said:
>> Please don't be discouraged to continue the work on and publication of
>> the lyx2xml script. I think it is a useful addition to LyX.
>
> I have a question for you...
>
> When is somebody going to write a lyx2yaml script?
>
> Another question: Instead of having LyX's native format being
> human-opaque XML, why not make it YAML, the ultimate in human
> readability and writeability?

I want XML because of XSLT (and XPath, and XQuery): I can write XSLs
to convert from one schema to another, and this then gets to be
completely external to LyX.  If the LyX XML schema changes, of course,
the XSLs need updating, but it's XSLT code, not C++ or what have you
-- it's a simpler update.  It's more than that.  You can serve XML and
XSLs from some web server and let the browser apply the XSLs to create
XHTML.  And more.  There's lots of databases that specialize in XML
documents and make it easy to search them in regular ways (i.e., with
XPath or XQuery).  I'm probably only scratching the surface here.

Also, properly formatted XML is not human-opaque, but merely annoying.

Don't get me wrong: I'm *not* a fan of XML.  I'm a fan of the DSLs and
tooling that has been built around XML, which -for me- overcome the
downsides to XML itself.

Of course, if our world had been built on programming languages with
hygienic macro facilities with all the power expect of a Scheme, then
we could write these DSLs as needed.  XML is so much wheel
re-invention, but there's a ton of value in standardizing these DSLs:
you can write portable code in them, and you need only know those
standard DSLs instead of having to learn and hack on ad-hoc DSLs.

In a sense YAML saddens me: it's even more wheel re-invention, but
without the DSLs to go with it that XML has.  Why would I want this
for any purpose other than UI?  And why would I want it even for that
purpose when LyX *is* the UI?

> http://en.wikipedia.org/wiki/Yaml

I don't really care what it is as long as there's a trivial,
*lossless* mapping onto XML.  (My script's translation of .lyx to XML
is lossless, though the return trip will not obtain the same original
.lyx because some things in .lyx content need to get normalized in the
conversion to XML.  But no data and metadata get lost in the
conversion.)

> As I understand, the LyX project's preferred scripting language is
> Python, and PyYaml is an excellent YAML parser and emitter.
>
> I don't have time or knowledge to write a lyx2yaml script, but if
> somebody else takes the captain's chair, I'll for sure help.

Well, there's http://yaxml.rubyforge.org/ , which is a tool that
converts between (in both directions) YAXML and YAML.  Pair this with
my lyx2xml script and you have a way to convert to YAML.

I don't think converting directly from .lyx to YAML is going to be any
easier than converting directly to XML is, but if it's *as* easy then
FYI you'll still run into pretty much the same issues I did in
lyx2xml.

Nico
--


Re: LyX2YAML: was Re: Word won't open simplest LyXHTML file

2013-01-23 Thread Steve Litt
On Wed, 23 Jan 2013 14:20:57 -0600, Nico Williams said:

> Well, there's http://yaxml.rubyforge.org/ , which is a tool that
> converts between (in both directions) YAXML and YAML.  Pair this with
> my lyx2xml script and you have a way to convert to YAML.

Well cool, I guess that's one less program I have to write. How close
to finished is your converter?

Thanks

SteveT

Steve Litt*  http://www.troubleshooters.com/
  *  http://twitter.com/stevelitt
Troubleshooting Training  *  Human Performance



Re: LyX2YAML: was Re: Word won't open simplest LyXHTML file

2013-01-23 Thread Nico Williams
On Wed, Jan 23, 2013 at 5:01 PM, Steve Litt  wrote:
> On Wed, 23 Jan 2013 14:20:57 -0600, Nico Williams said:
>
>> Well, there's http://yaxml.rubyforge.org/ , which is a tool that
>> converts between (in both directions) YAXML and YAML.  Pair this with
>> my lyx2xml script and you have a way to convert to YAML.
>
> Well cool, I guess that's one less program I have to write. How close
> to finished is your converter?

It... works.  For that subset of LyX that I use.  This includes
tables, but not math (someone needs to port to Python the
LaTeX->MathML code that can be found all over), and who knows what
else.

You can find it at
https://github.com/nicowilliams/lyx/tree/lyxml/lib/lyx2lyx  -- look
for lyx2xml*.  Forgive the sloppy code.

If this is of use to you and you need more features and want to
contribute them, or maybe tell me what they'd be...  we can make this
better.

Nico
--