File tree Expand file tree Collapse file tree 3 files changed +338
-3
lines changed Expand file tree Collapse file tree 3 files changed +338
-3
lines changed Original file line number Diff line number Diff line change 5656 "dependencies" : {
5757 "@jupyterlab/application" : " ^3.4.0" ,
5858 "@jupyterlab/apputils" : " ^3.4.0" ,
59+ "@jupyterlab/codemirror" : " ^3.4.8" ,
5960 "@jupyterlab/docregistry" : " ^3.4.0" ,
6061 "@jupyterlab/filebrowser" : " ^3.4.0" ,
6162 "@jupyterlab/launcher" : " ^3.4.0" ,
6667 "@lumino/messaging" : " ^1.10.0" ,
6768 "@lumino/signaling" : " ^1.10.0" ,
6869 "@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" ,
7171 "@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"
7375 },
7476 "devDependencies" : {
7577 "@babel/core" : " ^7.0.0" ,
Original file line number Diff line number Diff line change @@ -26,6 +26,9 @@ import { UrdfWidgetFactory } from './factory';
2626
2727import { urdf_icon } from './icons' ;
2828
29+ // For syntax highlighting
30+ import { Mode } from '@jupyterlab/codemirror' ;
31+
2932// Name of the factory that creates the URDF widgets
3033const FACTORY = 'URDF Widget Factory' ;
3134
@@ -90,6 +93,14 @@ const extension: JupyterFrontEndPlugin<void> = {
9093 tracker . add ( widget ) ;
9194 } ) ;
9295
96+ // Syntax highlighting
97+ Mode . getModeInfo ( ) . push ( {
98+ name : 'URDF' ,
99+ mime : 'text/xml' ,
100+ mode : 'xml' ,
101+ ext : [ 'urdf' , 'xacro' ]
102+ } ) ;
103+
93104 // Register widget and model factories
94105 app . docRegistry . addWidgetFactory ( widgetFactory ) ;
95106
@@ -101,6 +112,7 @@ const extension: JupyterFrontEndPlugin<void> = {
101112 iconClass : 'jp-URDFIcon' ,
102113 fileFormat : 'text' ,
103114 contentType : 'file' ,
115+ mimeTypes : [ 'application/xml' , 'text/xml' ] ,
104116 icon : urdf_icon
105117 } ) ;
106118
You can’t perform that action at this time.
0 commit comments