wayver's git archive


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

README.md@main

raw
Date Commit Message Author Files + -
2026-02-23 01:55 initial mvp wayverd 139 17808 0
...

1# `sable`
2
3`sable` is a obsidian renderer that powers my website.
4
5## Feature Support
6
7  - Markdown
8    - [ ] Escaping
9    - [X] Frontmatter
10      - [X] YAML
11      - [X] TOML
12      - [X] JSON
13    - [X] Syntax Highlighting
14    - [ ] Github Flavored Markdown
15      - [X] Autolinks
16      - [X] Tables
17      - [X] Task List Items
18      - [X] Strikethrough
19    - [ ] Obsidian Flavored Markdown
20      - [X] Callouts
21      - [ ] File Includes
22      - [X] Tags
23      - [X] Wikilinks
24
25  - Obsidian Vault
26    - [ ] Base
27    - [ ] Canvas
28    - [ ] Graph
29    - [X] Note
30
31  - Sable
32    - [ ] Build time assets (eg: running Tailwind)
33    - [ ] Custom data loading
34    - [ ] Dev Server
35    - [ ] Support HTML notes
36
37## Configuration
38
39`sable` is somewhat configurable with its config file and command line arguments.
40
41Config is stored is in the `sable.toml` file, and only some settings can be
42overwritten by command line arguments.
43
44```typescript
45interface Config {
46  // CLI: --dist
47  dist: string = `${CWD}/dist`;
48  // CLI: --static
49  static: string = `${CWD}/static`;
50  // CLI: --templates
51  templates: string = `${CWD}/templates`;
52  // CLI: --src
53  vault: string = `${CWD}/content`;
54
55  // The port the dev server will run on
56  // CLI: [serve] --port
57  port: number = 3000;
58
59  // The default template a Note will be rendered with if not provided a layout
60  // Defaults to a 'hidden' internal template
61  default_template: string;
62
63  // Custom data that will be available to a template
64  data: ConfigData;
65}
66
67interface ConfigData {
68  [key: string]: any;
69}
70```
71
72## Templates
73
74`sable` uses [Tera]https://keats.github.io/tera/ for templating, see its documentation for more information.
75
76Which template is used to render a note can be changed by setting the
77`template` frontmatter variable, otherwise it uses an included 'default'
78template.
79
80```typescript
81const meta: Meta;
82
83// `meta` is meta information about `sable` itself
84interface Meta {
85  package_name: string;
86  package_version: string;
87
88  git_dirty: boolean;
89  git_hash: string;
90}
91
92const data: Data;
93
94// `data` is any data passed in from the config (if it exists)
95interface Data {
96  [key: string]: any;
97}
98
99const note: Note;
100
101// An Obsidian note
102interface Note {
103  path: NotePath;
104
105  name: string;
106  title: string;
107
108  metadata: NoteMetadata;
109  properties: NoteProperties;
110
111  toc: NoteHeading[];
112
113  contents: string;
114}
115
116interface NotePath {
117  vault: VaultPath;
118
119  full: string;
120  relative: string;
121
122  slug: string;
123}
124
125type VaultPath = string;
126
127// Contains a Note's file system metadata
128interface NoteMetadata {
129  created: string;
130  modified: string;
131
132  git_created: string | null;
133  git_modified: string | null;
134}
135
136// This is actually the note's frontmatter
137// Its called properties as `sable` supports YAML, TOML, and JSON frontmatter
138interface NoteProperties {
139  [key: string]: any;
140}
141
142interface NoteHeading {
143  level: number;
144  id: string;
145  title: string;
146  children: NoteHeading[];
147}
148
149// Renders a string to Markdown
150function markdown(in: string): string;
151```
152