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: _internal/_template/README.md
+18-12Lines changed: 18 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,8 @@
1
1
# Title
2
2
3
3
<details>
4
-
<summary>How to run this example</summary>
4
+
<summary>How to run this example</summary>
5
+
<br/>
5
6
6
7
```bash
7
8
# Set your API key as an environment variable.
@@ -12,10 +13,16 @@ cd typescript # Navigate to the typescript example
12
13
npm install # Install dependencies
13
14
ts-node example.ts # Run the example
14
15
15
-
# Run the Python example
16
-
# Note: First install dependencies in the root examples directory.
16
+
# If using Poetry:
17
17
cd python # Navigate to the python example
18
-
poetry run python example.py # Run the example
18
+
poetry install # Install dependencies and build the example
19
+
poetry run main # Run the example
20
+
21
+
# If using Rye:
22
+
# Update pyproject.toml to switch to Rye.
23
+
cd python # Navigate to the python example
24
+
rye sync # Install dependencies and build the example
25
+
rye run main # Run the example
19
26
```
20
27
21
28
</details>
@@ -24,13 +31,13 @@ We follow this procedure to create consistent, high volume content.
24
31
25
32
1. Come up with a short readable slug, e.g. `generate-json` and a title.
26
33
2. Create a folder in the [examples repo](https://github.com/SubstrateLabs/examples), copying this folder
27
-
3. Write the code in TS or Python, and keep it simple. Ideally it’s just a script with no additional dependencies.
28
-
1. Consider creating illustrative variations of the script (e.g. `ComputeText` and `MultiComputeText` - [example](https://github.com/SubstrateLabs/examples/tree/main/basics/generate-text))
29
-
2. Translate your script to the other language. (TODO: automated translation with Substrate)
30
-
3. Make sure both examples run and produce simple polished output.
31
-
4. Simplify the code
32
-
1. Wrap lines (multi-line node declarations are easier to read)
33
-
2. Consider inlining variables
34
+
3. Write the code in TS or Python, and keep it simple. Ideally it’s just a script with no additional dependencies.
35
+
1. Consider creating illustrative variations of the script (e.g. `ComputeText` and `MultiComputeText` - [example](https://github.com/SubstrateLabs/examples/tree/main/basics/generate-text))
36
+
2. Translate your script to the other language. (TODO: automated translation with Substrate)
37
+
3. Make sure both examples run and produce simple polished output.
38
+
4. Simplify the code
39
+
1. Wrap lines (multi-line node declarations are easier to read)
40
+
2. Consider inlining variables
34
41
4. Fill out this README with walkthrough text and generate new image assets.
35
42
36
43

@@ -82,7 +89,6 @@ If your example is a graph, create a diagram.
0 commit comments