import { html, Component } from "../lib/index.js"; import { keybindings } from "../keybindings.js"; import commands from "../commands.js"; function KeyBindingsHelp() { let l = keybindings.map((binding) => { let keys = []; if (binding.ctrlKey) { keys.psuh("Ctrl"); } if (binding.altKey) { keys.push("Alt"); } keys.push(binding.key); keys = keys.map((name, i) => { return html` ${i > 0 ? "+" : null} ${name} `; }); return html`
${keys}
${binding.description}
`; }); return html`
/
Start writing a command
${l}
`; } function CommandsHelp() { let l = Object.keys(commands).map((name) => { let cmd = commands[name]; let usage = "/" + name; if (cmd.usage) { usage += " " + cmd.usage; } return html`
${usage}
${cmd.description}
`; }); return html`
${l}
`; } export default function Help() { return html`

Key bindings

<${KeyBindingsHelp}/>

Commands

<${CommandsHelp}/> `; }