Skip to content

Saving Djots

Djot will automatically save your Djot as you type to the Work in Progress state. This is a temporary state that is not saved to disk.

You can save your Djot to disk by clicking File -> Save Djot or by using the keyboard shortcut Ctrl + S or Cmd + S.

There are two types of djot files: Packaged and Unpackaged.

  • *.djotp - Packaged Djot
  • *.djotup - Unpackaged Djot

Djot Files Structure

Packaged Djots are saved to disk as a single file with the extension .djotp. This file contains all the files that make up your Djot.

The .djotp file is a zip file that contains the following files:

  • /djot.djotup - This is the Djot Manifest containing meta data about the djot - this is a yaml formatted file that you can modify if you need to.
  • /djot-data - directory containing the files that make up the djot
  • /djot-data/src - directory containing the source files
  • /djot-data/src/demo - directory containing the demo files
  • /djot-data/dist - directory containing the compiled files

Djot Manifest Type Definition

ts
type DjotManifest = {
  item: DjotItem;
  meta: DjotMeta;
  basepath?: string;
  features?: DjotFeatures;
  assets?: DjotManifestAsset[];
  compiled?: ("code" | "demo")[];
  transpiled?: {
    [filename: string]: {
      exports?: string[];
      modules?: DjotTranspiledFile["modules"];
    };
  };
};

type DjotManifestAsset = [filename: string, assetName?: string];
type DjotManifest = {
  item: DjotItem;
  meta: DjotMeta;
  basepath?: string;
  features?: DjotFeatures;
  assets?: DjotManifestAsset[];
  compiled?: ("code" | "demo")[];
  transpiled?: {
    [filename: string]: {
      exports?: string[];
      modules?: DjotTranspiledFile["modules"];
    };
  };
};

type DjotManifestAsset = [filename: string, assetName?: string];