File tree 3 files changed +338
-3
lines changed 3 files changed +338
-3
lines changed Original file line number Diff line number Diff line change 56
56
"dependencies" : {
57
57
"@jupyterlab/application" : " ^3.4.0" ,
58
58
"@jupyterlab/apputils" : " ^3.4.0" ,
59
+ "@jupyterlab/codemirror" : " ^3.4.8" ,
59
60
"@jupyterlab/docregistry" : " ^3.4.0" ,
60
61
"@jupyterlab/filebrowser" : " ^3.4.0" ,
61
62
"@jupyterlab/launcher" : " ^3.4.0" ,
66
67
"@lumino/messaging" : " ^1.10.0" ,
67
68
"@lumino/signaling" : " ^1.10.0" ,
68
69
"@lumino/widgets" : " ^1.30.0" ,
69
- "amphion" : " npm:@robostack/amphion@^0.1.25" ,
70
- "roslib" : " npm:@robostack/roslib@^1.1.1" ,
70
+ "@types/codemirror" : " ^5.60.5" ,
71
71
"@types/dat.gui" : " ^0.7.7" ,
72
- "dat.gui" : " ^0.7.9"
72
+ "amphion" : " npm:@robostack/amphion@^0.1.25" ,
73
+ "dat.gui" : " ^0.7.9" ,
74
+ "roslib" : " npm:@robostack/roslib@^1.1.1"
73
75
},
74
76
"devDependencies" : {
75
77
"@babel/core" : " ^7.0.0" ,
Original file line number Diff line number Diff line change @@ -26,6 +26,9 @@ import { UrdfWidgetFactory } from './factory';
26
26
27
27
import { urdf_icon } from './icons' ;
28
28
29
+ // For syntax highlighting
30
+ import { Mode } from '@jupyterlab/codemirror' ;
31
+
29
32
// Name of the factory that creates the URDF widgets
30
33
const FACTORY = 'URDF Widget Factory' ;
31
34
@@ -90,6 +93,14 @@ const extension: JupyterFrontEndPlugin<void> = {
90
93
tracker . add ( widget ) ;
91
94
} ) ;
92
95
96
+ // Syntax highlighting
97
+ Mode . getModeInfo ( ) . push ( {
98
+ name : 'URDF' ,
99
+ mime : 'text/xml' ,
100
+ mode : 'xml' ,
101
+ ext : [ 'urdf' , 'xacro' ]
102
+ } ) ;
103
+
93
104
// Register widget and model factories
94
105
app . docRegistry . addWidgetFactory ( widgetFactory ) ;
95
106
@@ -101,6 +112,7 @@ const extension: JupyterFrontEndPlugin<void> = {
101
112
iconClass : 'jp-URDFIcon' ,
102
113
fileFormat : 'text' ,
103
114
contentType : 'file' ,
115
+ mimeTypes : [ 'application/xml' , 'text/xml' ] ,
104
116
icon : urdf_icon
105
117
} ) ;
106
118
You can’t perform that action at this time.
0 commit comments