sdocp('interface.js.sdoc', 'Self-modifying Perl web interface | Spencer Tipping\nLicensed under the terms of the MIT source code license\n\nIntroduction.\nThis interface lets users open self-modifying Perl files as web pages. Attributes will be shown in a list, and each one can be expanded to show its value.\n\ntypeof loaded === \'undefined\' &&\ncaterwaul.clone(\'std seq continuation montenegro\')(function ($) {\n  loaded = true;\n  $(fn_[$(\'head\').append($(\'link\')),\n        $(\'body\').empty().append(loading_interface),\n        setTimeout(_, 100) /cps[$(\'body\').empty().append(the_interface())],\n\n  where*[original_html           = $(\'body\').html(),\n         loading_interface       = html[h1(\'parsing object state...\')],\n\n         partition(name, xs)     = html[div.partition(h1.namespace(name), div.attributes)] /se[_.find(\'.attributes\').append(seq[sp[xs] *[attribute(_[0], _[1])]])],\n         attribute(name, value)  = html[div.attribute(a.name(name), pre.contents /text(value) /css({display: \'none\'}))] /se[\n                                   _.find(\'.name\').clickable(fn_[_.children(\'.contents\').toggle()])],\n\n         namespace_sections(ps)  = seq[sp[ps] *[partition(_[0], _[1])]],\n\n         the_interface()         = l*[model             = parse_attributes(original_html),\n\n                                      description       = l[description = model.data.description         /re[_ ? html[pre /text(_)] :\n                                                                          model.data[\'description.html\'] /re[_ ? html[div(_)]       : \'[no description specified]\']]] in\n                                                          html[div.description(h1(\'Description\'), description)],\n\n                                      instructions      = html[h1(\'Usage instructions\'),\n                                                               p(\'This HTML file is also a valid Perl script that can rewrite itself to update its state. (See "\',\n                                                                 a(\'writing self-modifying Perl\') *href(\'http://github.com/spencertipping/writing-self-modifying-perl\') *target(\'_blank\'),\n                                                                 \'" for an explanation of how it works.) \',\n                                                                 \'This web interface shows you which attributes have been defined. You can modify the attributes by running the script \' +\n                                                                 \'on the command line.\'),\n                                                               ol(li(\'Set the executable bit of the script: \', code(\'chmod u+x script-name.html\')),\n                                                                  li(\'Open a REPL session: \', code(\'./script-name.html shell\')),\n                                                                  li(\'If unsure, use the \', code(\'lock\'), \' REPL command to prevent any unwanted modification.\')),\n                                                               p(\'You should probably be familiar with how these scripts work before running the REPL.\')],\n\n                                      metadata_section  = l[identity = model.data[\'permanent-identity\'] || \'[unidentified]\', author = model.data.author || \'[no author specified]\',\n                                                            license  = model.data.license || \'[no license specified]\'] in\n                                                          html[div.metadata(h1.identity(identity), h1.author(author), pre.license(license), description, div.instructions(instructions))],\n\n                                      attribute_section = html[div.attributes(namespace_sections(model))]] in\n\n                                   [metadata_section, attribute_section]]])})($);\n');
