【发布时间】:2017-01-22 13:04:14
【问题描述】:
我在 RAML 中有一个需要很长描述的字段。有没有办法把它分成多行?
例子:
"description": "这是一个很长的字符串"
我希望它呈现为:
"description": "这是
很长的字符串。”
谢谢
【问题讨论】:
我在 RAML 中有一个需要很长描述的字段。有没有办法把它分成多行?
例子:
"description": "这是一个很长的字符串"
我希望它呈现为:
"description": "这是
很长的字符串。”
谢谢
【问题讨论】:
...
description:
1st line<br>
2nd line<br>
3rd line<br>
或
...
description: 1st line<br>2nd line<br>3rd line<br>
【讨论】:
<br> 不起作用,请尝试在其前面添加一个空格。示例:foobar <br> 而不是 foobar<br>。
您可以使用| 将长线分成多个部分:-
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"
请注意这里的描述应该在""双引号下
【讨论】: