问题描述
我想在Julia文档字符串中包含一个循环,但是当我尝试使用看起来很明显的方式时,缩进不会显示。
"""
Function: dave
Arguments
x: first number
y: second number
Returns
interaction_sum: x + y + xy
Examples
#=
for i in 1:5
println(dave(i,i)) # 3,8,15,24,35
end
=#
"""
但是,当我在函数前面加上问号以获取文档时,循环的缩进不存在。
Function: dave
Arguments
x: first number
y: second number
Returns
interaction_sum: x + y + xy
Examples
#=
for i in 1:5
println(dave(i,35
end
=#
我在Python中没有这样的问题。如何使这些标签显示在Julia中?
解决方法
有关如何设置文档字符串格式的更多详细信息,请阅读Documentation部分。
julia> """
dave
# Arguments
x: first number
y: second number
# Returns
interaction_sum: x + y + xy
# Examples
```
for i in 1:5
println(dave(i,i)) # 3,8,15,24,35
end
```
"""
function dave() end
help?> dave
search: dave code_native @code_native readavailable
dave
Arguments
≡≡≡≡≡≡≡≡≡≡≡
x: first number
y: second number
Returns
≡≡≡≡≡≡≡≡≡
interaction_sum: x + y + xy
Examples
≡≡≡≡≡≡≡≡≡≡
for i in 1:5
println(dave(i,35
end