YAML transformations

I love YAML, and I love using YAML in ruby. Thank you Why and everyone involved.

It seems a natural thing to want to transform yaml into something else, e.g. XHTML or some other plain text format, or even more yaml with only selected pieces of the original, or renaming keys, etc. Does anything exist along those lines yet?

If not, what would you consider essential in such a tool?

Hans Fugal wrote:

I love YAML, and I love using YAML in ruby. Thank you Why and everyone involved.

It seems a natural thing to want to transform yaml into something else, e.g. XHTML or some other plain text format, or even more yaml with only selected pieces of the original, or renaming keys, etc. Does anything exist along those lines yet?

If not, what would you consider essential in such a tool?

.

I know that _why has been doing some of this, for WPGTR. And I've borrowed much of his technique for my Net::SSH and Copland manuals. However, the "transformations" only use YAML for structure, and then RedCloth for the markup. I'm not sure how you'd be able to use YAML (conveniently) for anything other than structure, though...

The transformations that I'm currently applying primarily involve converting values from one type to another (e.g., from a Hash to a Chapter). Rendering the converted data types is mostly the work of RedCloth. If you were to automate this somehow, it would be nice to be able to specify the system to use to convert content (RedCloth, BlueCloth, etc.), as well as to provide some kind of schema for automating the translation of "map" or "array" to some other type.

No concrete ideas for how to do that, though. :slight_smile: I'll leave that up to you.

- Jamis

ยทยทยท

--
Jamis Buck
jgb3@email.byu.edu
http://www.jamisbuck.org/jamis

"I use octal until I get to 8, and then I switch to decimal."

Jamis Buck wrote:

I know that _why has been doing some of this, for WPGTR. And I've borrowed much of his technique for my Net::SSH and Copland manuals. However, the "transformations" only use YAML for structure, and then RedCloth for the markup. I'm not sure how you'd be able to use YAML (conveniently) for anything other than structure, though...

I like the approach of instiki, to allow either markdown or textile, and I think such a templating system ought to employ bluecloth or redcloth configurably. (my personal preference is markdown syntax)

The transformations that I'm currently applying primarily involve converting values from one type to another (e.g., from a Hash to a Chapter). Rendering the converted data types is mostly the work of RedCloth. If you were to automate this somehow, it would be nice to be able to specify the system to use to convert content (RedCloth, BlueCloth, etc.), as well as to provide some kind of schema for automating the translation of "map" or "array" to some other type.

I personally would like to see the strengths of XSLT easily accessible, which IMHO are something like XPath and a method of matching transformations that goes from general to specific (or is otherwise predictable and simple), similar to CSS. There may be others that slip my mind; it's been awhile since I've delved into XSLT.

No concrete ideas for how to do that, though. :slight_smile: I'll leave that up to you.

If nobody has anything like this out there yet, I may be inclined to step up to the plate. Let's keep the ideas coming!