@segha/obsidianmd
v1.0.0
Published
Schemas for ObsidianMD
Readme
@segha/obsidianmd
Schemas for ObsidianMD
Requirements
zod
Installation
pnpm add @segha/obsidianmdUsage
import { DocumentSchema } from '@segha/obsidianmd';
// Validate data
const result = DocumentSchema.parse(data);
// Infer TypeScript types
type Document = z.infer<typeof DocumentSchema>;You can also import specific submodules:
import { DocumentSchema } from '@segha/obsidianmd/document';API Reference
Document
Obsidian document frontmatter schema
Object containing the following properties:
| Property | Description | Type |
| :----------------- | :------------------------------------ | :--------------------------- |
| tags | Document tags for categorization | Array<string> (nullable) |
| aliases | Alternative names for the document | Array<string> (nullable) |
| cssclasses | CSS classes to apply to the document | Array<string> (nullable) |
| publish (*) | Whether to publish the document | boolean |
| permalink | Permanent link for the document | string |
| description | Document description for SEO/previews | string |
| image | Featured image URL | string |
| cover | Cover image URL | string |
(*) Required.
