Skip to content

Commit

Permalink
do JSON-based Jupyter config properly
Browse files Browse the repository at this point in the history
  • Loading branch information
Shashi Gowda committed Jul 25, 2018
1 parent 17a48c7 commit a0937b7
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions deps/build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,25 @@ function install_ijulia_config()
$END_MARKER
"""
write(config_file, config_str)
config_file_json = joinpath(homedir(), ".jupyter", "jupyter_notebook_config.json")

if isfile(config_file_json)
dict = try
JSON.parse(read(config_file_json, String))
catch err
println(STDERR, "Error parsing Jupyter config file $config_file_json - fix it and build again or delete it to enable WebIO")
@goto jsondone
end
app = Base.@get! dict "NotebookApp" Dict()
nbext = Base.@get! app "nbserver_extensions" Dict()
nbext["jlstaticserve"] = true
open(config_file_json, "w") do io
prettyio = JSON.Writer.PrettyContext(io, 4)
JSON.print(prettyio, dict)
end
end
@label jsondone

write("load_paths.json", loadpath)
end

Expand Down

0 comments on commit a0937b7

Please sign in to comment.