Skip to content

Commit 66c141d

Browse files
docs: ogImage props fixes
1 parent da3dc43 commit 66c141d

13 files changed

Lines changed: 146 additions & 118 deletions

File tree

streamerbot/1.get-started/installation/linux/.navigation.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ title: Linux
22
icon: i-mdi-linux
33
navigation.title: Linux
44
ogImage:
5-
headline: Linux
5+
props:
6+
headline: Linux

streamerbot/3.api/1.sub-actions/.navigation.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ description: Reference of all available sub-actions in Streamer.bot
33
icon: i-mdi-lightning-bolt-outline
44
navigation.icon: i-mdi-lightning-bolt-outline
55
ogImage:
6-
headline: Sub-Actions
6+
props:
7+
headline: Sub-Actions

streamerbot/3.api/3.csharp/.navigation.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ title: C# Code
22
description: Guides and references for using C# code in Streamer.bot
33
navigation.icon: mdi:code-braces
44
ogImage:
5-
headline: C# Code
5+
props:
6+
headline: C# Code

streamerbot/3.api/3.csharp/1.recipes/visual-studio-code.md

Lines changed: 117 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,19 @@ title: Visual Studio Code
33
description: Configure Visual Studio Code for writing C# code for Streamer.bot with linting and autocomplete.
44
icon: mdi:microsoft-visual-studio-code
55
ogImage:
6-
icon: mdi:microsoft-visual-studio-code
6+
props:
7+
icon: mdi:microsoft-visual-studio-code
78
---
89

910
::tip
1011
**VSCode Extension now available!** :br
11-
This extension automates the process of setting up a Streamer.bot C# project directory with IntelliSense, while also providing hover documentation for CPH methods. Installation includes the base C# extension dependency.
12+
This extension automates the process of setting up a Streamer.bot C# project directory with IntelliSense, while also providing hover documentation for CPH methods. Installation includes the base C# extension dependency.
1213
::
1314

1415
::card{title="Streamer.bot C# Extension for Visual Studio Code" icon=mdi:microsoft-visual-studio-code color=info to="https://marketplace.visualstudio.com/items?itemName=fajita-of-treason.streamer-bot-csharp"}
15-
Write Streamer.bot C# code with IntelliSense and documentation
16+
Write Streamer.bot C# code with IntelliSense and documentation
1617

17-
<small>by FajitaOfTreason</small>
18+
<small>by FajitaOfTreason</small>
1819
::
1920

2021
<hr>
@@ -26,18 +27,19 @@ By following these instructions, you'll be able to write code with linting, whic
2627
## Prerequisites
2728

2829
::card-group
29-
::card{title="Visual Studio Code" icon=mdi:microsoft-visual-studio-code to="https://code.visualstudio.com/download"}
30-
Follow the installation instructions for your operating system
31-
::
30+
::card{title="Visual Studio Code" icon=mdi:microsoft-visual-studio-code to="https://code.visualstudio.com/download"}
31+
Follow the installation instructions for your operating system
32+
::
3233

33-
::card{title="VSCode C# Extension" icon=vscode-icons:file-type-csharp to="https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csharp"}
34-
This is the base extension for C# development and includes the .NET Install Tool
35-
::
34+
::card{title="VSCode C# Extension" icon=vscode-icons:file-type-csharp to="https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csharp"}
35+
This is the base extension for C# development and includes the .NET Install Tool
36+
::
3637
::
3738

3839
## Setup Guide
3940

4041
::steps{level=3}
42+
4143
### Create a new Streamer.bot Project Folder
4244

4345
::navigate
@@ -58,56 +60,58 @@ Open the `Explorer` view by selecting `View > Explorer` from the menu bar, or us
5860

5961
1. Create a new file by right-clicking in the `Explorer` pane and selecting `New File` from the context menu:
6062

