canonical / jujucharms.com

The jujucharms.com website.
8 stars 1 forks source link

Rendering of config.yaml ignores newlines #574

Open aieri opened 5 years ago

aieri commented 5 years ago

Newlines present within the description of configuration options seem to be invariably swallowed up. It doesn't seem to matter whether you use folded or literal multiline YAML strings, newlines are not rendered. This makes reading config options harder and sometimes even confusing.

hatched commented 5 years ago

Thanks @aieri

We're currently in the process of refactoring some of these UI elements. Could you supply us with a few examples of values that failed for you?

aieri commented 5 years ago

right, I should have provided examples... I have two in mind: (folded style) https://jujucharms.com/u/nagios-charmers/hw-health/10#charm-config-manufacturer (block style) https://jujucharms.com/rabbitmq-server/85#charm-config-queue_thresholds

However... I see that in the case of the hw-health charm, the original folded style is parsed and re-rendered by the charm build step into the literal style, so I can't say whether pure folded style would work. In any case, the \n characters aren't rendered in the webpage.

Original:

  manufacturer:
    type: string
    default: "auto"
    description: >
      Choose the tools to get deployed (hp, dell, supermicro, huawei) or leave
      the charm to self discover the tools needed to run hardware health checks.

      The special value "test" is only useful during testing to bypass
      installation restrictions and override hardware detection.

      Only "auto" and "test" are currently implemented.

After charm build:

  "manufacturer":
    "type": "string"
    "default": "auto"
    "description": "Choose the tools to get deployed (hp, dell, supermicro, huawei)\
      \ or leave the charm to self discover the tools needed to run hardware health\
      \ checks.\nThe special value \"test\" is only useful during testing to bypass\
      \ installation restrictions and override hardware detection.\nOnly \"auto\"\
      \ and \"test\" are currently implemented.\n"
hatched commented 5 years ago

Great thanks, we'll make sure that this case is handled.