You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/man/functionalities.md
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -79,3 +79,21 @@ Upon modifying a `.md` file (e.g. updating `docs/src/index.md`), the `make.jl` w
79
79
The first pass collects all information in the code (i.e. docstrings), while
80
80
subsequent passes only consider changes in the markdown (`.md`) files. This
81
81
restriction is necessary to achieve a fast update behavior.
82
+
83
+
### Additional keywords
84
+
85
+
The `servedocs` function now takes two extra keywords which may, in some cases, make your life easier:
86
+
87
+
*`doc_env=false`, if set to true, the `Project.toml` available in `docs/` will be activated (note 1),
88
+
*`skip_dir=""`, indicates a directory to skip when looking at the docs folder for change, this can be useful when using packages like Literate or Weave that may generate files inside your `src` folder.
89
+
90
+
Note that in both cases these keywords are there for your convenience but would be best not used. See also the discussion in [this issue](https://github.com/asprionj/LiveServer.jl/issues/85).
91
+
In the first case, doing
92
+
93
+
```
94
+
julia --project=docs -e 'using LiveServer; servedocs()'
95
+
```
96
+
97
+
is more robust.
98
+
99
+
In the second case, it would be best if you made sure that all generated files are saved in `docs/build/...`.
# if the file that was changed is the `make.jl` file, assume that maybe new files are # referenced and so refresh the vector of watched files as a result.
15
22
if fp == makejl
16
23
# it's easier to start from scratch (takes negligible time)
17
24
empty!(dw.watchedfiles)
18
25
scan_docs!(dw, literate)
19
26
end
20
27
fext =splitext(fp)[2]
21
-
P1 = fext ∈ (".md", ".jl")
28
+
P1 = fext ∈ (".md", ".jl", ".css")
22
29
# the second condition is for CSS files, we want to track it but not the output
23
30
# if we track the output then there's an infinite loop being triggered (see docstring)
24
-
if P1|| (fext ==".css"&&!occursin(joinpath("docs", "build", "assets"), fp))
Can be used when developing a package to run the `docs/make.jl` file from Documenter.jl and
103
110
then serve the `docs/build` folder with LiveServer.jl. This function assumes you are in the
104
111
directory `[MyPackage].jl` with a subfolder `docs`.
105
112
106
-
* `verbose` is a boolean switch to make the server print information about file changes and
113
+
* `verbose=false` is a boolean switch to make the server print information about file changes and
107
114
connections.
108
-
* `literate` is the path to the folder containing the literate scripts, if left empty, it will be
115
+
* `literate=""` is the path to the folder containing the literate scripts, if left empty, it will be
109
116
assumed that they are in `docs/src`.
117
+
* `doc_env=false` is a boolean switch to make the server start by activating the doc environment or not (i.e. the `Project.toml` in `docs/`).
118
+
* `skip_dir=""` is a subpath of `docs/` where modifications should not trigger the generation of the docs, this is useful for instance if you're using Weave and Weave generates some files in `docs/src/examples` in which case you should give `skip_dir=joinpath("docs","src","examples")`.
119
+
* `skip_dirs=[]` same as `skip_dir` but for a vector of such dirs. Takes precedence over `skip_dir`.
0 commit comments