|
|
1 week ago | |
|---|---|---|
| src | 1 week ago | |
| .gitignore | 1 week ago | |
| .npmrc | 1 week ago | |
| README.md | 1 week ago | |
| esbuild.config.mjs | 1 week ago | |
| manifest.json | 1 week ago | |
| package-lock.json | 1 week ago | |
| package.json | 1 week ago | |
| tsconfig.json | 1 week ago | |
README.md
Scriptorium Nostr
An Obsidian plugin for creating, editing, and publishing Nostr document events directly from your vault.
Author: Silberengel
Homepage: https://gitcitadel.com
Funding: gitcitadel@getalby.com
Features
- Multiple Event Kinds: Support for Markdown-formatted kinds (1, 11, 30023, 30817) and Asdciidoc-formatted kinds (30040, 30041, 30818).
- Bookstr Support: Automatic parsing and splitting of e-books/publications into nested 30040/30041 structures
- Metadata Management: YAML metadata files with validation per event kind
- Structure Preview: Visual preview of publication 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
Manual Installation
- Clone this repository
- Run
npm install.obsidian/plugins/scriptorium-obsidian/ - Run
npm run build - Create the plugin directory in your Obsidian vault (if it doesn't exist):
- Navigate to your vault's root directory
- Create
.obsidian/plugins/scriptorium-obsidian/directory
- Copy the
main.jsandmanifest.jsonfiles to.obsidian/plugins/scriptorium-obsidian/ - Reload Obsidian and enable the plugin in Settings → Community Plugins
Note: The .obsidian folder is hidden by default. You may need to show hidden files in your file manager to see it.
Setup
Private Key Configuration
You have three options to set your private key:
Option 1: Manual Entry (Easiest)
- Open Obsidian settings → Scriptorium Nostr
- Enter your private key in the password field
- Click "Set Key"
Option 2: File in Vault (Most Reliable)
- Create a file named
.scriptorium_keyin your vault root - Put your private key on a single line (nsec1... or 64-char hex)
- Open plugin settings and click "Refresh"
Option 3: Environment Variable
- Set
SCRIPTORIUM_OBSIDIAN_KEYin your terminal:export SCRIPTORIUM_OBSIDIAN_KEY="nsec1..." - Important: Launch Obsidian from the same terminal:
(If Obsidian is already running, close it and restart from the terminal)obsidian - Open plugin settings → Scriptorium Nostr
- Click "Refresh" to load your private key
Note: Environment variables are only available to processes launched from the terminal where they were set. If you launch Obsidian from a desktop shortcut or application menu, it won't have access to the environment variable. You must launch Obsidian from the terminal where you set the variable.
See ENV_SETUP.md for detailed instructions on setting environment variables.
Key Format: nsec1... (bech32) or 64-character hex string
Relay Configuration
- Open Obsidian settings → Scriptorium Nostr
- Click "Fetch" to get your relay list from Nostr relays
- The plugin will automatically fetch from
wss://profiles.nostr1.com,wss://relay.damus.io, andwss://thecitadel.nostr1.com
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
Author
Silberengel
- Homepage: https://gitcitadel.com
- Funding: gitcitadel@getalby.com