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/tutorialkit.dev/src/content/docs/guides/creating-content.mdx
+21
Original file line number
Diff line number
Diff line change
@@ -91,6 +91,14 @@ To get a better understanding of how the code you create in each lesson results
91
91
92
92
The `_solution` folder contains the code for the lesson in its solved state. This is the code that the user will see when they click the "Solve" button in the tutorial app. The folder usually contains the same files as the `_files` folder, but with the code filled in. It may also include additional files.
93
93
94
+
### File Visibility
95
+
96
+
Editor's files are resolved by three steps. Each step overrides previous one:
3. When solution is revealed, display files from `_solution` directory. (highest priority)
101
+
94
102
## Code templates
95
103
96
104
For the code to run in the preview, it must be an actual, working application, including a dev server and any necessary configuration files. Usually, it's not practical to include this kind of boilerplate files in a lesson content (and copy it for every further lesson!). Instead, you can use the `template` feature of TutorialKit to provide a base project that will be used for all lessons.
This declaration will make TutorialKit use the `src/templates/my-advanced-template` directory as the base for the lesson.
112
120
121
+
By default files in template are not shown in the code editor.
122
+
To make them visible, you can use `visibleFiles` option.
123
+
This can reduce repetition when you want to show same files visible in multiple lessons.
124
+
125
+
```markdown {5}
126
+
---
127
+
title: Advanced Topics
128
+
template:
129
+
name: my-advanced-template
130
+
visibleFiles: ['src/index.js', '**/utils/**']
131
+
---
132
+
```
133
+
113
134
If you start having a lot of templates and they all share some files, you can create a shared template that they all extend. This way, you can keep the shared files in one place and avoid duplication. To do that, you need to specify the `extends` property in the template's `.tk-config.json` file:
0 commit comments