I miss the definition of a fusionDoc standard - documentation is important for reusability, and as many developers don’t read or write separate documentations , there should be a standard for Fusion like phpDoc for PHP.
there is Atomic Fusion Proptypes and I learned recently, this only works for Components but for everything else it could at least be used as documentation…
and when looking at the core Fusion prototypes, not every prototype has comments and when there are, only some properties are documented with comments in the fusion code but others are just documented in the docBlock of the PHP class - I think all the API properties/paths should be documented in the Fusion code
/**
* Render each item in items using itemRenderer.
*/
prototype(Neos.Fusion:Loop) {
# The array or iterable to iterate over
items = null
items.@type = ${PropTypes.Iterable}
# Context variable name for each item
itemName = 'item'
itemName.@type = ${PropTypes.string}
# Context variable name for each item key, when working with array
itemKey = 'itemKey'
itemKey.@type = ${PropTypes.string}
}
if the above would not work or not be performant enough, it could also be written like that using the existing propTypes logic
/**
* Render each item in items using itemRenderer.
*/
prototype(Neos.Fusion:Loop) {
# The array or iterable to iterate over
items = null
@propTypes.items = ${PropTypes.Iterable}
# Context variable name for each item
itemName = 'item'
@propTypes.itemName = ${PropTypes.string}
# Context variable name for each item key, when working with array
itemKey = 'itemKey'
@propTypes.itemKey = ${PropTypes.string}
}
eventually a Fusion reference could be compiled from the fusionDoc.