From 7ad325828d0b9b5d44e0e75a58194aa59d103a48 Mon Sep 17 00:00:00 2001 From: Ferry Boender Date: Sat, 11 Jul 2015 14:49:59 +0200 Subject: [PATCH] Document additional field types. --- doc/MANUAL.md | 60 +++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 56 insertions(+), 4 deletions(-) diff --git a/doc/MANUAL.md b/doc/MANUAL.md index e1ab175..7c97072 100644 --- a/doc/MANUAL.md +++ b/doc/MANUAL.md @@ -4,8 +4,8 @@ This is the manual for version %%VERSION%%. ## Table of Contents -1. [Introduction](#introduction) - - [Terminology](#terminology) +1. [Introduction](#intro) + - [Terminology](#intro_terminology) 1. [Invocations](#invocations) - [Shell foreground](#invocations_foreground) - [Daemon](#invocations_daemon) @@ -391,7 +391,7 @@ The `date` field type supports the following additional options: - **`min`**: The minimum allowed date (format: a string YYYY-MM-DD) - **`max`**: The maximum allowed date (format: a string YYYY-MM-DD) -For Example: +For example: ... "fields": [ @@ -407,6 +407,28 @@ For Example: ### Radio +The `radio` field type lets the user pick one option from a list of options. + +The `radio` field type supports the following additional options: + +- **`options`**: The options available to the user. (list of lists, **required**) + +For example: + + ... + "fields": [ + { + "name": "network", + "title": "To which network", + "type": "radio", + "options": [ + ["intra", "Whole intranet"], + ["machine", "Acceptance machine"] + ] + } + ] + ... + ### Checkbox The `checkbox` field type represents the user with a toggleble checkbox that @@ -421,7 +443,7 @@ The `checkbox` field type supports the following additional options: - **`checked`**: Whether the checkbox should be checked by default (boolean) -For Example: +For example: ... "fields": [ @@ -448,6 +470,23 @@ The `text` field type supports the following additional options: - **`minlen`**: The minimum allowed length for the field. - **`maxlen`**: The maximum allowed length for the field. +For example: + + ... + "fields": [ + { + "name": "complaint", + "title": "Please write down your complaint", + "type": "text", + "rows": 6, + "cols": 60, + "minlen": 1, + "maxlen": 5 + } + ] + ... + + ### Password - **`minlen`**: The minimum allowed length for the field. @@ -469,6 +508,19 @@ The `file` field type supports the following additional options: No additional validation is done on the file contents. +For example: + + ... + "fields": [ + { + "name": "new_users", + "title": "CSV file of new users", + "type": "file", + "extensions": ["csv"] + } + ] + ... + ## Output **All output is assumed to be UTF8, regardless of system encoding!**