如何为 julia 创建本地版本的文档?我尝试过:
/Applications/Julia-0.3.1.app/Contents/Resources/julia/share/julia/doc make html
fatal: Not a git repository (or any of the parent directories): .git
make: [juliadoc-pkg] Error 128 (ignored)
PYTHONPATH=:juliadoc sphinx-build -b html -d _build/doctrees . _build/html
Running Sphinx v1.3b1
Extension error:
Could not import extension juliadoc.jldoctest (exception: cannot import name bytes)
make: *** [html] Error 1
/Applications/Julia-0.3.1.app/Contents/Resources/julia/share/julia/doc
虽然 sphinx 似乎可以工作,但我似乎缺少一些扩展?有人可以帮忙吗?谢谢!
最佳答案
Julia v0.4 以后的文档系统是内联的,可以使用 Documenter.jl 包生成。位于函数、类型、宏、模块和其他对象正上方的内联文档字符串被解释为记录随附对象。下面显示了函数 get_coeff()
的示例,
"""
get_coeff(a, v)
Return the coefficient of `a::TaylorN`, specified by
`v::Array{Int,1}` which has the indices of the specific monomial.
"""
function get_coeff(a::TaylorN, v::Array{Int,1})
有关文档的更多详细信息,请参阅 here .
下一步是文档生成,使用 Documenter.jl 包。详细步骤讲解here ,正如所解释的,输出可以以 markdown 或 html 形式获得。如果需要 pdf,我会使用 pandocs 将 .md 文件转换为 pdf。
关于documentation-generation - 如何为 Julia 创建离线文档,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26763593/