String interpolation in docstring

An alternative is to use a raw string literal, but then you need to explicitly call @doc:

@doc raw"""
    f(s::String)::Nothing
# Example
```julia
for i in 1:10
    f("i = $1")
end
```
"""
function f(s::String)
    println(s)
end
2 Likes