Skip to content

Commit db28ab7

Browse files
authored
Update FORM command docs (#116)
* update form docs * 1.7.2 * format
1 parent eb3ed96 commit db28ab7

File tree

3 files changed

+108
-21
lines changed

3 files changed

+108
-21
lines changed

docs/050-command-reference.md

+105-18
Original file line numberDiff line numberDiff line change
@@ -853,25 +853,112 @@ If it isn't, the block is not inserted
853853
**Parameters**:
854854

855855
- Block reference pointing to the Form Configuration. The Form Configuration should be a tree
856-
- The root of the tree will be the form label
857-
- fields - a tree of fields to include in the form
858-
- name - the name of each field. When the form is submitted, this name is used for the output variable
859-
- type - The type of field. The following values are supported
860-
- text
861-
- number
862-
- select
863-
- page
864-
- block
865-
- flag
866-
- embed
867-
- label - The label describing the field to the user
868-
- default - The default value the field should have
869-
- output - what to do once the form is submitted. The supported values are:
856+
- fields - a tree of fields to include in the form
857+
- name - the name of each field. When the form is submitted, this name is used for the output variable
858+
- type - The type of field. The following values are supported
859+
- text
860+
- number
861+
- select
862+
- page
870863
- block
871-
- variables
872-
- submit - the text assigned to the submit button
873-
- cancel - the text assigned to the cancel button
874-
- The form config supports nested smartblock commands.
864+
- flag
865+
- embed
866+
- autocomplete
867+
- label - The label describing the field to the user
868+
- default - The default value the field should have
869+
- options - For `select` and `autocomplete` types, specifies the options available for selection.
870+
- conditional - Specifies a field `name` that this field depends on to be displayed.
871+
- conditionalValues - Specifies the values of the conditional field for which this field will be displayed.
872+
- output - what to do once the form is submitted. The supported values are:
873+
- block
874+
- variables
875+
- submit - the text assigned to the submit button
876+
- cancel - the text assigned to the cancel button
877+
878+
\*The form config supports nested SmartBlock commands.
879+
880+
**Example Form**
881+
882+
```
883+
- Example Form
884+
- fields
885+
- This is Some Text
886+
- type
887+
- text
888+
- label
889+
- Text Field
890+
- This is a Number
891+
- type
892+
- number
893+
- label
894+
- Number Field
895+
- Just a Label
896+
- type
897+
- label
898+
- label
899+
- Text Field
900+
- Like a checkbox
901+
- type
902+
- flag
903+
- label
904+
- Flag Field
905+
- This is text that is conditional on the checkbox
906+
- type
907+
- text
908+
- label
909+
- Conditional Text Field
910+
- conditional
911+
- Like a checkbox
912+
- This searches all pages
913+
- type
914+
- page
915+
- label
916+
- Page Field
917+
- This searches all blocks
918+
- type
919+
- block
920+
- label
921+
- Block Field
922+
- This is a multiple choice
923+
- type
924+
- select
925+
- label
926+
- Select Field
927+
- options
928+
- apple
929+
- banana
930+
- orange
931+
- conditional select 1
932+
- This is a conditional text field based on the multiple choice
933+
- type
934+
- text
935+
- label
936+
- Conditional Text Field
937+
- conditional
938+
- This is a multiple choice
939+
- conditionalValues
940+
- conditional select 1
941+
- orange
942+
- This is an autocomplete field
943+
- type
944+
- autocomplete
945+
- label
946+
- Autocomplete Field
947+
- options:
948+
- apple
949+
- banana
950+
- orange
951+
- This is like a roam block
952+
- type
953+
- embed
954+
- label
955+
- Embed Field
956+
```
957+
958+
```
959+
- Form #SmartBlock
960+
- <%FORM:((S2MbRYozb))%>
961+
```
875962

876963
**Embed Default**
877964

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "smartblocks",
3-
"version": "1.7.1",
3+
"version": "1.7.2",
44
"description": "Create custom and programmable templates from within Roam!",
55
"main": "./build/main.js",
66
"scripts": {

0 commit comments

Comments
 (0)