in cloud 9, should the autogenerated html file contain all the css and js?

Well, it’s built on AmplifyJS, so that might be a good place to start.
http://amplifyjs.com/api/pubsub/
You could also search the javascript code for chilipeppr.publish and .subscribe , as well as at the top, you will see a section of publish and subscribe setups - these may be some good examples.

Thankyou. I am not at all familiar with amplify but it gives me a place to start.

But I could easily build an object to take gcode and the sections that are required and return a parsed object of relevant sections.
But I think there may be an easier way as John’s code already creates the gcode separately. So one approach would be to package that

@Justin_Adie ​ take a look at gcode widget in TinyG workspace as it has a pulldown for the sections. This may be an easier approach to just get the latest gcode widget into grbl workspace

Ok. Sounds like the work is already done then.