在我的kDoc中,我希望段落之间有一个空行。我该怎么做? (还在某处有完整的指南吗?例如如何创建表格,项目符号等?)
答案 0 :(得分:1)
kdoc使用markdown,另请参见kdoc reference。该参考文献还指出,对于内联标记,他们使用以下markdown,但看起来并没有得到完全支持。或至少是Intellij IDEA(因此也可能是Android Studio)未按markdown参考描述它进行呈现。通过Dokka生成时,也许情况会更好。还没尝试过。
因此,如果您有标题(#
)或使用空行,则会在行之间留出适当的空间,例如:
# Title (or ### title)
this line has some space before
或仅使用空行:
first line is the summary.
this line is now just written as the second line in your documentation. no space before... but maybe that suffices already...
如果在其中放置<br />
,则基本上应该添加新行,但是至少在Intellij IDEA中不起作用。但是,将其放在```
-代码注释中时仍然有效。可能是一个错误...可能是Intellij IDEA中的功能?如果任何人都可以与Dokka一起玩并给出适当的答案,那太好了,只想分享我到目前为止所知。 (必须现在离开)
答案 1 :(得分:0)
Dokka 确实将空行视为段落分隔符,但忽略了interface A { a?: number };
interface B { a?: string };
function copy<
K extends keyof Source, // The extra type parameter
Source extends object,
Destination extends { [destinationKey in K]?: unknown } // Can be anything we don't really care, we only care about the K key existing
>(
source: Source,
key: K, // The key is of type K
destination: Destination,
transformer: (value: Source[K]) => Destination[K] // We use K to specify the relation between Source and Destination property type
) {
if (source[key] !== undefined) {
destination[key] = transformer ? transformer(source[key]) : source[key];
}
}
const a: A = { a: 123 };
const b: B = {};
copy(a, "a", b, (value) => value.toString());
copy(a, "a", b, (value) => value); /// error
和def get_column_data(self, column):
data = []
for i in range(self.tableWidget.rowCount()):
data.append(self.tableWidget.item(i, column).text())
return data
。考虑以下 KDoc 片段:
<br>
这是在HTML中呈现的方式:
答案 2 :(得分:0)