You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2.8 KiB
2.8 KiB
Scriptorium Obsidian Plugin
An Obsidian plugin for creating, editing, and publishing Nostr document events directly from your vault.
Features
- Multiple Event Kinds: Support for kinds 1, 11, 30023, 30040, 30041, 30817, 30818
- AsciiDoc Support: Automatic parsing and splitting of AsciiDoc documents into nested 30040/30041 structures
- Metadata Management: YAML metadata files with validation per event kind
- Structure Preview: Visual preview of document structure before creating events
- Two-Step Workflow: Create and sign events separately from publishing
- Relay Management: Automatic fetching of relay lists (kind 10002) with AUTH support
- d-tag Normalization: Automatic NIP-54 compliant d-tag generation from titles
Installation
- Clone this repository
- Run
npm install - Run
npm run build - Copy the
main.js,manifest.json, andstyles.css(if any) to your Obsidian vault's.obsidian/plugins/scriptorium-obsidian/directory
Setup
- Set your Nostr private key in the environment variable
SCRIPTORIUM_OBSIDIAN_KEY:- Format:
nsec1...(bech32) or 64-character hex string
- Format:
- Open Obsidian settings → Scriptorium Nostr
- Click "Refresh from Env" to load your private key
- Click "Fetch" to get your relay list from Nostr relays
Usage
Creating Events
- Open a Markdown or AsciiDoc file
- Run command:
Create Nostr Events - If metadata doesn't exist, it will be created with defaults
- For AsciiDoc documents with structure (
= Title), a preview will be shown - Events are created, signed, and saved to
{filename}_events.jsonl
Editing Metadata
- Open a file
- Run command:
Edit Metadata - Fill in the metadata form
- Save
Publishing Events
- Ensure events have been created (check for
{filename}_events.jsonl) - Run command:
Publish Events to Relays - Events will be published to all configured write relays
Previewing Structure
- Open an AsciiDoc file with structure
- Run command:
Preview Document Structure - Review the event hierarchy before creating
File Formats
- Markdown (
.md): Kinds 1, 11, 30023, 30817 - AsciiDoc (
.adoc,.asciidoc): Kinds 30041, 30818 - AsciiDoc with Structure (starts with
= Title): Kind 30040 with nested 30041 events
Metadata Files
Metadata is stored as {filename}_metadata.yml in the same directory as the document.
For 30040 events, the title is derived from the document header (= Title) but can be overridden in the metadata file.
Commands
Create Nostr Events- Create and sign events from current filePreview Document Structure- Show event hierarchy previewPublish Events to Relays- Publish from .jsonl file to relaysEdit Metadata- Open metadata form for current file
Development
npm install
npm run dev # Watch mode
npm run build # Production build
License
MIT