5.3 KiB
Scriptorium Nostr
An Obsidian plugin for creating, editing, and publishing Nostr document events directly from your vault.
Author: Silberengel
Homepage: https://gitcitadel.com
Lightning tips: gitcitadel@getalby.com
Features
- Multiple event kinds: Markdown (1, 11, 30023, 30817) and AsciiDoc (30040, 30041, 30818)
- Automatic structure parsing: AsciiDoc documents with headers are parsed into nested 30040/30041 event hierarchies
- Metadata in files: Metadata stored directly in Markdown frontmatter or AsciiDoc header attributes
- Two-step workflow: Create/sign events separately from publishing to relays
- Automatic relay management: Fetch relay lists (kind 10002) with AUTH support
Quick Start
Installation
# First run (vault path required)
./start-obsidian.sh ~/Documents/MyVault
# Subsequent runs (path saved)
./start-obsidian.sh
The script automatically installs dependencies, builds the plugin, and starts Obsidian.
Setup
-
Generate a Nostr key (if needed):
./start-obsidian.sh --generate-keyAdd the shown export command to your shell profile (
~/.bashrc,~/.zshrc, etc.). -
Set your private key:
export SCRIPTORIUM_OBSIDIAN_KEY="nsec1..." -
Configure relays:
- Open Obsidian Settings → Scriptorium Nostr
- Click "Fetch" to get your relay list
Usage
Creating Events
- Open a Markdown or AsciiDoc file
- Run command: Create Nostr Events
- A reminder modal will prompt you to update metadata
- Update metadata in the file (see Metadata section below)
- Click "OK" in the modal
- Events are created, signed, and saved to
{filename}_events.jsonl
Publishing Events
- Ensure events exist (
{filename}_events.jsonl) - Run command: Publish Events to Relays
- Events publish to all configured write relays
Other Commands
- Edit Metadata - Open metadata editor for current file
- Preview Document Structure - Show event hierarchy (AsciiDoc structured documents only)
- New Nostr Document - Create a new document with metadata template
File Formats
Markdown Files (.md)
Supported event kinds: 1, 11, 30023, 30817
Metadata is stored in YAML frontmatter at the top of the file:
---
kind: 30023
title: "My Article"
author: "Author Name"
summary: "Article summary"
image: "https://example.com/image.jpg"
topics: "bitcoin, nostr"
published_at: "1234567890"
---
AsciiDoc Files (.adoc)
Supported event kinds: 30040, 30041, 30818
Simple AsciiDoc (kind 30818):
= Wiki Page Title
:kind: 30818
:author: Author Name
:summary: Page description
:image: https://example.com/image.jpg
:topics: bitcoin, nostr
Structured AsciiDoc (kind 30040 with nested 30041):
= Book Title
:kind: 30040
:author: Author Name
:type: book
:summary: Book description
:collection_id: my-collection
:version_tag: v1
== Chapter 1
Chapter content here...
=== Section 1.1
Section content...
When publishing, metadata is automatically stripped from content before creating events.
Event Kinds
| Kind | Format | Description | Title Required |
|---|---|---|---|
| 1 | Markdown | Normal note | No |
| 11 | Markdown | Discussion thread OP | Yes |
| 30023 | Markdown | Long-form article | Yes |
| 30040 | AsciiDoc | Publication index | Yes |
| 30041 | AsciiDoc | Publication content | Yes |
| 30817 | Markdown | Wiki page | Yes |
| 30818 | AsciiDoc | Wiki page | Yes |
Stand-alone vs Nested 30041
- Stand-alone 30041: Uses NKBIP-01 tags (d, title, image, summary, published_at, topics)
- Nested 30041 (under 30040): Uses NKBIP-08 tags (inherits collection_id, version_tag from parent)
Metadata Fields
All predefined metadata fields are shown in frontmatter/attributes with placeholder descriptions. Remove or update placeholders you don't need. Placeholder values are automatically skipped when creating events.
Common Fields
kind- Event kind (required)title- Document title (required for all except kind 1)author- Author namesummary- Brief descriptiontopics- Comma-separated topics (available for all event kinds)image- Image URL (available for 30023, 30040, 30041, 30817, 30818)
Kind-Specific Fields
30023 (Article):
published_at- Unix timestamp
30040 (Publication Index):
type- Publication type (book, illustrated, magazine, documentation, academic, blog)version- Version or editionpublished_on- Publication datepublished_by- Publishersource- Source URLauto_update- Auto-update behavior (yes, ask, no)collection_id- NKBIP-08 collection identifierversion_tag- NKBIP-08 version identifier
30041 (Publication Content):
- Stand-alone: Same as 30023 (image, summary, published_at, topics)
- Nested: NKBIP-08 tags (collection_id, title_id, chapter_id, section_id, version_tag)
Manual Installation
- Clone repository
- Run
npm install && npm run build - Copy
main.jsandmanifest.jsonto.obsidian/plugins/scriptorium-obsidian/ - Enable in Obsidian Settings → Community Plugins
- Install obsidian-asciidoc plugin (required for
.adocfiles)
Development
npm install
npm run dev # Watch mode
npm run build # Production build
License
MIT