如何在RAML中的描述文件中创建换行符?

时间:2016-09-14 16:17:28

标签: field raml

我在RAML中有一个需要很长描述的字段。有没有办法将其分成多行?

示例:

“description”:“这是一个很长的字符串”

我希望它呈现为:

“description”:“这是 一根很长的字符串。“

由于

2 个答案:

答案 0 :(得分:3)

您可以使用|将长行划分为多个部分: -

 post:
    description: |
      Creates a new account. Some **bold** text here. More text. Need to fill the line, so make it longer still. Hooray!
      Line two Starts here

参考: - https://github.com/raml2html/raml2html/blob/master/examples/example.raml

另一种选择是使用!\n来打破这一行: -

  post:
        description: !
          "Creates a new account. Some **bold** text here. More text. Need to fill the line, so make it longer still. Hooray!\n
          Line two Starts here"     

请注意,此处的描述应位于""双引号

答案 1 :(得分:0)

...  
  description:
    1st line<br>
    2nd line<br>
    3rd line<br> 

...  
  description: 1st line<br>2nd line<br>3rd line<br>

如下所示:
raw raml
produced html