Julia 0.3中Docile.jl的示例用法

Julia 0.3中Docile.jl的示例用法,julia,documentation-generation,Julia,Documentation Generation,我是朱莉娅的新手。我对使用添加文档到现有项目感兴趣。根据,Docstring已经添加到Julia 0.4中,但我想让Docstring在0.3中工作 不过,上面文章中的示例在0.3中不起作用帮助(f)不显示文档字符串,@doc f返回错误。有人能帮我看看少了什么吗 $ julia _ _ _ _(_)_ | A fresh approach to technical computing (_) | (_) (_) |

我是朱莉娅的新手。我对使用添加文档到现有项目感兴趣。根据,Docstring已经添加到Julia 0.4中,但我想让Docstring在0.3中工作

不过,上面文章中的示例在0.3中不起作用<代码>帮助(f)不显示文档字符串,
@doc f
返回错误。有人能帮我看看少了什么吗

$ 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,)

您可能希望结合使用Docile.jl。下面的会话显示,如果您只记录函数而不使用Lexicon,则任何函数的帮助文本都不会更改。帮助文本仅在您使用Lexicon键入
后反映您的文档。请注意,在下面,我是通过在repl中键入一个
来获取帮助文本的,而不是通过使用函数
help

   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "help()" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.3.6 (2015-02-17 22:12 UTC)
 _/ |\__'_|_|_|\__'_|  |  Official http://julialang.org/ release
|__/                   |  x86_64-unknown-linux-gnu

julia> using Docile

julia> 

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)

help?> f
INFO: Loading help data...
f (generic function with 1 method)

julia> using Lexicon

help?> f
f (generic function with 1 method)

INFO: Parsing documentation for Docile.
INFO: Parsing documentation for Lexicon.
INFO: Parsing documentation for Docile.Interface.

[method]

.f(x::Float64, y::Float64)

  Compute 2 times x minus y squared. 

 Details:

    source: (3,"none")