Skip to content

Commit 8eccefe

Browse files
committed
Update docs for match urls instead of filepaths
1 parent a678a24 commit 8eccefe

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

docs/directives/try_examples.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -177,31 +177,30 @@ directory of the build directory for the deployed documentation. The format is a
177177

178178
```json
179179
{
180-
"ignore_patterns": ["^latest/.*", "^stable/reference/generated/example"]
180+
"ignore_patterns": ["^/latest/.*", "^/stable/reference/generated/example.html"]
181181
}
182182
```
183183

184-
`TryExamples` buttons will be hidden in files matching at least one of these patterns,
185-
effectively disabling the interactive documentation. In the provided example:
184+
`TryExamples` buttons will be hidden in url pathnames matching at least one of these
185+
patterns, effectively disabling the interactive documentation. In the provided example:
186186

187-
* The pattern `"^latest/.*" disables interactive examples for all files within the
188-
latest directory, which may be useful if this directory contains documentation
189-
for a development version for which corresponding package build is not available
187+
* The pattern `".*latest/.*" disables interactive examples for urls for the documentation
188+
for the latest version of the package, which may be useful if this documentation is
189+
for a development version for which a corresponding package build is not available
190190
in a Jupyterlite kernel.
191191

192-
* The pattern `"^stable/reference/generated/example"` targets a particular file
192+
* The pattern `".*stable/reference/generated/example.html"` targets a particular url
193193
in the documentation for the latest stable release.
194194

195-
Note that these patterns should match the Sphinx docnames of the documentation files.
196-
A docname is the relative path from the documentation root to the file of interest,
197-
but without the file extension. For instance, the docname corresponding to `index.rst` at
198-
the root of the Sphinx source directory would be `index`.
195+
Note that these patterns should match the [pathname](https://developer.mozilla.org/en-US/docs/Web/API/Location/pathname) of the url, not the full url. This is the path portion of
196+
the url. For instance, the pathname of https://jupyterlite-sphinx.readthedocs.io/en/latest/directives/try_examples.html is `/en/latest/directives/try_examples.html`.
197+
199198

200199
A default configuration file can be specified in `conf.py` with the option
201200
`try_examples_default_runtime_config`.
202201

203202
```python
204203
try_examples_default_runtime_config = {
205-
"ignore_patterns": ["^latest/.*", "^stable/reference/generated/example"]
204+
"ignore_patterns": ["^/latest/.*", "^/stable/reference/generated/example.html"]
206205
}
207206
```

0 commit comments

Comments
 (0)