nf-core / tools

Python package with helper tools for the nf-core community.
https://nf-co.re
MIT License
244 stars 191 forks source link

Schema: Support multi-line text inputs #3145

Open ewels opened 3 months ago

ewels commented 3 months ago

It would be nice to support / differentiate text variables between simple one-line inputs and multi-line textareas in the schema. (See original request for support in Seqera Platform launch page).

Need to figure out what the best JSON schema syntax is first. Suggestions from Slack discussion:

  1. minLength
  2. New format type textarea
  3. Using a pattern that includes zero or more \n newlines

Once we agree on such a flag we can detect it in the launch form and have an option / docs for it in the schema builder.

mbosio85 commented 3 months ago

It would be great if the schema included an optional configuration to specify the desired height of the box (like rows) when defining multi-line text areas. I can see a number of use cases where the text area can be small and others where it should be bigger for it to be useful.

ewels commented 14 hours ago

Ok, suggestion then is to use rows:[integer] in that case. For example:

"my_parameter": {
    "type": "string",
    "description": "This parameter should be a super long string.",
    "fa_icon": "fas fa-file-signature",
    "rows": 4
}

This would be ignored if other things such as format are set to file-path and so on.