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
Add jupyterlite_ignore_contents config, mapping to --ignore-contents arg in JupyterLite build (#309)
* Add `jupyterlite_ignore_contents` config, mapping to `--ignore-contents` arg to JupyterLite build
* Add documentation for new config
* Add appropriate prefix to print call
* Format 🔔
`jupyterlite_contents` can be a string or a list of strings. Each string is expanded using the Python `glob.glob` function with its recursive option. See the [glob documentation](https://docs.python.org/3/library/glob.html#glob.glob) and the [wildcard pattern documentation](https://docs.python.org/3/library/fnmatch.html#fnmatch.fnmatch) for more details. This option supports both paths relative to the docs source directory and absolute ones.
14
14
15
+
### Ignoring content
16
+
17
+
You can exclude some contents from your specified contents, for example:
18
+
19
+
```python
20
+
jupyterlite_contents = ["./path/to/my/contents"]
21
+
jupyterlite_ignore_contents = [r".*\.txt"]
22
+
```
23
+
24
+
`jupyterlite_ignore_contents` can be a string or a list of strings. Strings are used as Python regular expressions to match and exclude files from your custom content. It's best to use raw string literals for your ignore strings, otherwise you'll need to double-escape (in other words, `r".*\.txt"` is more readable than `".*\\.txt"`).
25
+
26
+
Each string is passed directly to [the JupyterLite build `--ignore-contents` CLI argument](https://jupyterlite.readthedocs.io/en/stable/reference/cli.html#common-parameters).
27
+
15
28
## JupyterLite dir
16
29
17
30
By default, jupyterlite-sphinx runs the `jupyter lite build` command in the docs directory, you can overwrite this behavior and ask jupyterlite to build in a given directory:
0 commit comments