Skip to content

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

:sparkles: Improve database item template document creation https://github.com/siyuan-note/siyuan/issues/18532

Danielf29b05be56dd
diff --git a/app/appearance/langs/ar.json b/app/appearance/langs/ar.json
index 1254507e62..3674ae039d 100644
--- a/app/appearance/langs/ar.json
+++ b/app/appearance/langs/ar.json
@@ -1,4 +1,7 @@
{
+ "hideInFileTree": "إخفاء في شجرة المستندات",
+ "newItemTemplateSubDoc": "مستند فرعي للمستند الذي يحتوي على كتلة قاعدة البيانات الحالية",
+ "newItemTemplateSubDocTip": "عند الإنشاء من خلال قاعدة بيانات معكوسة، يُستخدم المستند الذي يحتوي على كتلة قاعدة البيانات المعكوسة الحالية",
"entrySeparator": "فاصل",
"tableAddColumnTip": "انقر لإدراج عمود إلى اليمين<br>اسحب لإدراج أعمدة متعددة أو حذفها",
"tableAddRowTip": "انقر لإدراج صف في الأسفل<br>اسحب لإدراج صفوف متعددة أو حذفها",
diff --git a/app/appearance/langs/de.json b/app/appearance/langs/de.json
index b03461ee2a..1f8705a0f0 100644
--- a/app/appearance/langs/de.json
+++ b/app/appearance/langs/de.json
@@ -1,4 +1,7 @@
{
+ "hideInFileTree": "Im Dokumentenbaum ausblenden",
+ "newItemTemplateSubDoc": "Unterdokument des Dokuments mit dem aktuellen Datenbankblock",
+ "newItemTemplateSubDocTip": "Beim Erstellen über eine gespiegelte Datenbank wird das Dokument mit dem aktuellen gespiegelten Datenbankblock verwendet",
"entrySeparator": "Trennlinie",
"tableAddColumnTip": "Klicken, um rechts eine Spalte einzufügen<br>Ziehen, um mehrere Spalten einzufügen oder zu löschen",
"tableAddRowTip": "Klicken, um unten eine Zeile einzufügen<br>Ziehen, um mehrere Zeilen einzufügen oder zu löschen",
diff --git a/app/appearance/langs/en.json b/app/appearance/langs/en.json
index 17e8903295..4684f05762 100644
--- a/app/appearance/langs/en.json
+++ b/app/appearance/langs/en.json
@@ -1,4 +1,7 @@
{
+ "hideInFileTree": "Hide in document tree",
+ "newItemTemplateSubDoc": "Child document of the document containing the current database block",
+ "newItemTemplateSubDocTip": "When creating from a mirror database, the document containing the current mirror database block is used",
"entrySeparator": "Separator",
"tableAddColumnTip": "Click to insert a column on the right<br>Drag to insert or delete multiple columns",
"tableAddRowTip": "Click to insert a row below<br>Drag to insert or delete multiple rows",
diff --git a/app/appearance/langs/es.json b/app/appearance/langs/es.json
index 6792f176c0..c5ae637c3d 100644
--- a/app/appearance/langs/es.json
+++ b/app/appearance/langs/es.json
@@ -1,4 +1,7 @@
{
+ "hideInFileTree": "Ocultar en el árbol de documentos",
+ "newItemTemplateSubDoc": "Subdocumento del documento que contiene el bloque de base de datos actual",
+ "newItemTemplateSubDocTip": "Al crear desde una base de datos reflejada, se usa el documento que contiene el bloque de base de datos reflejado actual",
"entrySeparator": "Separador",
"tableAddColumnTip": "Haz clic para insertar una columna a la derecha<br>Arrastra para insertar o eliminar varias columnas",
"tableAddRowTip": "Haz clic para insertar una fila debajo<br>Arrastra para insertar o eliminar varias filas",
diff --git a/app/appearance/langs/fr.json b/app/appearance/langs/fr.json
index bffe14ae62..c14edd1ef8 100644
--- a/app/appearance/langs/fr.json
+++ b/app/appearance/langs/fr.json
@@ -1,4 +1,7 @@
{
+ "hideInFileTree": "Masquer dans l’arborescence des documents",
+ "newItemTemplateSubDoc": "Sous-document du document contenant le bloc de base de données actuel",
+ "newItemTemplateSubDocTip": "Lors de la création depuis une base de données miroir, le document contenant le bloc de base de données miroir actuel est utilisé",
"entrySeparator": "Séparateur",
"tableAddColumnTip": "Cliquez pour insérer une colonne à droite<br>Faites glisser pour insérer ou supprimer plusieurs colonnes",
"tableAddRowTip": "Cliquez pour insérer une ligne en dessous<br>Faites glisser pour insérer ou supprimer plusieurs lignes",
diff --git a/app/appearance/langs/he.json b/app/appearance/langs/he.json
index 868a7f2382..5d6dfc7a6e 100644
--- a/app/appearance/langs/he.json
+++ b/app/appearance/langs/he.json
@@ -1,4 +1,7 @@
{
+ "hideInFileTree": "הסתרה בעץ המסמכים",
+ "newItemTemplateSubDoc": "מסמך משנה של המסמך המכיל את בלוק מסד הנתונים הנוכחי",
+ "newItemTemplateSubDocTip": "בעת יצירה ממסד נתונים משוקף, ייעשה שימוש במסמך המכיל את בלוק מסד הנתונים המשוקף הנוכחי",
"entrySeparator": "מפריד",
"tableAddColumnTip": "לחצו כדי להוסיף עמודה מימין<br>גררו כדי להוסיף או למחוק עמודות מרובות",
"tableAddRowTip": "לחצו כדי להוסיף שורה למטה<br>גררו כדי להוסיף או למחוק שורות מרובות",
diff --git a/app/appearance/langs/hi.json b/app/appearance/langs/hi.json
index 7d395eb89a..0bdd3e1096 100644
--- a/app/appearance/langs/hi.json
+++ b/app/appearance/langs/hi.json
@@ -1,4 +1,7 @@
{
+ "hideInFileTree": "दस्तावेज़ ट्री में छिपाएँ",
+ "newItemTemplateSubDoc": "वर्तमान डेटाबेस ब्लॉक वाले दस्तावेज़ का उप-दस्तावेज़",
+ "newItemTemplateSubDocTip": "मिरर डेटाबेस से बनाते समय वर्तमान मिरर डेटाबेस ब्लॉक वाला दस्तावेज़ उपयोग किया जाता है",
"entrySeparator": "विभाजक",
"tableAddColumnTip": "दाईं ओर एक कॉलम डालने के लिए क्लिक करें<br>कई कॉलम डालने या हटाने के लिए खींचें",
"tableAddRowTip": "नीचे एक पंक्ति डालने के लिए क्लिक करें<br>कई पंक्तियां डालने या हटाने के लिए खींचें",
diff --git a/app/appearance/langs/id.json b/app/appearance/langs/id.json
index dc8c63336f..d1e40c63ea 100644
--- a/app/appearance/langs/id.json
+++ b/app/appearance/langs/id.json
@@ -1,4 +1,7 @@
{
+ "hideInFileTree": "Sembunyikan di pohon dokumen",
+ "newItemTemplateSubDoc": "Subdokumen dari dokumen yang berisi blok basis data saat ini",
+ "newItemTemplateSubDocTip": "Saat membuat melalui basis data cermin, dokumen yang berisi blok basis data cermin saat ini akan digunakan",
"entrySeparator": "Pemisah",
"tableAddColumnTip": "Klik untuk menyisipkan kolom di sebelah kanan<br>Seret untuk menyisipkan atau menghapus beberapa kolom",
"tableAddRowTip": "Klik untuk menyisipkan baris di bawah<br>Seret untuk menyisipkan atau menghapus beberapa baris",
diff --git a/app/appearance/langs/it.json b/app/appearance/langs/it.json
index 00aaae92af..88cf678f47 100644
--- a/app/appearance/langs/it.json
+++ b/app/appearance/langs/it.json
@@ -1,4 +1,7 @@
{
+ "hideInFileTree": "Nascondi nell’albero dei documenti",
+ "newItemTemplateSubDoc": "Sottodocumento del documento che contiene il blocco database corrente",
+ "newItemTemplateSubDocTip": "Quando si crea da un database speculare, viene usato il documento che contiene il blocco database speculare corrente",
"entrySeparator": "Separatore",
"tableAddColumnTip": "Fai clic per inserire una colonna a destra<br>Trascina per inserire o eliminare più colonne",
"tableAddRowTip": "Fai clic per inserire una riga sotto<br>Trascina per inserire o eliminare più righe",
diff --git a/app/appearance/langs/ja.json b/app/appearance/langs/ja.json
index 766145a09d..f615abafdc 100644
--- a/app/appearance/langs/ja.json
+++ b/app/appearance/langs/ja.json
@@ -1,4 +1,7 @@
{
+ "hideInFileTree": "ドキュメントツリーで非表示",
+ "newItemTemplateSubDoc": "現在のデータベースブロックがあるドキュメントのサブドキュメント",
+ "newItemTemplateSubDocTip": "ミラーデータベースから作成する場合は、現在のミラーデータベースブロックがあるドキュメントを使用します",
"entrySeparator": "区切り線",
"tableAddColumnTip": "クリックして右側に列を挿入<br>ドラッグして複数の列を挿入または削除",
"tableAddRowTip": "クリックして下に行を挿入<br>ドラッグして複数の行を挿入または削除",
diff --git a/app/appearance/langs/ko.json b/app/appearance/langs/ko.json
index 73577d4aba..d693cbf849 100644
--- a/app/appearance/langs/ko.json
+++ b/app/appearance/langs/ko.json
@@ -1,4 +1,7 @@
{
+ "hideInFileTree": "문서 트리에서 숨기기",
+ "newItemTemplateSubDoc": "현재 데이터베이스 블록이 있는 문서의 하위 문서",
+ "newItemTemplateSubDocTip": "미러 데이터베이스에서 만들 때 현재 미러 데이터베이스 블록이 있는 문서를 사용합니다",
"entrySeparator": "구분선",
"tableAddColumnTip": "클릭하여 오른쪽에 열 삽입<br>드래그하여 여러 열 삽입 또는 삭제",
"tableAddRowTip": "클릭하여 아래에 행 삽입<br>드래그하여 여러 행 삽입 또는 삭제",
diff --git a/app/appearance/langs/nl.json b/app/appearance/langs/nl.json
index ea57f8cb48..5199351db1 100644
--- a/app/appearance/langs/nl.json
+++ b/app/appearance/langs/nl.json
@@ -1,4 +1,7 @@
{
+ "hideInFileTree": "Verbergen in de documentboom",
+ "newItemTemplateSubDoc": "Subdocument van het document met het huidige databaseblok",
+ "newItemTemplateSubDocTip": "Bij maken vanuit een gespiegelde database wordt het document met het huidige gespiegelde databaseblok gebruikt",
"entrySeparator": "Scheidingslijn",
"tableAddColumnTip": "Klik om rechts een kolom in te voegen<br>Sleep om meerdere kolommen in te voegen of te verwijderen",
"tableAddRowTip": "Klik om hieronder een rij in te voegen<br>Sleep om meerdere rijen in te voegen of te verwijderen",
diff --git a/app/appearance/langs/pl.json b/app/appearance/langs/pl.json
index bac0a0f819..2345bd3ff4 100644
--- a/app/appearance/langs/pl.json
+++ b/app/appearance/langs/pl.json
@@ -1,4 +1,7 @@
{
+ "hideInFileTree": "Ukryj w drzewie dokumentów",
+ "newItemTemplateSubDoc": "Dokument podrzędny dokumentu zawierającego bieżący blok bazy danych",
+ "newItemTemplateSubDocTip": "Podczas tworzenia z lustrzanej bazy danych używany jest dokument zawierający bieżący lustrzany blok bazy danych",
"entrySeparator": "Separator",
"tableAddColumnTip": "Kliknij, aby wstawić kolumnę po prawej<br>Przeciągnij, aby wstawić lub usunąć wiele kolumn",
"tableAddRowTip": "Kliknij, aby wstawić wiersz poniżej<br>Przeciągnij, aby wstawić lub usunąć wiele wierszy",
diff --git a/app/appearance/langs/pt-BR.json b/app/appearance/langs/pt-BR.json
index 00ec2dbaa6..a4484ccfa9 100644
--- a/app/appearance/langs/pt-BR.json
+++ b/app/appearance/langs/pt-BR.json
@@ -1,4 +1,7 @@
{
+ "hideInFileTree": "Ocultar na árvore de documentos",
+ "newItemTemplateSubDoc": "Subdocumento do documento que contém o bloco de banco de dados atual",
+ "newItemTemplateSubDocTip": "Ao criar por meio de um banco de dados espelhado, será usado o documento que contém o bloco de banco de dados espelhado atual",
"entrySeparator": "Separador",
"tableAddColumnTip": "Clique para inserir uma coluna à direita<br>Arraste para inserir ou excluir várias colunas",
"tableAddRowTip": "Clique para inserir uma linha abaixo<br>Arraste para inserir ou excluir várias linhas",
diff --git a/app/appearance/langs/ru.json b/app/appearance/langs/ru.json
index 8c3763277e..f6ce169bd9 100644
--- a/app/appearance/langs/ru.json
+++ b/app/appearance/langs/ru.json
@@ -1,4 +1,7 @@
{
+ "hideInFileTree": "Скрыть в дереве документов",
+ "newItemTemplateSubDoc": "Дочерний документ документа с текущим блоком базы данных",
+ "newItemTemplateSubDocTip": "При создании из зеркальной базы данных используется документ с текущим блоком зеркальной базы данных",
"entrySeparator": "Разделитель",
"tableAddColumnTip": "Нажмите, чтобы вставить столбец справа<br>Перетащите, чтобы вставить или удалить несколько столбцов",
"tableAddRowTip": "Нажмите, чтобы вставить строку ниже<br>Перетащите, чтобы вставить или удалить несколько строк",
diff --git a/app/appearance/langs/sk.json b/app/appearance/langs/sk.json
index c11270b46a..6fec1f333f 100644
--- a/app/appearance/langs/sk.json
+++ b/app/appearance/langs/sk.json
@@ -1,4 +1,7 @@
{
+ "hideInFileTree": "Skryť v strome dokumentov",
+ "newItemTemplateSubDoc": "Podradený dokument dokumentu obsahujúceho aktuálny blok databázy",
+ "newItemTemplateSubDocTip": "Pri vytváraní zo zrkadlenej databázy sa použije dokument obsahujúci aktuálny blok zrkadlenej databázy",
"entrySeparator": "Oddeľovač",
"tableAddColumnTip": "Kliknutím vložíte stĺpec napravo<br>Potiahnutím vložíte alebo odstránite viacero stĺpcov",
"tableAddRowTip": "Kliknutím vložíte riadok nižšie<br>Potiahnutím vložíte alebo odstránite viacero riadkov",
diff --git a/app/appearance/langs/th.json b/app/appearance/langs/th.json
index b27bd079c9..42744444ed 100644
--- a/app/appearance/langs/th.json
+++ b/app/appearance/langs/th.json
@@ -1,4 +1,7 @@
{
+ "hideInFileTree": "ซ่อนในแผนผังเอกสาร",
+ "newItemTemplateSubDoc": "เอกสารย่อยของเอกสารที่มีบล็อกฐานข้อมูลปัจจุบัน",
+ "newItemTemplateSubDocTip": "เมื่อสร้างผ่านฐานข้อมูลมิเรอร์ จะใช้เอกสารที่มีบล็อกฐานข้อมูลมิเรอร์ปัจจุบัน",
"entrySeparator": "ตัวคั่น",
"tableAddColumnTip": "คลิกเพื่อแทรกคอลัมน์ทางขวา<br>ลากเพื่อแทรกหรือลบหลายคอลัมน์",
"tableAddRowTip": "คลิกเพื่อแทรกแถวด้านล่าง<br>ลากเพื่อแทรกหรือลบหลายแถว",
diff --git a/app/appearance/langs/tr.json b/app/appearance/langs/tr.json
index f62a66795d..12d593667d 100644
--- a/app/appearance/langs/tr.json
+++ b/app/appearance/langs/tr.json
@@ -1,4 +1,7 @@
{
+ "hideInFileTree": "Belge ağacında gizle",
+ "newItemTemplateSubDoc": "Geçerli veritabanı bloğunu içeren belgenin alt belgesi",
+ "newItemTemplateSubDocTip": "Yansıtılmış bir veritabanından oluştururken geçerli yansıtılmış veritabanı bloğunu içeren belge kullanılır",
"entrySeparator": "Ayırıcı",
"tableAddColumnTip": "Sağa bir sütun eklemek için tıklayın<br>Birden fazla sütun eklemek veya silmek için sürükleyin",
"tableAddRowTip": "Aşağıya bir satır eklemek için tıklayın<br>Birden fazla satır eklemek veya silmek için sürükleyin",
diff --git a/app/appearance/langs/uk.json b/app/appearance/langs/uk.json
index 49cb62e7ef..44ba7df526 100644
--- a/app/appearance/langs/uk.json
+++ b/app/appearance/langs/uk.json
@@ -1,4 +1,7 @@
{
+ "hideInFileTree": "Приховати в дереві документів",
+ "newItemTemplateSubDoc": "Дочірній документ документа з поточним блоком бази даних",
+ "newItemTemplateSubDocTip": "Під час створення з дзеркальної бази даних використовується документ із поточним блоком дзеркальної бази даних",
"entrySeparator": "Роздільник",
"tableAddColumnTip": "Клацніть, щоб вставити стовпець праворуч<br>Перетягніть, щоб вставити або видалити кілька стовпців",
"tableAddRowTip": "Клацніть, щоб вставити рядок нижче<br>Перетягніть, щоб вставити або видалити кілька рядків",
diff --git a/app/appearance/langs/zh-CN.json b/app/appearance/langs/zh-CN.json
index 355a345fdb..ba73cc61a2 100644
--- a/app/appearance/langs/zh-CN.json
+++ b/app/appearance/langs/zh-CN.json
@@ -1,4 +1,7 @@
{
+ "hideInFileTree": "在文档树中隐藏",
+ "newItemTemplateSubDoc": "当前数据库块所在文档的子文档",
+ "newItemTemplateSubDocTip": "通过镜像数据库创建时,以当前镜像数据库块所在文档为准",
"entrySeparator": "分隔线",
"tableAddColumnTip": "点击在右侧插入一列<br>拖拽插入或删除多列",
"tableAddRowTip": "点击在下方插入一行<br>拖拽插入或删除多行",
diff --git a/app/appearance/langs/zh-TW.json b/app/appearance/langs/zh-TW.json
index 1596ae0a0d..96fd286e04 100644
--- a/app/appearance/langs/zh-TW.json
+++ b/app/appearance/langs/zh-TW.json
@@ -1,4 +1,7 @@
{
+ "hideInFileTree": "在文檔樹中隱藏",
+ "newItemTemplateSubDoc": "目前資料庫區塊所在文檔的子文檔",
+ "newItemTemplateSubDocTip": "透過鏡像資料庫建立時,以目前鏡像資料庫區塊所在文檔為準",
"entrySeparator": "分隔線",
"tableAddColumnTip": "點擊在右側插入一欄<br>拖曳插入或刪除多欄",
"tableAddRowTip": "點擊在下方插入一列<br>拖曳插入或刪除多列",
diff --git a/app/src/protyle/render/av/newItemTemplate.ts b/app/src/protyle/render/av/newItemTemplate.ts
index 9e9436b42b..5ef9d355b9 100644
--- a/app/src/protyle/render/av/newItemTemplate.ts
+++ b/app/src/protyle/render/av/newItemTemplate.ts
@@ -19,6 +19,9 @@ interface ICreatePosition {
groupID?: string;
}
+const SAVE_LOCATION_DEFAULT = "__default__";
+const SAVE_LOCATION_SUB_DOC = "__subdoc__";
+
const cloneTemplates = (templates?: IAVNewItemTemplate[]) => JSON.parse(JSON.stringify(templates || [])) as IAVNewItemTemplate[];
const getCustomTemplateData = (data: IAV) => {
@@ -473,10 +476,18 @@ const collectTemplate = (root: HTMLElement, itemTemplate: IAVNewItemTemplate, fi
itemTemplate.primaryKeyTemplate = (root.querySelector('[data-role="primary-key"]') as HTMLInputElement).value;
itemTemplate.contentTemplatePath = (root.querySelector('[data-role="content-template"]') as HTMLElement).dataset.value || "";
const boxID = (root.querySelector('[data-role="box-id"]') as HTMLSelectElement).value;
- itemTemplate.saveLocation = boxID === "__default__" ? undefined : {
- boxID,
- pathTemplate: (root.querySelector('[data-role="path-template"]') as HTMLInputElement).value,
- };
+ if (boxID === SAVE_LOCATION_DEFAULT) {
+ itemTemplate.saveLocation = undefined;
+ } else if (boxID === SAVE_LOCATION_SUB_DOC) {
+ itemTemplate.saveLocation = {pathTemplate: ""};
+ } else {
+ itemTemplate.saveLocation = {
+ boxID,
+ pathTemplate: (root.querySelector('[data-role="path-template"]') as HTMLInputElement).value,
+ };
+ }
+ itemTemplate.hideInFileTree = itemTemplate.targetType === "document" &&
+ (root.querySelector('[data-role="hide-in-file-tree"]') as HTMLInputElement).checked;
const fieldValues: Record<string, IAVNewItemFieldValue> = {};
root.querySelectorAll<HTMLElement>("[data-field-id]").forEach(element => {
const column = fields.find(item => item.id === element.dataset.fieldId);
@@ -502,10 +513,13 @@ const getEditorHTML = (itemTemplate: IAVNewItemTemplate, primaryKey: IAVColumn |
(!savedNotebook || savedNotebook.closed) ? itemTemplate.saveLocation.boxID : "";
const unavailableNotebookOption = unavailableNotebookID ?
`<option value="${escapeAttr(unavailableNotebookID)}" data-unavailable="true" selected disabled>${escapeHtml(savedNotebook?.name || unavailableNotebookID)}</option>` : "";
- const currentNotebookSelected = forceCurrentNotebook || !!itemTemplate.saveLocation &&
- (!itemTemplate.saveLocation.boxID || itemTemplate.saveLocation.boxID === currentNotebookID);
+ const isSubDoc = !!itemTemplate.saveLocation && !itemTemplate.saveLocation.boxID && !itemTemplate.saveLocation.pathTemplate;
+ const currentNotebookSelected = !isSubDoc && (forceCurrentNotebook || !!itemTemplate.saveLocation &&
+ (!itemTemplate.saveLocation.boxID || itemTemplate.saveLocation.boxID === currentNotebookID));
+ const showPath = !isSubDoc && (forceCurrentNotebook || !!itemTemplate.saveLocation);
const notebookOptions = (forceCurrentNotebook ? "" :
- `<option value="__default__"${itemTemplate.saveLocation ? "" : " selected"}>${window.siyuan.languages.default}</option>`) +
+ `<option value="${SAVE_LOCATION_DEFAULT}"${itemTemplate.saveLocation ? "" : " selected"}>${window.siyuan.languages.default}</option>`) +
+ `<option value="${SAVE_LOCATION_SUB_DOC}"${isSubDoc ? " selected" : ""}>${window.siyuan.languages.newItemTemplateSubDoc}</option>` +
`<option value=""${currentNotebookSelected ? " selected" : ""}>${window.siyuan.languages.currentNotebook}</option>` +
unavailableNotebookOption +
(forceCurrentNotebook ? "" : (window.siyuan.notebooks || []).filter(item => !item.closed && item.id !== currentNotebookID)
@@ -530,7 +544,11 @@ const getEditorHTML = (itemTemplate: IAVNewItemTemplate, primaryKey: IAVColumn |
</div>
<div class="block__icons av__row">
<div class="block__logo block__logo--icon ariaLabel" data-position="parentE" aria-label="${escapeAttr(`${window.siyuan.languages.fileTree14}<br>${window.siyuan.languages.fileTree13}`)}"><svg class="block__logoicon"><use xlink:href="#iconFolder"></use></svg><span>${window.siyuan.languages.savePath}</span></div>
- <div class="fn__flex-1 fn__flex custom-attr__avvalue" style="align-items:center"><select class="b3-select" data-role="box-id" style="width:160px">${notebookOptions}</select><span class="fn__space${itemTemplate.saveLocation || forceCurrentNotebook ? "" : " fn__none"}" data-role="path-space"></span><input class="b3-text-field fn__flex-1${itemTemplate.saveLocation || forceCurrentNotebook ? "" : " fn__none"}" data-role="path-template" value="${escapeAttr(itemTemplate.saveLocation?.pathTemplate || "")}"${itemTemplate.saveLocation || forceCurrentNotebook ? "" : " disabled"}></div>
+ <div class="fn__flex-1 custom-attr__avvalue"><div class="fn__flex" style="align-items:center"><select class="b3-select" data-role="box-id" style="width:${showPath ? "160px" : "100%"}">${notebookOptions}</select><span class="fn__space${showPath ? "" : " fn__none"}" data-role="path-space"></span><input class="b3-text-field fn__flex-1${showPath ? "" : " fn__none"}" data-role="path-template" value="${escapeAttr(itemTemplate.saveLocation?.pathTemplate || "")}"${showPath ? "" : " disabled"}></div><div class="b3-label__text${isSubDoc ? "" : " fn__none"}" data-role="subdoc-tip" style="margin-top:4px">${window.siyuan.languages.newItemTemplateSubDocTip}</div></div>
+ </div>
+ <div class="block__icons av__row">
+ <div class="block__logo block__logo--icon"><svg class="block__logoicon"><use xlink:href="#iconEyeoff"></use></svg><span>${window.siyuan.languages.hideInFileTree}</span></div>
+ <div class="fn__flex-1 fn__flex custom-attr__avvalue" style="align-items:center;justify-content:flex-end"><input class="b3-switch" data-role="hide-in-file-tree" type="checkbox"${itemTemplate.hideInFileTree ? " checked" : ""}></div>
</div>
<div class="block__icons av__row">
<div class="block__logo block__logo--icon"><svg class="block__logoicon"><use xlink:href="#iconFile"></use></svg><span>${window.siyuan.languages.contentTemplate}</span></div>
@@ -614,10 +632,12 @@ export const openNewItemTemplateDialog = (options: {
}
boxIDElement?.addEventListener("change", () => {
const pathElement = hostElement.querySelector('[data-role="path-template"]') as HTMLInputElement;
- const useDefaultPath = boxIDElement.value === "__default__";
- pathElement.disabled = useDefaultPath;
- pathElement.classList.toggle("fn__none", useDefaultPath);
- hostElement.querySelector('[data-role="path-space"]')?.classList.toggle("fn__none", useDefaultPath);
+ const showPath = boxIDElement.value !== SAVE_LOCATION_DEFAULT && boxIDElement.value !== SAVE_LOCATION_SUB_DOC;
+ pathElement.disabled = !showPath;
+ pathElement.classList.toggle("fn__none", !showPath);
+ boxIDElement.style.width = showPath ? "160px" : "100%";
+ hostElement.querySelector('[data-role="path-space"]')?.classList.toggle("fn__none", !showPath);
+ hostElement.querySelector('[data-role="subdoc-tip"]')?.classList.toggle("fn__none", boxIDElement.value !== SAVE_LOCATION_SUB_DOC);
});
hostElement.querySelector<HTMLElement>('[data-role="content-template"]')?.addEventListener("click", event => {
event.preventDefault();
diff --git a/app/src/types/index.d.ts b/app/src/types/index.d.ts
index f3462be791..016ac1a967 100644
--- a/app/src/types/index.d.ts
+++ b/app/src/types/index.d.ts
@@ -1093,6 +1093,7 @@ interface IAVNewItemTemplate {
fieldValues?: Record<string, IAVNewItemFieldValue>;
saveLocation?: IAVNewItemSaveLocation;
contentTemplatePath?: string;
+ hideInFileTree?: boolean;
}
interface IAVView {
diff --git a/kernel/api/filetree.go b/kernel/api/filetree.go
index 6d9d97820f..f30647bdca 100644
--- a/kernel/api/filetree.go
+++ b/kernel/api/filetree.go
@@ -998,33 +998,14 @@ func getDocCreateSavePath(c *gin.Context) {
}
notebook := arg["notebook"].(string)
- box := model.Conf.Box(notebook)
- var docCreateSaveBox string
- docCreateSavePathTpl := model.Conf.FileTree.DocCreateSavePath
+ docCreateSaveBox, docCreateSavePathTpl := model.ResolveDocCreateSaveLocation(notebook)
docCreateTemplatePath := model.Conf.FileTree.DocCreateTemplatePath
- if nil != box {
+ if box := model.Conf.Box(notebook); nil != box {
boxConf := box.GetConf()
- docCreateSaveBox = boxConf.DocCreateSaveBox
- docCreateSavePathTpl = boxConf.DocCreateSavePath
if "" != boxConf.DocCreateTemplatePath {
docCreateTemplatePath = boxConf.DocCreateTemplatePath
}
}
- if "" == docCreateSaveBox && "" == docCreateSavePathTpl {
- docCreateSaveBox = model.Conf.FileTree.DocCreateSaveBox
- }
- if "" != docCreateSaveBox {
- if nil == model.Conf.Box(docCreateSaveBox) {
- // 如果配置的笔记本未打开或者不存在,则使用当前笔记本
- docCreateSaveBox = notebook
- }
- }
- if "" == docCreateSaveBox {
- docCreateSaveBox = notebook
- }
- if "" == docCreateSavePathTpl {
- docCreateSavePathTpl = model.Conf.FileTree.DocCreateSavePath
- }
docCreateSavePathTpl = strings.TrimSpace(docCreateSavePathTpl)
if docCreateSaveBox != notebook {
diff --git a/kernel/av/av.go b/kernel/av/av.go
index 3229029cc1..9b07ee3343 100644
--- a/kernel/av/av.go
+++ b/kernel/av/av.go
@@ -97,6 +97,7 @@ type NewItemTemplate struct {
FieldValues map[string]*NewItemFieldValue `json:"fieldValues,omitempty"`
SaveLocation *NewItemSaveLocation `json:"saveLocation,omitempty"`
ContentTemplatePath string `json:"contentTemplatePath,omitempty"`
+ HideInFileTree bool `json:"hideInFileTree,omitempty"`
}
// NewItemTemplatesConfig 描述一次完整的新增条目模板配置修改。
diff --git a/kernel/av/new_item_template.go b/kernel/av/new_item_template.go
index fff6db1512..0aec2cad67 100644
--- a/kernel/av/new_item_template.go
+++ b/kernel/av/new_item_template.go
@@ -75,6 +75,7 @@ func (av *AttributeView) SetNewItemTemplates(config *NewItemTemplatesConfig) err
}
if NewItemTargetDocument != itemTemplate.TargetType {
itemTemplate.Icon = ""
+ itemTemplate.HideInFileTree = false
}
itemTemplate.ContentTemplatePath = strings.TrimSpace(itemTemplate.ContentTemplatePath)
if nil != itemTemplate.SaveLocation {
@@ -475,6 +476,7 @@ func cloneNewItemTemplate(itemTemplate *NewItemTemplate) *NewItemTemplate {
TargetType: itemTemplate.TargetType,
PrimaryKeyTemplate: itemTemplate.PrimaryKeyTemplate,
ContentTemplatePath: itemTemplate.ContentTemplatePath,
+ HideInFileTree: itemTemplate.HideInFileTree,
}
if nil != itemTemplate.SaveLocation {
ret.SaveLocation = &NewItemSaveLocation{
diff --git a/kernel/av/new_item_template_test.go b/kernel/av/new_item_template_test.go
index c3ce1683d0..0c7c988091 100644
--- a/kernel/av/new_item_template_test.go
+++ b/kernel/av/new_item_template_test.go
@@ -22,10 +22,11 @@ func TestSetNewItemTemplates(t *testing.T) {
templateID := ast.NewNodeID()
config := &NewItemTemplatesConfig{
Templates: []*NewItemTemplate{{
- ID: templateID,
- Name: " Document ",
- Icon: " 1f4c4 ",
- TargetType: NewItemTargetDocument,
+ ID: templateID,
+ Name: " Document ",
+ Icon: " 1f4c4 ",
+ TargetType: NewItemTargetDocument,
+ HideInFileTree: true,
FieldValues: map[string]*NewItemFieldValue{
textKey.ID: {Mode: NewItemFieldValueStatic, Value: &Value{
ID: ast.NewNodeID(), KeyID: "old", BlockID: "old", Type: KeyTypeNumber, Text: &ValueText{Content: "value"},
@@ -45,6 +46,9 @@ func TestSetNewItemTemplates(t *testing.T) {
if "1f4c4" != got.Icon {
t.Fatalf("unexpected normalized icon: %q", got.Icon)
}
+ if !got.HideInFileTree {
+ t.Fatal("document template should preserve the file tree visibility setting")
+ }
value := got.FieldValues[textKey.ID].Value
if KeyTypeText != value.Type || "" != value.ID || "" != value.KeyID || "" != value.BlockID {
t.Fatalf("unexpected normalized value: %+v", value)
@@ -122,7 +126,7 @@ func TestEmptyNewItemTemplatesUseVirtualDefault(t *testing.T) {
func TestDetachedNewItemTemplateDropsIcon(t *testing.T) {
attrView := &AttributeView{Spec: CurrentSpec, ID: ast.NewNodeID()}
config := &NewItemTemplatesConfig{Templates: []*NewItemTemplate{{
- ID: ast.NewNodeID(), Name: "Detached", Icon: "1f4c4", TargetType: NewItemTargetDetached,
+ ID: ast.NewNodeID(), Name: "Detached", Icon: "1f4c4", TargetType: NewItemTargetDetached, HideInFileTree: true,
}}}
if err := attrView.SetNewItemTemplates(config); nil != err {
t.Fatalf("set detached new item template failed: %s", err)
@@ -130,6 +134,9 @@ func TestDetachedNewItemTemplateDropsIcon(t *testing.T) {
if "" != attrView.NewItemTemplates[0].Icon {
t.Fatalf("detached template icon should be empty: %q", attrView.NewItemTemplates[0].Icon)
}
+ if attrView.NewItemTemplates[0].HideInFileTree {
+ t.Fatal("detached template should not preserve the file tree visibility setting")
+ }
if "1f4c4" != config.Templates[0].Icon {
t.Fatal("input icon was mutated")
}
diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go
index 63c6cec7f7..10d2f7a409 100644
--- a/kernel/model/attribute_view.go
+++ b/kernel/model/attribute_view.go
@@ -6126,11 +6126,21 @@ func removeRelatedRelationItems(avID string, itemIDs []string) (err error) {
}
func removeNodeAvID(node *ast.Node, avID string, tx *Transaction, tree *parse.Tree) (err error) {
- attrs := parse.IAL2Map(node.KramdownIAL)
- if ast.NodeDocument == node.Type && !IsBoxDoc(tree.Box, tree.ID) {
- delete(attrs, DocHiddenAttr)
- node.RemoveIALAttr(DocHiddenAttr)
+ attrs := removeNodeAvIDAttrs(node, avID)
+ if nil != tx {
+ if err = setNodeAttrsWithTx(tx, node, tree, attrs); err != nil {
+ return
+ }
+ } else {
+ if err = setNodeAttrs(node, tree, attrs); err != nil {
+ return
+ }
}
+ return
+}
+
+func removeNodeAvIDAttrs(node *ast.Node, avID string) map[string]string {
+ attrs := parse.IAL2Map(node.KramdownIAL)
if avs := attrs[av.NodeAttrNameAvs]; "" != avs {
avIDs := strings.Split(avs, ",")
@@ -6152,17 +6162,7 @@ func removeNodeAvID(node *ast.Node, avID string, tx *Transaction, tree *parse.Tr
attrs[av.NodeAttrViewNames] = avNames
}
}
-
- if nil != tx {
- if err = setNodeAttrsWithTx(tx, node, tree, attrs); err != nil {
- return
- }
- } else {
- if err = setNodeAttrs(node, tree, attrs); err != nil {
- return
- }
- }
- return
+ return attrs
}
func (tx *Transaction) doDuplicateAttrViewKey(operation *Operation) (ret *TxErr) {
diff --git a/kernel/model/attribute_view_new_item.go b/kernel/model/attribute_view_new_item.go
index e1a136a064..bcf33cdb0c 100644
--- a/kernel/model/attribute_view_new_item.go
+++ b/kernel/model/attribute_view_new_item.go
@@ -365,9 +365,7 @@ func resolveAttributeViewItemDocument(blockID, primary string, itemTemplate *av.
if nil == blockTree {
return nil, ErrBlockNotFound
}
- preview := &NewItemTemplatePreview{}
primary = normalizeDocTitle(primary)
- preview.PrimaryKey = primary
boxID, pathTemplate, inherited, err := resolveNewItemSaveConfig(blockTree.BoxID, itemTemplate.SaveLocation)
if nil != err {
@@ -378,6 +376,11 @@ func resolveAttributeViewItemDocument(blockID, primary string, itemTemplate *av.
return nil, err
}
renderedPath = util.TrimSpaceInPath(strings.TrimSpace(renderedPath))
+ return newItemDocumentPreview(blockTree, boxID, renderedPath, primary, inherited), nil
+}
+
+func newItemDocumentPreview(blockTree *treenode.BlockTree, boxID, renderedPath, primary string, inherited bool) *NewItemTemplatePreview {
+ preview := &NewItemTemplatePreview{PrimaryKey: primary, BoxID: boxID}
if boxID != blockTree.BoxID && "" != renderedPath && !strings.HasPrefix(renderedPath, "/") {
renderedPath = "/" + renderedPath
}
@@ -406,11 +409,10 @@ func resolveAttributeViewItemDocument(blockID, primary string, itemTemplate *av.
} else {
preview.HPath = path.Join(parentHPath, primary)
}
- preview.BoxID = boxID
if inherited && boxID != blockTree.BoxID {
preview.parentID = ""
}
- return preview, nil
+ return preview
}
func createAttributeViewItemDocument(preview *NewItemTemplatePreview, itemTemplate *av.NewItemTemplate) (docID string, tree *parse.Tree, err error) {
@@ -431,8 +433,7 @@ func createAttributeViewItemDocument(preview *NewItemTemplatePreview, itemTempla
err = newItemCreationError(err, removeCreatedNewItemDoc(docID))
return
}
- if "" != itemTemplate.Icon {
- tree.Root.SetIALAttr("icon", itemTemplate.Icon)
+ if applyNewItemDocumentAttrs(tree, itemTemplate) {
if err = indexWriteTreeUpsertQueue(tree); nil != err {
err = newItemCreationError(err, removeCreatedNewItemDoc(docID))
return
@@ -442,6 +443,23 @@ func createAttributeViewItemDocument(preview *NewItemTemplatePreview, itemTempla
return
}
+func applyNewItemDocumentAttrs(tree *parse.Tree, itemTemplate *av.NewItemTemplate) (changed bool) {
+ if "" != itemTemplate.Icon && tree.Root.IALAttr("icon") != itemTemplate.Icon {
+ tree.Root.SetIALAttr("icon", itemTemplate.Icon)
+ changed = true
+ }
+ if itemTemplate.HideInFileTree {
+ if "true" != tree.Root.IALAttr(DocHiddenAttr) {
+ tree.Root.SetIALAttr(DocHiddenAttr, "true")
+ changed = true
+ }
+ } else if "" != tree.Root.IALAttr(DocHiddenAttr) {
+ tree.Root.RemoveIALAttr(DocHiddenAttr)
+ changed = true
+ }
+ return
+}
+
func resolveNewItemSaveConfig(currentBoxID string, location *av.NewItemSaveLocation) (boxID, pathTemplate string, inherited bool, err error) {
if nil != location {
boxID = location.BoxID
@@ -458,24 +476,7 @@ func resolveNewItemSaveConfig(currentBoxID string, location *av.NewItemSaveLocat
}
inherited = true
- boxID = currentBoxID
- pathTemplate = Conf.FileTree.DocCreateSavePath
- if box := Conf.Box(currentBoxID); nil != box {
- boxConf := box.GetConf()
- if "" != boxConf.DocCreateSaveBox || "" != boxConf.DocCreateSavePath {
- boxID = boxConf.DocCreateSaveBox
- pathTemplate = boxConf.DocCreateSavePath
- }
- }
- if "" == boxID {
- boxID = Conf.FileTree.DocCreateSaveBox
- }
- if "" == boxID || nil == Conf.Box(boxID) {
- boxID = currentBoxID
- }
- if "" == pathTemplate {
- pathTemplate = Conf.FileTree.DocCreateSavePath
- }
+ boxID, pathTemplate = ResolveDocCreateSaveLocation(currentBoxID)
err = validateNewItemSaveBox(currentBoxID, boxID)
return
}
diff --git a/kernel/model/attribute_view_new_item_test.go b/kernel/model/attribute_view_new_item_test.go
index 7db5cd4c17..827c6ec9a7 100644
--- a/kernel/model/attribute_view_new_item_test.go
+++ b/kernel/model/attribute_view_new_item_test.go
@@ -14,6 +14,9 @@ import (
"github.com/88250/lute/ast"
"github.com/siyuan-note/siyuan/kernel/av"
+ "github.com/siyuan-note/siyuan/kernel/conf"
+ "github.com/siyuan-note/siyuan/kernel/treenode"
+ "github.com/siyuan-note/siyuan/kernel/util"
)
func TestNewItemParentPathTemplate(t *testing.T) {
@@ -42,6 +45,24 @@ func TestNewItemPathTitleFallback(t *testing.T) {
}
}
+func TestNewItemDocumentPreviewUsesCurrentDatabaseInstance(t *testing.T) {
+ boxID := ast.NewNodeID()
+ template := &av.NewItemTemplate{TargetType: av.NewItemTargetDocument, SaveLocation: &av.NewItemSaveLocation{}}
+ for name, blockTree := range map[string]*treenode.BlockTree{
+ "original": {ID: ast.NewNodeID(), RootID: ast.NewNodeID(), BoxID: boxID, HPath: "/Original"},
+ "mirror": {ID: ast.NewNodeID(), RootID: ast.NewNodeID(), BoxID: boxID, HPath: "/Mirror"},
+ } {
+ preview := newItemDocumentPreview(blockTree, boxID, template.SaveLocation.PathTemplate, "Child", false)
+ expectedHPath := "/Original/Child"
+ if "mirror" == name {
+ expectedHPath = "/Mirror/Child"
+ }
+ if expectedHPath != preview.HPath || blockTree.RootID != preview.parentID {
+ t.Fatalf("%s database instance resolved to unexpected parent: %+v", name, preview)
+ }
+ }
+}
+
func TestCreatedDocLifecycleOperationsRequireSnapshot(t *testing.T) {
docID := ast.NewNodeID()
tx := &Transaction{}
@@ -101,6 +122,110 @@ func TestAttributeViewItemDocumentTemplate(t *testing.T) {
}
}
+func TestApplyNewItemDocumentAttrs(t *testing.T) {
+ tree := treenode.NewTree(ast.NewNodeID(), "/"+ast.NewNodeID()+".sy", "/Document", "Document")
+ tree.Root.SetIALAttr(DocHiddenAttr, "true")
+ template := &av.NewItemTemplate{TargetType: av.NewItemTargetDocument, Icon: "1f4c4"}
+ if !applyNewItemDocumentAttrs(tree, template) {
+ t.Fatal("item template attributes should update the document")
+ }
+ if "1f4c4" != tree.Root.IALAttr("icon") {
+ t.Fatalf("unexpected document icon: %q", tree.Root.IALAttr("icon"))
+ }
+ if "" != tree.Root.IALAttr(DocHiddenAttr) {
+ t.Fatal("the disabled visibility option should override the content template attribute")
+ }
+
+ template.HideInFileTree = true
+ if !applyNewItemDocumentAttrs(tree, template) {
+ t.Fatal("enabling the visibility option should update the document")
+ }
+ if "true" != tree.Root.IALAttr(DocHiddenAttr) {
+ t.Fatal("the enabled visibility option should hide the document")
+ }
+ if applyNewItemDocumentAttrs(tree, template) {
+ t.Fatal("applying unchanged item template attributes should be a no-op")
+ }
+}
+
+func TestRemoveNodeAvIDKeepsHiddenAttr(t *testing.T) {
+ avID := ast.NewNodeID()
+ node := &ast.Node{Type: ast.NodeDocument, ID: ast.NewNodeID()}
+ node.SetIALAttr(av.NodeAttrNameAvs, avID)
+ node.SetIALAttr(DocHiddenAttr, "true")
+ attrs := removeNodeAvIDAttrs(node, avID)
+ if "true" != attrs[DocHiddenAttr] || "true" != node.IALAttr(DocHiddenAttr) {
+ t.Fatal("removing a database binding should preserve the document visibility setting")
+ }
+ if "" != attrs[av.NodeAttrNameAvs] {
+ t.Fatalf("the removed database ID should be cleared: %q", attrs[av.NodeAttrNameAvs])
+ }
+}
+
+func TestResolveDocCreateSaveLocation(t *testing.T) {
+ originalConf, originalDataDir := Conf, util.DataDir
+ util.DataDir = t.TempDir()
+ Conf = NewAppConf()
+ Conf.FileTree = conf.NewFileTree()
+ Conf.NotebookCrypto = conf.NewNotebookCrypto()
+ Conf.Sync = conf.NewSync()
+ t.Cleanup(func() {
+ Conf = originalConf
+ util.DataDir = originalDataDir
+ })
+
+ currentBoxID, globalBoxID, localBoxID := ast.NewNodeID(), ast.NewNodeID(), ast.NewNodeID()
+ currentBoxConf, globalBoxConf, localBoxConf := conf.NewBoxConf(), conf.NewBoxConf(), conf.NewBoxConf()
+ currentBoxConf.Name, currentBoxConf.Closed = "Current", false
+ globalBoxConf.Name, globalBoxConf.Closed = "Global", false
+ localBoxConf.Name, localBoxConf.Closed = "Local", false
+ for boxID, boxConf := range map[string]*conf.BoxConf{
+ currentBoxID: currentBoxConf,
+ globalBoxID: globalBoxConf,
+ localBoxID: localBoxConf,
+ } {
+ if err := (&Box{ID: boxID}).SaveConf(boxConf); nil != err {
+ t.Fatalf("save notebook config failed: %s", err)
+ }
+ }
+ Conf.FileTree.DocCreateSaveBox = globalBoxID
+ Conf.FileTree.DocCreateSavePath = "/Global/{{now | date \"200601\"}}"
+
+ assertLocation := func(expectedBoxID, expectedPath string) {
+ t.Helper()
+ boxID, pathTemplate := ResolveDocCreateSaveLocation(currentBoxID)
+ if expectedBoxID != boxID || expectedPath != pathTemplate {
+ t.Fatalf("unexpected save location: box=%q path=%q", boxID, pathTemplate)
+ }
+ }
+ assertLocation(globalBoxID, Conf.FileTree.DocCreateSavePath)
+
+ currentBoxConf.DocCreateSavePath = "Local/{{now | date \"200601\"}}"
+ if err := (&Box{ID: currentBoxID}).SaveConf(currentBoxConf); nil != err {
+ t.Fatal(err)
+ }
+ assertLocation(currentBoxID, currentBoxConf.DocCreateSavePath)
+
+ currentBoxConf.DocCreateSavePath = ""
+ currentBoxConf.DocCreateSaveBox = localBoxID
+ if err := (&Box{ID: currentBoxID}).SaveConf(currentBoxConf); nil != err {
+ t.Fatal(err)
+ }
+ assertLocation(localBoxID, Conf.FileTree.DocCreateSavePath)
+
+ currentBoxConf.DocCreateSavePath = "/Local"
+ if err := (&Box{ID: currentBoxID}).SaveConf(currentBoxConf); nil != err {
+ t.Fatal(err)
+ }
+ assertLocation(localBoxID, currentBoxConf.DocCreateSavePath)
+
+ localBoxConf.Closed = true
+ if err := (&Box{ID: localBoxID}).SaveConf(localBoxConf); nil != err {
+ t.Fatal(err)
+ }
+ assertLocation(currentBoxID, currentBoxConf.DocCreateSavePath)
+}
+
func TestNewBoundAttributeViewItemValueUsesDynamicAnchorText(t *testing.T) {
original := &av.Value{
Type: av.KeyTypeBlock,
diff --git a/kernel/model/file.go b/kernel/model/file.go
index bcaf7d9217..5d19f3e50f 100644
--- a/kernel/model/file.go
+++ b/kernel/model/file.go
@@ -1378,6 +1378,29 @@ func applyRequestedDocCreateTemplate(arg map[string]any, markdown, docID string)
}
}
+// ResolveDocCreateSaveLocation 按笔记本配置和全局配置解析新建文档的存放位置。
+func ResolveDocCreateSaveLocation(currentBoxID string) (boxID, pathTemplate string) {
+ pathTemplate = Conf.FileTree.DocCreateSavePath
+ if box := Conf.Box(currentBoxID); nil != box {
+ boxConf := box.GetConf()
+ boxID = boxConf.DocCreateSaveBox
+ pathTemplate = boxConf.DocCreateSavePath
+ }
+ if "" == boxID && "" == pathTemplate {
+ boxID = Conf.FileTree.DocCreateSaveBox
+ }
+ if "" != boxID && nil == Conf.Box(boxID) {
+ boxID = currentBoxID
+ }
+ if "" == boxID {
+ boxID = currentBoxID
+ }
+ if "" == pathTemplate {
+ pathTemplate = Conf.FileTree.DocCreateSavePath
+ }
+ return
+}
+
const (
DailyNoteAttrPrefix = "custom-dailynote-"
NodeAttrTitleEmpty = "custom-sy-title-empty"