π The open-source, offline-first Notion, Obsidian & Confluence alternative. Advanced Markdown, multi-tenant teams, OIDC/SSO, and local S3 backups. Deploy in one command.
Vue dockergolangkanbanknowledge-baseknowledge-managementmarkdownnote-takingnotesnotes-appnotionnuxtnuxtjsoffline-firstoidcpwaselfhostedssovuevuejswiki
Markdown export, syntax guide, shortcuts guide, doc card header, markdown editor
Smaug67393eb770966c43
diff --git a/frontend/components/MarkdownEditor/LazyMarkdownEditor.vue b/frontend/components/MarkdownEditor/LazyMarkdownEditor.vueindex 9fc9d3f2..238b00cf 100644--- a/frontend/components/MarkdownEditor/LazyMarkdownEditor.vue+++ b/frontend/components/MarkdownEditor/LazyMarkdownEditor.vue@@ -1,7 +1,7 @@<template><div class="editor-container"><Toolbar :document="document" @execute-action="exec" />- <div style="padding: 6px 8px; flex: 1; display: flex; flex-direction: column; min-height: 0">+ <div style="padding: 6px 0; flex: 1; display: flex; flex-direction: column; min-height: 0; gap: 8px"><input placeholder="Title" class="title" v-model="document.name" v-if="!minimal" /><input placeholder="Description" class="description" v-model="document.description" v-if="!minimal" /><div class="markdown" ref="container">@@ -189,13 +189,6 @@ const markdownKeysmap = [},];-watch(- () => document.value.content_markdown,- val => {- document.value.content_html = compile(val || '');- },-);-const themeCompartment = new Compartment();watch(useColorMode(), mode => {@@ -204,36 +197,34 @@ watch(useColorMode(), mode => {effects: themeCompartment.reconfigure(mode.value === 'dark' ? materialDark : materialLight),});});+const updateListener = EditorView.updateListener.of(v => {+ if (v.docChanged) {+ const content = v.state.doc.toString();+ document.value.content_markdown = content;+ document.value.content_html = compile(content);+ }+});+const state = EditorState.create({+ doc: document.value.content_markdown || '',+ extensions: [+ lineNumbers(),+ highlightSpecialChars(),+ history(),+ drawSelection(),+ autocompletion(),+ keymap.of([...defaultKeymap, ...historyKeymap, ...searchKeymap, ...markdownKeysmap]),+ markdown({ base: markdownLanguage }),+ updateListener,+ snippetListener,+ themeCompartment.of(useColorMode().value === 'dark' ? materialDark : materialLight),+ highlightSelectionMatches({}),+ EditorView.lineWrapping,+ EditorState.allowMultipleSelections.of(true),+ ],+});onMounted(() => {if (!editorContainer.value) return;- const updateListener = EditorView.updateListener.of(v => {- if (v.docChanged) {- const content = v.state.doc.toString();- document.value.content_markdown = content;- document.value.content_html = compile(content);- }- });-- const state = EditorState.create({- doc: document.value.content_markdown || '',- extensions: [- lineNumbers(),- highlightSpecialChars(),- history(),- drawSelection(),- autocompletion(),- keymap.of([...defaultKeymap, ...historyKeymap, ...searchKeymap, ...markdownKeysmap]),- markdown({ base: markdownLanguage }),- updateListener,- snippetListener,- themeCompartment.of(useColorMode().value === 'dark' ? materialDark : materialLight),- highlightSelectionMatches({}),- EditorView.lineWrapping,- EditorState.allowMultipleSelections.of(true),- ],- });-editorView.value = new EditorView({state,parent: editorContainer.value,@@ -315,6 +306,9 @@ input {font-size: 1rem;font-weight: 500;width: 100%;+ border: 1px solid var(--border-color);+ border-radius: 8px;+ padding: 8px;}.title {diff --git a/frontend/pages/dashboard/docs/_components/DocumentCardHeader.vue b/frontend/pages/dashboard/docs/_components/DocumentCardHeader.vueindex c1ea2eb3..f1341da1 100644--- a/frontend/pages/dashboard/docs/_components/DocumentCardHeader.vue+++ b/frontend/pages/dashboard/docs/_components/DocumentCardHeader.vue@@ -3,7 +3,7 @@<div class="text"><p class="category">{{ category?.name }}- <DocumentCardHeaderActionRow :doc_id="doc.id" class="no-print" />+ <DocumentCardHeaderActionRow :doc="doc" class="no-print" /></p><h1 class="title">{{ doc?.name }}</h1><p class="description">{{ doc?.description }}</p>diff --git a/frontend/pages/dashboard/docs/_components/DocumentCardHeaderActionRow.vue b/frontend/pages/dashboard/docs/_components/DocumentCardHeaderActionRow.vueindex 48568c59..572849d8 100644--- a/frontend/pages/dashboard/docs/_components/DocumentCardHeaderActionRow.vue+++ b/frontend/pages/dashboard/docs/_components/DocumentCardHeaderActionRow.vue@@ -1,10 +1,17 @@<template><span class="header">- <NuxtLink :to="`/dashboard/docs/edit/${doc_id}`">+ <NuxtLink :to="`/dashboard/docs/edit/${doc.id}`"><svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M200-200h57l391-391-57-57-391 391v57Zm-80 80v-170l528-527q12-11 26.5-17t30.5-6q16 0 31 6t26 18l55 56q12 11 17.5 26t5.5 30q0 16-5.5 30.5T817-647L290-120H120Zm640-584-56-56 56 56Zm-141 85-28-29 57 57-29-28Z" /></svg></NuxtLink>+ <NuxtLink @click="exportMarkdown">+ <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px">+ <path+ d="m640-360 120-120-42-43-48 48v-125h-60v125l-48-48-42 43 120 120ZM160-160q-33 0-56.5-23.5T80-240v-480q0-33 23.5-56.5T160-800h640q33 0 56.5 23.5T880-720v480q0 33-23.5 56.5T800-160H160Zm0-80h640v-480H160v480Zm0 0v-480 480Zm60-120h60v-180h40v120h60v-120h40v180h60v-200q0-17-11.5-28.5T440-600H260q-17 0-28.5 11.5T220-560v200Z"+ />+ </svg>+ </NuxtLink><NuxtLink @click="print"><svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path@@ -22,10 +29,23 @@<script setup lang="ts">import DeleteDocumentModal from '../_modals/DeleteDocumentModal.vue';+import type { Document } from '~/stores';-const props = defineProps<{ doc_id: string }>();+const props = defineProps<{ doc: Document }>();const print = () => window.print();-const openDeleteModal = () => useModal().add(new Modal(shallowRef(DeleteDocumentModal), { documentId: props.doc_id }));+const openDeleteModal = () => useModal().add(new Modal(shallowRef(DeleteDocumentModal), { documentId: props.doc.id }));++function exportMarkdown() {+ const blob = new Blob([props.doc.content_markdown || ''], { type: 'text/markdown' });+ const url = URL.createObjectURL(blob);+ const a = document.createElement('a');+ a.href = url;+ a.download = `${props.doc.name}.md`;+ document.body.appendChild(a);+ a.click();+ document.body.removeChild(a);+ URL.revokeObjectURL(url);+}</script><style lang="scss" scoped>diff --git a/frontend/pages/dashboard/settings/_views/markdown.vue b/frontend/pages/dashboard/settings/_views/markdown.vueindex 2a308370..6656c1ef 100644--- a/frontend/pages/dashboard/settings/_views/markdown.vue+++ b/frontend/pages/dashboard/settings/_views/markdown.vue@@ -12,6 +12,32 @@<li><mark>Highlight</mark>: <code>`highlight`</code></li></ul>+ <strong>Tags: </strong> <tag blue>Info</tag> <tag green>Success</tag><tag red>Danger</tag><tag yellow>Yellow</tag> <tag grey>Note</tag> <tag teal>Teal</tag>++ <pre><code><tag blue>Info</tag>+<tag green>Success</tag>+<tag red>Danger</tag>+<tag yellow>Yellow</tag>+<tag grey>Note</tag>+<tag teal>Teal</tag></code></pre>++ <h2>π’ Headings</h2>++ <ul>+ <li>H1: <code># Heading 1</code></li>+ <li>H2: <code>## Heading 2</code></li>+ <li>H3: <code>### Heading 3</code></li>+ <li>H4: <code>#### Heading 4</code></li>+ <li>H5: <code>##### Heading 5</code></li>+ <li>H6: <code>###### Heading 6</code></li>+ </ul>+ <pre><code># Heading 1+## Heading 2+### Heading 3</code></pre>+ <h2>π¬ Blockquotes</h2>+ <p>Use the greater-than symbol to create blockquotes:</p>+ <pre><code>> This is a blockquote.+> It can span multiple lines.</code></pre><h2>π Links & Images</h2><ul><li><a href="https://example.com">Example link</a>: <code>[Example link](https://example.com)</code></li>@@ -104,11 +130,19 @@ function hello() {><div class="red custom-block"><p class="custom-block-title">DANGER</p></div></span></div>-+ <div style="display: flex">+ <span style="flex: 1; margin-right: 10px">+ <pre style="color: white; padding: 5px"><code>:::teal TEAL<br/>:::</code></pre>+ </span>+ <span style="flex: 1; margin-left: 10px"+ ><div class="teal custom-block"><p class="custom-block-title">TEAL</p></div></span+ >+ </div><h2>π Special Blocks</h2><p>These enhance your note structure visually and semantically:</p><ul><li><code>:::center</code> β center-aligned content</li>+ <li><code>:::no-print</code> β content hidden in PDF export</li><li><code>:::details</code> β collapsible content</li><li><code>:::definition [Title]</code></li><li><code>:::theorem [Title]</code></li>@@ -117,6 +151,9 @@ function hello() {<p>Examples:</p><pre><code>:::centerThis text is centered!+:::</code></pre>+ <pre><code>:::no-print+This content will not appear in PDF exports.:::</code></pre><pre><code>:::details@@ -147,16 +184,6 @@ Snippets help you focus on writing, not formatting.</div></template>-<script setup>-const colorBlocks = [- { color: 'blue', label: 'INFO' },- { color: 'green', label: 'SUCCESS' },- { color: 'yellow', label: 'WARNING' },- { color: 'grey', label: 'NOTE' },- { color: 'red', label: 'DANGER' },-];-</script>-<style scoped>.markdown-doc {max-width: 850px;diff --git a/frontend/pages/dashboard/settings/_views/shortcuts.vue b/frontend/pages/dashboard/settings/_views/shortcuts.vueindex 6b7a8fb9..7b353843 100644--- a/frontend/pages/dashboard/settings/_views/shortcuts.vue+++ b/frontend/pages/dashboard/settings/_views/shortcuts.vue@@ -41,6 +41,14 @@<span class="key">Ctrl + s</span><span>Save the document</span></div>+ <div class="shortcut">+ <span class="key">Ctrl + p</span>+ <span>Toggle preview</span>+ </div>+ <div class="shortcut">+ <span class="key">Esc</span>+ <span>Exit the page</span>+ </div><div class="shortcut"><span class="key">Ctrl + z</span><span>Undo the last action</span>diff --git a/frontend/pages/dashboard/settings/index.vue b/frontend/pages/dashboard/settings/index.vueindex 412cc8b8..ed78d63a 100644--- a/frontend/pages/dashboard/settings/index.vue+++ b/frontend/pages/dashboard/settings/index.vue@@ -18,8 +18,8 @@<span>Workspaces</span><NuxtLink to="/dashboard/categories"><Icon fill="var(--font-color)" name="categories" />Manage categories</NuxtLink><NuxtLink to="/dashboard/docs"><Icon fill="var(--font-color)" name="draft" />Manage documents</NuxtLink>- <NuxtLink to="/dashboard/import" style="display: flex; align-items: center"><Icon fill="var(--font-color)" name="import" />Manage importations <tag blue>New</tag></NuxtLink>- <span>Utils</span>+ <NuxtLink to="/dashboard/import" style="display: flex; align-items: center"><Icon fill="var(--font-color)" name="import" />Manage importations <tag yellow>Beta</tag></NuxtLink>+ <span>Utils <tag blue>New</tag></span><NuxtLink to="?p=shortcuts"><Icon fill="var(--font-color)" name="shortcuts" />Shortcuts</NuxtLink><NuxtLink to="?p=snippets"><Icon fill="var(--font-color)" name="snippets" />Snippets</NuxtLink><NuxtLink to="?p=markdown"><Icon fill="var(--font-color)" name="markdown" />Markdown</NuxtLink>