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: build/tcedocs/README.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -111,7 +111,8 @@ The `TEST_MARKER` dictionary maps programming languages to test framework annota
111
111
112
112
Each code example uses special comments, such as `HIDE_START` and `REMOVE_START`, to control how the examples are displayed. The following list gives an explanation:
113
113
114
-
-`EXAMPLE id`: Defines the identifier of the source code example file, where `id` is any common string (for example, `cmds_string`). IDs should only contain ASCII alphanumeric characters, underline characters (`_`), or hyphen characters (`-`). Do not use multibyte characters.
114
+
-`EXAMPLE: id`: Defines the identifier of the source code example file, where `id` is any common string (for example, `cmds_string`). IDs should only contain ASCII alphanumeric characters, underline characters (`_`), or hyphen characters (`-`). Do not use multibyte characters.
115
+
-`BINDER_ID id`: Defines the [BinderHub](https://binderhub.readthedocs.io/en/latest/) commit hash for the example. This is used to generate a link to a BinderHub instance that will run the example.
115
116
-`HIDE_START`: Starts a code block that should be *hidden* when showing the example. This code block will only become visible if **unhide** (the eye button) is clicked.
116
117
-`HIDE_END`: Marks the end a hidden code block.
117
118
-`REMOVE_START`: Starts a code block that should be entirely removed when the example is processed by the build code. This is useful for removing lines of code that do not contribute to the example but are needed to embed the code into a proper test case or framework. Good examples of such code blocks are imports of external libraries or test assertions.
Copy file name to clipboardExpand all lines: build/tcedocs/SPECIFICATION.md
+76-7Lines changed: 76 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -299,24 +299,84 @@ This allows the same language to appear multiple times in the tab interface with
299
299
**Purpose**: Parse and process individual example files
300
300
301
301
**Special Comment Markers**:
302
-
-`EXAMPLE: {id}`: Defines the example identifier
302
+
-`EXAMPLE: {id}`: Defines the example identifier (required, must be first line)
303
+
-`BINDER_ID {hash}`: Defines the BinderHub commit hash for interactive notebook link (optional)
303
304
-`HIDE_START` / `HIDE_END`: Code blocks hidden by default (revealed with eye button)
304
305
-`REMOVE_START` / `REMOVE_END`: Code blocks completely removed from display
305
306
-`STEP_START {name}` / `STEP_END`: Named code blocks for step-by-step examples
306
307
308
+
**BINDER_ID Marker**:
309
+
310
+
The `BINDER_ID` marker provides a commit hash for [BinderHub](https://binderhub.readthedocs.io/en/latest/) integration, allowing users to run examples in an interactive Jupyter notebook environment.
-`hidden`: Line ranges initially hidden (revealed with eye button)
1197
1258
-`named_steps`: Map of step names to line ranges
1198
1259
-`sourceUrl`: GitHub link to original source (null for local examples)
1260
+
-`binderId`: **Optional**- BinderHub commit hashfor interactive notebook link (string, only present if`BINDER_ID` marker exists in source file)
1261
+
1262
+
**Metadata Hierarchy**:
1263
+
- The `binderId` field is stored **per-language**, not per-example-set
1264
+
- This allows different languages to have different BinderHub configurations
1265
+
- Example: Python might have a BinderHub link, while Node.js doesn't
1266
+
- If `BINDER_ID` marker isnot present in the source file, the `binderId` field should be omitted entirely (notset to null or empty string)
1199
1267
1200
1268
### Special Comment Reference
1201
1269
1202
1270
| Marker | Purpose | Example | Notes |
1203
1271
|--------|---------|---------|-------|
1204
1272
|`EXAMPLE: id`| Define example ID|`# EXAMPLE: home_vecsets` | Must be first line |
1273
+
|`BINDER_IDhash`| Define BinderHub commit hash|`# BINDER_ID 6bbed3da294e8de5a8c2ad99abf883731a50d4dd` | Optional, typically line 2. Used to generate interactive notebook links. Hash is a Git commit SHA from binder-launchers repo. |
0 commit comments