I'm new to Julia. I'm interested in using Docile.jl to add documentation to an existing Julia project. According to this post, docstrings have already been added to Julia 0.4, but I'd like to get docstrings working in 0.3.
The example in the post above doesn't work in 0.3, though. help(f)
doesn't show the docstring, and @doc f
returns an error. Can someone help me see what is missing?
$ julia
_
_ _ _(_)_ | A fresh approach to technical computing
(_) | (_) (_) | Documentation: http://docs.julialang.org
_ _ _| |_ __ _ | Type "help()" for help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 0.3.6 (2015-01-08 22:33 UTC)
_/ |\__'_|_|_|\__'_| | Official http://julialang.org release
|__/ | x86_64-linux-gnu
julia> using Docile
julia> @doc """
Compute 2 times x minus y squared.
""" ->
function f(x::Float64, y::Float64)
return 2x - y^2
end
f (generic function with 1 method)
julia> help(f)
INFO: Loading help data...
f (generic function with 1 method)
julia> @doc f
ERROR: @doc: use `->` to separate docs/object:
(:f,)