diff --git a/home.tsx b/home.tsx
index 11e10f3..cf5bb8a 100644
--- a/home.tsx
+++ b/home.tsx
@@ -1,95 +1,7 @@
-import { renderToString } from "preact-render-to-string";
-import { PluginData, PluginsData, readInfoFile } from "./readInfoFile.js";
+import { renderHomeHtml } from "./homeView.jsx";
+import { readInfoFile } from "./readInfoFile.js";
export async function renderHome(origin: string, ctx?: ExecutionContext) {
- const content = await renderContent(origin, ctx);
- return `
-
-
-
+
+ {renderPlugins(pluginsData)}
+ No plugins match your filter.
+ {renderCommands()}
+
+ );
+}
+
+// builds the lowercased string the search filters against: name, url, version,
+// description, config key, and every file extension / file name / exec command
+// the plugin handles.
+function pluginSearchText(plugin: PluginData) {
+ const parts: (string | undefined)[] = [
+ plugin.name,
+ plugin.url,
+ plugin.version,
+ plugin.description,
+ plugin.configKey,
+ ...(plugin.keywords ?? []),
+ ...(plugin.fileExtensions ?? []),
+ ...(plugin.fileNames ?? []),
+ ];
+ for (const item of plugin.configItems ?? []) {
+ parts.push(...(item.match?.fileExtensions ?? []));
+ for (const command of item.config?.commands ?? []) {
+ parts.push(command.command, ...(command.exts ?? []));
+ }
+ }
+ return parts.filter(Boolean).join(" ").toLowerCase();
+}
+
+function renderCommands() {
+ const commands: { cmd: string; desc: string }[] = [
+ { cmd: "dprint config update", desc: "Automatically updates the plugins in a config file." },
+ { cmd: "dprint add", desc: "Adds one of these plugins via a multi-select prompt." },
+ { cmd: "dprint add