123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- require_once(__DIR__.SLASH.'..'.SLASH.'..'.SLASH.'hackpoint'.SLASH.'types'.SLASH.'ReadmeType.class.php');
- class YamlType extends ReadmeType{
- public static function manifest(){
- return array(
- 'uid' => 'yaml',
- 'label' => 'YAML',
- 'icon' => 'fas fa-indent',
- 'color' => '#ffffff',
- 'background' => '#222222',
- 'description' => 'Structure YAML',
- 'fromExtension' => array('yaml','yml'),
- 'toExtension' => 'yml',
- 'default' => 'web:
- - restart: with-hackpoint-only',
- );
- }
- /* EDITION */
- public static function toHtml($resource,$sketch=null){
- $infos = self::manifest();
- return array(
- 'html'=>'<textarea id="content" onblur="hackpoint_resource_save_content()" class="arduino-text">'.$resource->content.'</textarea>',
- 'javascript' => "
- hackpoint_resource_mirrorify('.arduino-text',{
- mode : 'text/x-yaml',
- lineNumbers : true,
- theme : 'monokai',
- readOnly : false
- });
- "
- );
- }
-
- }
- ?>
|