Fancy YAML MODX abstraction

Discuss general development subjects that are not specific to a particular version like the versioning control system we use or other infrastructure.
Post Reply
User avatar
igorw
Registered User
Posts: 500
Joined: Thu Jan 04, 2007 11:47 pm

Fancy YAML MODX abstraction

Post by igorw » Sun May 09, 2010 12:43 am

XML is not fun to write by hand. You can use the MODX creator and MODX generator to do the work for you. But some people prefer to use text files. There are some projects that try to make HTML, CSS or markup in general more human friendly. Projects like Haml, Sass or SHPAML.

It would be nice to have something like that for MODX. For simplicity's sake it would use plain YAML. Why not use YAML for MODX directly? There is no good schema/validation and no stylesheets. Instead there would be an application that you can feed a YAML file and it will convert it to a MODX file.

I would however do this application using libmodx. But libmodx is really not worth the effort unless it is for MODX 2.0, imo. Using that library it should be fairly trivial to implement.

Are you interested in this? Would you use it?

Oleg
Posts: 1150
Joined: Tue Feb 23, 2010 2:38 am
Contact:

Re: Fancy YAML MODX abstraction

Post by Oleg » Sun May 09, 2010 1:03 am

I was skeptical so I converted a sample modx file using this nifty tool: http://yaml.org/xml.html

Input: http://dump.bsdpower.com/2010/05/08/install.xml
Output: http://dump.bsdpower.com/2010/05/08/install.yml

Note tab/space mix in find/replace sections. It must be impossible to get right by hand.

User avatar
igorw
Registered User
Posts: 500
Joined: Thu Jan 04, 2007 11:47 pm

Re: Fancy YAML MODX abstraction

Post by igorw » Sun May 09, 2010 1:12 am

The attributes (such as lang) can be simplified, and the whole action-group tag will of course not be in the YAML file. To clarify: this is intended for the <header> section of the MODX, or the info.xml of the MODX 2.0.

Post Reply