Alan,
I'm not a professional programmer per say but have been developing a Google Doc Add-on, I call CalcPad, that performs calculations similar to a program called MathCAD or SMath.
Basically the user types lines in a Doc representing a series of equations and pushes a button and voila all the equations are solved, some feeding into the next or subsequent. The "variables" can have physical units, like feet, inch, pound, etc and the program handles unit addition, multiplication etc.
My problem is I have been testing with the code in a library attached as a resource to a Doc. There is a sidebar so I also need to implement HTML Service and google.script.run to insert text from the sidebar into the Doc and run the calculation. I think it needs to be an Editor Add-on, as opposed to a Workplace Add-on, but can't figure out how to minimize the Doc Code.gs functions or simply call the library directly. By Code.gs I mean add to the Add-on menu from onOpen and a dispatcher to call the CalcPad.library functions. I'm also having trouble finding a forum to discuss this. Stackoverflow and this forum have not been helpful.
Thanks for any advice you can provide.
Screen shots of Doc input and sidebar: