Skip to content

Commit bc01566

Browse files
docs: markdown syntax guide (#368)
1 parent 24f1bee commit bc01566

File tree

2 files changed

+70
-13
lines changed

2 files changed

+70
-13
lines changed

docs/tutorialkit.dev/src/content/docs/guides/creating-content.mdx

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,3 +144,72 @@ src/templates
144144
│ # Overrides "index.js" from "shared-template"
145145
└── index.js
146146
```
147+
148+
## Markdown and MDX Support
149+
150+
TutorialKit comes with built-in support for both Markdown and MDX, powered by Astro. This means you can leverage all Markdown and MDX features when creating lesson content. To explore the full capabilities, check out Astro's [Markdown support](https://docs.astro.build/en/guides/markdown-content/) and [MDX support](https://docs.astro.build/en/guides/integrations-guide/mdx/) documentation for more details.
151+
152+
### Callouts
153+
154+
Callouts are visual elements designed to highlight specific information or provide additional context within a document or user interface. They are ideal for drawing attention to important tips, warnings, and other key messages.
155+
156+
You can create callouts using the following types: `tip`, `info`, `warn`, `danger` and `success`.
157+
158+
```
159+
:::info
160+
Some info with some markdown `syntax` and a [`link`](https://tutorialkit.dev/).
161+
162+
Here's a normal [link](https://tutorialkit.dev/).
163+
:::
164+
```
165+
166+
![Content](../reference/images/theming-callout.png)
167+
168+
To customize the styles of a callout, check out the [theming reference](/reference/theming/#callouts).
169+
170+
171+
### Code blocks
172+
173+
TutorialKit offers a comprehensive set of code block features powered by Expressive Code. It includes all core features, along with optional plugins like collapsible sections and line numbers. For a full overview, check out the [Expressive Code documentation](https://expressive-code.com/).
174+
175+
````md title="content.md"
176+
```js title="code.js" ins={4} del={5} {6} "greeting"
177+
const greeting = 'Hello, World!';
178+
179+
// This is a comment
180+
const added = 'This line was added';
181+
const removed = 'This line was removed';
182+
const highlighted = 'This line is highlighted';
183+
```
184+
````
185+
186+
```js title="code.js" ins={4} del={5} {6} "greeting"
187+
const greeting = 'Hello, World!';
188+
189+
// This is a comment
190+
const added = 'This line was added';
191+
const removed = 'This line was removed';
192+
const highlighted = 'This line is highlighted';
193+
```
194+
195+
#### Importing files
196+
197+
In addition to Expressive Code features, you can import files from your code template `_files` and `_solution` folders using the file or solution shortcodes. These shortcodes insert the content of the specified file directly into your lesson content.
198+
199+
- `file` shortcode is used to reference files from the lesson `_files` or code template folder.
200+
- `solution` shortcode is used to reference files from the lesson `_solution` folder.
201+
202+
For example, the following code will insert the content of the `box.css` file from the `_files` folder:
203+
204+
````md "file"
205+
```file:/box.css
206+
```
207+
````
208+
209+
```css
210+
.box {
211+
width: 100px;
212+
height: 100px;
213+
background-color: red;
214+
}
215+
```

docs/tutorialkit.dev/src/content/docs/reference/theming.mdx

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -77,22 +77,10 @@ The content refers to the main part of the lesson that contains the text and ima
7777

7878
### Callouts
7979

80-
Callouts are visual elements used to draw attention to specific information or provide additional context within a document or user interface. They are typically used to highlight important tips, warnings, or other types of messages.
81-
82-
For instanceof, here's an example of an info callout.
80+
Customize the appearance of each callout type by adjusting its specific style tokens. Each callout includes tokens for elements such as text color, title color, icon color, background, code snippet color, and border color.
8381

8482
![Content](./images/theming-callout.png)
8583

86-
Callouts are created like this:
87-
88-
```
89-
:::tip
90-
This is a tip
91-
:::
92-
```
93-
94-
Valid callout names are `tip`, `info`, `warn` and `danger`.
95-
9684
#### Tip
9785

9886
| Token | Description |

0 commit comments

Comments
 (0)