Skip to content

Commit 15beac2

Browse files
author
Sorita Heng
committed
Add instructions for VS Code
1 parent 6ad3eb1 commit 15beac2

2 files changed

Lines changed: 51 additions & 12 deletions

File tree

modules/ROOT/partials/integrations/blazor-postinstall.adoc

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
1-
. Verify the installation by checking the `+ItemGroup+` references in `+BlazorApp.csproj+`, such as:
2-
+
3-
_File:_ `+BlazorApp.csproj+`
1+
. Verify the installation by checking the `+ItemGroup+` references in the project file. For example, if the project is named _BlazorApp_, the relevant file would be `+BlazorApp.csproj+` with the dependency referenced as follows:
42
+
53
[source,xml]
64
----
75
<ItemGroup>
86
<PackageReference Include="TinyMCE.Blazor" Version="X.Y.Z" />
97
</ItemGroup>
108
----
11-
. Add the `+tinymce-blazor.js+` script to the main page.
12-
* If using the Blazor Web App, add the script in `+Components/App.razor+`, for example:
9+
. Add the `+tinymce-blazor.js+` script to the main page. If using the Blazor Web App, add the script in `+Components/App.razor+`, for example:
1310
+
1411
[source,html]
1512
----
1613
<script src="_framework/blazor.web.js"></script>
1714
<script src="_content/TinyMCE.Blazor/tinymce-blazor.js"></script>
1815
----
19-
16+
+
2017
[NOTE]
18+
====
2119
The location of the script depends on the type of Blazor app, including Blazor Server and Blazor WebAssembly (WASM) which are not covered in this guide.
2220
2321
* If using Blazor Server, add the script in `+Pages/_Host.cshtml+`, for example:
@@ -34,17 +32,33 @@ The location of the script depends on the type of Blazor app, including Blazor S
3432
<script src="_content/TinyMCE.Blazor/tinymce-blazor.js"></script>
3533
<script src="_framework/blazor.webassembly.js"></script>
3634
----
35+
====
36+
+
3737
38-
. Add the `+Editor+` component to a page by either:
39-
* Using the `+using+` directive
38+
. Add the `+Editor+` component to a page by either:
39+
* Using the `+using+` directive:
40+
+
41+
[source,cs]
42+
----
43+
@using TinyMCE.Blazor
44+
<Editor />
45+
----
46+
+
47+
For example:
48+
+
49+
_File:_ `+Pages/Index.razor+`
4050
+
4151
[source,cs]
4252
----
53+
@page "/"
4354
@rendermode InteractiveServer
4455
@using TinyMCE.Blazor
56+
57+
<h1>Hello, world!</h1>
58+
Welcome to your new app.
4559
<Editor />
4660
----
47-
* Using the full component and package name
61+
* Using the component with its namespace:
4862
+
4963
[source,cs]
5064
----
@@ -64,9 +78,11 @@ _File:_ `+Pages/Index.razor+`
6478
<h1>Hello, world!</h1>
6579
Welcome to your new app.
6680
<Editor />
67-
----
81+
----
82+
+
6883
[IMPORTANT]
69-
In a Blazor Web App, different render modes determine how components are rendered and how interactivity is handled. To enable JavaScript interactivity, ensure that `+@rendermode InteractiveServer+` is specified in a page component.
84+
In a Blazor Web App, different render modes determine how components are rendered and how interactivity is handled. To enable JavaScript interactivity, ensure that `+@rendermode InteractiveServer+` is specified in a page component.
85+
+
7086

7187
ifeval::["{productSource}" != "cloud"]
7288

modules/ROOT/partials/integrations/blazor-quick-start.adoc

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,29 @@ Select from the following guides:
99
[[using-visual-studio-code]]
1010
== Using Visual Studio Code (VS Code)
1111

12+
=== Prerequisites
13+
14+
This procedure requires:
15+
16+
* https://code.visualstudio.com/[Visual Studio Code (VS Code)^]
17+
* https://dotnet.microsoft.com/en-us/download[.NET SDK^]
18+
* https://learn.microsoft.com/en-us/visualstudio/subscriptions/vs-c-sharp-dev-kit[C# Dev Kit VS Code Extension^]
19+
20+
Alternatively, the https://learn.microsoft.com/en-us/dotnet/core/install/windows#install-with-visual-studio-code[.NET WinGet Configuration file^] can be downloaded to install the necessary dependencies.
21+
22+
=== Procedure
23+
24+
. In VS Code, open the Command Palette by pressing `+Ctrl+Shift+P+`. Find `.NET: New Project` and select it to create a new project.
25+
. Select *Blazor Web App* from the list of templates and follow the steps to set up the project.
26+
. Using the Command Palette, find and select `.NuGet: Add NuGet Package`. Enter `+TinyMCE.Blazor+` and select the package along with the version to install.
27+
28+
ifeval::["{productSource}" == "package-manager"]
29+
30+
. To use the self-hosted version of `{productName}`, install the `{productname}` package from the Command Pallette.
31+
endif::[]
32+
include::partial$integrations/blazor-postinstall.adoc[]
33+
34+
1235
[[using-visual-studio]]
1336
== Using Visual Studio
1437

@@ -22,7 +45,7 @@ This procedure requires:
2245
=== Procedure
2346

2447
. On the Visual Studio toolbar, click the https://docs.microsoft.com/en-us/visualstudio/ide/create-new-project[*New Project* button].
25-
. Select the *Blazor Web App* template and name the project 'BlazorApp'.
48+
. Select the *Blazor Web App* template and follow the steps to set up the project.
2649
. Use the NuGet package manager console to install the `+TinyMCE.Blazor+` package, such as:
2750
+
2851
[source,sh]

0 commit comments

Comments
 (0)