Skip to content

Commit

Permalink
Add instructions on how to use LiveServer to preview docs locally
Browse files Browse the repository at this point in the history
  • Loading branch information
pwochner committed Feb 13, 2025
1 parent dd2906f commit a6ee87b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
1 change: 1 addition & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ HerbInterpret = "5bbddadd-02c5-4713-84b8-97364418cca7"
HerbSearch = "3008d8e8-f9aa-438a-92ed-26e9c7b4829f"
HerbSpecification = "6d54aada-062f-46d8-85cf-a1ceaf058a06"
Kroki = "b3565e16-c1f2-4fe9-b4ab-221c88942068"
LiveServer = "16fef848-5104-11e9-1b77-fb7a48bbb589"
Pluto = "c3e4b0f8-55cb-11ea-2926-15256bba5781"
PlutoSliderServer = "2fc8631c-6f24-4c5b-bca7-cbb509c42db4"
PlutoStaticHTML = "359b1769-a58e-495b-9770-312e911026ad"
Expand Down
10 changes: 9 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ The majority of the documentation of automatically generated from the respective
There are some pages that were added manually and can be edited likewise. New pages can 1. easily be written in markdown and 2. added to the site-tree by editing `docs/make.jl`.

## Compiling the documentation
Compiling is automatically triggered whenever pushing to this branch. If you want to run the documentation locally run `julia --project=. make.jl` in this directory.
Compiling is automatically triggered whenever pushing to this branch.

If you want to run the documentation locally run `julia --project=. make.jl` from this directory.
Once built successfully, the documentation is generated in the directory `docs/build`. You can preview it by either opening `docs/build/index.html` in a browser,
or by using `LiveServer`:
```
julia --project=. -e 'using LiveServer; serve(dir="build")'
```
The documentation will be available at http://localhost:8000.

## Help!

Expand Down
17 changes: 11 additions & 6 deletions docs/build_notebooks.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
using PlutoStaticHTML

"""
Builds the Pluto notebooks in the specified directory.
As part of the build, all notebooks are executed to make sure there is no
deprecated code.
"""
function build(tutorials_dir)
@info "Building notebooks in $tutorials_dir"
use_distributed = false
output_format = documenter_output
bopts = BuildOptions(tutorials_dir; use_distributed, output_format)
build_notebooks(bopts)
end
@info "Building notebooks in $tutorials_dir"
use_distributed = false
output_format = documenter_output
bopts = BuildOptions(tutorials_dir; use_distributed, output_format)
build_notebooks(bopts)
end

0 comments on commit a6ee87b

Please sign in to comment.