omp packages

pi-file0.1.2

Create temporary Markdown files from Pi command text and embed them in the input editor.

GitHub Actions Published 2 days ago Apache-2.0 ~335 downloads/mo

Untested on omp

This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.

Did it work for you?

Result

One report per person. A new report replaces your old one.

Reports 0

No reports yet.

Readme

pi-file

/file turns command text into temporary Markdown files and prepares them as embedded Pi file context.

Single file

/file Hello World

This creates a temporary hello-world.md and prepares:

<file name="/tmp/pi-file-XXXXXX/hello-world.md" bytes="11" label="Hello World">
Hello World
</file>

The first usable ATX heading (# through ######) determines the label and filename. If there is no usable heading, the first non-empty line is used.

/file Intro

### Authentication Failure
...

This produces authentication-failure.md.

Multiple files

/file # Request
GET /users

/file # Response
200 OK

Each top-level marker consisting of /file followed by one literal space starts another file. Separators are ignored inside fenced Markdown code blocks.

The initial command also requires that space before its content, for example /file # Request. A bare /file followed by a newline is not valid command syntax. A top-level line beginning with /file followed by a literal space, outside a fence, is reserved as the multi-file separator.

/file prepares context in Pi's normal input editor but does not submit it. Add any instructions you want, then press Enter to submit normally.

Files remain in the operating system's temporary directory. Cleanup by the operating system is intentional.

Install and develop

pi install git:github.com/boadij/pi-file
pi -e ./extensions/index.ts
npm test
npm pack --dry-run