Skip to content

Commit d6e108f

Browse files
committed
feat: add media assets for doc comments documentation
1 parent 84f3b4a commit d6e108f

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

docs/04-Editing & Code/07-doc-comments.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,22 @@ title: Doc Comments
33
slug: "/Features/doc-comments"
44
---
55

6+
import VideoPlayer from '@site/src/components/Video/player';
7+
68
**Phoenix Code** can write documentation comments for your functions and classes. Type `/**` on the line above a function and accept the hint that appears. Phoenix Code reads the function's signature and generates a comment with all its parameters filled in.
79

8-
<!-- TODO: PLUTO - add video here showing a JSDoc comment being generated -->
10+
<VideoPlayer
11+
src="https://docs-images.phcode.dev/videos/doc-comments/jsdoc-generation.mp4"
12+
/>
913

1014
## Generating a Doc Comment
1115

1216
1. Place your cursor on an empty line right above a function or class.
1317
2. Type `/**`. A code hint appears, for example **Add JSDoc comment**.
1418
3. Press `Enter` or `Tab` to accept it.
1519

20+
![Add JSDoc comment hint](../images/docComments/jsdoc-hint.png "The Add JSDoc comment hint")
21+
1622
The comment expands with a description placeholder, one `@param` tag for each parameter, and an `@returns` tag if the function returns something.
1723

1824
The description is selected first, so you can start typing right away. Press `Tab` to jump to the next field, like a parameter type.
@@ -32,6 +38,10 @@ Each language gets a comment in its own convention:
3238

3339
> In Python, type `"""` on the first line inside a `def` or `class` instead, since docstrings sit below the definition.
3440
41+
<VideoPlayer
42+
src="https://docs-images.phcode.dev/videos/doc-comments/python-docstring.mp4"
43+
/>
44+
3545
## What Gets Filled In
3646

3747
The generated comment is built from the actual signature, not a generic template:
33.1 KB
Loading

0 commit comments

Comments
 (0)