I am doing a project in julia, and was attempting to use doctest.jl for documentation. I was following the intstructions on github, and had everything working until running make.jl from the docs directory. Here is the code I used:
julia> cd("C:\\Arya's desktop\\Arya\\Programming\\Julia\\ConsistentSampler\\docs")
julia> make.jl
ERROR: UndefVarError: make not defined
Here is my folder structure:
C:\Arya’s desktop\Arya\Programming\Julia\ConsistentSampler\src: consistent_sampler.jl, demo_consistent_sampler.jl
C:\Arya’s desktop\Arya\Programming\Julia\ConsistentSampler\docs: index.md, make.jl
C:\Arya’s desktop\Arya\Programming\Julia\ConsistentSampler\docs\src: empty
Without those, user will run into errors:
Ruining 3rd line without the first two:
julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate();'
ERROR: expected a `name` entry in project file at C:\Users\yahyaaba\Documents\GitHub\MatLang\docs\Project.toml
Stacktrace:
[1] pkgerror(::String) at C:\Julia-1.2.0\share\julia\stdlib\v1.2\Pkg\src\Types.jl:112
[2] (::getfield(Pkg.Types, Symbol("#_throw_package_err#69")){String})(::String) at C:\Julia-1.2.0\share\julia\stdlib\v1.2\Pkg\src\Types.jl:455
[3] read_package(::String) at C:\Julia-1.2.0\share\julia\stdlib\v1.2\Pkg\src\Types.jl:458
[4] parse_package!(::Pkg.Types.Context, ::Pkg.Types.PackageSpec, ::String) at C:\Julia-1.2.0\share\julia\stdlib\v1.2\Pkg\src\Types.jl:734
[5] explicit_dev_path(::Pkg.Types.Context, ::Pkg.Types.PackageSpec) at C:\Julia-1.2.0\share\julia\stdlib\v1.2\Pkg\src\Types.jl:524
[6] handle_repos_develop!(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}, ::Bool) at C:\Julia-1.2.0\share\julia\stdlib\v1.2\Pkg\src\Types.jl:592
[7] #develop#17(::Bool, ::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(Pkg.API.develop), ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at C:\Julia-1.2.0\share\julia\stdlib\v1.2\Pkg\src\API.jl:54
[8] develop at C:\Julia-1.2.0\share\julia\stdlib\v1.2\Pkg\src\API.jl:39 [inlined]
[9] #develop#16 at C:\Julia-1.2.0\share\julia\stdlib\v1.2\Pkg\src\API.jl:36 [inlined]
[10] develop at C:\Julia-1.2.0\share\julia\stdlib\v1.2\Pkg\src\API.jl:36 [inlined]
[11] #develop#12 at C:\Julia-1.2.0\share\julia\stdlib\v1.2\Pkg\src\API.jl:33 [inlined]
[12] develop(::Pkg.Types.PackageSpec) at C:\Julia-1.2.0\share\julia\stdlib\v1.2\Pkg\src\API.jl:33
[13] top-level scope at none:1
ERROR: LoadError: ArgumentError: Package MatLang [05b439c0-bb3c-11e9-1d8d-1f0a9ebca87a] is required but does not seem to be installed:
Run Pkg.instantiate() to install all recorded dependencies.
Stacktrace:
[1] _require(::Base.PkgId) at .\loading.jl:982
[2] require(::Base.PkgId) at .\loading.jl:911
[3] require(::Module, ::Symbol) at .\loading.jl:906
[4] include at .\boot.jl:328 [inlined]
[5] include_relative(::Module, ::String) at .\loading.jl:1094
[6] include(::Module, ::String) at .\Base.jl:31
[7] exec_options(::Base.JLOptions) at .\client.jl:295
[8] _start() at .\client.jl:464
in expression starting at C:\Users\yahyaaba\Documents\GitHub\MatLang\docs\make.jl:1
No they don’t. The error you’re seeing is because you were already in the docs/ directory when you called that line. The error is thrown by the Pkg.develop call, which tries to develop the docs/Project.toml (implying that pwd() was already docs/). That fails as it is not a package and is missing the name entry.