Adding Content
When you want to insert content to a file, you can use the content
or contentPath
properties in the demo step.
Property | Description |
---|---|
content | This property allows you to add the content directly in the JSON file, but this can make your JSON file quite big and it can be hard to read. |
contentPath | This property allows you to reference a file in the .demo folder. This way you can keep your JSON file clean and add the content in separate files. Important: the path is relative to the .demo folder. |
Using the content
property
When you use the content
property, you can add the content directly in the JSON file. This property is best used when you want to add a single line of text.
{ "action": "insert", "path": "src/content/docs/tips/adding-content.mdx",3 "position": "end", "content": "Learn how to add content to a file in Demo Time."}
Using the contentPath
property
When you use the contentPath
property, you can reference a file in the .demo
folder. This way you can keep your JSON file clean and add the content in separate files.
Add a line by line insertion delay
You also have the option to define the speed of each line that is inserted. You can define this on global level with the demoTime.lineInsertionDelay
setting or on a per step level with the insertLineSpeed
property.
{ "action": "insert", "path": "src/content/docs/tips/adding-content.mdx", "position": "end", "contentPath": "multiple-lines.md", "insertLineSpeed": 25}