1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- require_once(__DIR__.SLASH.'ReadmeType.class.php');
- class PythonType extends ReadmeType{
- public static function manifest(){
- return array(
- 'uid' => 'python',
- 'label' => 'Python',
- 'icon' => 'fab fa-python',
- 'color' => '#ffffff',
- 'background' => '#FFD43B',
- 'description' => 'Fichier contenant du langage Python',
- 'fromExtension' => array('py'),
- 'toExtension' => 'py',
- 'default' => 'print("Hello python")',
- );
- }
- /* 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 : 'python',
- lineNumbers : true,
- theme : 'monokai',
- readOnly : false
- });
- "
- );
- }
-
- }
- ?>
|