From f0c40bc9eed8922b87cf5061de3210f8508ebe01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nu=C5=A1a=20Puk=C5=A1i=C4=8D?= Date: Sat, 6 Sep 2025 13:06:35 +0200 Subject: [PATCH] Compose --- src/lib/a/primitives/AAlert.svelte | 5 +- src/lib/components/ZettelEditor.svelte | 306 +++++++++++-------------- src/routes/new/compose/+page.svelte | 22 +- 3 files changed, 151 insertions(+), 182 deletions(-) diff --git a/src/lib/a/primitives/AAlert.svelte b/src/lib/a/primitives/AAlert.svelte index 6e064ef..c4643af 100644 --- a/src/lib/a/primitives/AAlert.svelte +++ b/src/lib/a/primitives/AAlert.svelte @@ -1,15 +1,16 @@ - + {#if title}
{@render title()} diff --git a/src/lib/components/ZettelEditor.svelte b/src/lib/components/ZettelEditor.svelte index e92573f..96ca28d 100644 --- a/src/lib/components/ZettelEditor.svelte +++ b/src/lib/components/ZettelEditor.svelte @@ -1,34 +1,15 @@ -
+
{#if hasPublicationHeader}
- +
@@ -115,14 +153,14 @@ Note content here... Publication Format Detected

- You're using a publication format (document title with = or "index card"). - This editor is for individual notes only. Use the - Events form + You're using a publication format (document title with = or "index card"). + This editor is for individual notes only. Use the + Events form to create structured publications.

- { // Store the content in sessionStorage so it can be loaded in the Events form sessionStorage.setItem('zettelEditorContent', content); @@ -132,7 +170,7 @@ Note content here... > Switch to Publication Editor -
{:else} -
-
-
- - - -
-
-

- Note-Taking Tool -

-

- This editor is for creating individual notes (30041 events) only. Each section becomes a separate note event. - You can add metadata like author, version, publication date, summary, and tags using AsciiDoc attributes. - To create structured publications with a 30040 index event that ties multiple notes together, - use the Events form. -

- -
+ + {#snippet title()}Note-Taking Tool{/snippet} +

+ This editor is for creating individual notes (30041 events) only. Each section becomes a separate note event. + You can add metadata like author, version, publication date, summary, and tags using AsciiDoc attributes. + To create structured publications with a 30040 index event that ties multiple notes together, + use the Events form. +

+ -
+ {/if} -
- -
- -
- -
-
- - {#if showPreview && !hasPublicationHeader} -
+
-

- AsciiDoc Preview -

- -
+ +
{#if !content.trim()} -
- Start typing to see the preview... -
+
Start typing to see the preview...
{:else}
{#each parsedSections as section, index}
-
- {@html asciidoctor().convert( - `== ${section.title}\n\n${section.content}`, - { - standalone: false, - doctype: "article", - attributes: { - showtitle: true, - sectids: true, - }, - }, - )} -
- - +
{@html asciidoctor().convert(`== ${section.title}\n\n${section.content}`, { standalone:false, doctype:'article', attributes:{ showtitle:true, sectids:true } })}
- -
+
{#if section.tags && section.tags.length > 0} {#each section.tags as tag} -
- {tag[0]}: - {tag[1]} -
+
{tag[0]}:{tag[1]}
{/each} {:else} - No tags + No tags {/if}
- {#if index < parsedSections.length - 1} - -
-
- Event Boundary -
-
+
Event Boundary
{/if}
{/each}
- -
- Event Count: - {parsedSections.length} event{parsedSections.length !== 1 - ? "s" - : ""} -
-
+
Event Count: {parsedSections.length} event{parsedSections.length !== 1 ? 's' : ''}
{/if}
diff --git a/src/routes/new/compose/+page.svelte b/src/routes/new/compose/+page.svelte index 2d20b3b..a63b83c 100644 --- a/src/routes/new/compose/+page.svelte +++ b/src/routes/new/compose/+page.svelte @@ -1,12 +1,12 @@