|
| 1 | +# How to build the docs locally |
| 2 | + |
| 3 | +If you just want to modify or add an example, you can [build just the example](../examples/README.md) without having to build the full documentation locally. |
| 4 | + |
| 5 | +If you want to build the documentation, navigate to this (docs/) directory and open a Julia REPL. |
| 6 | + |
| 7 | +## Instantiation |
| 8 | + |
| 9 | +First activate the documentation environment: |
| 10 | +```julia |
| 11 | +julia> ] activate . |
| 12 | +``` |
| 13 | +Alternatively, you can start Julia with `julia --project=.`. |
| 14 | + |
| 15 | +Then install all packages: |
| 16 | +```julia |
| 17 | +julia> ] instantiate |
| 18 | +``` |
| 19 | +By default, this will use the development version of KernelFunctions in the parent directory. |
| 20 | + |
| 21 | +## Build |
| 22 | + |
| 23 | +To build the documentation, run (after activating the documentation environment) |
| 24 | +```julia |
| 25 | +julia> include("make.jl") |
| 26 | +``` |
| 27 | +You can speed up the process if you do not execute the examples and comment out the |
| 28 | +relevant sections in `docs/make.jl`. |
| 29 | + |
| 30 | +The output is in the `docs/build/` directory and best viewed in a browser. |
| 31 | +The documentation uses pretty URLs which can be a hindrance if you browse the documentation locally. |
| 32 | +The [Documenter documentation](https://juliadocs.github.io/Documenter.jl/stable/man/guide/#Building-an-Empty-Document) suggests that |
| 33 | + |
| 34 | +> You can run a local web server out of the `docs/build` directory. One way to accomplish |
| 35 | +> this is to install the [LiveServer](https://github.com/tlienart/LiveServer.jl) Julia |
| 36 | +> package. You can then start the server with `julia -e 'using LiveServer; serve(dir="docs/build")'`. |
| 37 | +> Alternatively, if you have Python installed, you can start one with |
| 38 | +> `python3 -m http.server --bind localhost` (or `python -m SimpleHTTPServer` with Python 2). |
| 39 | +
|
| 40 | +If you make any changes, you can run |
| 41 | +```julia |
| 42 | +julia> include("make.jl") |
| 43 | +``` |
| 44 | +again to rebuild the documentation. |
| 45 | + |
| 46 | +# How to contribute to the docs |
| 47 | + |
| 48 | +## To add additional docs dependencies |
| 49 | + |
| 50 | +To add additional dependencies, run (after activating the documentation environment) |
| 51 | +```julia |
| 52 | +julia> ] add NewDependency |
| 53 | +``` |
| 54 | +or, as a shell one-liner: |
| 55 | +```shell |
| 56 | +julia --project=. -e 'using Pkg; Pkg.add("NewDependency")' |
| 57 | +``` |
| 58 | +and commit the changes to Project.toml and Manifest.toml. |
| 59 | + |
| 60 | + |
| 61 | +## To add examples |
| 62 | + |
| 63 | +See [../examples](../examples/README.md) |
0 commit comments