wayver's git archive


an obsidian renderer
git clone https://git.wayver.dev/sable

Date Commit Message Author Files + -
2026-02-23 21:59 beginning on port over some of the changes from markdown-ppp since the f... wayverd 11 527 15
2026-02-23 01:55 initial mvp wayverd 139 17808 0
...

sable

sable is a obsidian renderer that powers my website.

Feature Support

Configuration

sable is somewhat configurable with its config file and command line arguments.

Config is stored is in the sable.toml file, and only some settings can be overwritten by command line arguments.

interface Config {
  // CLI: --dist
  dist: string = `${CWD}/dist`;
  // CLI: --static
  static: string = `${CWD}/static`;
  // CLI: --templates
  templates: string = `${CWD}/templates`;
  // CLI: --src
  vault: string = `${CWD}/content`;

  // The port the dev server will run on
  // CLI: [serve] --port
  port: number = 3000;

  // The default template a Note will be rendered with if not provided a layout
  // Defaults to a 'hidden' internal template
  default_template: string;

  // Custom data that will be available to a template
  data: ConfigData;
}

interface ConfigData {
  [key: string]: any;
}

Templates

sable uses Tera for templating, see its documentation for more information.

Which template is used to render a note can be changed by setting the template frontmatter variable, otherwise it uses an included 'default' template.

const meta: Meta;

// `meta` is meta information about `sable` itself
interface Meta {
  package_name: string;
  package_version: string;

  git_dirty: boolean;
  git_hash: string;
}

const data: Data;

// `data` is any data passed in from the config (if it exists)
interface Data {
  [key: string]: any;
}

const note: Note;

// An Obsidian note
interface Note {
  path: NotePath;

  name: string;
  title: string;

  metadata: NoteMetadata;
  properties: NoteProperties;

  toc: NoteHeading[];

  contents: string;
}

interface NotePath {
  vault: VaultPath;

  full: string;
  relative: string;

  slug: string;
}

type VaultPath = string;

// Contains a Note's file system metadata
interface NoteMetadata {
  created: string;
  modified: string;

  git_created: string | null;
  git_modified: string | null;
}

// This is actually the note's frontmatter
// Its called properties as `sable` supports YAML, TOML, and JSON frontmatter
interface NoteProperties {
  [key: string]: any;
}

interface NoteHeading {
  level: number;
  id: string;
  title: string;
  children: NoteHeading[];
}

// Renders a string to Markdown
function markdown(in: string): string;