61-
![New File option being selected in VS Code's Explorer Pane context menu](assets/vscode-new-file.png)
63+
![New File option being selected in VS Code's Explorer Pane context menu](assets/vscode-new-file.png)
6264

6365
2. Name the file, ending with `.csproj`
6466

65-
![A new file being named StreamerBot.csproj](assets/vscode-naming-new-csproj.png)
67+
![A new file being named StreamerBot.csproj](assets/vscode-naming-new-csproj.png)
6668

6769
<br>
6870

6971
3. Paste the contents from the code block below into your new `.csproj` file:
7072

71-
::code-collapse
72-
```xml [StreamerBot.csproj]
73-
<Project Sdk="Microsoft.NET.Sdk">
74-
<PropertyGroup>
75-
<TargetFramework>net481</TargetFramework>
76-
<LangVersion>13.0</LangVersion>
77-
<Nullable>enable</Nullable>
78-
<UseWPF>true</UseWPF>
79-
<DefineConstants>EXTERNAL_EDITOR</DefineConstants>
80-
<NoWarn>CS0114</NoWarn>
81-
82-
<!-- Set the following directory with your Streamer.bot install location -->
83-
<StreamerBotPath>C:/path/to/streamer.bot-directory</StreamerBotPath>
84-
</PropertyGroup>
85-
<ItemGroup>
86-
<!-- Automatically include in every CS file -->
87-
<Using Include="Streamer.bot.Plugin.Interface" />
88-
<Using Include="Streamer.bot.Plugin.Interface.Model" />
89-
<Using Include="Streamer.bot.Plugin.Interface.Enums" />
90-
<Using Include="Streamer.bot.Common.Events" />
91-
92-
<!-- Use forward slashes for cross-platform compatibility -->
93-
<Reference Include="$(StreamerBotPath)/Streamer.bot.Plugin.Interface.dll" />
94-
<Reference Include="$(StreamerBotPath)/Streamer.bot.Common.dll" />
95-
<Reference Include="$(StreamerBotPath)/Twitch.Common.dll" />
96-
97-
<Reference Include="$(StreamerBotPath)/NAudio*.dll" />
98-
<Reference Include="$(StreamerBotPath)/Wpf*.dll" />
99-
<Reference Include="$(StreamerBotPath)/Newtonsoft.Json.dll" />
100-
<Reference Include="$(StreamerBotPath)/System.*.dll" />
101-
102-
<Reference Include="System.Web" />
103-
<Reference Include="System.Net.Http" />
104-
105-
<!-- Uncomment the following line to reference all DLLs in the streamerbot directory -->
106-
<!-- <Reference Include="$(StreamerBotPath)/**/*.dll" /> -->
107-
</ItemGroup>
108-
</Project>
109-
```
110-
::
73+
::code-collapse
74+
75+
```xml [StreamerBot.csproj]
76+
<Project Sdk="Microsoft.NET.Sdk">
77+
<PropertyGroup>
78+
<TargetFramework>net481</TargetFramework>
79+
<LangVersion>13.0</LangVersion>
80+
<Nullable>enable</Nullable>
81+
<UseWPF>true</UseWPF>
82+
<DefineConstants>EXTERNAL_EDITOR</DefineConstants>
83+
<NoWarn>CS0114</NoWarn>
84+
85+
<!-- Set the following directory with your Streamer.bot install location -->
86+
<StreamerBotPath>C:/path/to/streamer.bot-directory</StreamerBotPath>
87+
</PropertyGroup>
88+
<ItemGroup>
89+
<!-- Automatically include in every CS file -->
90+
<Using Include="Streamer.bot.Plugin.Interface" />
91+
<Using Include="Streamer.bot.Plugin.Interface.Model" />
92+
<Using Include="Streamer.bot.Plugin.Interface.Enums" />
93+
<Using Include="Streamer.bot.Common.Events" />
94+
95+
<!-- Use forward slashes for cross-platform compatibility -->
96+
<Reference Include="$(StreamerBotPath)/Streamer.bot.Plugin.Interface.dll" />
97+
<Reference Include="$(StreamerBotPath)/Streamer.bot.Common.dll" />
98+
<Reference Include="$(StreamerBotPath)/Twitch.Common.dll" />
99+
100+
<Reference Include="$(StreamerBotPath)/NAudio*.dll" />
101+
<Reference Include="$(StreamerBotPath)/Wpf*.dll" />
102+
<Reference Include="$(StreamerBotPath)/Newtonsoft.Json.dll" />
103+
<Reference Include="$(StreamerBotPath)/System.*.dll" />
104+
105+
<Reference Include="System.Web" />
106+
<Reference Include="System.Net.Http" />
107+
108+
<!-- Uncomment the following line to reference all DLLs in the streamerbot directory -->
109+
<!-- <Reference Include="$(StreamerBotPath)/**/*.dll" /> -->
110+
</ItemGroup>
111+
</Project>
112+
```
113+
114+
::
111115

112116
<br>
113117

@@ -119,10 +123,11 @@ Do not use quotes around your Streamer.bot directory path, even if it contains s
119123

120124
::note
121125
**Notes about `StreamerBot.csproj`**
126+
122127
- This file includes the Streamer.bot using statements in every `.cs` file automatically
123128
- This file configures the project as a `.NET Framework 4.8.1` project
124129
- To point to your own Streamer.bot DLLs, replace the contents of `<StreamerBotPath>` with the path to your own Streamer.bot directory (containing `Streamer.bot.exe` and `.dll` files)
125-
::
130+
::
126131

127132
### Create a .cs File
128133

@@ -137,6 +142,7 @@ Create a new file ending with the `.cs` extension. This is the file we will use
137142
Paste the `C# Code Example` below into your `.cs` file, replacing `UniqueClassName` with your filename
138143

139144
::code-collapse
145+
140146
```cs [UniqueClassName.cs]
141147
using System;
142148

@@ -155,6 +161,7 @@ public class CPHInline
155161
}
156162
}
157163
```
164+
158165
::
159166

160167
::read-more{to=#file-template-snippet}
@@ -178,11 +185,12 @@ See the [File Template Snippet](#file-template-snippet) section below for more i
178185
- You can now type `CPH.` and it will automatically give you the available `CPH` methods
179186
- This uses the `Streamer.bot.Plugin.Interface.dll` in your Streamer.bot folder
180187
- The advantage of this is that you will have an up-to-date list of methods, classes, and enums available
181-
::
188+
::
182189

183190
![Dropdown of autocomplete options following CPH. in VS Code](assets/vscode-example-autocomplete.png)
184191

185192
## Debugging
193+
186194
While writing your code, you can check for compilation errors in the `Problems` view.
187195

188196
::navigate
@@ -193,50 +201,51 @@ Compilation errors will be shown in red, and will prevent your code from compili
193201

194202
![Example of missing semicolon error which will not compile](assets/vscode-example-error.png)
195203

196-
197204
Warnings will be shown in yellow, but will not prevent your code from compiling:
198205

199206
![Example of compiler warning for an unused variable which will not block compilation](assets/vscode-example-warning.png)
200207

201-
202208
## Copying Code to Streamer.bot
203209

204210
When you code is ready to run in Streamer.bot, you can copy it into an [Execute C# Code](/api/sub-actions/core/csharp/execute-csharp-code) sub-action.
205211

206212
::steps{level=3}
207-
### Select your Action
208213

209-
::navigate
210-
In **Streamer.bot**, navigate to the `Actions` panel
211-
::
214+
### Select your Action
215+
216+
::navigate
217+
In **Streamer.bot**, navigate to the `Actions` panel
218+
::
212219

213-
- Create or select an existing action
214-
- Add or select an `Execute C# Code` sub-action
220+
- Create or select an existing action
221+
- Add or select an `Execute C# Code` sub-action
215222

216-
### Copy your C# Code
217-
- You can copy the entirety of your `.cs` file into Streamer.bot's C# code editor.
223+
### Copy your C# Code
218224

219-
::tip
220-
The preprocessor directives will ensure the VSCode specific sections are not active inside Streamer.bot.
221-
::
225+
- You can copy the entirety of your `.cs` file into Streamer.bot's C# code editor.
222226

223-
- Make sure the code compiles successfully by clicking `Compile`
224-
- Click `Save and Compile`
227+
::tip
228+
The preprocessor directives will ensure the VSCode specific sections are not active inside Streamer.bot.
229+
::
225230

226-
::note
227-
If you see any errors ending with `(are you missing an assembly reference?)`, click `Find Refs`
228-
::
231+
- Make sure the code compiles successfully by clicking `Compile`
232+
- Click `Save and Compile`
229233

230-
::success
231-
Your code has now been added inside an `Execute C# Code` Sub-Action and is ready to run in your Action!
232-
::
234+
::note
235+
If you see any errors ending with `(are you missing an assembly reference?)`, click `Find Refs`
236+
::
237+
238+
::success
239+
Your code has now been added inside an `Execute C# Code` Sub-Action and is ready to run in your Action!
240+
::
233241
::
234242

235243
## Additional Steps
236244

237245
These steps are optional, but can help speed up your workflow.
238246

239247
### File Template Snippet
248+
240249
To make creating new `.cs` files easier, you can create a workplace snippet that will fill in the Streamer.bot C# sub-action template code for you.
241250

242251
::navigate
@@ -250,38 +259,41 @@ Select the option to create a new snippets file for the current workspace, and e
250259
![VS Code Configure Snippets Command with New Snippets file for workspace option selected](assets/vscode-snippets-new-workplace-file.png)
251260

252261
Replace the contents of your new `.code-snippets` file with the code below:
253-
::code-collapse
254-
```json
255-
{
256-
"Execute C# Sub-Action Template" : {
257-
"scope": "csharp",
258-
"isFileTemplate": true,
259-
"prefix": "streamer.bot-file-template",
260-
"description": "New Execute C# Sub-Action for Streamer.bot",
261-
"body": [
262-
"using System;",
263-
"",
264-
"/*----- Class name should match FileName -----*/",
265-
"#if EXTERNAL_EDITOR",
266-
"public class ${TM_FILENAME_BASE} : CPHInlineBase",
267-
"#else",
268-
"public class CPHInline",
269-
"#endif",
270-
"/*--------------------------------------------*/",
271-
"{",
272-
" public bool Execute()",
273-
" {",
274-
" ${0:// Add your code here}",
275-
" return true;",
276-
" }",
277-
"}"
278-
]
279-
}
262+
::code-collapse
263+
264+
```json
265+
{
266+
"Execute C# Sub-Action Template": {
267+
"scope": "csharp",
268+
"isFileTemplate": true,
269+
"prefix": "streamer.bot-file-template",
270+
"description": "New Execute C# Sub-Action for Streamer.bot",
271+
"body": [
272+
"using System;",
273+
"",
274+
"/*----- Class name should match FileName -----*/",
275+
"#if EXTERNAL_EDITOR",
276+
"public class ${TM_FILENAME_BASE} : CPHInlineBase",
277+
"#else",
278+
"public class CPHInline",
279+
"#endif",
280+
"/*--------------------------------------------*/",
281+
"{",
282+
" public bool Execute()",
283+
" {",
284+
" ${0:// Add your code here}",
285+
" return true;",
286+
" }",
287+
"}"
288+
]
280289
}
281-
```
282-
::
290+
}
291+
```
292+
293+
::
283294

284295
::success
285296
You can use workplace snippets to quickly scaffold new Streamer.bot C# files!
297+
286298
- After creating new .cs files, you can now fill them with the snippet by either typing `sbfile`, and selecting the `streamer.bot-file-template` from the dropdown, or by running `Snippets: Fill File with Snippet` from the Command Palette
287-
::
299+
::

streamerbot/3.api/3.csharp/3.methods/.navigation.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ navigation:
55
title: C# Methods
66
icon: mdi:code-braces-box
77
ogImage:
8-
headline: C# Methods
8+
props:
9+
headline: C# Methods

streamerbot/3.api/3.csharp/4.classes/.navigation.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ navigation:
55
title: C# Classes
66
icon: mdi:code-braces-box
77
ogImage:
8-
headline: C# Classes
8+
props:
9+
headline: C# Classes

streamerbot/3.api/3.csharp/5.enums/.navigation.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ navigation:
55
title: Enums
66
icon: mdi:code-braces-box
77
ogImage:
8-
headline: C# Enums
8+
props:
9+
headline: C# Enums

streamerbot/3.api/4.websocket/.navigation.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ navigation.icon: mdi:api
33
title: WebSocket Server
44
description: Reference for the Streamer.bot WebSocket Server API
55
ogImage:
6-
headline: WebSocket Server
6+
props:
7+
headline: WebSocket Server

0 commit comments

Comments
 (0)