I want to make editing/creating TYPO3.Fluid files scriptable in a semantic fashion. I do not want line based editing. It's got to be able to insert elements (html, fluid, etc) at particular positions without mangling the syntax/semantics and spacing of the file.
This is my design for the "script" on the backend:
- The script will be a DSL (TYPO3.Eel and FlowQuery strings stored in YAML files).
- The TYPO3.Eel objects will map to
- querypath/QueryPath functions (see also http://querypath.org)
- lambda/callback functions won't be accessible from within Eel.
- additional Fluid creation/editing functions
- additional functions to find/load/select files (possibly a selection of files from a boilerplate package like zurb foundation or html5bp+bootstrap)
- I will use a version of QueryPath that uses masterminds/html5 (QueryPath 3.x includes this)
Once I've got this down, then I'll extend my app to edit other filetypes, including php, typoscript, stylesheets (css, sass, less, etc), javascript, yaml, and whatever else people might want to edit. All they have to do is add a library that understands the semantics of the filetype and provides a fluent interface (or at least uses method chaining) for searching/editing the file in a jquery-like manner. It'll use the same DSL (FlowQuery in Eel in YAML). Hopefully, I'll be able to jump from editing one kind of document to editing another, as different documenttypes are embedded in each other (eg SVG, MathML, CSS, and JavaScript are all easily embedded in HTML)