questionary icon indicating copy to clipboard operation
questionary copied to clipboard

New line after instructions

Open woile opened this issue 3 years ago • 2 comments

Question

Hello there! I was wondering if it is possible to add a new line after setting some instructions. The instructions may be long, so it would be nice to do that. I've checked the docs, but I didn't find anything relevant. I searched for new line and instruction.

questions = [
        {
            "type": "text",
            "name": "field_name",
            "message": "Field Name",
            "instruction": "Name used for something, specially for foo and bar, just making the text relatively long",
        }
]
questionary.prompt(questions)

Thanks a lot 🙏🏻 !

What have you already tried?

Adding a new line at the end: Name used for something, specially for foo and bar, just making the text relatively long\n. But the style is underlined, so the new line is underlined as well

Screenshot 2022-06-13 at 09 36 08

Read the documentation

  • [X] I have checked to ensure that my question is not answered by the documentation.

woile avatar Jun 13 '22 07:06 woile

I don't think it is possible to do exactly as you want. You could possibly remove the underline style from instruction. Alternatively, move the text from instruction into message, then set instruction to \n.

kiancross avatar Jun 17 '22 20:06 kiancross

I just opened an enhancement fro something similar https://github.com/tmbo/questionary/issues/252

Different specific scenarios, but having the ability to format only specific parts of a question would be helpful.

Wulf-Steppen avatar Sep 16 '22 20:09 Wulf-Steppen