2014-11-05 51 views
1

如何爲julia創建本地版本的文檔?我試過了:如何爲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 

雖然獅身人面像似乎工作,它看起來像我缺少一些擴展?任何人都可以幫忙?謝謝!

回答

0

可能需要從Julia git存儲庫的克隆構建文檔,而不是從Julia源的存檔構建文檔。這是簡單的由具有安裝Git和做得到:

git clone https://github.com/JuliaLang/julia.git 

下面的代碼片段重現我的機器上的朱莉婭文檔:

cd doC# change into the doc directory of the julia repository 
make latex SPHINXOPTS="-n" 
make latexpdf 
# view the newly created PDF using linux default PDF viewer 
evince _build/latex/JuliaLanguage.pdf 

(經過幾次回車壓制忽略乳膠字體問題鍵問題,但它的文檔證明確定)

+0

感謝您的幫助!但是,這也會出現錯誤消息。但是,這可能與我的本地設置有關。 – user2979331 2014-11-08 13:31:11

1

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。