String Input Example ==================== Location: ``examples/webapp/string/`` This example demonstrates the ```` input type for both single-line and multi-line text entry. The ```` element controls textarea dimensions. tool.xml -------- .. code-block:: xml string (rappture2web) python3 @tool/run_string.py @driver Text used as the title for all plots. untitled Control file for the program. EXAMPLE: .print ac vm(11) mag(i(vcc)) 40x10 Enter your SPICE commands in this area. Script ------ .. code-block:: python import sys import rappture2web.rp_library as Rappture rx = Rappture.PyXml(sys.argv[1]) title = rx['input.(title).current'].value indeck = rx['input.(indeck).current'].value rx['output.string(outt).about.label'] = 'Echo of title' rx['output.string(outt).current'] = title rx['output.string(outi).about.label'] = 'Echo of input' rx['output.string(outi).current'] = indeck rx.close() Key concepts ------------ - ``40x10`` creates a multi-line textarea (40 cols x 10 rows). - Without ````, the string renders as a single-line input. - ```` draws a horizontal divider between inputs. - ```` provides a help tooltip for the input. Running ------- .. code-block:: bash rappture2web examples/webapp/string/