2022-05-09 14:07:39 +02:00
# Formidable
Web-based - but terminal compatible ! - little form editor using [JSONSchema ](https://json-schema.org/ ) models.
**Terminal compatible ?**
The generated web UI does not use Javascript and can be used with terminal browsers like [w3m ](https://en.wikipedia.org/wiki/W3m ) or [lynx ](https://en.wikipedia.org/wiki/Lynx_(web_browser )).
2022-08-01 10:36:00 +02:00
> ⚠ Formidable is currently in a very alpha stage ! Expect breaking changes...
2022-05-09 14:07:39 +02:00
## Install
### Manually
Download the pre-compiled binaries from the [releases page ](https://github.com/Bornholm/formidable/releases ) and copy them to the desired location.
### Bash script
```
curl -sfL https://raw.githubusercontent.com/Bornholm/formidable/master/misc/script/install.sh | bash
```
It will download `frmd` to your current directory.
2022-05-10 23:56:25 +02:00
#### Install script environment variables
2022-05-09 14:07:39 +02:00
|Name|Description|Default|
|----|-----------|-------|
|`FORMIDABLE_VERSION`|Formidable version to download|`latest`|
|`FORMIDABLE_DESTDIR`|Formidable destination directory|`.`|
2022-05-10 23:56:25 +02:00
2022-05-09 14:37:43 +02:00
### URLs
2022-05-09 14:07:39 +02:00
2022-05-09 14:37:43 +02:00
Formidable uses URLs to define how to handle schemas/defaults/values.
2022-05-09 14:07:39 +02:00
2022-05-11 09:48:36 +02:00
For example, to edit with Firefox a schema (in YAML) from an HTTPS server, while readig default values from `stdin` (in JSON) and using effective values from the local file system (in HCL), outputing updates to `stdout` :
2022-05-09 14:07:39 +02:00
2022-05-10 22:31:17 +02:00
```bash
2022-05-11 09:48:36 +02:00
echo '{}' | FORMIDABLE_BROWSER="firefox" frmd \
2022-05-09 14:37:43 +02:00
edit
2022-05-10 22:31:17 +02:00
--schema 'https://example.com/my-schema.yml' \
--defaults 'stdin://local?format=json' \
--values 'file:///my/file/absolute/path.hcl' \
--output 'stdout://local?format=json'
2022-05-09 14:37:43 +02:00
```
2022-05-09 14:07:39 +02:00
2022-05-10 22:31:17 +02:00
### Available loaders
#### `stdin://`
> TODO: Write doc + example
2022-05-10 23:53:20 +02:00
2022-05-10 22:31:17 +02:00
#### `http://` and `https://`
> TODO: Write doc + example
2022-05-10 23:53:20 +02:00
2022-05-10 22:31:17 +02:00
#### `file://`
> TODO: Write doc + example
### Available formats
#### JSON
2022-05-10 23:53:20 +02:00
- **URL Query:** `?format=json`
- **File extension:** `.json`
- **As input:** yes
- **As output:** yes
2022-05-10 22:31:17 +02:00
#### YAML
2022-05-10 23:53:20 +02:00
- **URL Query:** `?format=yaml`
- **File extension:** `.yaml` or `.yml`
- **As input:** yes
- **As output:** yes
2022-05-10 22:31:17 +02:00
#### HCL
2022-05-10 23:53:20 +02:00
- **URL Query:** `?format=hcl`
- **File extension:** `.hcl`
- **As input:** yes
- **As output:** no
2022-05-10 22:31:17 +02:00
### Available outputs
#### `stdout://` (default)
> TODO: Write doc + example
2022-08-01 15:33:41 +02:00
#### `null://`
> TODO: Write doc + example
2022-05-10 22:31:17 +02:00
#### `file://`
> TODO: Write doc + example
#### `exec://`
> TODO: Write doc + example
2022-05-09 14:07:39 +02:00
2022-08-01 10:36:00 +02:00
## Changelog
[See `CHANGELOG.md` ](./CHANGELOG.md )
2022-05-09 14:07:39 +02:00
## Licence
2022-05-11 09:48:36 +02:00
AGPL-3.0