Build a plugin
Create First Extension

Create First Extension

This a guide to build a minimal extension and debug in PenX.

Prerequisites

Before write the code, make sure you have the following prerequisites.

Clone the sample extension

Clone the sample plugin using Git.

git clone git@github.com:penxio/extension-template-minimal.git

Develop your extension

After clone it, you'll compile the sample extension

cd penx-extension-sample
npm install # install the dependencies
npm run dev # compile the source code

When you npm run dev, PenX will load the sample extension automatically.

The source code of Hello world is very simple:

// src/index.ts
import { MarkdownBuilder, render } from 'penx'
 
export async function main() {
  render(new MarkdownBuilder('Hello **world**'))
}

Test it in PenX

Open Penx and run the Hello world command:

hello-world-sample

🎉 Congratulations! You built your first extension successfully.