Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:sparkles: Shorthands on mobile https://github.com/siyuan-note/siyuan/issues/14414

Daniel38be2cd8877c
diff --git a/app/appearance/langs/ar_SA.json b/app/appearance/langs/ar_SA.json
index 08dfd6134b..fd5b0a8c8a 100644
--- a/app/appearance/langs/ar_SA.json
+++ b/app/appearance/langs/ar_SA.json
@@ -1223,6 +1223,8 @@
"fileTree23": "إشعار عند تجاوز ملفات ‎.sy‎ أو قاعدة بيانات ‎.json‎ لهذا الحجم",
"fileTree24": "وضع المستندات الفرعية الجديدة في الأعلى",
"fileTree25": "عند التمكين، سيتم وضع المستندات الفرعية الجديدة في أعلى قائمة المستندات الفرعية (ينطبق فقط عند تمكين الترتيب المخصص)",
+ "fileTree26": "مسار الحفظ الافتراضي للمذكرات السريعة",
+ "fileTree27": "على سبيل المثال، <code class=\"fn__code\">/shorthands/{{now | date \"20060102150405\"}}</code>، إذا لم يتم استخدام متغير قالب، ستُضاف المذكرة السريعة إلى نهاية المستند في المسار المحدد",
"export10": "‫على سبيل المثال ‪<code class='fn__code'>&lt;span style=\"color: #fff;background-color: black;padding: 4px;border-radius: 5px;float:right;\"&gt;SiYuan&lt;/span&gt;</code>‬، إذا كان فارغاً، سيتم استخدام العلامة المائية من النص المخصص أو مسار ملف العلامة المائية.‬",
"export11": "طريقة معالجة محتوى المراجع عند التصدير",
"export12": "طريقة معالجة محتوى كتلة التضمين عند التصدير",
diff --git a/app/appearance/langs/de_DE.json b/app/appearance/langs/de_DE.json
index 0a37c4db8c..8ad0aa2df5 100644
--- a/app/appearance/langs/de_DE.json
+++ b/app/appearance/langs/de_DE.json
@@ -1223,6 +1223,8 @@
"fileTree23": "Benachrichtigen, wenn .sy-Dateien oder die Datenbank .json diese Größe überschreiten",
"fileTree24": "Neue Unterdokumente oben platzieren",
"fileTree25": "Wenn aktiviert, werden neu erstellte Unterdokumente oben in der Liste der Unterdokumente platziert (wirkt nur, wenn die benutzerdefinierte Sortierung aktiviert ist)",
+ "fileTree26": "Standard-Speicherort für neue Kurznotizen",
+ "fileTree27": "Zum Beispiel <code class=\"fn__code\">/shorthands/{{now | date \"20060102150405\"}}</code>, wenn keine Vorlagenvariable verwendet wird, wird die Kurznotiz am Ende des Dokuments im angegebenen Pfad angehängt",
"export10": "Beispiel <code class='fn__code'>&lt;span style=\"color: #fff;background-color: black;padding: 4px;border-radius: 5px;float:right;\"&gt;SiYuan&lt;/span&gt;</code>, wenn leer, verwenden Sie Wasserzeichentext oder den Pfad zur Wasserzeichen-Datei.",
"export11": "Inhaltsbehandlungsverfahren des Inhaltsreferenzblocks beim Exportieren",
"export12": "Inhaltsbehandlungsverfahren des Inhalteinbettungsblocks beim Exportieren",
diff --git a/app/appearance/langs/en_US.json b/app/appearance/langs/en_US.json
index b6cdb7971a..b9f67bca16 100644
--- a/app/appearance/langs/en_US.json
+++ b/app/appearance/langs/en_US.json
@@ -520,7 +520,7 @@
"apiMaxContexts": "Maximum number of contexts",
"apiMaxContextsTip": "The maximum number of contexts passed in when requesting the API",
"apiBaseURL": "API Base URL",
- "apiBaseURLTip": "The base URL for API requests, e.g., <code class='fn__code'>https://api.openai.com/v1</code>. The actual endpoint is <code class='fn__code'>/chat/completions</code> under this address",
+ "apiBaseURLTip": "The base URL for API requests, For example, , <code class='fn__code'>https://api.openai.com/v1</code>. The actual endpoint is <code class='fn__code'>/chat/completions</code> under this address",
"apiUserAgentTip": "The user agent that initiated the request, that is, the HTTP header <code class='fn__code'>User-Agent</code>",
"apiVersion": "API version",
"apiVersionTip": "Only required when using the Azure OpenAI service",
@@ -1223,6 +1223,8 @@
"fileTree23": "Notify when .sy files or database .json exceed this size",
"fileTree24": "Place new subdocuments at the top",
"fileTree25": "When enabled, newly created subdocuments will be placed at the top of the subdocument list (only takes effect when custom sorting is enabled)",
+ "fileTree26": "Default shorthand save path",
+ "fileTree27": "For example, <code class=\"fn__code\">/shorthands/{{now | date \"20060102150405\"}}</code>, if no template variable is used the shorthand will be appended to the end of the document at the specified path",
"export10": "For example <code class='fn__code'>&lt;span style=\"color: #fff;background-color: black;padding: 4px;border-radius: 5px;float:right;\"&gt;SiYuan&lt;/span&gt;</code>, if empty, use watermark text or watermark file path.",
"export11": "Content handling method of content ref block when exporting",
"export12": "Content handling method of content embed block when exporting",
diff --git a/app/appearance/langs/es_ES.json b/app/appearance/langs/es_ES.json
index d605c3fd47..7224615492 100644
--- a/app/appearance/langs/es_ES.json
+++ b/app/appearance/langs/es_ES.json
@@ -1223,6 +1223,8 @@
"fileTree23": "Notificar cuando los archivos .sy o la base de datos .json superen este tamaño",
"fileTree24": "Colocar nuevos subdocumentos en la parte superior",
"fileTree25": "Al habilitar, los subdocumentos nuevos se colocarán en la parte superior de la lista de subdocumentos (solo surte efecto cuando el orden personalizado esté habilitado)",
+ "fileTree26": "Ruta de guardado predeterminada para notas rápidas",
+ "fileTree27": "Por ejemplo, <code class=\"fn__code\">/shorthands/{{now | date \"20060102150405\"}}</code>, si no se usa una variable de plantilla, la nota rápida se añadirá al final del documento en la ruta especificada",
"export10": "Por ejemplo <code class='fn__code'>&lt;span style=\"color: #fff;background-color: black;padding: 4px;border-radius: 5px;float:right;\"&gt;SiYuan&lt;/span&gt;</code>, si está vacío, utilice texto de marca de agua o ruta del archivo de marca de agua.",
"export11": "Método de manejo de contenido del bloque de referencia de contenido al exportar",
"export12": "Método de manejo de contenido del bloque de incrustación de contenido al exportar",
diff --git a/app/appearance/langs/fr_FR.json b/app/appearance/langs/fr_FR.json
index 8a9ca220ee..20a1e7a43c 100644
--- a/app/appearance/langs/fr_FR.json
+++ b/app/appearance/langs/fr_FR.json
@@ -1168,8 +1168,8 @@
"appearance3": "Thème de mise en évidence de la syntaxe des blocs de code en mode Sombre",
"appearance2": "Thème de mise en évidence de la syntaxe des blocs de code en mode Clair",
"appearance1": "Thème du bloc de codes",
-"appearance10": "Paramètres du bouton fermer",
- "appearance11": "Réduire dans la barre des tâches après avoir cliqué sur le bouton fermer",
+ "appearance10": "Paramètres du bouton fermer",
+ "appearance11": "Réduire dans la barre des tâches après avoir cliqué sur le bouton fermer",
"appearance16": "Masquer la barre d'état inférieure",
"appearance17": "Une fois activé, la barre d'état sera masquée",
"appearance18": "Configurer l'interrupteur des messages de la barre d'état",
@@ -1223,6 +1223,8 @@
"fileTree23": "Notifier lorsque les fichiers .sy ou la base de données .json dépassent cette taille",
"fileTree24": "Placer les sous-documents nouvellement créés en haut",
"fileTree25": "Si activé, les nouveaux sous-documents seront placés en haut de la liste des sous-documents (ne prend effet que lorsque le tri personnalisé est activé)",
+ "fileTree26": "Chemin d'enregistrement par défaut pour les notes rapides",
+ "fileTree27": "Par exemple, <code class=\"fn__code\">/shorthands/{{now | date \"20060102150405\"}}</code>, si aucune variable de modèle n'est utilisée, la note rapide sera ajoutée à la fin du document dans le chemin spécifié",
"export10": "Par exemple <code class='fn__code'>&lt;span style=\"color: #fff;background-color: black;padding: 4px;border-radius: 5px;float:right;\"&gt;SiYuan&lt;/span&gt;</code>, s'il est vide, utilisez le texte du filigrane ou le chemin du fichier du filigrane.",
"export11": "Traitement du contenu des blocs de référence lors de l'exportation",
"export12": "Gestion du contenu des blocs intégrés lors de l'exportation",
diff --git a/app/appearance/langs/he_IL.json b/app/appearance/langs/he_IL.json
index e912e0dd86..54f9151460 100644
--- a/app/appearance/langs/he_IL.json
+++ b/app/appearance/langs/he_IL.json
@@ -1223,6 +1223,8 @@
"fileTree23": "הצג התראה כאשר קובץ ‎.sy‎ או מסד נתונים ‎.json‎ חורג מגודל זה",
"fileTree24": "מקם מסמך משנה חדש בחלק העליון",
"fileTree25": "כאשר מופעל, מסמכי המשנה החדשים יופיעו בראש רשימת מסמכי המשנה (פועל רק כאשר מיון מותאם אישית מופעל)",
+ "fileTree26": "נתיב שמירה ברירת מחדל לרשומות מהירות",
+ "fileTree27": "לדוגמה, <code class=\"fn__code\">/shorthands/{{now | date \"20060102150405\"}}</code>, אם לא נעשה שימוש במשתנה תבנית, הרשומה המהירה תתווסף לסוף המסמך בנתיב שצוין",
"export10": "למשל <code class='fn__code'>&lt;span style=\"color: #fff;background-color: black;padding: 4px;border-radius: 5px;float:right;\"&gt;SiYuan&lt;/span&gt;</code>, אם ריק, השתמש בטקסט סימן מים או בנתיב קובץ סימן מים.",
"export11": "שיטת טיפול תוכן של בלוק תוכן בעת הייצוא",
"export12": "שיטת טיפול תוכן של בלוק הטמעה בעת הייצוא",
diff --git a/app/appearance/langs/hi_IN.json b/app/appearance/langs/hi_IN.json
index 52f47ef9a4..f422c9ca79 100644
--- a/app/appearance/langs/hi_IN.json
+++ b/app/appearance/langs/hi_IN.json
@@ -1223,6 +1223,8 @@
"fileTree23": ".sy फ़ाइलें या डेटाबेस .json इस आकार से अधिक होने पर सूचित करें",
"fileTree24": "नए उप-दस्तावेज़ शीर्ष पर रखें",
"fileTree25": "सक्षम होने पर, नए बनाए गए उप-दस्तावेज़ उप-दस्तावेज़ सूची के शीर्ष पर रखे जाएंगे (केवल तभी प्रभावी जब कस्टम क्रमबद्धता सक्षम हो)",
+ "fileTree26": "त्वरित नोट्स के लिए डिफ़ॉल्ट सहेजें पथ",
+ "fileTree27": "उदाहरण के लिए, <code class=\"fn__code\">/shorthands/{{now | date \"20060102150405\"}}</code>, यदि कोई टेम्पलेट चर का उपयोग नहीं किया जाता है, तो त्वरित नोट निर्दिष्ट पथ पर दस्तावेज़ के अंत में जोड़ा जाएगा",
"export10": "उदाहरण के लिए <code class='fn__code'>&lt;span style=\"color: #fff;background-color: black;padding: 4px;border-radius: 5px;float:right;\"&gt;SiYuan&lt;/span&gt;</code>, यदि खाली है, तो वॉटरमार्क पाठ या वॉटरमार्क फ़ाइल पथ का उपयोग करें।",
"export11": "निर्यात करते समय सामग्री रेफ़ ब्लॉक की सामग्री हैंडलिंग विधि",
"export12": "निर्यात करते समय सामग्री एम्बेड ब्लॉक की सामग्री हैंडलिंग विधि",
diff --git a/app/appearance/langs/id_ID.json b/app/appearance/langs/id_ID.json
index 9786500574..dd231198d5 100644
--- a/app/appearance/langs/id_ID.json
+++ b/app/appearance/langs/id_ID.json
@@ -1223,6 +1223,8 @@
"fileTree23": "Beritahu ketika file .sy atau database .json melebihi ukuran ini",
"fileTree24": "Tempatkan sub-dokumen baru di bagian atas",
"fileTree25": "Saat diaktifkan, sub-dokumen yang baru dibuat akan ditempatkan di atas daftar sub-dokumen (hanya berlaku saat penyortiran kustom diaktifkan)",
+ "fileTree26": "Lokasi penyimpanan default untuk catatan cepat",
+ "fileTree27": "Misalnya, <code class=\"fn__code\">/shorthands/{{now | date \"20060102150405\"}}</code>, jika tidak ada variabel template yang digunakan, catatan cepat akan ditambahkan ke akhir dokumen di jalur yang ditentukan",
"export10": "Misalnya <code class='fn__code'>&lt;span style=\"color: #fff;background-color: black;padding: 4px;border-radius: 5px;float:right;\"&gt;SiYuan&lt;/span&gt;</code>, jika kosong, gunakan teks watermark atau jalur file watermark.",
"export11": "Metode penanganan konten blok referensi konten saat mengekspor",
"export12": "Metode penanganan konten blok semat konten saat mengekspor",
diff --git a/app/appearance/langs/it_IT.json b/app/appearance/langs/it_IT.json
index 7d1be5b8ec..2c92083eea 100644
--- a/app/appearance/langs/it_IT.json
+++ b/app/appearance/langs/it_IT.json
@@ -1223,6 +1223,8 @@
"fileTree23": "Notifica quando i file .sy e il database .json superano questa dimensione",
"fileTree24": "Posiziona il nuovo sottodocumento in cima",
"fileTree25": "Se abilitato, i nuovi sottodocumenti verranno posizionati in cima all'elenco dei sottodocumenti (funziona solo quando l'ordinamento personalizzato è abilitato)",
+ "fileTree26": "Percorso di salvataggio predefinito per le note rapide",
+ "fileTree27": "Ad esempio, <code class=\"fn__code\">/shorthands/{{now | date \"20060102150405\"}}</code>, se non viene utilizzata alcuna variabile di modello, la nota rapida verrà aggiunta alla fine del documento nel percorso specificato",
"export10": "Ad esempio <code class='fn__code'>&lt;span style=\"color: #fff;background-color: black;padding: 4px;border-radius: 5px;float:right;\"&gt;SiYuan&lt;/span&gt;</code>, se vuoto, utilizza il testo della filigrana o il percorso del file della filigrana.",
"export11": "Metodo di gestione del contenuto del blocco di riferimento durante l'esportazione",
"export12": "Metodo di gestione del contenuto del blocco incorporato durante l'esportazione",
diff --git a/app/appearance/langs/ja_JP.json b/app/appearance/langs/ja_JP.json
index 0927690898..d3170cfe31 100644
--- a/app/appearance/langs/ja_JP.json
+++ b/app/appearance/langs/ja_JP.json
@@ -1223,6 +1223,8 @@
"fileTree23": ".sy ドキュメントやデータベース .json がこのサイズを超えると通知します",
"fileTree24": "新しい子ドキュメントを先頭に配置",
"fileTree25": "有効にすると、新しく作成された子ドキュメントは子ドキュメント一覧の先頭に配置されます(カスタム並び替えが有効な場合のみ動作します)",
+ "fileTree26": "クイックメモのデフォルト保存場所",
+ "fileTree27": "例: <code class=\"fn__code\">/shorthands/{{now | date \"20060102150405\"}}</code>、テンプレート変数を使用しない場合、クイックメモは指定されたパスのドキュメントの末尾に追加されます",
"export10": "例: <code class='fn__code'>&lt;span style=\"color: #fff;background-color: black;padding: 4px;border-radius: 5px;float:right;\"&gt;SiYuan&lt;/span&gt;</code><br>空の場合は透かしテキストまたは透かし画像ファイルのパスを使用します",
"export11": "エクスポート時のブロック参照コンテンツの処理方法",
"export12": "エクスポート時の埋め込みブロックコンテンツの処理方法",
diff --git a/app/appearance/langs/ko_KR.json b/app/appearance/langs/ko_KR.json
index ab87d60f37..6dddeb218d 100644
--- a/app/appearance/langs/ko_KR.json
+++ b/app/appearance/langs/ko_KR.json
@@ -1223,6 +1223,8 @@
"fileTree23": ".sy 파일 또는 데이터베이스 .json이 이 크기를 초과할 때 알림",
"fileTree24": "새 하위 문서를 맨 위에 배치",
"fileTree25": "활성화하면 새로 생성된 하위 문서가 하위 문서 목록의 맨 위에 배치됩니다(사용자 지정 정렬이 활성화된 경우에만 적용됨)",
+ "fileTree26": "빠른 메모의 기본 저장 경로",
+ "fileTree27": "예: <code class=\"fn__code\">/shorthands/{{now | date \"20060102150405\"}}</code>, 템플릿 변수를 사용하지 않으면 빠른 메모가 지정된 경로의 문서 끝에 추가됩니다",
"export10": "예: <code class='fn__code'>&lt;span style=\"color: #fff;background-color: black;padding: 4px;border-radius: 5px;float:right;\"&gt;SiYuan&lt;/span&gt;</code>, 비어 있으면 워터마크 텍스트 또는 워터마크 파일 경로를 사용합니다.",
"export11": "내보낼 때 콘텐츠 참조 블록 처리 방법",
"export12": "내보낼 때 콘텐츠 임베드 블록 처리 방법",
diff --git a/app/appearance/langs/nl_NL.json b/app/appearance/langs/nl_NL.json
index 27eb000e20..ee67d0b7b4 100644
--- a/app/appearance/langs/nl_NL.json
+++ b/app/appearance/langs/nl_NL.json
@@ -1223,6 +1223,8 @@
"fileTree23": "Melden bij overschrijding grootte",
"fileTree24": "Nieuw subdoc bovenaan",
"fileTree25": "Bovenaan bij aangepaste sortering",
+ "fileTree26": "Standaard opslaglocatie voor snelle notities",
+ "fileTree27": "Bv. <code class=\"fn__code\">/shorthands/{{now | date \"20060102150405\"}}</code>, als er geen sjabloonvariabele wordt gebruikt, wordt de snelle notitie toegevoegd aan het einde van het document op het opgegeven pad",
"export10": "HTML-span voor watermerk",
"export11": "Inhoudsverwerking ref bij export",
"export12": "Inhoudsverwerking embed bij export",
diff --git a/app/appearance/langs/pl_PL.json b/app/appearance/langs/pl_PL.json
index 35457c1936..b4913540be 100644
--- a/app/appearance/langs/pl_PL.json
+++ b/app/appearance/langs/pl_PL.json
@@ -1223,6 +1223,8 @@
"fileTree23": "Powiadom, gdy plik .sy lub baza danych .json przekroczy ten rozmiar",
"fileTree24": "Umieść nowy poddokument na górze",
"fileTree25": "Po włączeniu nowe poddokumenty będą umieszczane na początku listy poddokumentów (działa tylko, gdy włączone jest niestandardowe sortowanie)",
+ "fileTree26": "Domyślna ścieżka zapisu dla szybkich notatek",
+ "fileTree27": "Na przykład, <code class=\"fn__code\">/shorthands/{{now | date \"20060102150405\"}}</code>, jeśli nie użyto zmiennej szablonu, szybka notatka zostanie dodana na końcu dokumentu w określonej ścieżce",
"export10": "Na przykład <code class='fn__code'>&lt;span style=\"color: #fff;background-color: black;padding: 4px;border-radius: 5px;float:right;\"&gt;SiYuan&lt;/span&gt;</code>, jeśli jest puste, użyj tekstu znaków wodnych lub ścieżki pliku znaku wodnego.",
"export11": "Sposób obsługi treści bloku odniesienia podczas eksportu",
"export12": "Sposób obsługi treści bloku osadzonego podczas eksportu",
diff --git a/app/appearance/langs/pt_BR.json b/app/appearance/langs/pt_BR.json
index 00f2dbee01..5267cc499c 100644
--- a/app/appearance/langs/pt_BR.json
+++ b/app/appearance/langs/pt_BR.json
@@ -1223,6 +1223,8 @@
"fileTree23": "Notificar quando arquivos .sy e banco de dados .json excederem este tamanho",
"fileTree24": "Colocar novo subdocumento no topo",
"fileTree25": "Ao ativar, os novos subdocumentos serão colocados no topo da lista de subdocumentos (somente tem efeito quando a ordenação personalizada estiver ativada)",
+ "fileTree26": "Caminho de salvamento padrão para notas rápidas",
+ "fileTree27": "Por exemplo, <code class=\"fn__code\">/shorthands/{{now | date \"20060102150405\"}}</code>, se nenhuma variável de modelo for usada, a nota rápida será anexada ao final do documento no caminho especificado",
"export10": "Por exemplo <code class='fn__code'>&lt;span style=\"color: #fff;background-color: black;padding: 4px;border-radius: 5px;float:right;\"&gt;SiYuan&lt;/span&gt;</code>, se vazio, use texto de marca d'água ou caminho do arquivo de marca d'água.",
"export11": "Método de manipulação de conteúdo do bloco de referência ao exportar",
"export12": "Método de manipulação de conteúdo do bloco incorporado ao exportar",
diff --git a/app/appearance/langs/ru_RU.json b/app/appearance/langs/ru_RU.json
index 038ea7c27d..12fac4f644 100644
--- a/app/appearance/langs/ru_RU.json
+++ b/app/appearance/langs/ru_RU.json
@@ -1223,6 +1223,8 @@
"fileTree23": "Появится уведомление, если размер файла .sy или базы данных .json превышает этот предел",
"fileTree24": "Размещать новые дочерние документы вверху",
"fileTree25": "Если включено, новые дочерние документы будут помещаться в начале списка дочерних документов (действует только при включённой пользовательской сортировке)",
+ "fileTree26": "Путь сохранения по умолчанию для быстрых заметок",
+ "fileTree27": "Например, <code class=\"fn__code\">/shorthands/{{now | date \"20060102150405\"}}</code>, если переменная шаблона не используется, быстрая заметка будет добавлена в конец документа по указанному пути",
"export10": "Например <code class='fn__code'>&lt;span style=\"color: #fff;background-color: black;padding: 4px;border-radius: 5px;float:right;\"&gt;SiYuan&lt;/span&gt;</code>, если пусто, использовать текст водяного знака или путь к файлу водяного знака.",
"export11": "Обработка блока ссылок при экспорте",
"export12": "Обработка блока встроенного контента при экспорте",
diff --git a/app/appearance/langs/sk_SK.json b/app/appearance/langs/sk_SK.json
index beafb033d0..8fe9236e5a 100644
--- a/app/appearance/langs/sk_SK.json
+++ b/app/appearance/langs/sk_SK.json
@@ -1223,6 +1223,8 @@
"fileTree23": "Upozorniť, ak .sy alebo .json prekročí túto veľkosť",
"fileTree24": "Nové dokumenty navrch",
"fileTree25": "Nové poddokumenty sa zobrazia na začiatku zoznamu",
+ "fileTree26": "Predvolené umiestnenie pre rýchle poznámky",
+ "fileTree27": "Napr. <code class=\"fn__code\">/shorthands/{{now | date \"20060102150405\"}}</code>, ak sa nepoužije premenná šablóny, rýchla poznámka sa pridá na koniec dokumentu na zadanej ceste",
"export10": "HTML kód pre vodoznak",
"export11": "Spracovanie odkazu na blok pri exporte",
"export12": "Spracovanie vloženého bloku pri exporte",
diff --git a/app/appearance/langs/th_TH.json b/app/appearance/langs/th_TH.json
index e63340b810..903f3fa37d 100644
--- a/app/appearance/langs/th_TH.json
+++ b/app/appearance/langs/th_TH.json
@@ -1223,6 +1223,8 @@
"fileTree23": "แจ้งเกินขนาด",
"fileTree24": "วางใหม่บน",
"fileTree25": "ใหม่บน (เรียงกำหนดเอง)",
+ "fileTree26": "ที่ตั้งบันทึกเริ่มต้นของบันทึกย่อ",
+ "fileTree27": "เช่น <code class=\"fn__code\">/shorthands/{{now | date \"20060102150405\"}}</code>, หากไม่ใช่ตัวแปรแม่แบบ บันทึกย่อจะถูกเพิ่มที่ส่วนท้ายของเอกสารในเส้นทางที่ระบุ",
"export10": "HTML ลายน้ำ",
"export11": "จัดการอ้างอิง",
"export12": "จัดการฝัง",
diff --git a/app/appearance/langs/tr_TR.json b/app/appearance/langs/tr_TR.json
index e2e0df3552..a465ef05c7 100644
--- a/app/appearance/langs/tr_TR.json
+++ b/app/appearance/langs/tr_TR.json
@@ -1223,6 +1223,8 @@
"fileTree23": ".sy veya .json dosyaları bu boyutu aşarsa uyar",
"fileTree24": "Yeni alt belgeleri en üste yerleştir",
"fileTree25": "Etkinleştirildiğinde yeni alt belgeler listenin en üstüne eklenir (sadece özel sıralama etkinse geçerli)",
+ "fileTree26": "Hızlı notlar için varsayılan kayıt yolu",
+ "fileTree27": "Örneğin, <code class=\"fn__code\">/shorthands/{{now | date \"20060102150405\"}}</code>, eğer şablon değişkeni kullanılmazsa, hızlı not belirtilen yoldaki belgenin sonuna eklenecektir",
"export10": "Örnek: <code class='fn__code'>&lt;span style=\"color: #fff;background-color: black;padding: 4px;border-radius: 5px;float:right;\"&gt;SiYuan&lt;/span&gt;</code>. Boşsa filigran metni veya dosya yolu kullanılır",
"export11": "Dışa aktarımda içerik referans bloklarının işlenme yöntemi",
"export12": "Dışa aktarımda gömülü içerik bloklarının işlenme yöntemi",
diff --git a/app/appearance/langs/uk_UA.json b/app/appearance/langs/uk_UA.json
index 0f4e7334a3..70efd26beb 100644
--- a/app/appearance/langs/uk_UA.json
+++ b/app/appearance/langs/uk_UA.json
@@ -1223,6 +1223,8 @@
"fileTree23": "Сповіщати, коли .sy файли або .json файли баз даних перевищують цей розмір",
"fileTree24": "Розміщувати нові піддокументи зверху",
"fileTree25": "Якщо увімкнено, новостворені піддокументи буде розміщено на початку списку піддокументів (працює лише при користувацькому сортуванні)",
+ "fileTree26": "Типовий шлях збереження для швидких нотаток",
+ "fileTree27": "Наприклад, <code class=\"fn__code\">/shorthands/{{now | date \"20060102150405\"}}</code>, якщо змінна шаблону не використовується, швидка нотатка буде додана в кінець документа за вказаним шляхом",
"export10": "Наприклад <code class='fn__code'>&lt;span style=\"color: #fff;background-color: black;padding: 4px;border-radius: 5px;float:right;\"&gt;SiYuan&lt;/span&gt;</code>; якщо порожньо, використовується текст водяного знака або шлях до файла водяного знака.",
"export11": "Спосіб обробки блоку посилання на вміст під час експорту",
"export12": "Спосіб обробки блоку вбудованого вмісту під час експорту",
diff --git a/app/appearance/langs/zh_CHT.json b/app/appearance/langs/zh_CHT.json
index a194f8d5a5..ea693b2303 100644
--- a/app/appearance/langs/zh_CHT.json
+++ b/app/appearance/langs/zh_CHT.json
@@ -1223,6 +1223,8 @@
"fileTree23": ".sy 文件和資料庫 .json 超過該大小時彈出通知提醒",
"fileTree24": "新建子文檔放置在頂部",
"fileTree25": "啟用後新建的子文檔將放置在子文檔列表的頂部(僅在自訂排序啟用時生效)",
+ "fileTree26": "新建閃念速記的默認存放路徑",
+ "fileTree27": "例如 <code class=\"fn__code\">/閃念速記/{{now | date \"20060102150405\"}}</code>,不使用變量時閃念速記將添加到該路徑指定文檔內容的末尾",
"export10": "例如 <code class='fn__code'>&lt;span style=\"color: #fff;background-color: black;padding: 4px;border-radius: 5px;float:right;\"&gt;SiYuan&lt;/span&gt;</code> ,為空時使用水印文字或浮水印檔案路徑。",
"export11": "匯出時關於塊引用內容的處理方式",
"export12": "匯出時關於嵌入塊內容的處理方式",
diff --git a/app/appearance/langs/zh_CN.json b/app/appearance/langs/zh_CN.json
index 51bdfd71ef..eb42ee5e2d 100644
--- a/app/appearance/langs/zh_CN.json
+++ b/app/appearance/langs/zh_CN.json
@@ -1223,6 +1223,8 @@
"fileTree23": ".sy 文档和数据库 .json 超过该大小时弹出通知提醒",
"fileTree24": "新建子文档放置在顶部",
"fileTree25": "启用后新建的子文档将放置在子文档列表的顶部(仅在自定义排序启用时生效)",
+ "fileTree26": "新建闪念速记的默认存放路径",
+ "fileTree27": "例如 <code class='fn__code'>/闪念速记/{{now | date \"20060102150405\"}}</code>,不使用变量时闪念速记将添加到该路径指定文档内容的末尾",
"export10": "例如 <code class='fn__code'>&lt;span style=\"color: #fff;background-color: black;padding: 4px;border-radius: 5px;float:right;\"&gt;SiYuan&lt;/span&gt;</code> ,为空时使用水印文本或水印文件路径。",
"export11": "导出时关于块引用内容的处理方式",
"export12": "导出时关于嵌入块内容的处理方式",
diff --git a/app/src/config/fileTree.ts b/app/src/config/fileTree.ts
index 80f561832d..195eeb15c4 100644
--- a/app/src/config/fileTree.ts
+++ b/app/src/config/fileTree.ts
@@ -123,6 +123,16 @@ export const fileTree = {
<div class="fn__space"></div>
<input class="b3-text-field fn__flex-1" id="refCreateSavePath" value="${window.siyuan.config.fileTree.refCreateSavePath}">
</div>
+</div>
+<div class="b3-label config__item">
+ ${window.siyuan.languages.fileTree26}
+ <div class="b3-label__text">${window.siyuan.languages.fileTree27}</div>
+ <span class="fn__hr"></span>
+ <div class="fn__flex">
+ <select style="min-width: 200px" class="b3-select" id="shorthandSaveBox">${genNotebookOption(window.siyuan.config.fileTree.shorthandSaveBox, undefined, true)}</select>
+ <div class="fn__space"></div>
+ <input class="b3-text-field fn__flex-1" id="shorthandSavePath" value="${window.siyuan.config.fileTree.shorthandSavePath}">
+ </div>
</div>`;
},
_send() {
@@ -142,6 +152,8 @@ export const fileTree = {
alwaysSelectOpenedFile: (fileTree.element.querySelector("#alwaysSelectOpenedFile") as HTMLInputElement).checked,
refCreateSavePath: (fileTree.element.querySelector("#refCreateSavePath") as HTMLInputElement).value,
refCreateSaveBox: (fileTree.element.querySelector("#refCreateSaveBox") as HTMLInputElement).value,
+ shorthandSavePath: (fileTree.element.querySelector("#shorthandSavePath") as HTMLInputElement).value,
+ shorthandSaveBox: (fileTree.element.querySelector("#shorthandSaveBox") as HTMLInputElement).value,
docCreateSavePath: (fileTree.element.querySelector("#docCreateSavePath") as HTMLInputElement).value,
docCreateSaveBox: (fileTree.element.querySelector("#docCreateSaveBox") as HTMLInputElement).value,
openFilesUseCurrentTab: (fileTree.element.querySelector("#openFilesUseCurrentTab") as HTMLInputElement).checked,
@@ -162,6 +174,7 @@ export const fileTree = {
bindEvent: () => {
(fileTree.element.querySelector("#docCreateSavePath") as HTMLInputElement).value = window.siyuan.config.fileTree.docCreateSavePath;
(fileTree.element.querySelector("#refCreateSavePath") as HTMLInputElement).value = window.siyuan.config.fileTree.refCreateSavePath;
+ (fileTree.element.querySelector("#shorthandSavePath") as HTMLInputElement).value = window.siyuan.config.fileTree.shorthandSavePath;
fileTree.element.querySelectorAll("input, select").forEach((item) => {
item.addEventListener("change", () => {
fileTree._send();
diff --git a/app/src/index.ts b/app/src/index.ts
index 6065557066..956d6b22c6 100644
--- a/app/src/index.ts
+++ b/app/src/index.ts
@@ -33,9 +33,6 @@ import {loadPlugins, reloadPlugin} from "./plugin/loader";
import "./assets/scss/base.scss";
import {reloadEmoji} from "./emoji";
import {processIOSPurchaseResponse} from "./util/iOSPurchase";
-/// #if BROWSER
-import {setLocalShorthandCount} from "./util/noRelyPCFunction";
-/// #else
import {ipcRenderer} from "electron";
/// #endif
import {getDockByType} from "./layout/tabUtil";
@@ -95,11 +92,6 @@ export class App {
(getDockByType("tag").data.tag as Tag).update();
}
break;
- /// #if BROWSER
- case "setLocalShorthandCount":
- setLocalShorthandCount();
- break;
- /// #endif
case "setRefDynamicText":
setRefDynamicText(data.data);
break;
diff --git a/app/src/layout/dock/Files.ts b/app/src/layout/dock/Files.ts
index 8931b0f988..752669280a 100644
--- a/app/src/layout/dock/Files.ts
+++ b/app/src/layout/dock/Files.ts
@@ -323,13 +323,6 @@ export class Files extends Model {
x: event.clientX,
y: event.clientY
});
- } else if (type === "addLocal") {
- fetchPost("/api/filetree/moveLocalShorthands", {
- "notebook": notebookId
- });
- this.element.querySelectorAll('[data-type="addLocal"]').forEach(item => {
- item.remove();
- });
}
}
if (type === "more-file") {
diff --git a/app/src/menus/onGetnotebookconf.ts b/app/src/menus/onGetnotebookconf.ts
index b08cd0e2cb..16063fff7e 100644
--- a/app/src/menus/onGetnotebookconf.ts
+++ b/app/src/menus/onGetnotebookconf.ts
@@ -17,20 +17,33 @@ declare interface INotebookConf {
refCreateSaveBox: string;
docCreateSaveBox: string;
dailyNoteTemplatePath: string
+ shorthandSaveBox: string;
+ shorthandSavePath: string;
}
}
-export const genNotebookOption = (id: string, notebookId?: string) => {
- let html = `<option value="">${window.siyuan.languages.currentNotebook}</option>`;
+export const genNotebookOption = (id: string, notebookId?: string, noCurrent?: boolean) => {
+ let html = "";
+ if (!noCurrent) {
+ html = `<option value="">${window.siyuan.languages.currentNotebook}</option>`;
+ }
const helpIds: string[] = [];
Object.keys(Constants.HELP_PATH).forEach((key: "zh_CN") => {
helpIds.push(Constants.HELP_PATH[key]);
});
+ let firstNotebookId = "";
window.siyuan.notebooks.forEach((item) => {
if (helpIds.includes(item.id) || item.id === notebookId) {
return;
}
- html += `<option value="${item.id}" ${id === item.id ? "selected" : ""}>${escapeHtml(item.name)}</option>`;
+ if ("" === firstNotebookId) {
+ firstNotebookId = item.id;
+ }
+ let selected = id === item.id;
+ if (noCurrent && "" === id && item.id === firstNotebookId) {
+ selected = true;
+ }
+ html += `<option value="${item.id}" ${selected ? "selected" : ""}>${escapeHtml(item.name)}</option>`;
});
return html;
};
@@ -60,6 +73,16 @@ export const onGetnotebookconf = (data: INotebookConf) => {
<input class="b3-text-field fn__flex-1" id="refCreateSavePath" value="">
</div>
</div>
+<div class="b3-label config__item">
+ ${window.siyuan.languages.fileTree26}
+ <div class="b3-label__text">${window.siyuan.languages.fileTree27}</div>
+ <span class="fn__hr"></span>
+ <div class="fn__flex">
+ <select style="min-width: 200px" class="b3-select" id="shorthandSaveBox">${genNotebookOption(data.conf.shorthandSaveBox, data.box, true)}</select>
+ <div class="fn__space"></div>
+ <input class="b3-text-field fn__flex-1" id="shorthandSavePath" value="">
+ </div>
+</div>
<div class="b3-label">
${window.siyuan.languages.fileTree11}
<div class="b3-label__text">${window.siyuan.languages.fileTree14}</div>
@@ -101,6 +124,8 @@ const bindSettingEvent = (contentElement: Element, data: INotebookConf) => {
docCreateSavePathElement.value = data.conf.docCreateSavePath;
const refCreateSavePathElement = contentElement.querySelector("#refCreateSavePath") as HTMLInputElement;
refCreateSavePathElement.value = data.conf.refCreateSavePath;
+ const shorthandSavePathElement = contentElement.querySelector("#shorthandSavePath") as HTMLInputElement;
+ shorthandSavePathElement.value = data.conf.shorthandSavePath;
const dailyNoteTemplatePathElement = contentElement.querySelector("#dailyNoteTemplatePath") as HTMLInputElement;
dailyNoteTemplatePathElement.value = data.conf.dailyNoteTemplatePath;
contentElement.querySelectorAll("input, select").forEach((item) => {
@@ -114,6 +139,8 @@ const bindSettingEvent = (contentElement: Element, data: INotebookConf) => {
docCreateSavePath: docCreateSavePathElement.value,
dailyNoteSavePath: dailyNoteSavePathElement.value,
dailyNoteTemplatePath: dailyNoteTemplatePathElement.value,
+ shorthandSaveBox: (contentElement.querySelector("#shorthandSaveBox") as HTMLInputElement).value,
+ shorthandSavePath: shorthandSavePathElement.value,
}
});
});
diff --git a/app/src/mobile/dock/MobileFiles.ts b/app/src/mobile/dock/MobileFiles.ts
index dd4f1bd886..0f5a23a1fd 100644
--- a/app/src/mobile/dock/MobileFiles.ts
+++ b/app/src/mobile/dock/MobileFiles.ts
@@ -249,13 +249,6 @@ export class MobileFiles extends Model {
} else if (type === "more-root") {
initNavigationMenu(app, target.parentElement);
window.siyuan.menus.menu.fullscreen("bottom");
- } else if (type === "addLocal") {
- fetchPost("/api/filetree/moveLocalShorthands", {
- "notebook": notebookId
- });
- this.element.querySelectorAll('[data-type="addLocal"]').forEach(item => {
- item.remove();
- });
}
}
if (type === "more-file") {
diff --git a/app/src/mobile/settings/fileTree.ts b/app/src/mobile/settings/fileTree.ts
index 764de1b140..5154f7408a 100644
--- a/app/src/mobile/settings/fileTree.ts
+++ b/app/src/mobile/settings/fileTree.ts
@@ -75,10 +75,19 @@ export const initFileTree = () => {
<span class="fn__hr"></span>
<input class="b3-text-field fn__block" id="refCreateSavePath" value="${window.siyuan.config.fileTree.refCreateSavePath}">
<div class="b3-label__text">${window.siyuan.languages.fileTree6}</div>
+</div>
+<div class="b3-label">
+ ${window.siyuan.languages.fileTree26}
+ <span class="fn__hr"></span>
+ <select class="b3-select fn__block" id="shorthandSaveBox">${genNotebookOption(window.siyuan.config.fileTree.shorthandSaveBox, undefined, true)}</select>
+ <span class="fn__hr"></span>
+ <input class="b3-text-field fn__block" id="shorthandSavePath" value="${window.siyuan.config.fileTree.shorthandSavePath}">
+ <div class="b3-label__text">${window.siyuan.languages.fileTree27}</div>
</div>`,
bindEvent(modelMainElement: HTMLElement) {
(modelMainElement.querySelector("#docCreateSavePath") as HTMLInputElement).value = window.siyuan.config.fileTree.docCreateSavePath;
(modelMainElement.querySelector("#refCreateSavePath") as HTMLInputElement).value = window.siyuan.config.fileTree.refCreateSavePath;
+ (modelMainElement.querySelector("#shorthandSavePath") as HTMLInputElement).value = window.siyuan.config.fileTree.shorthandSavePath;
modelMainElement.querySelectorAll("input, select").forEach((item) => {
item.addEventListener("change", () => {
fetchPost("/api/setting/setFiletree", {
@@ -86,6 +95,8 @@ export const initFileTree = () => {
alwaysSelectOpenedFile: window.siyuan.config.fileTree.alwaysSelectOpenedFile,
refCreateSavePath: (modelMainElement.querySelector("#refCreateSavePath") as HTMLInputElement).value,
refCreateSaveBox: (modelMainElement.querySelector("#refCreateSaveBox") as HTMLInputElement).value,
+ shorthandSavePath: (modelMainElement.querySelector("#shorthandSavePath") as HTMLInputElement).value,
+ shorthandSaveBox: (modelMainElement.querySelector("#shorthandSaveBox") as HTMLInputElement).value,
docCreateSavePath: (modelMainElement.querySelector("#docCreateSavePath") as HTMLInputElement).value,
docCreateSaveBox: (modelMainElement.querySelector("#docCreateSaveBox") as HTMLInputElement).value,
openFilesUseCurrentTab: window.siyuan.config.fileTree.openFilesUseCurrentTab,
diff --git a/app/src/mobile/util/onMessage.ts b/app/src/mobile/util/onMessage.ts
index 5f3939b7a1..91ef95b701 100644
--- a/app/src/mobile/util/onMessage.ts
+++ b/app/src/mobile/util/onMessage.ts
@@ -10,7 +10,6 @@ import {
import {App} from "../../index";
import {reloadPlugin} from "../../plugin/loader";
import {reloadEmoji} from "../../emoji";
-import {setLocalShorthandCount} from "../../util/noRelyPCFunction";
import {renderSnippet} from "../../config/util/snippets";
import {redirectToCheckAuth} from "../../util/pathName";
@@ -49,9 +48,6 @@ export const onMessage = (app: App, data: IWebSocketData) => {
case "reloadTag":
window.siyuan.mobile.docks.tag?.update();
break;
- case "setLocalShorthandCount":
- setLocalShorthandCount();
- break;
case "setRefDynamicText":
setRefDynamicText(data.data);
break;
diff --git a/app/src/types/config.d.ts b/app/src/types/config.d.ts
index e1dcd2c86b..60dee80649 100644
--- a/app/src/types/config.d.ts
+++ b/app/src/types/config.d.ts
@@ -685,6 +685,14 @@ declare namespace Config {
*/
refCreateSavePath: string;
refCreateSaveBox: string;
+ /**
+ * Shorthand save notebook
+ */
+ shorthandSaveBox: string;
+ /**
+ * Shorthand save path
+ */
+ shorthandSavePath: string;
docCreateSaveBox: string;
/**
* Close the secondary confirmation when deleting a document
diff --git a/app/src/util/noRelyPCFunction.ts b/app/src/util/noRelyPCFunction.ts
index 27a278c9ed..68bf602dbd 100644
--- a/app/src/util/noRelyPCFunction.ts
+++ b/app/src/util/noRelyPCFunction.ts
@@ -5,7 +5,6 @@ import {Constants} from "../constants";
import {pathPosix} from "./pathName";
/// #if !MOBILE
import {getDockByType} from "../layout/tabUtil";
-import {Files} from "../layout/dock/Files";
import {Tag} from "../layout/dock/Tag";
/// #endif
import {upDownHint} from "./upDownHint";
@@ -133,28 +132,3 @@ export const checkFold = (id: string, cb: (zoomIn: boolean, action: TProtyleActi
foldResponse.data.isRoot);
});
};
-
-export const setLocalShorthandCount = () => {
- let fileElement;
- /// #if MOBILE
- fileElement = window.siyuan.mobile.docks.file.element;
- /// #else
- const dockFile = getDockByType("file");
- if (!dockFile) {
- return false;
- }
- fileElement = (dockFile.data.file as Files).element;
- /// #endif
- const helpIDs: string[] = [];
- Object.keys(Constants.HELP_PATH).forEach((key) => {
- helpIDs.push(Constants.HELP_PATH[key]);
- });
- fileElement.childNodes.forEach((item: Element) => {
- if (item.querySelector('[data-type="addLocal"]') || helpIDs.includes(item.getAttribute("data-url"))) {
- return;
- }
- item.querySelector('[data-type="more-root"]').insertAdjacentHTML("beforebegin", `<span data-type="addLocal" class="b3-list-item__action">
- <svg><use xlink:href="#iconRiffCard"></use></svg>
-</span>`);
- });
-};
diff --git a/kernel/api/filetree.go b/kernel/api/filetree.go
index d11db7808e..1592061bdf 100644
--- a/kernel/api/filetree.go
+++ b/kernel/api/filetree.go
@@ -50,29 +50,7 @@ func moveLocalShorthands(c *gin.Context) {
return
}
- var parentID string
- parentIDArg := arg["parentID"]
- if nil != parentIDArg {
- parentID = parentIDArg.(string)
- }
-
- var hPath string
- hPathArg := arg["path"]
- if nil != hPathArg {
- hPath = arg["path"].(string)
- baseName := path.Base(hPath)
- dir := path.Dir(hPath)
- r, _ := regexp.Compile("\r\n|\r|\n|\u2028|\u2029|\t|/")
- baseName = r.ReplaceAllString(baseName, "")
- if 512 < utf8.RuneCountInString(baseName) {
- baseName = gulu.Str.SubStr(baseName, 512)
- }
- hPath = path.Join(dir, baseName)
- }
-
- // TODO: 改造旧方案,去掉 hPath, parentID,改为使用文档树配置项 闪念速记存放位置,参考创建日记实现
- // https://github.com/siyuan-note/siyuan/issues/14414
- ids, err := model.MoveLocalShorthands(notebook, hPath, parentID)
+ ids, err := model.MoveLocalShorthands(notebook)
if err != nil {
ret.Code = -1
ret.Msg = err.Error()
@@ -1000,6 +978,54 @@ func getRefCreateSavePath(c *gin.Context) {
}
}
+func getShorthandSavePath(c *gin.Context) {
+ ret := gulu.Ret.NewResult()
+ defer c.JSON(http.StatusOK, ret)
+
+ arg, ok := util.JsonArg(c, ret)
+ if !ok {
+ return
+ }
+
+ notebook := arg["notebook"].(string)
+ box := model.Conf.Box(notebook)
+
+ var shorthandSaveBox string
+ shorthandSavePathTpl := model.Conf.FileTree.ShorthandSavePath
+ if nil != box {
+ boxConf := box.GetConf()
+ shorthandSaveBox = boxConf.ShorthandSaveBox
+ shorthandSavePathTpl = boxConf.ShorthandSavePath
+ }
+ if "" == shorthandSaveBox {
+ shorthandSaveBox = model.Conf.FileTree.ShorthandSaveBox
+ }
+ if "" == shorthandSavePathTpl {
+ shorthandSavePathTpl = model.Conf.FileTree.ShorthandSavePath
+ }
+
+ if "" == shorthandSaveBox {
+ shorthandSaveBox = notebook
+ }
+
+ if shorthandSaveBox != notebook {
+ if "" != shorthandSavePathTpl && !strings.HasPrefix(shorthandSavePathTpl, "/") {
+ shorthandSavePathTpl = "/" + shorthandSavePathTpl
+ }
+ }
+
+ shorthandSavePath, err := model.RenderGoTemplate(shorthandSavePathTpl)
+ if err != nil {
+ ret.Code = -1
+ ret.Msg = err.Error()
+ return
+ }
+ ret.Data = map[string]any{
+ "box": shorthandSaveBox,
+ "path": shorthandSavePath,
+ }
+}
+
func changeSort(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)
diff --git a/kernel/api/notebook.go b/kernel/api/notebook.go
index 71ddc8334e..c5099de219 100644
--- a/kernel/api/notebook.go
+++ b/kernel/api/notebook.go
@@ -411,6 +411,13 @@ func setNotebookConf(c *gin.Context) {
boxConf.DocCreateSavePath = util.TrimSpaceInPath(boxConf.DocCreateSavePath)
+ boxConf.ShorthandSavePath = util.TrimSpaceInPath(boxConf.ShorthandSavePath)
+ if "" != boxConf.ShorthandSavePath {
+ if !strings.HasPrefix(boxConf.ShorthandSavePath, "/") {
+ boxConf.ShorthandSavePath = "/" + boxConf.ShorthandSavePath
+ }
+ }
+
box.SaveConf(boxConf)
ret.Data = boxConf
}
diff --git a/kernel/api/router.go b/kernel/api/router.go
index 6ff38bb233..45031bf12c 100644
--- a/kernel/api/router.go
+++ b/kernel/api/router.go
@@ -123,6 +123,7 @@ func ServeAPI(ginServer *gin.Engine) {
ginServer.Handle("POST", "/api/filetree/getDoc", model.CheckAuth, getDoc)
ginServer.Handle("POST", "/api/filetree/getDocCreateSavePath", model.CheckAuth, getDocCreateSavePath)
ginServer.Handle("POST", "/api/filetree/getRefCreateSavePath", model.CheckAuth, getRefCreateSavePath)
+ ginServer.Handle("POST", "/api/filetree/getShorthandSavePath", model.CheckAuth, getShorthandSavePath)
ginServer.Handle("POST", "/api/filetree/changeSort", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, changeSort)
ginServer.Handle("POST", "/api/filetree/createDocWithMd", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, createDocWithMd)
ginServer.Handle("POST", "/api/filetree/createDailyNote", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, createDailyNote)
diff --git a/kernel/api/setting.go b/kernel/api/setting.go
index beceae7d81..68018a2bfe 100644
--- a/kernel/api/setting.go
+++ b/kernel/api/setting.go
@@ -423,6 +423,13 @@ func setFiletree(c *gin.Context) {
fileTree.DocCreateSavePath = util.TrimSpaceInPath(fileTree.DocCreateSavePath)
+ fileTree.ShorthandSavePath = util.TrimSpaceInPath(fileTree.ShorthandSavePath)
+ if "" != fileTree.ShorthandSavePath {
+ if !strings.HasPrefix(fileTree.ShorthandSavePath, "/") {
+ fileTree.ShorthandSavePath = "/" + fileTree.ShorthandSavePath
+ }
+ }
+
if 1 > fileTree.MaxOpenTabCount {
fileTree.MaxOpenTabCount = 8
}
diff --git a/kernel/conf/box.go b/kernel/conf/box.go
index c79257af20..eeb8647e30 100644
--- a/kernel/conf/box.go
+++ b/kernel/conf/box.go
@@ -30,6 +30,8 @@ type BoxConf struct {
DocCreateSavePath string `json:"docCreateSavePath"` // 新建文档存储路径
DailyNoteSavePath string `json:"dailyNoteSavePath"` // 新建日记存储路径
DailyNoteTemplatePath string `json:"dailyNoteTemplatePath"` // 新建日记使用的模板路径
+ ShorthandSaveBox string `json:"shorthandSaveBox"` // 闪念速记存储笔记本
+ ShorthandSavePath string `json:"shorthandSavePath"` // 闪念速记存储路径
SortMode int `json:"sortMode"` // 排序方式
}
diff --git a/kernel/conf/filetree.go b/kernel/conf/filetree.go
index 6a616d3c0a..d714e5dfb5 100644
--- a/kernel/conf/filetree.go
+++ b/kernel/conf/filetree.go
@@ -27,6 +27,8 @@ type FileTree struct {
RefCreateSavePath string `json:"refCreateSavePath"` // 块引时新建文档存储路径
DocCreateSaveBox string `json:"docCreateSaveBox"` // 新建文档存储笔记本
DocCreateSavePath string `json:"docCreateSavePath"` // 新建文档存储路径
+ ShorthandSaveBox string `json:"shorthandSaveBox"` // 闪念速记存储笔记本
+ ShorthandSavePath string `json:"shorthandSavePath"` // 闪念速记存储路径
MaxListCount int `json:"maxListCount"` // 最大列出数量
MaxOpenTabCount int `json:"maxOpenTabCount"` // 最大打开页签数量
AllowCreateDeeper bool `json:"allowCreateDeeper"` // 允许创建超过 7 层深度的子文档
diff --git a/kernel/harmony/kernel.go b/kernel/harmony/kernel.go
index 390e16399f..f2324d3a8d 100644
--- a/kernel/harmony/kernel.go
+++ b/kernel/harmony/kernel.go
@@ -20,10 +20,12 @@ import (
"C"
"fmt"
"os"
+ "path/filepath"
"strings"
"time"
"github.com/88250/gulu"
+ "github.com/88250/lute/ast"
"github.com/siyuan-note/filelock"
"github.com/siyuan-note/logging"
"github.com/siyuan-note/siyuan/kernel/cache"
@@ -127,6 +129,26 @@ func DisableFeature(feature *C.char) {
util.DisableFeature(C.GoString(feature))
}
+//export FilepathBase
+func FilepathBase(path string) string {
+ return filepath.Base(path)
+}
+
+//export FilterUploadFileName
+func FilterUploadFileName(name string) string {
+ return util.FilterUploadFileName(name)
+}
+
+//export AssetName
+func AssetName(name string) string {
+ return util.AssetName(name, ast.NewNodeID())
+}
+
+//export HTML2Markdown
+func HTML2Markdown(html string) string {
+ return util.NewLute().HTML2Md(html)
+}
+
//export Unzip
func Unzip(zipFilePath, destination *C.char) {
var zipPath, destPath string = C.GoString(zipFilePath), C.GoString(destination)
diff --git a/kernel/job/cron.go b/kernel/job/cron.go
index 36ec7e6da2..46214c9d55 100644
--- a/kernel/job/cron.go
+++ b/kernel/job/cron.go
@@ -47,9 +47,7 @@ func StartCron() {
go every(24*time.Hour, model.AutoPurgeRepoJob)
go every(30*time.Minute, model.AutoCheckMicrosoftDefenderJob)
go every(24*time.Hour, model.ClearOutdatedHistoryDirJob)
-
- // TODO: 移除旧方案 https://github.com/siyuan-note/siyuan/issues/14414 实现新的刷新机制
- //go every(3*time.Second, model.WatchLocalShorthands)
+ go every(7*time.Second, model.AutoConsumeShorthandsJob)
}
func every(interval time.Duration, f func(), name ...string) {
diff --git a/kernel/mobile/kernel.go b/kernel/mobile/kernel.go
index 6bb5eeed17..6c931bd870 100644
--- a/kernel/mobile/kernel.go
+++ b/kernel/mobile/kernel.go
@@ -293,6 +293,10 @@ func AssetName(name string) string {
return util.AssetName(name, ast.NewNodeID())
}
+func HTML2Markdown(html string) string {
+ return util.NewLute().HTML2Md(html)
+}
+
func Unzip(zipFilePath, destination string) {
if err := gulu.Zip.Unzip(zipFilePath, destination); nil != err {
logging.LogErrorf("unzip [%s] failed: %s", zipFilePath, err)
diff --git a/kernel/model/conf.go b/kernel/model/conf.go
index d9f7d88b3e..57d13c18eb 100644
--- a/kernel/model/conf.go
+++ b/kernel/model/conf.go
@@ -233,6 +233,7 @@ func InitConf() {
}
Conf.FileTree.DocCreateSavePath = util.TrimSpaceInPath(Conf.FileTree.DocCreateSavePath)
Conf.FileTree.RefCreateSavePath = util.TrimSpaceInPath(Conf.FileTree.RefCreateSavePath)
+ Conf.FileTree.ShorthandSavePath = util.TrimSpaceInPath(Conf.FileTree.ShorthandSavePath)
util.UseSingleLineSave = Conf.FileTree.UseSingleLineSave
if 2 > Conf.FileTree.LargeFileWarningSize {
Conf.FileTree.LargeFileWarningSize = 8
diff --git a/kernel/model/shortcuts.go b/kernel/model/shortcuts.go
index 164b35fd1c..7b006c3e41 100644
--- a/kernel/model/shortcuts.go
+++ b/kernel/model/shortcuts.go
@@ -33,7 +33,7 @@ import (
"github.com/siyuan-note/siyuan/kernel/util"
)
-func MoveLocalShorthands(boxID, hPath, parentID string) (retIDs []string, err error) {
+func MoveLocalShorthands(boxID string) (retIDs []string, err error) {
shorthandsDir := filepath.Join(util.ShortcutsPath, "shorthands")
if !gulu.File.IsDir(shorthandsDir) {
return
@@ -68,8 +68,25 @@ func MoveLocalShorthands(boxID, hPath, parentID string) (retIDs []string, err er
}
}
- var toRemoves []string
+ var hPath string
box := Conf.Box(boxID)
+ if nil != box {
+ boxConf := box.GetConf()
+ hPath = boxConf.ShorthandSavePath
+ }
+ if "" == hPath {
+ hPath = Conf.FileTree.ShorthandSavePath
+ }
+ if "" != hPath {
+ var renderErr error
+ hPath, renderErr = RenderGoTemplate(hPath)
+ if nil != renderErr {
+ logging.LogErrorf("render shorthand save path failed: %s", renderErr)
+ hPath = ""
+ }
+ }
+
+ var toRemoves []string
if "" == hPath { // hPath 为空的话每一个速记对应创建一个文档记录
for _, entry := range entries {
@@ -98,7 +115,7 @@ func MoveLocalShorthands(boxID, hPath, parentID string) (retIDs []string, err er
}
hPath = "/" + time.UnixMilli(i).Format("2006-01-02 15:04:05")
var retID string
- retID, err = CreateWithMarkdown("", boxID, hPath, content, parentID, "", false, "")
+ retID, err = CreateWithMarkdown("", boxID, hPath, content, "", "", false, "")
if nil != err {
logging.LogErrorf("create doc failed: %s", err)
return
@@ -106,7 +123,6 @@ func MoveLocalShorthands(boxID, hPath, parentID string) (retIDs []string, err er
retIDs = append(retIDs, retID)
toRemoves = append(toRemoves, p)
- box.setSortByConf("/", retID)
}
} else { // 不为空的话将所有速记合并到指定路径的文档中
if !strings.HasPrefix(hPath, "/") {
@@ -141,7 +157,7 @@ func MoveLocalShorthands(boxID, hPath, parentID string) (retIDs []string, err er
bt := treenode.GetBlockTreeRootByHPath(boxID, hPath)
if nil == bt {
var retID string
- retID, err = CreateWithMarkdown("", boxID, hPath, buff.String(), parentID, "", false, "")
+ retID, err = CreateWithMarkdown("", boxID, hPath, buff.String(), "", "", false, "")
if nil != err {
logging.LogErrorf("create doc failed: %s", err)
return
@@ -174,8 +190,8 @@ func MoveLocalShorthands(boxID, hPath, parentID string) (retIDs []string, err er
}
indexWriteTreeIndexQueue(tree)
+ util.PushReloadProtyle(tree.ID)
}
-
}
}
@@ -187,7 +203,9 @@ func MoveLocalShorthands(boxID, hPath, parentID string) (retIDs []string, err er
return
}
-func WatchLocalShorthands() {
+func consumeShorthands() {
+ defer logging.Recover()
+
shorthandsDir := filepath.Join(util.ShortcutsPath, "shorthands")
if !gulu.File.IsDir(shorthandsDir) {
return
@@ -195,26 +213,50 @@ func WatchLocalShorthands() {
entries, err := os.ReadDir(shorthandsDir)
if nil != err {
- logging.LogErrorf("read dir [%s] failed: %s", shorthandsDir, err)
return
}
- shorthandCount := 0
+ hasShorthand := false
for _, entry := range entries {
- if entry.IsDir() {
- continue
+ if !entry.IsDir() && filepath.Ext(entry.Name()) == ".md" {
+ hasShorthand = true
+ break
}
+ }
- if filepath.Ext(entry.Name()) != ".md" {
- continue
+ if !hasShorthand {
+ return
+ }
+
+ var notebookID string
+ notebookID = Conf.FileTree.ShorthandSaveBox
+ if "" != notebookID && nil == Conf.Box(notebookID) {
+ notebookID = ""
+ }
+
+ if "" == notebookID {
+ boxes := Conf.GetBoxes()
+ for _, box := range boxes {
+ if !IsUserGuide(box.ID) {
+ notebookID = box.ID
+ break
+ }
}
+ }
- shorthandCount++
+ if "" == notebookID {
+ return
}
- if 1 > shorthandCount {
+ if _, err = MoveLocalShorthands(notebookID); nil != err {
+ logging.LogErrorf("auto consume shorthands failed: %s", err)
+ }
+}
+
+func AutoConsumeShorthandsJob() {
+ if Conf.Sync.Enabled {
return
}
- util.PushLocalShorthandCount(shorthandCount)
+ consumeShorthands()
}
diff --git a/kernel/model/sync.go b/kernel/model/sync.go
index f610ce0f78..a4248bed87 100644
--- a/kernel/model/sync.go
+++ b/kernel/model/sync.go
@@ -68,6 +68,9 @@ func SyncDataDownload() {
code = 2
}
util.BroadcastByType("main", "syncing", code, Conf.Sync.Stat, nil)
+ if 1 == code {
+ consumeShorthands()
+ }
}
func SyncDataUpload() {
@@ -206,6 +209,10 @@ func syncData(exit, byHand bool) {
}
util.BroadcastByType("main", "syncing", code, Conf.Sync.Stat, nil)
+ if !exit && 1 == code {
+ consumeShorthands()
+ }
+
if nil == webSocketConn && Conf.Sync.Perception {
// 如果 websocket 连接已经断开,则重新连接
connectSyncWebSocket()
diff --git a/kernel/util/websocket.go b/kernel/util/websocket.go
index 51b49dcdef..1cd22e8f0e 100644
--- a/kernel/util/websocket.go
+++ b/kernel/util/websocket.go
@@ -359,10 +359,6 @@ func PushSetDefRefCount(rootID, blockID string, defIDs []string, refCount, rootR
BroadcastByType("main", "setDefRefCount", 0, "", map[string]any{"rootID": rootID, "blockID": blockID, "refCount": refCount, "rootRefCount": rootRefCount, "defIDs": defIDs})
}
-func PushLocalShorthandCount(count int) {
- BroadcastByType("main", "setLocalShorthandCount", 0, "", map[string]any{"count": count})
-}
-
func PushProtyleLoading(rootID, msg string) {
BroadcastByType("protyle", "addLoading", 0, msg, rootID)
}