-- Leo's gemini proxy

-- Connecting to git.thebackupbox.net:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

repo: blog
action: blob
revision:
path_from: text_form
revision_from: refs/heads/master:
path_to:
revision_to:

git.thebackupbox.net

blog

git://git.thebackupbox.net/blog

blob of:

blog

/ text_form

refs/heads/master:/text_form
 # a text/form spec?

 I didn't know w3 XForms existed, but ofc it is 10 seconds long measured by holding page-down on my keyboard.
 => https://www.w3.org/MarkUp/Forms/wiki/XForms_2.0 XForms
 but I also found out about:
 => http://xforms-toolkit.org/screenshots/ xforms-toolkit (unrelated)

 => https://hackers.town/@theruran/107848120022642225 how I found out about these two things. thanks, theruran.

 I guess content-type would be:
 ```
 text/form
 ```
 need a way to have a list of inputs.

 each input should have a type associated with it
 a name that is mainly for machine use
 a description that is only for human use
 maybe a label? description and label might be similar enough to merge.

 ## inputs
 input:
   type:
     text
   name:
     user
   label:
     username
   desc:
     your username on thebackupbox.net

 input:
   type:
     password
   name:
     pass
   label:
     password
   desc:
     the password that goes with your user on thebackupbox.net

 ### input types
 uh..
 * text
 * password
 * date
 * uri

 I dunno. there's probably something that has a good list that has thought about this more than I have.
 looking into semantic web stuff atm...

 ## action
 each form needs an action URI...

 form:
   action:
     http://thebackupbox.net/cgi-bin/fmrl-client.cgi
   input:
     type:
       text
     name:
       user
     label:
       fmrl user
     description:
       the fmrl user of which you wish to view updates

 default action is to just launch the action URL with the inputs appended in the usual way in a query_string

 name=value pairs separated by &s or ;s for multiple inputs.

 ## "method"

 this /might/ need a method attribute for the form.
 maybe http:POST would be good for what the value of this attribute would look like?
 the two main types would be:
 * something that becomes the query_string part of the URI
 * something that is sent some other way
 * something that is only asking for user and password to put into the URI? (for the URI handler to deal with as it needs) http probably puts it into basic-auth header?

 maybe there should be methods that manipulate the URL in other ways.
 like something for appending the input to the path?


 like, ftp might do put.. http doing POST or PUT..
 sftp doing put as well.

 as with HTML forms, file inputs probably shouldn't get included as parts of the query-string-generator method.

 ## format

 I guess it /could/ be done as json if each input was part of an array so the order was retained.
 like:
 ```
 { "form": {
     "action" : "https://thebackupbox.net/cgi-bin/login.cgi",
     "method" : "http:POST",
     "input" [
       {
         "type": "text",
         "name": "user",
         "label": "user",
         "description": "long string"
       },
       { "type": "password",
         "name": "pass",
         "label": "I dunno.",
         "description": "just an example"
       }
     ]
   }
 }
 ```
 or...
 ```
 <xml>
   <form action="https://thebackupbox.net/cgi-bin/login.cgi" method="http:POST">
     <input type="text" name="user" label="user" description="long string" />
     <input type="password" name="pass" label="I dunno"." description="just an example" />
   </form>
 </xml>
 ```
 I guess if I'm going to do XML-based I'll write a DTD for it...

 could also be in yaml? which I guess would be the examples I did up there.
 or maybe toml

 => https://en.wikipedia.org/wiki/Recfiles
 rec file would work too.
 ...
 I've worked my way to RDF and Turtle and N-Triples.
 help.
 I'm trapped in semantics.

 ## conclusion

 so far this is just taking pretty much HTML forms and stripping the HTML off.
 I figure the actions should be influenced on what curl does.
 it does a lot

 comments:

 => mailto:epoch@thebackupbox.net
 => talk:epoch@thebackupbox.net
 => ircs://irc.thebackupbox.net:6697/%23default
 => ircs://irc.tilde.chat:6697/epoch,isnick

-- Response ended

-- Page fetched on Sun Jun 2 15:10:18 2024