This module loads an Ace editor for all textarea with
data-yaml-editor
attribute
You can use the YAML editor for Text (plain, long) fields, simply go to Manage form display and select Textarea with YAML editor.
When you need an editor for your YAML files add a data-yaml-editor
to you textarea like:
$form['config'] = [
'#type' => 'textarea',
'#title' => t('Configuration'),
'#attributes' => ['data-yaml-editor' => 'true'],
];
Here are some module which are already implementing the data-yaml-editor
attribute:
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.