# Adding package developed in a local folder for use in other environment (for Documenter)

**URL:** <https://discourse.julialang.org/t/adding-package-developed-in-a-local-folder-for-use-in-other-environment-for-documenter/75233>\
**Category:** General Usage\
**Tags:** documenter, environment\
**Created:** [January 26, 2022, 3:33pm UTC](https://discourse.julialang.org/t/adding-package-developed-in-a-local-folder-for-use-in-other-environment-for-documenter/75233 "2022-01-26T15:33:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sstroemer](https://avatars.discourse-cdn.com/v4/letter/s/a88e4f/32.png) [@sstroemer](https://discourse.julialang.org/u/sstroemer)\
**Post date:** [January 26, 2022, 3:33pm UTC](https://discourse.julialang.org/t/adding-package-developed-in-a-local-folder-for-use-in-other-environment-for-documenter/75233/1 "2022-01-26T15:33:44Z")

</div>

I’ve created a package that I’m currently developing, specifying a path so that it fits into the overall folder structure (and the overall git structure), using:

```julia
using PkgTemplates

t = Template(; user="username", dir="path_to_mypackage", julia=v"1.7.1")
t("MyPackage")

```

Now I wanted to use `Documenter` so I created the following additonal `docs` structure inside the package:

```julia
MyPackage
- docs
  - src/
    ...
  - make.jl
  - Project.toml
- src/
  - ...

```

My goal would be to then run `julia --project=docs docs/make.jl`, but I do not know how to properly “add” my package “MyPackage”. Since its not in the usual Julia folder I can not add it to my “docs” environment (when running `] (docs) pkg> add MyPackage`) and therefore I can not `using MyPackage` inside the `make.jl`.

As far as I understand, running `Pkg.develop("MyPackage")` would create a copy of my current package in `.julia\\dev\\MyPackage`. Changes that I do in my local folder would then not be visible there and I could not develop and update the documentation at the same time; so that seems to be no option either.

I’m pretty sure there is a simple fix to this, but I can’t find out how.

---

<div class="post-metadata">

**Author:** ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)\
**Post date:** [January 26, 2022, 3:42pm UTC](https://discourse.julialang.org/t/adding-package-developed-in-a-local-folder-for-use-in-other-environment-for-documenter/75233/2 "2022-01-26T15:42:05Z")

</div>

Try

```julia
$ cd docs
$ julia --project=.
pkg> dev ..

```

The last step can alternatively be done with `Pkg.develop(path = "..")`.

---

<div class="post-metadata">

**Author:** ![sstroemer](https://avatars.discourse-cdn.com/v4/letter/s/a88e4f/32.png) [@sstroemer](https://discourse.julialang.org/u/sstroemer)\
**Post date:** [January 26, 2022, 5:10pm UTC](https://discourse.julialang.org/t/adding-package-developed-in-a-local-folder-for-use-in-other-environment-for-documenter/75233/3 "2022-01-26T17:10:14Z")

</div>

That works perfect, thanks!

One thing that I do not understand though… My package uses `JuMP`, with `MyPackage.jl` looking like:

```julia
module MyPackage

import JuMP
# all the stuff

end

```

I’ve added `JuMP` to my documentation environment. When building the docs using `julia --project=docs docs/make.jl` it fails with `ERROR: LoadError: UndefVarError: JuMP not defined` unless I manually import `JuMP` in the `make.jl` too!?

My `make.jl` is:

```julia
using Documenter
import JuMP # this line is necessary...
using MyPackage

makedocs(sitename="My Doc")

```

and my `index.md`:

````julia
# MyPackage.jl Documentation

```@docs
generate!(model::JuMP.Model)
```

````
