McStasMcXtrace / McCode

The home of the McStas (neutrons) and McXtrace (x-rays) Monte-Carlo ray-tracing instrument simulation codes.
https://github.com/McStasMcXtrace/McCode/wiki
GNU General Public License v3.0
77 stars 53 forks source link

mcdoc / web-editor innovation idea #1142

Open willend opened 2 years ago

willend commented 2 years ago

To go in the direction of an actual "web-editor", one could imagine this relatively simple extension to mcdoc:

A small javascript / form-based code embedded in every component page that would allow generating a relevant COMPONENT instance for an instrument, think of this as an alternative "component insertion dialogue".

One way to implement this would be an extra column in the parameter-table plus boxes for instance-name, AT - ROTATED placement and a "create" button -> sending the generated code to the clipboard.

Mockup illustration will be added as a comment below.

willend commented 2 years ago

Mockup

willend commented 2 years ago

https://www.w3schools.com/howto/howto_js_copy_clipboard.asp

willend commented 2 years ago

Semi-functional hand-written draft Source_simple2.html.txt

willend commented 2 years ago

Mostly works (!!!)

Source_simple3.html.txt

willend commented 2 years ago

This demonstrates the basic functionality.

Should be ported to become auto-generated via mcdoc.py Source_simple4.html.txt

willend commented 2 years ago

Direct link to web-served prototype: http://tmp.mcstas.org/Source_simple4.html