You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: hub/powertoys/command-palette/using-markdown-content.md
+25-4Lines changed: 25 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,12 +17,18 @@ So far, we've only shown how to display a list of commands in a **ListPage**. Ho
17
17
18
18
[IContentPage](./microsoft-commandpalette-extensions/icontentpage.md) (and its toolkit implementation, [ContentPage](microsoft-commandpalette-extensions-toolkit/contentpage.md)) is the base for displaying all types of rich content in the Command Palette. To display markdown content, you can use the [MarkdownContent](microsoft-commandpalette-extensions-toolkit/markdowncontent.md) class.
19
19
20
-
1. In your <ExtensionName>Page.cs, replace content with:
20
+
1. In the `Pages` directory, add a new class
21
+
1. Name the class `MarkdownPage.cs`
22
+
1. Update the file to:
21
23
22
24
```csharp
23
-
internalsealedpartial class <ExtensionName>Page : ContentPage
+ new CommandItem(new MarkdownPage()) { Title = DisplayName },
57
+
];
58
+
}
59
+
60
+
```
61
+
41
62
1. Deploy your extension
42
63
1. In command palette, `Reload`
43
64
44
65
In this example, a new `ContentPage` that displays a simple markdown string is created. The 'MarkdownContent' class takes a string of markdown content and renders it in the Command Palette.
45
66
46
-

67
+

47
68
48
69
You can also add multiple blocks of content to a page. For example, you can add two blocks of markdown content.
0 commit comments