Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
feat(pdf): describe the attributes & fix conflict in name
Elian Doranfa655ea45e7e
diff --git a/src/public/app/widgets/attribute_widgets/attribute_detail.ts b/src/public/app/widgets/attribute_widgets/attribute_detail.tsindex 7ea7061a9f..cccb700753 100644--- a/src/public/app/widgets/attribute_widgets/attribute_detail.ts+++ b/src/public/app/widgets/attribute_widgets/attribute_detail.ts@@ -242,7 +242,9 @@ const ATTR_HELP: Record<string, Record<string, string>> = {executeDescription: t("attribute_detail.execute_description"),excludeFromNoteMap: t("attribute_detail.exclude_from_note_map"),newNotesOnTop: t("attribute_detail.new_notes_on_top"),- hideHighlightWidget: t("attribute_detail.hide_highlight_widget")+ hideHighlightWidget: t("attribute_detail.hide_highlight_widget"),+ printLandscape: t("attribute_detail.print_landscape"),+ printPageSize: t("attribute_detail.print_page_size")},relation: {runOnNoteCreation: t("attribute_detail.run_on_note_creation"),diff --git a/src/public/app/widgets/note_detail.js b/src/public/app/widgets/note_detail.jsindex 11cc6f71d1..7c1e4f1d98 100644--- a/src/public/app/widgets/note_detail.js+++ b/src/public/app/widgets/note_detail.js@@ -261,7 +261,7 @@ export default class NoteDetailWidget extends NoteContextAwareWidget {const { ipcRenderer } = utils.dynamicRequire("electron");ipcRenderer.send("export-as-pdf", {title: this.note.title,- pageSize: this.note.getAttributeValue("label", "pageSize") ?? "Letter",+ pageSize: this.note.getAttributeValue("label", "printPageSize") ?? "Letter",landscape: this.note.hasAttribute("label", "printLandscape")});}diff --git a/src/public/translations/en/translation.json b/src/public/translations/en/translation.jsonindex e29c258f09..958df556bc 100644--- a/src/public/translations/en/translation.json+++ b/src/public/translations/en/translation.json@@ -438,7 +438,9 @@"share_favicon": "Favicon note to be set in the shared page. Typically you want to set it to share root and make it inheritable. Favicon note must be in the shared sub-tree as well. Consider using 'share_hidden_from_tree'.","is_owned_by_note": "is owned by note","other_notes_with_name": "Other notes with {{attributeType}} name \"{{attributeName}}\"",- "and_more": "... and {{count}} more."+ "and_more": "... and {{count}} more.",+ "print_landscape": "When exporting to PDF, changes the orientation of the page to landscape instead of portrait.",+ "print_page_size": "When exporting to PDF, changes the size of the page. Supported values: <code>A0</code>, <code>A1</code>, <code>A2</code>, <code>A3</code>, <code>A4</code>, <code>A5</code>, <code>A6</code>, <code>Legal</code>, <code>Letter</code>, <code>Tabloid</code>, <code>Ledger</code>."},"attribute_editor": {"help_text_body1": "To add label, just type e.g. <code>#rock</code> or if you want to add also value then e.g. <code>#year = 2020</code>",diff --git a/src/services/builtin_attributes.ts b/src/services/builtin_attributes.tsindex 30c0b6ce5a..1caaecd632 100644--- a/src/services/builtin_attributes.ts+++ b/src/services/builtin_attributes.ts@@ -72,6 +72,9 @@ export default [{ type: "label", name: "webViewSrc", isDangerous: true },{ type: "label", name: "hideHighlightWidget" },+ { type: "label", name: "printLandscape" },+ { type: "label", name: "printPageSize" },+// relation names{ type: "relation", name: "internalLink" },{ type: "relation", name: "imageLink" },