⚠️Early Alpha — Org-press is experimental. Perfect for hackers and tinkerers, not ready for production. Documentation may be incomplete or inaccurate.

API Reference

Org-press exposes several APIs for different use cases.

APIs

For Block Rendering

#+begin_src javascript :use dom | withSourceCode
// Execute code and show both source and result
console.log("Hello World");
#+end_src

#+begin_src javascript :use sourceOnly
// Display code without execution
const x = 1;
#+end_src

See Modes API.

For Plugin Authors

import type { BlockPlugin } from "org-press";

export const myPlugin: BlockPlugin = {
  name: "my-plugin",
  // ...
};

See Plugin API.

For Programmatic Usage

import { parseOrgContent, renderOrg } from "org-press";

const parsed = await parseOrgContent(content, context);
const result = await renderOrg(parsed.ast, renderContext);

See JavaScript API.

For CLI Extensions

export const myPlugin: BlockPlugin = {
  name: "my-plugin",
  cli: {
    command: "mycommand",
    description: "Do something",
    action: async (args, config) => {
      // ...
    },
  },
};

See CLI Plugins.