From c134ee180a1e7c9056fc5fb809f0fa722b1ecdd3 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Tue, 14 Feb 2023 19:46:39 +0100 Subject: [PATCH] Added input fields example --- nomadnet/examples/various/input_fields.py | 37 +++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 nomadnet/examples/various/input_fields.py diff --git a/nomadnet/examples/various/input_fields.py b/nomadnet/examples/various/input_fields.py new file mode 100644 index 0000000..2400b79 --- /dev/null +++ b/nomadnet/examples/various/input_fields.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python3 +import os +env_string = "" +for e in os.environ: + env_string += "{}={}\n".format(e, os.environ[e]) + +template = """>Fields and Submitting Data + +Nomad Network let's you use simple input fields for submitting data to node-side applications. Submitted data, along with other session variables will be available to the node-side script / program as environment variables. This page contains a few examples. + +>> Read Environment Variables + +{@ENV} +>>Examples of Fields and Submissions + +The following section contains a simple set of fields, and a few different links that submit the field data in different ways. + +-= + +An input field : `B444``b + +An masked field : `B444``b + +An small field : `B444`<8|small`test>`b, and some more text. + +Two fields : `B444`<8|one`One>`b `B444`<8|two`Two>`b + +The data can be `!`[submitted`:/page/input_fields.mu`username|two]`!. + +You can `!`[submit`:/page/input_fields.mu`one|password|small]`! other fields, or just `!`[a single one`:/page/input_fields.mu`username]`! + +Or simply `!`[submit them all`:/page/input_fields.mu`*]`!. + +-= + +""" +print(template.replace("{@ENV}", env_string)) \ No newline at end of file