Skip to content

Commit 2fd6b90

Browse files
author
Rik Huijzer
authored
Update README.md (#133)
1 parent 5c1e256 commit 2fd6b90

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,15 @@ This is similar to the [`http.server`](https://docs.python.org/3/library/http.se
5454

5555
`servedocs` is a convenience function that runs `Documenter` along with `LiveServer` to watch your doc files for any changes and render them in your browser when modifications are detected.
5656

57-
Assuming you are in `directory/to/YourPackage.jl` and that you have a `docs/` folder as prescribed by [Documenter.jl](https://github.com/JuliaDocs/Documenter.jl), just run:
57+
Assuming you are in `directory/to/YourPackage.jl`, that you have a `docs/` folder as prescribed by [Documenter.jl](https://github.com/JuliaDocs/Documenter.jl) and `LiveServer` installed in your global environment, you can run:
5858

5959
```julia
60+
$ julia
61+
62+
pkg> activate docs
63+
6064
julia> using YourPackage, LiveServer
65+
6166
julia> servedocs()
6267
[ Info: SetupBuildDirectory: setting up build directory.
6368
[ Info: ExpandTemplates: expanding markdown templates.
@@ -69,4 +74,10 @@ julia> servedocs()
6974
7075
Open a browser and go to `http://localhost:8000/` to see your docs being rendered; try modifying files (e.g. `docs/index.md`) and watch the changes being rendered in the browser.
7176
77+
To run the server with one line of code, run:
78+
79+
```
80+
$ julia --project=docs -ie 'using YourPackage, LiveServer; servedocs()'
81+
```
82+
7283
**Note**: this works with [Literate.jl](https://github.com/fredrikekre/Literate.jl) as well. See [the docs](https://tlienart.github.io/LiveServer.jl/dev/man/ls+lit/).

0 commit comments

Comments
 (0)