You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2026-01-08 00:14:28 +02:00
Compare commits
16 Commits
plugin_con
...
command_en
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f3b708ff64 | ||
|
|
fea85b39a0 | ||
|
|
a53955a03d | ||
|
|
8d61514f64 | ||
|
|
c8f496b733 | ||
|
|
c4414e3bee | ||
|
|
89e7a3a65e | ||
|
|
b3bce34e9a | ||
|
|
d059aeebab | ||
|
|
910a5ad09d | ||
|
|
259dadb650 | ||
|
|
4ce2bf492b | ||
|
|
e635ee967a | ||
|
|
6a43f3be66 | ||
|
|
a4562a0a75 | ||
|
|
410a0f5d14 |
@@ -64,13 +64,10 @@ CliClient/build/
|
||||
# AUTO-GENERATED - EXCLUDED TYPESCRIPT BUILD
|
||||
CliClient/app/LinkSelector.js
|
||||
CliClient/app/services/plugins/PluginRunner.js
|
||||
CliClient/tests/fsDriver.js
|
||||
CliClient/tests/InMemoryCache.js
|
||||
CliClient/tests/MdToHtml.js
|
||||
CliClient/tests/models_Setting.js
|
||||
CliClient/tests/services_CommandService.js
|
||||
CliClient/tests/services_InteropService.js
|
||||
CliClient/tests/services_keychainService.js
|
||||
CliClient/tests/services_PluginService.js
|
||||
CliClient/tests/services_rest_Api.js
|
||||
CliClient/tests/services/plugins/api/JoplinSetting.js
|
||||
@@ -183,7 +180,6 @@ ElectronClient/gui/SideBar/styles/index.js
|
||||
ElectronClient/gui/StatusScreen/StatusScreen.js
|
||||
ElectronClient/gui/style/StyledInput.js
|
||||
ElectronClient/gui/style/StyledTextInput.js
|
||||
ElectronClient/gui/TagList.js
|
||||
ElectronClient/gui/ToggleEditorsButton/styles/index.js
|
||||
ElectronClient/gui/ToggleEditorsButton/ToggleEditorsButton.js
|
||||
ElectronClient/gui/ToolbarBase.js
|
||||
@@ -218,36 +214,22 @@ ReactNativeClient/lib/components/screens/UpgradeSyncTargetScreen.js
|
||||
ReactNativeClient/lib/components/SelectDateTimeDialog.js
|
||||
ReactNativeClient/lib/errorUtils.js
|
||||
ReactNativeClient/lib/eventManager.js
|
||||
ReactNativeClient/lib/fs-driver-node.js
|
||||
ReactNativeClient/lib/hooks/useEffectDebugger.js
|
||||
ReactNativeClient/lib/hooks/useImperativeHandlerDebugger.js
|
||||
ReactNativeClient/lib/hooks/usePrevious.js
|
||||
ReactNativeClient/lib/hooks/usePropsDebugger.js
|
||||
ReactNativeClient/lib/InMemoryCache.js
|
||||
ReactNativeClient/lib/joplin-renderer/MarkupToHtml.js
|
||||
ReactNativeClient/lib/joplin-renderer/MdToHtml.js
|
||||
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/checkbox.js
|
||||
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/code_inline.js
|
||||
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/fence.js
|
||||
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/fountain.js
|
||||
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/highlight_keywords.js
|
||||
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/html_image.js
|
||||
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/image.js
|
||||
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/katex.js
|
||||
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/link_open.js
|
||||
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/mermaid.js
|
||||
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/sanitize_html.js
|
||||
ReactNativeClient/lib/joplin-renderer/noteStyle.js
|
||||
ReactNativeClient/lib/joplin-renderer/pathUtils.js
|
||||
ReactNativeClient/lib/JoplinServerApi.js
|
||||
ReactNativeClient/lib/locale.js
|
||||
ReactNativeClient/lib/Logger.js
|
||||
ReactNativeClient/lib/markdownUtils.js
|
||||
ReactNativeClient/lib/markupLanguageUtils.js
|
||||
ReactNativeClient/lib/models/Alarm.js
|
||||
ReactNativeClient/lib/models/Setting.js
|
||||
ReactNativeClient/lib/ntpDate.js
|
||||
ReactNativeClient/lib/path-utils.js
|
||||
ReactNativeClient/lib/PoorManIntervals.js
|
||||
ReactNativeClient/lib/reducer.js
|
||||
ReactNativeClient/lib/services/AlarmService.js
|
||||
@@ -308,7 +290,6 @@ ReactNativeClient/lib/services/plugins/PluginService.js
|
||||
ReactNativeClient/lib/services/plugins/reducer.js
|
||||
ReactNativeClient/lib/services/plugins/sandboxProxy.js
|
||||
ReactNativeClient/lib/services/plugins/ToolbarButtonController.js
|
||||
ReactNativeClient/lib/services/plugins/utils/contentScriptsToRendererRules.js
|
||||
ReactNativeClient/lib/services/plugins/utils/createViewHandle.js
|
||||
ReactNativeClient/lib/services/plugins/utils/executeSandboxCall.js
|
||||
ReactNativeClient/lib/services/plugins/utils/manifestFromObject.js
|
||||
|
||||
19
.gitignore
vendored
19
.gitignore
vendored
@@ -58,13 +58,10 @@ plugin_types/
|
||||
# AUTO-GENERATED - EXCLUDED TYPESCRIPT BUILD
|
||||
CliClient/app/LinkSelector.js
|
||||
CliClient/app/services/plugins/PluginRunner.js
|
||||
CliClient/tests/fsDriver.js
|
||||
CliClient/tests/InMemoryCache.js
|
||||
CliClient/tests/MdToHtml.js
|
||||
CliClient/tests/models_Setting.js
|
||||
CliClient/tests/services_CommandService.js
|
||||
CliClient/tests/services_InteropService.js
|
||||
CliClient/tests/services_keychainService.js
|
||||
CliClient/tests/services_PluginService.js
|
||||
CliClient/tests/services_rest_Api.js
|
||||
CliClient/tests/services/plugins/api/JoplinSetting.js
|
||||
@@ -177,7 +174,6 @@ ElectronClient/gui/SideBar/styles/index.js
|
||||
ElectronClient/gui/StatusScreen/StatusScreen.js
|
||||
ElectronClient/gui/style/StyledInput.js
|
||||
ElectronClient/gui/style/StyledTextInput.js
|
||||
ElectronClient/gui/TagList.js
|
||||
ElectronClient/gui/ToggleEditorsButton/styles/index.js
|
||||
ElectronClient/gui/ToggleEditorsButton/ToggleEditorsButton.js
|
||||
ElectronClient/gui/ToolbarBase.js
|
||||
@@ -212,36 +208,22 @@ ReactNativeClient/lib/components/screens/UpgradeSyncTargetScreen.js
|
||||
ReactNativeClient/lib/components/SelectDateTimeDialog.js
|
||||
ReactNativeClient/lib/errorUtils.js
|
||||
ReactNativeClient/lib/eventManager.js
|
||||
ReactNativeClient/lib/fs-driver-node.js
|
||||
ReactNativeClient/lib/hooks/useEffectDebugger.js
|
||||
ReactNativeClient/lib/hooks/useImperativeHandlerDebugger.js
|
||||
ReactNativeClient/lib/hooks/usePrevious.js
|
||||
ReactNativeClient/lib/hooks/usePropsDebugger.js
|
||||
ReactNativeClient/lib/InMemoryCache.js
|
||||
ReactNativeClient/lib/joplin-renderer/MarkupToHtml.js
|
||||
ReactNativeClient/lib/joplin-renderer/MdToHtml.js
|
||||
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/checkbox.js
|
||||
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/code_inline.js
|
||||
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/fence.js
|
||||
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/fountain.js
|
||||
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/highlight_keywords.js
|
||||
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/html_image.js
|
||||
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/image.js
|
||||
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/katex.js
|
||||
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/link_open.js
|
||||
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/mermaid.js
|
||||
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/sanitize_html.js
|
||||
ReactNativeClient/lib/joplin-renderer/noteStyle.js
|
||||
ReactNativeClient/lib/joplin-renderer/pathUtils.js
|
||||
ReactNativeClient/lib/JoplinServerApi.js
|
||||
ReactNativeClient/lib/locale.js
|
||||
ReactNativeClient/lib/Logger.js
|
||||
ReactNativeClient/lib/markdownUtils.js
|
||||
ReactNativeClient/lib/markupLanguageUtils.js
|
||||
ReactNativeClient/lib/models/Alarm.js
|
||||
ReactNativeClient/lib/models/Setting.js
|
||||
ReactNativeClient/lib/ntpDate.js
|
||||
ReactNativeClient/lib/path-utils.js
|
||||
ReactNativeClient/lib/PoorManIntervals.js
|
||||
ReactNativeClient/lib/reducer.js
|
||||
ReactNativeClient/lib/services/AlarmService.js
|
||||
@@ -302,7 +284,6 @@ ReactNativeClient/lib/services/plugins/PluginService.js
|
||||
ReactNativeClient/lib/services/plugins/reducer.js
|
||||
ReactNativeClient/lib/services/plugins/sandboxProxy.js
|
||||
ReactNativeClient/lib/services/plugins/ToolbarButtonController.js
|
||||
ReactNativeClient/lib/services/plugins/utils/contentScriptsToRendererRules.js
|
||||
ReactNativeClient/lib/services/plugins/utils/createViewHandle.js
|
||||
ReactNativeClient/lib/services/plugins/utils/executeSandboxCall.js
|
||||
ReactNativeClient/lib/services/plugins/utils/manifestFromObject.js
|
||||
|
||||
19
.ignore
19
.ignore
@@ -7,13 +7,10 @@
|
||||
# AUTO-GENERATED - EXCLUDED TYPESCRIPT BUILD
|
||||
CliClient/app/LinkSelector.js
|
||||
CliClient/app/services/plugins/PluginRunner.js
|
||||
CliClient/tests/fsDriver.js
|
||||
CliClient/tests/InMemoryCache.js
|
||||
CliClient/tests/MdToHtml.js
|
||||
CliClient/tests/models_Setting.js
|
||||
CliClient/tests/services_CommandService.js
|
||||
CliClient/tests/services_InteropService.js
|
||||
CliClient/tests/services_keychainService.js
|
||||
CliClient/tests/services_PluginService.js
|
||||
CliClient/tests/services_rest_Api.js
|
||||
CliClient/tests/services/plugins/api/JoplinSetting.js
|
||||
@@ -126,7 +123,6 @@ ElectronClient/gui/SideBar/styles/index.js
|
||||
ElectronClient/gui/StatusScreen/StatusScreen.js
|
||||
ElectronClient/gui/style/StyledInput.js
|
||||
ElectronClient/gui/style/StyledTextInput.js
|
||||
ElectronClient/gui/TagList.js
|
||||
ElectronClient/gui/ToggleEditorsButton/styles/index.js
|
||||
ElectronClient/gui/ToggleEditorsButton/ToggleEditorsButton.js
|
||||
ElectronClient/gui/ToolbarBase.js
|
||||
@@ -161,36 +157,22 @@ ReactNativeClient/lib/components/screens/UpgradeSyncTargetScreen.js
|
||||
ReactNativeClient/lib/components/SelectDateTimeDialog.js
|
||||
ReactNativeClient/lib/errorUtils.js
|
||||
ReactNativeClient/lib/eventManager.js
|
||||
ReactNativeClient/lib/fs-driver-node.js
|
||||
ReactNativeClient/lib/hooks/useEffectDebugger.js
|
||||
ReactNativeClient/lib/hooks/useImperativeHandlerDebugger.js
|
||||
ReactNativeClient/lib/hooks/usePrevious.js
|
||||
ReactNativeClient/lib/hooks/usePropsDebugger.js
|
||||
ReactNativeClient/lib/InMemoryCache.js
|
||||
ReactNativeClient/lib/joplin-renderer/MarkupToHtml.js
|
||||
ReactNativeClient/lib/joplin-renderer/MdToHtml.js
|
||||
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/checkbox.js
|
||||
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/code_inline.js
|
||||
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/fence.js
|
||||
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/fountain.js
|
||||
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/highlight_keywords.js
|
||||
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/html_image.js
|
||||
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/image.js
|
||||
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/katex.js
|
||||
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/link_open.js
|
||||
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/mermaid.js
|
||||
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/sanitize_html.js
|
||||
ReactNativeClient/lib/joplin-renderer/noteStyle.js
|
||||
ReactNativeClient/lib/joplin-renderer/pathUtils.js
|
||||
ReactNativeClient/lib/JoplinServerApi.js
|
||||
ReactNativeClient/lib/locale.js
|
||||
ReactNativeClient/lib/Logger.js
|
||||
ReactNativeClient/lib/markdownUtils.js
|
||||
ReactNativeClient/lib/markupLanguageUtils.js
|
||||
ReactNativeClient/lib/models/Alarm.js
|
||||
ReactNativeClient/lib/models/Setting.js
|
||||
ReactNativeClient/lib/ntpDate.js
|
||||
ReactNativeClient/lib/path-utils.js
|
||||
ReactNativeClient/lib/PoorManIntervals.js
|
||||
ReactNativeClient/lib/reducer.js
|
||||
ReactNativeClient/lib/services/AlarmService.js
|
||||
@@ -251,7 +233,6 @@ ReactNativeClient/lib/services/plugins/PluginService.js
|
||||
ReactNativeClient/lib/services/plugins/reducer.js
|
||||
ReactNativeClient/lib/services/plugins/sandboxProxy.js
|
||||
ReactNativeClient/lib/services/plugins/ToolbarButtonController.js
|
||||
ReactNativeClient/lib/services/plugins/utils/contentScriptsToRendererRules.js
|
||||
ReactNativeClient/lib/services/plugins/utils/createViewHandle.js
|
||||
ReactNativeClient/lib/services/plugins/utils/executeSandboxCall.js
|
||||
ReactNativeClient/lib/services/plugins/utils/manifestFromObject.js
|
||||
|
||||
@@ -8,7 +8,7 @@ const Note = require('lib/models/Note.js');
|
||||
const Tag = require('lib/models/Tag.js');
|
||||
const Setting = require('lib/models/Setting').default;
|
||||
const { reg } = require('lib/registry.js');
|
||||
const { fileExtension } = require('lib/path-utils');
|
||||
const { fileExtension } = require('lib/path-utils.js');
|
||||
const { _ } = require('lib/locale');
|
||||
const fs = require('fs-extra');
|
||||
const { cliUtils } = require('./cli-utils.js');
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const fs = require('fs-extra');
|
||||
const { fileExtension, dirname } = require('lib/path-utils');
|
||||
const { fileExtension, dirname } = require('lib/path-utils.js');
|
||||
const wrap_ = require('word-wrap');
|
||||
const { languageCode } = require('lib/locale');
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
const fs = require('fs-extra');
|
||||
const Logger = require('lib/Logger').default;
|
||||
const { dirname } = require('lib/path-utils');
|
||||
const { dirname } = require('lib/path-utils.js');
|
||||
const { DatabaseDriverNode } = require('lib/database-driver-node.js');
|
||||
const { JoplinDatabase } = require('lib/joplin-database.js');
|
||||
const BaseModel = require('lib/BaseModel.js');
|
||||
|
||||
@@ -5,7 +5,7 @@ const DecryptionWorker = require('lib/services/DecryptionWorker');
|
||||
const BaseItem = require('lib/models/BaseItem');
|
||||
const Setting = require('lib/models/Setting').default;
|
||||
const shim = require('lib/shim').default;
|
||||
const pathUtils = require('lib/path-utils');
|
||||
const pathUtils = require('lib/path-utils.js');
|
||||
const imageType = require('image-type');
|
||||
const readChunk = require('read-chunk');
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
const { time } = require('lib/time-utils.js');
|
||||
const Logger = require('lib/Logger').default;
|
||||
const Resource = require('lib/models/Resource.js');
|
||||
const { dirname } = require('lib/path-utils');
|
||||
const FsDriverNode = require('lib/fs-driver-node').default;
|
||||
const { dirname } = require('lib/path-utils.js');
|
||||
const { FsDriverNode } = require('./fs-driver-node.js');
|
||||
const lodash = require('lodash');
|
||||
const exec = require('child_process').exec;
|
||||
const fs = require('fs-extra');
|
||||
|
||||
@@ -24,7 +24,7 @@ const MasterKey = require('lib/models/MasterKey');
|
||||
const Setting = require('lib/models/Setting').default;
|
||||
const Revision = require('lib/models/Revision.js');
|
||||
const Logger = require('lib/Logger').default;
|
||||
const FsDriverNode = require('lib/fs-driver-node').default;
|
||||
const { FsDriverNode } = require('lib/fs-driver-node.js');
|
||||
const { shimInit } = require('lib/shim-init-node.js');
|
||||
const { _ } = require('lib/locale');
|
||||
const { FileApiDriverLocal } = require('lib/file-api-driver-local.js');
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,29 +2,25 @@
|
||||
# Copyright (C) 2017 Lucas Vieites
|
||||
# Copyright (C) 2019 Andros Fenollosa
|
||||
# Copyright (C) 2019 Germán Martín
|
||||
# Copyright (C) 2020 Andros Fenollosa
|
||||
# This file is distributed under the same license as the Joplin-CLI package.
|
||||
# Lucas Vieites <lucas.vieites@gmail.com>, 2017.
|
||||
# Andros Fenollosa <andros@fenollosa.email>, 2019.
|
||||
# Germán Martín <gmag11@gmail.com>, 2019.
|
||||
# Fernando Pindado <fpindado@gmail.com>, 2020.
|
||||
# Andros Fenollosa <andros@fenollosa.email>, 2020.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Joplin-CLI 1.0.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"Last-Translator: Andros Fenollosa <andros@fenollosa.email>\n"
|
||||
"Last-Translator: Fernando Pindado <fpindado@gmail.com>\n"
|
||||
"Language-Team: Spanish <lucas.vieites@gmail.com>\n"
|
||||
"Language: es_ES\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Poedit 2.4.1\n"
|
||||
"X-Generator: Poedit 2.3\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Poedit-SourceCharset: UTF-8\n"
|
||||
"POT-Creation-Date: \n"
|
||||
"PO-Revision-Date: \n"
|
||||
|
||||
#: ElectronClient/services/plugins/UserWebviewDialogButtonBar.js:20
|
||||
#: ElectronClient/checkForUpdates.js:139
|
||||
@@ -532,14 +528,12 @@ msgstr "Creando nuevo %s..."
|
||||
#: ElectronClient/gui/NoteEditor/NoteEditor.js:373
|
||||
msgid "The following attachments are being watched for changes:"
|
||||
msgstr ""
|
||||
"Los siguientes adjuntos están siendo vigilados para ver si hay cambios:"
|
||||
|
||||
#: ElectronClient/gui/NoteEditor/NoteEditor.js:376
|
||||
msgid ""
|
||||
"The attachments will no longer be watched when you switch to a different "
|
||||
"note."
|
||||
msgstr ""
|
||||
"Los archivos adjuntos ya no se verán cuándo cambies a una nota diferente."
|
||||
|
||||
#: ElectronClient/gui/NoteEditor/NoteEditor.js:381
|
||||
#, javascript-format
|
||||
@@ -655,15 +649,12 @@ msgid ""
|
||||
"may take a few minutes to complete and the app needs to be restarted. To "
|
||||
"proceed please click on the link."
|
||||
msgstr ""
|
||||
"El objetivo de sincronización necesita ser actualizado antes de que Joplin "
|
||||
"pueda sincronizarse. La operación puede tardar unos minutos en completarse y "
|
||||
"la aplicación necesita ser reiniciada. Para proceder, por favor, haz clic en "
|
||||
"el enlace."
|
||||
|
||||
#: ElectronClient/gui/MainScreen/MainScreen.js:416
|
||||
#: ElectronClient/gui/MainScreen/MainScreen.min.js:306
|
||||
#, fuzzy
|
||||
msgid "Restart and upgrade"
|
||||
msgstr "Reiniciar y actualizar"
|
||||
msgstr "Claves maestras que necesitan actualización"
|
||||
|
||||
#: ElectronClient/gui/MainScreen/MainScreen.js:420
|
||||
#: ElectronClient/gui/MainScreen/MainScreen.min.js:313
|
||||
@@ -823,8 +814,9 @@ msgid "Toggle sidebar"
|
||||
msgstr "Cambia la barra lateral"
|
||||
|
||||
#: ElectronClient/gui/MainScreen/commands/toggleEditors.js:17
|
||||
#, fuzzy
|
||||
msgid "Toggle editors"
|
||||
msgstr "Intercambiar editores"
|
||||
msgstr "Cambia el diseño del editor"
|
||||
|
||||
#: ElectronClient/gui/MainScreen/commands/selectTemplate.js:23
|
||||
msgid "Template file:"
|
||||
@@ -1329,8 +1321,9 @@ msgid "Import"
|
||||
msgstr "Importar"
|
||||
|
||||
#: ElectronClient/gui/MenuBar.js:343
|
||||
#, fuzzy
|
||||
msgid "Export all"
|
||||
msgstr "Exportar todo"
|
||||
msgstr "Exportar"
|
||||
|
||||
#: ElectronClient/gui/MenuBar.js:356
|
||||
#, javascript-format
|
||||
@@ -1411,36 +1404,38 @@ msgstr "Adjuntos"
|
||||
|
||||
#: ElectronClient/gui/KeymapConfig/ShortcutRecorder.js:48
|
||||
msgid "Press the shortcut"
|
||||
msgstr "Presiona el atajo"
|
||||
msgstr ""
|
||||
|
||||
#: ElectronClient/gui/KeymapConfig/ShortcutRecorder.js:48
|
||||
msgid ""
|
||||
"Press the shortcut and then press ENTER. Or, press BACKSPACE to clear the "
|
||||
"shortcut."
|
||||
msgstr ""
|
||||
"Pulse el atajo y luego ENTER. O bien, pulse RETROCESO para borrar el atajo."
|
||||
|
||||
#: ElectronClient/gui/KeymapConfig/KeymapConfigScreen.js:62
|
||||
#: ReactNativeClient/lib/services/KeymapService.js:142
|
||||
#, javascript-format
|
||||
#, fuzzy, javascript-format
|
||||
msgid "Error: %s"
|
||||
msgstr "Error: %s"
|
||||
msgstr "Error"
|
||||
|
||||
#: ElectronClient/gui/KeymapConfig/KeymapConfigScreen.js:125
|
||||
msgid "Command"
|
||||
msgstr "Comando"
|
||||
msgstr ""
|
||||
|
||||
#: ElectronClient/gui/KeymapConfig/KeymapConfigScreen.js:126
|
||||
#, fuzzy
|
||||
msgid "Keyboard Shortcut"
|
||||
msgstr "Atajo de teclado"
|
||||
msgstr "Modo de teclado"
|
||||
|
||||
#: ElectronClient/gui/KeymapConfig/utils/getLabel.js:24
|
||||
#, fuzzy
|
||||
msgid "Hide Joplin"
|
||||
msgstr "Ocultar Joplin"
|
||||
msgstr "Acerca de Joplin"
|
||||
|
||||
#: ElectronClient/gui/KeymapConfig/utils/getLabel.js:28
|
||||
#, fuzzy
|
||||
msgid "Preferences"
|
||||
msgstr "Preferencias"
|
||||
msgstr "Preferencias..."
|
||||
|
||||
#: ElectronClient/gui/NoteContentPropertiesDialog.js:77
|
||||
msgid "Words"
|
||||
@@ -1485,8 +1480,6 @@ msgstr "Estadísticas"
|
||||
msgid ""
|
||||
"The app is now going to close. Please relaunch it to complete the process."
|
||||
msgstr ""
|
||||
"La aplicación se va a cerrar. Por favor, vuelva a iniciarla para completar "
|
||||
"el proceso."
|
||||
|
||||
#: ElectronClient/app.js:340
|
||||
#, javascript-format
|
||||
@@ -1498,8 +1491,9 @@ msgid "Exit"
|
||||
msgstr "Salir"
|
||||
|
||||
#: ElectronClient/commands/copyDevCommand.js:17
|
||||
#, fuzzy
|
||||
msgid "Copy dev mode command to clipboard"
|
||||
msgstr "Copiar el comando del modo de desarrollo al portapapeles"
|
||||
msgstr "Copiar la ruta en el portapapeles"
|
||||
|
||||
#: ElectronClient/commands/startExternalEditing.js:18
|
||||
msgid "Edit in external editor"
|
||||
@@ -1511,12 +1505,13 @@ msgid "Error opening note in editor: %s"
|
||||
msgstr "Error abriendo la nota en el editor: %s"
|
||||
|
||||
#: ElectronClient/commands/toggleExternalEditing.js:16
|
||||
#, fuzzy
|
||||
msgid "Toggle external editing"
|
||||
msgstr "Intercambiar la edición externa"
|
||||
msgstr "Detener la edición externa"
|
||||
|
||||
#: ElectronClient/commands/toggleExternalEditing.js:42
|
||||
msgid "Stop"
|
||||
msgstr "Parar"
|
||||
msgstr ""
|
||||
|
||||
#: ElectronClient/commands/stopExternalEditing.js:16
|
||||
msgid "Stop external editing"
|
||||
@@ -1745,7 +1740,7 @@ msgstr ""
|
||||
|
||||
#: CliClient/app/command-sync.js:35
|
||||
msgid "Upgrade the sync target to the latest version."
|
||||
msgstr "Actualiza el objetivo de sincronización a la última versión."
|
||||
msgstr ""
|
||||
|
||||
#: CliClient/app/command-sync.js:105
|
||||
#, javascript-format
|
||||
@@ -2252,10 +2247,10 @@ msgstr ""
|
||||
"No se puede cargar el módulo «%s» para el formato «%s» y destino \"%s\""
|
||||
|
||||
#: ReactNativeClient/lib/services/interop/InteropService.js:152
|
||||
#, javascript-format
|
||||
#, fuzzy, javascript-format
|
||||
msgid "Cannot load \"%s\" module for format \"%s\" and target \"%s\""
|
||||
msgstr ""
|
||||
"No se puede cargar el módulo “%s” para el formato “%s” y el objetivo “%s”"
|
||||
"No se puede cargar el módulo «%s» para el formato «%s» y destino \"%s\""
|
||||
|
||||
#: ReactNativeClient/lib/services/interop/InteropService.js:187
|
||||
#, javascript-format
|
||||
@@ -2272,23 +2267,23 @@ msgstr "Notas restauradas"
|
||||
|
||||
#: ReactNativeClient/lib/services/KeymapService.js:236
|
||||
msgid "command"
|
||||
msgstr "comando"
|
||||
msgstr ""
|
||||
|
||||
#: ReactNativeClient/lib/services/KeymapService.js:236
|
||||
#: ReactNativeClient/lib/services/KeymapService.js:241
|
||||
#, javascript-format
|
||||
msgid "\"%s\" is missing the required \"%s\" property."
|
||||
msgstr "A “%s” le falta la propiedad requerida de “%s”."
|
||||
msgstr ""
|
||||
|
||||
#: ReactNativeClient/lib/services/KeymapService.js:241
|
||||
#: ReactNativeClient/lib/services/KeymapService.js:248
|
||||
msgid "accelerator"
|
||||
msgstr "acelerador"
|
||||
msgstr ""
|
||||
|
||||
#: ReactNativeClient/lib/services/KeymapService.js:248
|
||||
#, javascript-format
|
||||
#, fuzzy, javascript-format
|
||||
msgid "Invalid %s: %s."
|
||||
msgstr "Inválido %s: %s."
|
||||
msgstr "Respuesta inválida: %s"
|
||||
|
||||
#: ReactNativeClient/lib/services/KeymapService.js:266
|
||||
#, javascript-format
|
||||
@@ -2296,13 +2291,11 @@ msgid ""
|
||||
"Accelerator \"%s\" is used for \"%s\" and \"%s\" commands. This may lead to "
|
||||
"unexpected behaviour."
|
||||
msgstr ""
|
||||
"El acelerador “%s” se usa para los comandos “%s” y “%s”. Esto puede llevar a "
|
||||
"un comportamiento inesperado."
|
||||
|
||||
#: ReactNativeClient/lib/services/KeymapService.js:291
|
||||
#, javascript-format
|
||||
msgid "Accelerator \"%s\" is not valid."
|
||||
msgstr "El acelerador “%s” no es válido."
|
||||
msgstr ""
|
||||
|
||||
#: ReactNativeClient/lib/services/report.js:121
|
||||
msgid "Items that cannot be synchronised"
|
||||
@@ -2452,7 +2445,7 @@ msgstr "Versión del perfil: %s"
|
||||
#: ReactNativeClient/lib/versionInfo.js:23
|
||||
#, javascript-format
|
||||
msgid "Keychain Supported: %s"
|
||||
msgstr "Llavero soportado: %s"
|
||||
msgstr ""
|
||||
|
||||
#: ReactNativeClient/lib/JoplinServerApi.js:71
|
||||
#, javascript-format
|
||||
@@ -2856,7 +2849,7 @@ msgstr "Añadir título"
|
||||
|
||||
#: ReactNativeClient/lib/components/screens/UpgradeSyncTargetScreen.js:42
|
||||
msgid "Sync Target Upgrade"
|
||||
msgstr "Actualización del objetivo de sincronización"
|
||||
msgstr ""
|
||||
|
||||
#: ReactNativeClient/lib/components/screens/encryption-config.js:119
|
||||
#, javascript-format
|
||||
@@ -2948,8 +2941,6 @@ msgstr ""
|
||||
#: ReactNativeClient/lib/components/screen-header.js:453
|
||||
msgid "The sync target needs to be upgraded. Press this banner to proceed."
|
||||
msgstr ""
|
||||
"El objetivo de sincronización necesita ser mejorado. Presiona este banner "
|
||||
"para proceder."
|
||||
|
||||
#: ReactNativeClient/lib/components/side-menu-content.js:126
|
||||
#, javascript-format
|
||||
@@ -3146,7 +3137,7 @@ msgstr "sí"
|
||||
#: ReactNativeClient/lib/models/Setting.js:66
|
||||
#, javascript-format
|
||||
msgid "(wysiwyg: %s)"
|
||||
msgstr "(wysiwyg: %s)"
|
||||
msgstr ""
|
||||
|
||||
#: ReactNativeClient/lib/models/Setting.js:66
|
||||
msgid "no"
|
||||
@@ -3189,7 +3180,7 @@ msgstr "Nord"
|
||||
|
||||
#: ReactNativeClient/lib/models/Setting.js:80
|
||||
msgid "Aritim Dark"
|
||||
msgstr "Aritim Oscuro"
|
||||
msgstr ""
|
||||
|
||||
#: ReactNativeClient/lib/models/Setting.js:81
|
||||
msgid "OLED Dark"
|
||||
@@ -3238,15 +3229,15 @@ msgstr "Contraseña de WebDAV"
|
||||
|
||||
#: ReactNativeClient/lib/models/Setting.js:214
|
||||
msgid "AWS S3 bucket"
|
||||
msgstr "AWS S3 bucket"
|
||||
msgstr ""
|
||||
|
||||
#: ReactNativeClient/lib/models/Setting.js:225
|
||||
msgid "AWS key"
|
||||
msgstr "AWS key"
|
||||
msgstr ""
|
||||
|
||||
#: ReactNativeClient/lib/models/Setting.js:235
|
||||
msgid "AWS secret"
|
||||
msgstr "AWS secret"
|
||||
msgstr ""
|
||||
|
||||
#: ReactNativeClient/lib/models/Setting.js:247
|
||||
msgid "Attachment download behaviour"
|
||||
@@ -3704,8 +3695,9 @@ msgid "Web Clipper"
|
||||
msgstr "Web Clipper"
|
||||
|
||||
#: ReactNativeClient/lib/models/Setting.js:1292
|
||||
#, fuzzy
|
||||
msgid "Keyboard Shortcuts"
|
||||
msgstr "Atajos de teclado"
|
||||
msgstr "Modo de teclado"
|
||||
|
||||
#: ReactNativeClient/lib/models/Setting.js:1299
|
||||
msgid ""
|
||||
@@ -3752,7 +3744,7 @@ msgstr "OneDrive"
|
||||
|
||||
#: ReactNativeClient/lib/SyncTargetAmazonS3.js:28
|
||||
msgid "AWS S3"
|
||||
msgstr "AWS S3"
|
||||
msgstr ""
|
||||
|
||||
#: ReactNativeClient/lib/commands/historyForward.js:16
|
||||
msgid "Forward"
|
||||
|
||||
@@ -7,16 +7,14 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Joplin-CLI 1.0.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"Last-Translator: João Duarte <jduar@protonmail.com>\n"
|
||||
"Last-Translator: Diogo Caveiro \n"
|
||||
"Language-Team: \n"
|
||||
"Language: pt_PT\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Generator: Poedit 2.4.1\n"
|
||||
"POT-Creation-Date: \n"
|
||||
"PO-Revision-Date: \n"
|
||||
"X-Generator: Poedit 2.2.4\n"
|
||||
|
||||
#: ElectronClient/services/plugins/UserWebviewDialogButtonBar.js:20
|
||||
#: ElectronClient/checkForUpdates.js:139
|
||||
@@ -114,28 +112,29 @@ msgid "Full Release Notes"
|
||||
msgstr "Notas de Lançamento Completas"
|
||||
|
||||
#: ElectronClient/InteropServiceHelper.js:153
|
||||
#, javascript-format
|
||||
#, fuzzy, javascript-format
|
||||
msgid "Exporting to \"%s\" as \"%s\" format. Please wait..."
|
||||
msgstr "A exportar para \"%s\" com o formato \"%s\". Por favor, aguarde..."
|
||||
msgstr "A importar de \"%s\" com o formato \"%s\". Por favor, aguarde..."
|
||||
|
||||
#: ElectronClient/InteropServiceHelper.js:170
|
||||
#, javascript-format
|
||||
#, fuzzy, javascript-format
|
||||
msgid "Could not export notes: %s"
|
||||
msgstr "Não foi possível exportar as notas: %s"
|
||||
msgstr "Não foi possível atualizar a chave mestra: %s"
|
||||
|
||||
#: ElectronClient/plugins/GotoAnything.min.js:459
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
"Type a note title or part of its content to jump to it. Or type # followed "
|
||||
"by a tag name, or @ followed by a notebook name."
|
||||
msgstr ""
|
||||
"Escreva um título de uma nota ou parte do seu conteúdo para saltar para o "
|
||||
"mesmo. Ou digite # seguido de um nome de etiqueta, ou @ seguido de um nome "
|
||||
"de um caderno."
|
||||
"Digite um título de nota para avançar para o mesmo. Ou digite # seguido do "
|
||||
"título de uma etiqueta, ou @ seguido do nome de um bloco de notas, ou / "
|
||||
"seguido do conteúdo da nota."
|
||||
|
||||
#: ElectronClient/plugins/GotoAnything.min.js:499
|
||||
#: ElectronClient/gui/KeymapConfig/utils/getLabel.js:20
|
||||
msgid "Goto Anything..."
|
||||
msgstr "Saltar para..."
|
||||
msgstr "Ir até qualquer coisa..."
|
||||
|
||||
#: ElectronClient/gui/NoteListControls/commands/focusSearch.js:15
|
||||
msgid "Search in all the notes"
|
||||
@@ -179,9 +178,9 @@ msgid "Delete"
|
||||
msgstr "Eliminar"
|
||||
|
||||
#: ElectronClient/gui/ResourceScreen.js:94
|
||||
#, javascript-format
|
||||
#, fuzzy, javascript-format
|
||||
msgid "Delete attachment \"%s\"?"
|
||||
msgstr "Eliminar anexo \"%s\"?"
|
||||
msgstr "Eliminar nota \"%s\"?"
|
||||
|
||||
#: ElectronClient/gui/ResourceScreen.js:140
|
||||
msgid ""
|
||||
@@ -189,9 +188,6 @@ msgid ""
|
||||
"notes. Please be careful when deleting one of them as they cannot be "
|
||||
"restored afterwards."
|
||||
msgstr ""
|
||||
"Esta é uma ferramenta avançada para ver os anexos que estão ligados às suas "
|
||||
"notas. Por favor tenha cuidado ao apagar um deles já que não poderão ser "
|
||||
"repostos de seguida."
|
||||
|
||||
#: ElectronClient/gui/ResourceScreen.js:141
|
||||
msgid "Please wait..."
|
||||
@@ -199,13 +195,13 @@ msgstr "Por favor, aguarde..."
|
||||
|
||||
#: ElectronClient/gui/ResourceScreen.js:143
|
||||
msgid "No resources!"
|
||||
msgstr "Sem recursos!"
|
||||
msgstr "Sem fontes!"
|
||||
|
||||
#: ElectronClient/gui/ResourceScreen.js:145
|
||||
#, javascript-format
|
||||
msgid "Warning: not all resources shown for performance reasons (limit: %s)."
|
||||
msgstr ""
|
||||
"Aviso: nem todos os recursos apresentadas por razões de desempenho (limite: "
|
||||
"Aviso: nem todas as fontes apresentadas por razões de desempenho (limite: "
|
||||
"%s)."
|
||||
|
||||
#: ElectronClient/gui/PromptDialog.min.js:249
|
||||
@@ -431,11 +427,11 @@ msgstr "Anexar ficheiro"
|
||||
|
||||
#: ElectronClient/gui/NoteEditor/NoteBody/TinyMCE/TinyMCE.js:584
|
||||
msgid "Code Block"
|
||||
msgstr "Bloco de Código"
|
||||
msgstr ""
|
||||
|
||||
#: ElectronClient/gui/NoteEditor/NoteBody/TinyMCE/TinyMCE.js:593
|
||||
msgid "Inline Code"
|
||||
msgstr "Código em Linha"
|
||||
msgstr ""
|
||||
|
||||
#: ElectronClient/gui/NoteEditor/NoteBody/TinyMCE/TinyMCE.js:608
|
||||
#: ElectronClient/gui/NoteEditor/commands/editorCommandDeclarations.js:83
|
||||
@@ -444,12 +440,13 @@ msgstr "Inserir Data e Hora"
|
||||
|
||||
#: ElectronClient/gui/NoteEditor/NoteBody/TinyMCE/TinyMCE.js:1030
|
||||
msgid "Drop notes or files here"
|
||||
msgstr "Insira notas ou ficheiros aqui"
|
||||
msgstr ""
|
||||
|
||||
#: ElectronClient/gui/NoteEditor/NoteBody/TinyMCE/TinyMCE.js:1030
|
||||
#: ElectronClient/gui/MainScreen/MainScreen.min.js:419
|
||||
#, fuzzy
|
||||
msgid "Code View"
|
||||
msgstr "Vista de Código"
|
||||
msgstr "Código"
|
||||
|
||||
#: ElectronClient/gui/NoteEditor/NoteBody/TinyMCE/TinyMCE.js:1030
|
||||
#, javascript-format
|
||||
@@ -457,18 +454,18 @@ msgid ""
|
||||
"Please wait for all attachments to be downloaded and decrypted. You may also "
|
||||
"switch to %s to edit the note."
|
||||
msgstr ""
|
||||
"Por favor espere que todos os anexados sejam transferidos e desencriptados. "
|
||||
"Também pode mudar para %s para editar a nota."
|
||||
|
||||
#: ElectronClient/gui/NoteEditor/NoteBody/TinyMCE/plugins/lists.js:2151
|
||||
#, fuzzy
|
||||
msgid "Checkbox list"
|
||||
msgstr "Lista de caixas de seleção"
|
||||
msgstr "Campo de seleção"
|
||||
|
||||
#: ElectronClient/gui/NoteEditor/NoteBody/CodeMirror/CodeMirror.js:165
|
||||
msgid "strong text"
|
||||
msgstr "texto destacado"
|
||||
|
||||
#: ElectronClient/gui/NoteEditor/NoteBody/CodeMirror/CodeMirror.js:166
|
||||
#, fuzzy
|
||||
msgid "emphasised text"
|
||||
msgstr "texto realçado"
|
||||
|
||||
@@ -529,14 +526,13 @@ msgstr "A criar novo/a %s..."
|
||||
|
||||
#: ElectronClient/gui/NoteEditor/NoteEditor.js:373
|
||||
msgid "The following attachments are being watched for changes:"
|
||||
msgstr "Os anexos seguintes estão a ser monitorizados quanto a alterações:"
|
||||
msgstr ""
|
||||
|
||||
#: ElectronClient/gui/NoteEditor/NoteEditor.js:376
|
||||
msgid ""
|
||||
"The attachments will no longer be watched when you switch to a different "
|
||||
"note."
|
||||
msgstr ""
|
||||
"Os anexos deixarão de ser monitorizados quando mudar para uma nota diferente."
|
||||
|
||||
#: ElectronClient/gui/NoteEditor/NoteEditor.js:381
|
||||
#, javascript-format
|
||||
@@ -553,7 +549,7 @@ msgstr "Guardar como..."
|
||||
|
||||
#: ElectronClient/gui/NoteEditor/utils/contextMenu.js:65
|
||||
msgid "Reveal file in folder"
|
||||
msgstr "Revelar arquivo na pasta"
|
||||
msgstr ""
|
||||
|
||||
#: ElectronClient/gui/NoteEditor/utils/contextMenu.js:73
|
||||
msgid "Copy path to clipboard"
|
||||
@@ -653,15 +649,12 @@ msgid ""
|
||||
"may take a few minutes to complete and the app needs to be restarted. To "
|
||||
"proceed please click on the link."
|
||||
msgstr ""
|
||||
"O alvo de sincronização deve ser atualizado antes que o Joplin possa "
|
||||
"sincronizar. A operação pode demorar alguns minutos a ser completa e a "
|
||||
"aplicação precisará de ser reiniciada. Para proceder, por favor clique na "
|
||||
"ligação."
|
||||
|
||||
#: ElectronClient/gui/MainScreen/MainScreen.js:416
|
||||
#: ElectronClient/gui/MainScreen/MainScreen.min.js:306
|
||||
#, fuzzy
|
||||
msgid "Restart and upgrade"
|
||||
msgstr "Reiniciar e atualizar"
|
||||
msgstr "Chaves mestras que necessitam de atualização"
|
||||
|
||||
#: ElectronClient/gui/MainScreen/MainScreen.js:420
|
||||
#: ElectronClient/gui/MainScreen/MainScreen.min.js:313
|
||||
@@ -719,11 +712,11 @@ msgstr "Procurar..."
|
||||
|
||||
#: ElectronClient/gui/MainScreen/commands/moveToFolder.js:17
|
||||
msgid "Move to notebook"
|
||||
msgstr "Mudar para o caderno"
|
||||
msgstr "Mudar para o bloco de notas"
|
||||
|
||||
#: ElectronClient/gui/MainScreen/commands/moveToFolder.js:36
|
||||
msgid "Move to notebook:"
|
||||
msgstr "Mudar para o caderno:"
|
||||
msgstr "Mudar para o bloco de notas:"
|
||||
|
||||
#: ElectronClient/gui/MainScreen/commands/setTags.js:16
|
||||
#: ElectronClient/gui/SideBar/SideBar.js:426
|
||||
@@ -821,8 +814,9 @@ msgid "Toggle sidebar"
|
||||
msgstr "Alternar a barra lateral"
|
||||
|
||||
#: ElectronClient/gui/MainScreen/commands/toggleEditors.js:17
|
||||
#, fuzzy
|
||||
msgid "Toggle editors"
|
||||
msgstr "Alternar editores"
|
||||
msgstr "Alternar a estrutura do editor"
|
||||
|
||||
#: ElectronClient/gui/MainScreen/commands/selectTemplate.js:23
|
||||
msgid "Template file:"
|
||||
@@ -830,7 +824,7 @@ msgstr "Ficheiro do modelo:"
|
||||
|
||||
#: ElectronClient/gui/MainScreen/commands/showNoteContentProperties.js:16
|
||||
msgid "Statistics..."
|
||||
msgstr "Estatísticas..."
|
||||
msgstr ""
|
||||
|
||||
#: ElectronClient/gui/EncryptionConfigScreen.min.js:96
|
||||
#: ElectronClient/gui/KeymapConfig/ShortcutRecorder.js:49
|
||||
@@ -1154,12 +1148,13 @@ msgstr ""
|
||||
#: ElectronClient/gui/NoteList/NoteList.min.js:151
|
||||
#: ElectronClient/gui/NoteList/NoteList.js:160
|
||||
msgid "Custom order"
|
||||
msgstr "Ordem personalizada"
|
||||
msgstr ""
|
||||
|
||||
#: ElectronClient/gui/NoteList/NoteList.min.js:151
|
||||
#: ElectronClient/gui/NoteList/NoteList.js:160
|
||||
#, fuzzy
|
||||
msgid "View"
|
||||
msgstr "Ver"
|
||||
msgstr "&Ver"
|
||||
|
||||
#: ElectronClient/gui/NoteList/NoteList.min.js:151
|
||||
#: ElectronClient/gui/NoteList/NoteList.js:160
|
||||
@@ -1174,13 +1169,12 @@ msgid ""
|
||||
"To manually sort the notes, the sort order must be changed to \"%s\" in the "
|
||||
"menu \"%s\" > \"%s\""
|
||||
msgstr ""
|
||||
"Para ordenar as notas manualmente, a ordem deve ser alterada para \"%s\" no "
|
||||
"menu \"%s\" > \"%s\""
|
||||
|
||||
#: ElectronClient/gui/NoteList/NoteList.min.js:152
|
||||
#: ElectronClient/gui/NoteList/NoteList.js:161
|
||||
#, fuzzy
|
||||
msgid "Do it now"
|
||||
msgstr "Fazer agora"
|
||||
msgstr "Obter agora:"
|
||||
|
||||
#: ElectronClient/gui/NoteList/NoteList.min.js:423
|
||||
#: ElectronClient/gui/NoteList/NoteList.js:412
|
||||
@@ -1293,8 +1287,9 @@ msgid "Options"
|
||||
msgstr "Opções"
|
||||
|
||||
#: ElectronClient/gui/MenuBar.js:266
|
||||
#, fuzzy
|
||||
msgid "Note attachments..."
|
||||
msgstr "Anexos das notas..."
|
||||
msgstr "Anexos"
|
||||
|
||||
#: ElectronClient/gui/MenuBar.js:296 ElectronClient/gui/MenuBar.js:366
|
||||
#: ElectronClient/gui/MenuBar.js:659
|
||||
@@ -1325,8 +1320,9 @@ msgid "Import"
|
||||
msgstr "Importar"
|
||||
|
||||
#: ElectronClient/gui/MenuBar.js:343
|
||||
#, fuzzy
|
||||
msgid "Export all"
|
||||
msgstr "Exportar todos"
|
||||
msgstr "Exportar"
|
||||
|
||||
#: ElectronClient/gui/MenuBar.js:356
|
||||
#, javascript-format
|
||||
@@ -1364,8 +1360,9 @@ msgid "Zoom Out"
|
||||
msgstr "Reduzir"
|
||||
|
||||
#: ElectronClient/gui/MenuBar.js:516
|
||||
#, fuzzy
|
||||
msgid "&Note"
|
||||
msgstr "&Nota"
|
||||
msgstr "Nota"
|
||||
|
||||
#: ElectronClient/gui/MenuBar.js:525
|
||||
msgid "&Tools"
|
||||
@@ -1402,42 +1399,44 @@ msgid "Dropbox Login"
|
||||
msgstr "Acesso Dropbox"
|
||||
|
||||
#: ElectronClient/gui/Root.js:105 ElectronClient/gui/Root.min.js:105
|
||||
#, fuzzy
|
||||
msgid "Note attachments"
|
||||
msgstr "Anexos das notas"
|
||||
msgstr "Anexos"
|
||||
|
||||
#: ElectronClient/gui/KeymapConfig/ShortcutRecorder.js:48
|
||||
msgid "Press the shortcut"
|
||||
msgstr "Prima o atalho"
|
||||
msgstr ""
|
||||
|
||||
#: ElectronClient/gui/KeymapConfig/ShortcutRecorder.js:48
|
||||
msgid ""
|
||||
"Press the shortcut and then press ENTER. Or, press BACKSPACE to clear the "
|
||||
"shortcut."
|
||||
msgstr ""
|
||||
"Prima o atalho e de seguida prima ENTER. Ou então, prima BACKSPACE para "
|
||||
"apagar o atalho."
|
||||
|
||||
#: ElectronClient/gui/KeymapConfig/KeymapConfigScreen.js:62
|
||||
#: ReactNativeClient/lib/services/KeymapService.js:142
|
||||
#, javascript-format
|
||||
#, fuzzy, javascript-format
|
||||
msgid "Error: %s"
|
||||
msgstr "Erro: %s"
|
||||
msgstr "Erro"
|
||||
|
||||
#: ElectronClient/gui/KeymapConfig/KeymapConfigScreen.js:125
|
||||
msgid "Command"
|
||||
msgstr "Comando"
|
||||
msgstr ""
|
||||
|
||||
#: ElectronClient/gui/KeymapConfig/KeymapConfigScreen.js:126
|
||||
#, fuzzy
|
||||
msgid "Keyboard Shortcut"
|
||||
msgstr "Atalhos de Teclado"
|
||||
msgstr "Modo de Teclado"
|
||||
|
||||
#: ElectronClient/gui/KeymapConfig/utils/getLabel.js:24
|
||||
#, fuzzy
|
||||
msgid "Hide Joplin"
|
||||
msgstr "Esconder o Joplin"
|
||||
msgstr "Sobre o Joplin"
|
||||
|
||||
#: ElectronClient/gui/KeymapConfig/utils/getLabel.js:28
|
||||
#, fuzzy
|
||||
msgid "Preferences"
|
||||
msgstr "Preferências"
|
||||
msgstr "Preferências..."
|
||||
|
||||
#: ElectronClient/gui/NoteContentPropertiesDialog.js:77
|
||||
msgid "Words"
|
||||
@@ -1472,18 +1471,17 @@ msgstr "Visualizador"
|
||||
#: ElectronClient/gui/NoteContentPropertiesDialog.js:106
|
||||
#, javascript-format
|
||||
msgid "Read time: %s min"
|
||||
msgstr "Tempo de leitura: %s min"
|
||||
msgstr ""
|
||||
|
||||
#: ElectronClient/gui/NoteContentPropertiesDialog.js:109
|
||||
#, fuzzy
|
||||
msgid "Statistics"
|
||||
msgstr "Estatísticas"
|
||||
msgstr "Estado"
|
||||
|
||||
#: ElectronClient/bridge.js:177
|
||||
msgid ""
|
||||
"The app is now going to close. Please relaunch it to complete the process."
|
||||
msgstr ""
|
||||
"A aplicação vai fechar. Por favor volte a executá-la para completar o "
|
||||
"processo."
|
||||
|
||||
#: ElectronClient/app.js:340
|
||||
#, javascript-format
|
||||
@@ -1495,8 +1493,9 @@ msgid "Exit"
|
||||
msgstr "Sair"
|
||||
|
||||
#: ElectronClient/commands/copyDevCommand.js:17
|
||||
#, fuzzy
|
||||
msgid "Copy dev mode command to clipboard"
|
||||
msgstr "Copiar comando de modo dev para a área de transferências"
|
||||
msgstr "Copiar caminho para a área de transferência"
|
||||
|
||||
#: ElectronClient/commands/startExternalEditing.js:18
|
||||
msgid "Edit in external editor"
|
||||
@@ -1508,12 +1507,13 @@ msgid "Error opening note in editor: %s"
|
||||
msgstr "Erro a abrir a nota no editor: %s"
|
||||
|
||||
#: ElectronClient/commands/toggleExternalEditing.js:16
|
||||
#, fuzzy
|
||||
msgid "Toggle external editing"
|
||||
msgstr "Alternar edição externa"
|
||||
msgstr "Parar a edição externa"
|
||||
|
||||
#: ElectronClient/commands/toggleExternalEditing.js:42
|
||||
msgid "Stop"
|
||||
msgstr "Parar"
|
||||
msgstr ""
|
||||
|
||||
#: ElectronClient/commands/stopExternalEditing.js:16
|
||||
msgid "Stop external editing"
|
||||
@@ -1649,8 +1649,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Em qualquer comando, uma nota ou caderno pode ser indicada pelo título ou "
|
||||
"ID, ou através dos atalhos `$n` ou `$b` para, respetivamente, a nota ou "
|
||||
"caderno atualmente selecionado. O `$c` pode ser usado para indicar o item "
|
||||
"atualmente selecionado."
|
||||
"bloco de notas atualmente selecionado. O `$c` pode ser usado para indicar o "
|
||||
"item atualmente selecionado."
|
||||
|
||||
#: CliClient/app/command-help.js:79
|
||||
msgid "To move from one pane to another, press Tab or Shift+Tab."
|
||||
@@ -1743,7 +1743,7 @@ msgstr ""
|
||||
|
||||
#: CliClient/app/command-sync.js:35
|
||||
msgid "Upgrade the sync target to the latest version."
|
||||
msgstr "Atualize o alvo de sincronização para a última versão."
|
||||
msgstr ""
|
||||
|
||||
#: CliClient/app/command-sync.js:105
|
||||
#, javascript-format
|
||||
@@ -1771,8 +1771,9 @@ msgid "Synchronisation target: %s (%s)"
|
||||
msgstr "Destino de sincronização: %s (%s)"
|
||||
|
||||
#: CliClient/app/command-sync.js:177
|
||||
#, fuzzy
|
||||
msgid "Cannot initialise synchroniser."
|
||||
msgstr "Não é possível inicializar o sincronizador."
|
||||
msgstr "Não é possível alterar item encriptado."
|
||||
|
||||
#: CliClient/app/command-sync.js:207
|
||||
msgid "Starting synchronisation..."
|
||||
@@ -1915,8 +1916,9 @@ msgstr ""
|
||||
"desencriptados em segundo plano e estarão disponíveis brevemente."
|
||||
|
||||
#: CliClient/app/gui/NoteWidget.js:50
|
||||
#, fuzzy
|
||||
msgid "You may also type `status` for more information."
|
||||
msgstr "Pode também escrever `status` para mais informação."
|
||||
msgstr "Não peça confirmação."
|
||||
|
||||
#: CliClient/app/gui/FolderListWidget.js:31
|
||||
msgid "Search:"
|
||||
@@ -1960,16 +1962,14 @@ msgstr ""
|
||||
"vários minutos, dependendo de quanto há para desencriptar."
|
||||
|
||||
#: CliClient/app/command-e2ee.js:53
|
||||
#, javascript-format
|
||||
#, fuzzy, javascript-format
|
||||
msgid "Decrypted items: %d"
|
||||
msgstr "Itens desencriptados: %d"
|
||||
msgstr "Itens desencriptados: %s / %s"
|
||||
|
||||
#: CliClient/app/command-e2ee.js:54
|
||||
#, javascript-format
|
||||
msgid "Skipped items: %d (use --retry-failed-items to retry decrypting them)"
|
||||
msgstr ""
|
||||
"Itens ignorados: %d (use --retry-failed-items para tentar desencriptá-los "
|
||||
"novamente)"
|
||||
|
||||
#: CliClient/app/command-e2ee.js:68
|
||||
msgid "Completed decryption."
|
||||
@@ -2018,9 +2018,9 @@ msgid "Do not ask for confirmation."
|
||||
msgstr "Não peça confirmação."
|
||||
|
||||
#: CliClient/app/command-import.js:27
|
||||
#, javascript-format
|
||||
#, fuzzy, javascript-format
|
||||
msgid "Output format: %s"
|
||||
msgstr "Formato da saída: %s"
|
||||
msgstr "Formato da origem: %s"
|
||||
|
||||
#: CliClient/app/command-import.js:65
|
||||
msgid "Importing notes..."
|
||||
@@ -2051,8 +2051,6 @@ msgstr "Exibe um resumo sobre as notas e os cadernos."
|
||||
msgid ""
|
||||
"To retry decryption of these items. Run `e2ee decrypt --retry-failed-items`"
|
||||
msgstr ""
|
||||
"Para tentar desencriptar estes itens novamente. Execute `e2ee decrypt --"
|
||||
"retry-failed-items`"
|
||||
|
||||
#: CliClient/app/command-undone.js:12
|
||||
msgid "Marks a to-do as non-completed."
|
||||
@@ -2246,17 +2244,14 @@ msgid "HTML Directory"
|
||||
msgstr "Diretório HTML"
|
||||
|
||||
#: ReactNativeClient/lib/services/interop/InteropService.js:127
|
||||
#, javascript-format
|
||||
#, fuzzy, javascript-format
|
||||
msgid "Cannot load \"%s\" module for format \"%s\" and output \"%s\""
|
||||
msgstr ""
|
||||
"Não é possível carregar o módulo \"%s\" para o formato \"%s\" e saída \"%s\""
|
||||
msgstr "Não é possível carregar o módulo \"%s\" para o formato \"%s\"."
|
||||
|
||||
#: ReactNativeClient/lib/services/interop/InteropService.js:152
|
||||
#, javascript-format
|
||||
#, fuzzy, javascript-format
|
||||
msgid "Cannot load \"%s\" module for format \"%s\" and target \"%s\""
|
||||
msgstr ""
|
||||
"Não é possível carregar o módulo \"%s\" para o formato \"%s\" e o alvo \"%s"
|
||||
"\"."
|
||||
msgstr "Não é possível carregar o módulo \"%s\" para o formato \"%s\"."
|
||||
|
||||
#: ReactNativeClient/lib/services/interop/InteropService.js:187
|
||||
#, javascript-format
|
||||
@@ -2274,37 +2269,35 @@ msgstr "Notas Recuperadas"
|
||||
|
||||
#: ReactNativeClient/lib/services/KeymapService.js:236
|
||||
msgid "command"
|
||||
msgstr "comando"
|
||||
msgstr ""
|
||||
|
||||
#: ReactNativeClient/lib/services/KeymapService.js:236
|
||||
#: ReactNativeClient/lib/services/KeymapService.js:241
|
||||
#, javascript-format
|
||||
msgid "\"%s\" is missing the required \"%s\" property."
|
||||
msgstr "Está em falta a propriedade \"%s\" de \"%s\"."
|
||||
msgstr ""
|
||||
|
||||
#: ReactNativeClient/lib/services/KeymapService.js:241
|
||||
#: ReactNativeClient/lib/services/KeymapService.js:248
|
||||
msgid "accelerator"
|
||||
msgstr "acelerador"
|
||||
msgstr ""
|
||||
|
||||
#: ReactNativeClient/lib/services/KeymapService.js:248
|
||||
#, fuzzy, javascript-format
|
||||
msgid "Invalid %s: %s."
|
||||
msgstr "\"%s\" inválida: %s"
|
||||
msgstr "Resposta inválida: %s"
|
||||
|
||||
#: ReactNativeClient/lib/services/KeymapService.js:266
|
||||
#, fuzzy, javascript-format
|
||||
#, javascript-format
|
||||
msgid ""
|
||||
"Accelerator \"%s\" is used for \"%s\" and \"%s\" commands. This may lead to "
|
||||
"unexpected behaviour."
|
||||
msgstr ""
|
||||
"O acelerador \"%s\" é usado para comandos \"%s\" e \"%s\". Isto pode levar a "
|
||||
"comportamentos inesperados."
|
||||
|
||||
#: ReactNativeClient/lib/services/KeymapService.js:291
|
||||
#, fuzzy, javascript-format
|
||||
#, javascript-format
|
||||
msgid "Accelerator \"%s\" is not valid."
|
||||
msgstr "O acelerador \"%s\" não é válido."
|
||||
msgstr ""
|
||||
|
||||
#: ReactNativeClient/lib/services/report.js:121
|
||||
msgid "Items that cannot be synchronised"
|
||||
@@ -2316,9 +2309,9 @@ msgid ""
|
||||
"target. In order to find these items, either search for the title or the ID "
|
||||
"(which is displayed in brackets above)."
|
||||
msgstr ""
|
||||
"Esses itens permanecerão no dispositivo, mas não serão enviados para o alvo "
|
||||
"de sincronização. Para encontrar estes itens, procure o título ou o ID (que "
|
||||
"é apresentado entre parênteses acima)."
|
||||
"Esses itens permanecerão no dispositivo, mas não serão enviados para o "
|
||||
"destino de sincronização. Para encontrar estes itens, procure o título ou o "
|
||||
"ID (que é apresentado entre parênteses acima)."
|
||||
|
||||
#: ReactNativeClient/lib/services/report.js:130
|
||||
#, javascript-format
|
||||
@@ -2454,7 +2447,7 @@ msgstr "Versão do Perfil: %s"
|
||||
#: ReactNativeClient/lib/versionInfo.js:23
|
||||
#, javascript-format
|
||||
msgid "Keychain Supported: %s"
|
||||
msgstr "Porta-Chaves Suportado: %s"
|
||||
msgstr ""
|
||||
|
||||
#: ReactNativeClient/lib/JoplinServerApi.js:71
|
||||
#, javascript-format
|
||||
@@ -2856,7 +2849,7 @@ msgstr "Adicionar título"
|
||||
|
||||
#: ReactNativeClient/lib/components/screens/UpgradeSyncTargetScreen.js:42
|
||||
msgid "Sync Target Upgrade"
|
||||
msgstr "Atualização do Alvo de Sincronização"
|
||||
msgstr ""
|
||||
|
||||
#: ReactNativeClient/lib/components/screens/encryption-config.js:119
|
||||
#, javascript-format
|
||||
@@ -2884,7 +2877,7 @@ msgid ""
|
||||
"the data! To enable encryption, please enter your password below."
|
||||
msgstr ""
|
||||
"Ativar a encriptação significa que *todas* as suas notas e anexos serão "
|
||||
"ressincronizados e enviados encriptados para o alvo de sincronização. Não "
|
||||
"ressincronizados e enviados encriptados para o destino de sincronização. Não "
|
||||
"perca a palavra-passe pois, por razões de segurança, esta será a única forma "
|
||||
"de desencriptar os dados! Para ativar a encriptação, introduza a sua palavra-"
|
||||
"passe abaixo."
|
||||
@@ -2946,11 +2939,8 @@ msgstr ""
|
||||
"Alguns itens não puderam ser sincronizados. Prima para mais informações."
|
||||
|
||||
#: ReactNativeClient/lib/components/screen-header.js:453
|
||||
#, fuzzy
|
||||
msgid "The sync target needs to be upgraded. Press this banner to proceed."
|
||||
msgstr ""
|
||||
"O alvo de sincronização precisa de ser atualizado. Clique neste banner para "
|
||||
"proceder."
|
||||
|
||||
#: ReactNativeClient/lib/components/side-menu-content.js:126
|
||||
#, javascript-format
|
||||
@@ -3031,7 +3021,7 @@ msgid ""
|
||||
"the sync target is accessible. The reported error was:"
|
||||
msgstr ""
|
||||
"Erro. Por favor verifique se o endereço, nome de utilizador, palavra-passe, "
|
||||
"etc. estão corretos e se o alvo de sincronização está acessível. O erro "
|
||||
"etc. estão corretos e se o destino de sincronização está acessível. O erro "
|
||||
"reportado foi:"
|
||||
|
||||
#: ReactNativeClient/lib/components/note-list.js:97
|
||||
@@ -3096,20 +3086,17 @@ msgid "Downloaded"
|
||||
msgstr "Transferido"
|
||||
|
||||
#: ReactNativeClient/lib/models/Resource.js:371
|
||||
#, javascript-format
|
||||
#, fuzzy, javascript-format
|
||||
msgid "Attachment conflict: \"%s\""
|
||||
msgstr "Anexos em conflito: \"%s\""
|
||||
msgstr "Anexos"
|
||||
|
||||
#: ReactNativeClient/lib/models/Resource.js:372
|
||||
#, javascript-format
|
||||
#, fuzzy, javascript-format
|
||||
msgid ""
|
||||
"There was a [conflict](%s) on the attachment below.\n"
|
||||
"\n"
|
||||
"%s"
|
||||
msgstr ""
|
||||
"Ocorreu um [conflito](%s) no anexo em baixo.\n"
|
||||
"\n"
|
||||
"%s"
|
||||
msgstr "Ocorreu um erro ao transferir este anexo:"
|
||||
|
||||
#: ReactNativeClient/lib/models/BaseItem.js:721
|
||||
msgid "Encrypted"
|
||||
@@ -3117,7 +3104,7 @@ msgstr "Encriptado"
|
||||
|
||||
#: ReactNativeClient/lib/models/BaseItem.js:781
|
||||
msgid "Encrypted items cannot be modified"
|
||||
msgstr "Não é possível modificar itens encriptados"
|
||||
msgstr "Não é possível modificar tens encriptados"
|
||||
|
||||
#: ReactNativeClient/lib/models/Note.js:27
|
||||
msgid "created date"
|
||||
@@ -3125,7 +3112,7 @@ msgstr "data criada"
|
||||
|
||||
#: ReactNativeClient/lib/models/Note.js:28
|
||||
msgid "custom order"
|
||||
msgstr "ordem personalizada"
|
||||
msgstr ""
|
||||
|
||||
#: ReactNativeClient/lib/models/Note.js:92
|
||||
msgid "This note does not have geolocation information."
|
||||
@@ -3142,18 +3129,20 @@ msgid "Cannot move note to \"%s\" notebook"
|
||||
msgstr "Não é possível mover a nota para o caderno \"%s\""
|
||||
|
||||
#: ReactNativeClient/lib/models/Setting.js:65
|
||||
#, fuzzy
|
||||
msgid "yes"
|
||||
msgstr "sim"
|
||||
msgstr "Sim"
|
||||
|
||||
#: ReactNativeClient/lib/models/Setting.js:65
|
||||
#: ReactNativeClient/lib/models/Setting.js:66
|
||||
#, javascript-format
|
||||
msgid "(wysiwyg: %s)"
|
||||
msgstr "(wysiwyg: %s)"
|
||||
msgstr ""
|
||||
|
||||
#: ReactNativeClient/lib/models/Setting.js:66
|
||||
#, fuzzy
|
||||
msgid "no"
|
||||
msgstr "não"
|
||||
msgstr "n"
|
||||
|
||||
#: ReactNativeClient/lib/models/Setting.js:68
|
||||
#, javascript-format
|
||||
@@ -3192,7 +3181,7 @@ msgstr "Nórdico"
|
||||
|
||||
#: ReactNativeClient/lib/models/Setting.js:80
|
||||
msgid "Aritim Dark"
|
||||
msgstr "Escuro Aritim"
|
||||
msgstr ""
|
||||
|
||||
#: ReactNativeClient/lib/models/Setting.js:81
|
||||
msgid "OLED Dark"
|
||||
@@ -3207,8 +3196,8 @@ msgid ""
|
||||
"The target to synchonise to. Each sync target may have additional parameters "
|
||||
"which are named as `sync.NUM.NAME` (all documented below)."
|
||||
msgstr ""
|
||||
"O destino para a sincronização. Cada alvo de sincronização pode ter "
|
||||
"parâmetros adicionais que são designados como `sync.NUM.NAME` (todos "
|
||||
"O destino para a sincronização. Cada destino de sincronização pode ter "
|
||||
"parâmetros adicionais que são designados como `sync.NUM.NUM.NAME` (todos "
|
||||
"documentados abaixo)."
|
||||
|
||||
#: ReactNativeClient/lib/models/Setting.js:131
|
||||
@@ -3241,15 +3230,15 @@ msgstr "Palavra-passe WebDAV"
|
||||
|
||||
#: ReactNativeClient/lib/models/Setting.js:214
|
||||
msgid "AWS S3 bucket"
|
||||
msgstr "Bucket AWS S3"
|
||||
msgstr ""
|
||||
|
||||
#: ReactNativeClient/lib/models/Setting.js:225
|
||||
msgid "AWS key"
|
||||
msgstr "Chave AWS"
|
||||
msgstr ""
|
||||
|
||||
#: ReactNativeClient/lib/models/Setting.js:235
|
||||
msgid "AWS secret"
|
||||
msgstr "Segredo AWS"
|
||||
msgstr ""
|
||||
|
||||
#: ReactNativeClient/lib/models/Setting.js:247
|
||||
msgid "Attachment download behaviour"
|
||||
@@ -3261,9 +3250,10 @@ msgid ""
|
||||
"In \"Auto\", they are downloaded when you open the note. In \"Always\", all "
|
||||
"the attachments are downloaded whether you open the note or not."
|
||||
msgstr ""
|
||||
"No modo \"Manual\", os anexos são transferidos apenas quando são clicados. "
|
||||
"Em \"Automático\", eles são transferidos quando a nota é aberta. Em \"Sempre"
|
||||
"\", todos os anexos são transferidos, quer a nota seja aberta ou não."
|
||||
"No modo \"Manual\", os anexos são transferidos apenas quando é dado um "
|
||||
"clique neles. Em \"Automático\", eles são transferidos quando a nota é "
|
||||
"aberta. Em \"Sempre\", todos os anexos são transferidos, quer a nota seja "
|
||||
"aberta ou não."
|
||||
|
||||
#: ReactNativeClient/lib/models/Setting.js:251
|
||||
msgid "Always"
|
||||
@@ -3299,15 +3289,15 @@ msgstr "Tema"
|
||||
|
||||
#: ReactNativeClient/lib/models/Setting.js:337
|
||||
msgid "Automatically switch theme to match system theme"
|
||||
msgstr "Mudar automaticamente o tema para combinar com o tema do sistema"
|
||||
msgstr ""
|
||||
|
||||
#: ReactNativeClient/lib/models/Setting.js:348
|
||||
msgid "Preferred light theme"
|
||||
msgstr "Tema claro preferido"
|
||||
msgstr ""
|
||||
|
||||
#: ReactNativeClient/lib/models/Setting.js:361
|
||||
msgid "Preferred dark theme"
|
||||
msgstr "Tema escuro preferido"
|
||||
msgstr ""
|
||||
|
||||
#: ReactNativeClient/lib/models/Setting.js:365
|
||||
msgid "Show note counts"
|
||||
@@ -3470,14 +3460,15 @@ msgid "Editor font family"
|
||||
msgstr "Família da letra do editor"
|
||||
|
||||
#: ReactNativeClient/lib/models/Setting.js:556
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
"This should be a *monospace* font or some elements will render incorrectly. "
|
||||
"If the font is incorrect or empty, it will default to a generic monospace "
|
||||
"font."
|
||||
msgstr ""
|
||||
"Este deverá ser um tipo de letra *mono-espaçado* ou não funcionará "
|
||||
"corretamente. Se o tipo de letra estiver incorreto ou em branco, reverterá "
|
||||
"para um tipo de letra mono-espaçado genérico pré-definido."
|
||||
"corretamente. Se o tipo de letra estiver incorreto ou em branco, será pré-"
|
||||
"definida para um tipo de letra mono-espaçado genérico."
|
||||
|
||||
#: ReactNativeClient/lib/models/Setting.js:595
|
||||
msgid "Custom stylesheet for Joplin-wide app styles"
|
||||
@@ -3491,7 +3482,7 @@ msgstr "Atualizar a aplicação automaticamente"
|
||||
|
||||
#: ReactNativeClient/lib/models/Setting.js:601
|
||||
msgid "Get pre-releases when checking for updates"
|
||||
msgstr "Obtenha versões de pré-lançamento ao verificar se há atualizações"
|
||||
msgstr "Obtenha versões de pré-lançamento ao verificar atualizações"
|
||||
|
||||
#: ReactNativeClient/lib/models/Setting.js:601
|
||||
#, javascript-format
|
||||
@@ -3500,7 +3491,7 @@ msgstr "Consulte a página de pré-lançamento para obter mais detalhes: %s"
|
||||
|
||||
#: ReactNativeClient/lib/models/Setting.js:609
|
||||
msgid "Synchronisation interval"
|
||||
msgstr "Intervalo de sincronização"
|
||||
msgstr "Periodicidade de sincronização"
|
||||
|
||||
#: ReactNativeClient/lib/models/Setting.js:613
|
||||
#: ReactNativeClient/lib/models/Setting.js:614
|
||||
@@ -3619,8 +3610,8 @@ msgid ""
|
||||
"Fail-safe: Do not wipe out local data when sync target is empty (often the "
|
||||
"result of a misconfiguration or bug)"
|
||||
msgstr ""
|
||||
"Segurança contra falhas: Não elimine os dados locais quando o alvo de "
|
||||
"sincronização está em branco (muitas vezes o resultado de uma má "
|
||||
"À prova de falhas: Não elimine os dados locais quando o destino de "
|
||||
"sincronização está em brancp (muitas vezes o resultado de uma má "
|
||||
"configuração ou erro)"
|
||||
|
||||
#: ReactNativeClient/lib/models/Setting.js:695
|
||||
@@ -3650,7 +3641,7 @@ msgstr "Manter histórico de notas por"
|
||||
|
||||
#: ReactNativeClient/lib/models/Setting.js:735
|
||||
msgid "Notebook list growth factor"
|
||||
msgstr "Fator de crescimento do caderno"
|
||||
msgstr ""
|
||||
|
||||
#: ReactNativeClient/lib/models/Setting.js:736
|
||||
#: ReactNativeClient/lib/models/Setting.js:748
|
||||
@@ -3661,18 +3652,14 @@ msgid ""
|
||||
"item with a factor of 2 will take twice as much space as an item with a "
|
||||
"factor of 1.Restart app to see changes."
|
||||
msgstr ""
|
||||
"A propriedade fator define como um item aumentará ou diminuirá para ocupar o "
|
||||
"espaço disponível no seu contentor com respeito aos outros itens. Como tal, "
|
||||
"um item com um fator de 2 ocupará o dobro do espaço de um item com um fator "
|
||||
"de 1. Reinicie a aplicação para ver as alterações."
|
||||
|
||||
#: ReactNativeClient/lib/models/Setting.js:747
|
||||
msgid "Note list growth factor"
|
||||
msgstr "Fator de crescimento da lista de notas"
|
||||
msgstr ""
|
||||
|
||||
#: ReactNativeClient/lib/models/Setting.js:759
|
||||
msgid "Note area growth factor"
|
||||
msgstr "Fator de crescimento da área de notas"
|
||||
msgstr ""
|
||||
|
||||
#: ReactNativeClient/lib/models/Setting.js:1272
|
||||
msgid "General"
|
||||
@@ -3707,8 +3694,9 @@ msgid "Web Clipper"
|
||||
msgstr "Recorte Web"
|
||||
|
||||
#: ReactNativeClient/lib/models/Setting.js:1292
|
||||
#, fuzzy
|
||||
msgid "Keyboard Shortcuts"
|
||||
msgstr "Atalhos do Teclado"
|
||||
msgstr "Modo de Teclado"
|
||||
|
||||
#: ReactNativeClient/lib/models/Setting.js:1299
|
||||
msgid ""
|
||||
@@ -3720,12 +3708,6 @@ msgid ""
|
||||
"formatting. It is indicated below which plugins are compatible or not with "
|
||||
"the WYSIWYG editor."
|
||||
msgstr ""
|
||||
"Estes plugins modificam o renderizador de Markdown com recursos adicionais. "
|
||||
"Note que, enquanto estes recursos podem ser úteis, não são Markdown padrão "
|
||||
"e, como tal, a maioria deles só funcionará no Joplin. Adicionalmente, alguns "
|
||||
"deles são *incompatíveis* com o editor WYSIWYG. Se abrir uma nota que use um "
|
||||
"destes plugins nesse editor, perderá a formatação do plugin. Está indicado "
|
||||
"abaixo quais os plugins que são ou não compatíveis com o editor WYSIWYG."
|
||||
|
||||
#: ReactNativeClient/lib/models/Setting.js:1301
|
||||
#, javascript-format
|
||||
@@ -3754,11 +3736,11 @@ msgstr "OneDrive"
|
||||
|
||||
#: ReactNativeClient/lib/SyncTargetAmazonS3.js:28
|
||||
msgid "AWS S3"
|
||||
msgstr "AWS S3"
|
||||
msgstr ""
|
||||
|
||||
#: ReactNativeClient/lib/commands/historyForward.js:16
|
||||
msgid "Forward"
|
||||
msgstr "Avançar"
|
||||
msgstr ""
|
||||
|
||||
#: ReactNativeClient/lib/shim-init-node.js:158
|
||||
#, javascript-format
|
||||
|
||||
@@ -4,7 +4,7 @@ require('app-module-path').addPath(__dirname);
|
||||
|
||||
const os = require('os');
|
||||
const { time } = require('lib/time-utils.js');
|
||||
const { filename } = require('lib/path-utils');
|
||||
const { filename } = require('lib/path-utils.js');
|
||||
const { asyncTest, fileContentEqual, setupDatabase, setupDatabaseAndSynchronizer, db, synchronizer, fileApi, sleep, clearDatabase, switchClient, syncTargetId, objectsEqual, checkThrowAsync } = require('test-utils.js');
|
||||
const Folder = require('lib/models/Folder.js');
|
||||
const Note = require('lib/models/Note.js');
|
||||
|
||||
@@ -4,7 +4,7 @@ require('app-module-path').addPath(__dirname);
|
||||
|
||||
const os = require('os');
|
||||
const { time } = require('lib/time-utils.js');
|
||||
const { filename } = require('lib/path-utils');
|
||||
const { filename } = require('lib/path-utils.js');
|
||||
const { asyncTest, fileContentEqual, setupDatabase, setupDatabaseAndSynchronizer, db, synchronizer, fileApi, sleep, clearDatabase, switchClient, syncTargetId, objectsEqual, checkThrowAsync } = require('test-utils.js');
|
||||
const Folder = require('lib/models/Folder.js');
|
||||
const Note = require('lib/models/Note.js');
|
||||
|
||||
@@ -4,7 +4,7 @@ require('app-module-path').addPath(__dirname);
|
||||
|
||||
const os = require('os');
|
||||
const { time } = require('lib/time-utils.js');
|
||||
const { filename } = require('lib/path-utils');
|
||||
const { filename } = require('lib/path-utils.js');
|
||||
const { asyncTest, fileContentEqual, setupDatabase, setupDatabaseAndSynchronizer, db, synchronizer, fileApi, sleep, clearDatabase, switchClient, syncTargetId, objectsEqual, checkThrowAsync } = require('test-utils.js');
|
||||
const Folder = require('lib/models/Folder.js');
|
||||
const Note = require('lib/models/Note.js');
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
require('app-module-path').addPath(__dirname);
|
||||
|
||||
const { asyncTest } = require('test-utils.js');
|
||||
const MarkupToHtml = require('lib/joplin-renderer/MarkupToHtml').default;
|
||||
const MarkupToHtml = require('lib/joplin-renderer/MarkupToHtml');
|
||||
|
||||
describe('MarkupToHtml', function() {
|
||||
|
||||
|
||||
@@ -1,11 +1,24 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
|
||||
require('app-module-path').addPath(__dirname);
|
||||
|
||||
const os = require('os');
|
||||
const { filename } = require('lib/path-utils');
|
||||
const { asyncTest, setupDatabaseAndSynchronizer, switchClient } = require('test-utils.js');
|
||||
const { time } = require('lib/time-utils.js');
|
||||
const { filename } = require('lib/path-utils.js');
|
||||
const { asyncTest, fileContentEqual, setupDatabase, setupDatabaseAndSynchronizer, db, synchronizer, fileApi, sleep, clearDatabase, switchClient, syncTargetId, objectsEqual, checkThrowAsync } = require('test-utils.js');
|
||||
const Folder = require('lib/models/Folder.js');
|
||||
const Note = require('lib/models/Note.js');
|
||||
const BaseModel = require('lib/BaseModel.js');
|
||||
const shim = require('lib/shim').default;
|
||||
const MdToHtml = require('lib/joplin-renderer/MdToHtml').default;
|
||||
const MdToHtml = require('lib/joplin-renderer/MdToHtml');
|
||||
const { enexXmlToMd } = require('lib/import-enex-md-gen.js');
|
||||
const { themeStyle } = require('lib/theme');
|
||||
|
||||
function newTestMdToHtml(options:any = null) {
|
||||
process.on('unhandledRejection', (reason, p) => {
|
||||
console.log('Unhandled Rejection at: Promise', p, 'reason:', reason);
|
||||
});
|
||||
|
||||
function newTestMdToHtml(options = null) {
|
||||
options = {
|
||||
ResourceModel: {
|
||||
isResourceUrl: () => false,
|
||||
@@ -19,7 +32,7 @@ function newTestMdToHtml(options:any = null) {
|
||||
|
||||
describe('MdToHtml', function() {
|
||||
|
||||
beforeEach(async (done:Function) => {
|
||||
beforeEach(async (done) => {
|
||||
await setupDatabaseAndSynchronizer(1);
|
||||
await switchClient(1);
|
||||
done();
|
||||
@@ -39,14 +52,14 @@ describe('MdToHtml', function() {
|
||||
|
||||
// if (mdFilename !== 'sanitize_9.md') continue;
|
||||
|
||||
const mdToHtmlOptions:any = {
|
||||
const mdToHtmlOptions = {
|
||||
bodyOnly: true,
|
||||
};
|
||||
|
||||
if (mdFilename === 'checkbox_alternative.md') {
|
||||
mdToHtmlOptions.plugins = {
|
||||
checkbox: {
|
||||
checkboxRenderingType: 2,
|
||||
renderingType: 2,
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -83,7 +96,7 @@ describe('MdToHtml', function() {
|
||||
}));
|
||||
|
||||
it('should return enabled plugin assets', asyncTest(async () => {
|
||||
const pluginOptions:any = {};
|
||||
const pluginOptions = {};
|
||||
const pluginNames = MdToHtml.pluginNames();
|
||||
|
||||
for (const n of pluginNames) pluginOptions[n] = { enabled: false };
|
||||
@@ -113,7 +126,7 @@ describe('MdToHtml', function() {
|
||||
// In this case, the HTML contains both the style and
|
||||
// the rendered markdown wrapped in a DIV.
|
||||
const result = await mdToHtml.render('just **testing**');
|
||||
expect(result.cssStrings.length).toBeGreaterThan(0);
|
||||
expect(result.cssStrings.length).toBe(0);
|
||||
expect(result.html.indexOf('rendered-md') >= 0).toBe(true);
|
||||
}));
|
||||
|
||||
@@ -124,7 +137,7 @@ describe('MdToHtml', function() {
|
||||
// with no wrapper and no style.
|
||||
// The style is instead in the cssStrings property.
|
||||
const result = await mdToHtml.render('just **testing**', null, { bodyOnly: true });
|
||||
expect(result.cssStrings.length).toBeGreaterThan(0);
|
||||
expect(result.cssStrings.length).toBe(1);
|
||||
expect(result.html.trim()).toBe('just <strong>testing</strong>');
|
||||
}));
|
||||
|
||||
@@ -134,7 +147,7 @@ describe('MdToHtml', function() {
|
||||
// It is similar to the bodyOnly option, excepts that
|
||||
// the rendered Markdown is wrapped in a DIV
|
||||
const result = await mdToHtml.render('just **testing**', null, { splitted: true });
|
||||
expect(result.cssStrings.length).toBeGreaterThan(0);
|
||||
expect(result.cssStrings.length).toBe(1);
|
||||
expect(result.html.trim()).toBe('<div id="rendered-md"><p>just <strong>testing</strong></p>\n</div>');
|
||||
}));
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
import FsDriverNode from 'lib/fs-driver-node';
|
||||
const { expectThrow } = require('test-utils.js');
|
||||
|
||||
describe('fsDriver', function() {
|
||||
|
||||
it('should resolveRelativePathWithinDir', () => {
|
||||
const fsDriver = new FsDriverNode();
|
||||
expect(fsDriver.resolveRelativePathWithinDir('/test/temp', './my/file.txt')).toBe('/test/temp/my/file.txt');
|
||||
expect(fsDriver.resolveRelativePathWithinDir('/', './test')).toBe('/test');
|
||||
expect(fsDriver.resolveRelativePathWithinDir('/test', 'myfile.txt')).toBe('/test/myfile.txt');
|
||||
expect(fsDriver.resolveRelativePathWithinDir('/test/temp', './mydir/../test.txt')).toBe('/test/temp/test.txt');
|
||||
|
||||
expectThrow(() => fsDriver.resolveRelativePathWithinDir('/test/temp', '../myfile.txt'));
|
||||
expectThrow(() => fsDriver.resolveRelativePathWithinDir('/test/temp', './mydir/../../test.txt'));
|
||||
expectThrow(() => fsDriver.resolveRelativePathWithinDir('/test/temp', '/var/local/no.txt'));
|
||||
});
|
||||
|
||||
});
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
require('app-module-path').addPath(__dirname);
|
||||
|
||||
const { extractExecutablePath, quotePath, unquotePath, friendlySafeFilename, toFileProtocolPath } = require('lib/path-utils');
|
||||
const { extractExecutablePath, quotePath, unquotePath, friendlySafeFilename, toFileProtocolPath } = require('lib/path-utils.js');
|
||||
const { asyncTest, fileContentEqual, setupDatabase, setupDatabaseAndSynchronizer, db, synchronizer, fileApi, sleep, clearDatabase, switchClient, syncTargetId, objectsEqual, checkThrowAsync } = require('test-utils.js');
|
||||
|
||||
process.on('unhandledRejection', (reason, p) => {
|
||||
|
||||
@@ -299,7 +299,7 @@ describe('services_KeymapService', () => {
|
||||
],
|
||||
[
|
||||
{ command: 'showLocalSearch', accelerator: 'Option+Cmd+S' },
|
||||
{ command: 'print', accelerator: 'Cmd+P' /* Default of gotoAnything */ },
|
||||
{ command: 'print', accelerator: 'Cmd+G' /* Default of gotoAnything */ },
|
||||
{ command: 'focusElementNoteTitle', accelerator: 'Option+Shift+Cmd+J' },
|
||||
],
|
||||
];
|
||||
@@ -317,7 +317,7 @@ describe('services_KeymapService', () => {
|
||||
],
|
||||
[
|
||||
{ command: 'showLocalSearch', accelerator: 'Ctrl+Alt+S' },
|
||||
{ command: 'print', accelerator: 'Ctrl+P' /* Default of gotoAnything */ },
|
||||
{ command: 'print', accelerator: 'Ctrl+G' /* Default of gotoAnything */ },
|
||||
{ command: 'focusElementNoteTitle', accelerator: 'Ctrl+Alt+Shift+J' },
|
||||
],
|
||||
];
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
import PluginRunner from '../app/services/plugins/PluginRunner';
|
||||
import PluginService from 'lib/services/plugins/PluginService';
|
||||
import { ContentScriptType } from 'lib/services/plugins/api/types';
|
||||
import MdToHtml from 'lib/joplin-renderer/MdToHtml';
|
||||
import Setting from 'lib/models/Setting';
|
||||
import shim from 'lib/shim';
|
||||
import uuid from 'lib/uuid';
|
||||
|
||||
require('app-module-path').addPath(__dirname);
|
||||
const { asyncTest, setupDatabaseAndSynchronizer, switchClient, expectThrow } = require('test-utils.js');
|
||||
@@ -153,52 +148,4 @@ describe('services_PluginService', function() {
|
||||
}
|
||||
}));
|
||||
|
||||
it('should register a Markdown-it plugin', asyncTest(async () => {
|
||||
const contentScriptPath = `${Setting.value('tempDir')}/markdownItTestPlugin${uuid.createNano()}.js`;
|
||||
await shim.fsDriver().copy(`${testPluginDir}/content_script/src/markdownItTestPlugin.js`, contentScriptPath);
|
||||
|
||||
const service = newPluginService();
|
||||
|
||||
const plugin = await service.loadPluginFromString('example', Setting.value('tempDir'), `
|
||||
/* joplin-manifest:
|
||||
{
|
||||
"manifest_version": 1,
|
||||
"name": "JS Bundle test",
|
||||
"description": "JS Bundle Test plugin",
|
||||
"version": "1.0.0",
|
||||
"author": "Laurent Cozic",
|
||||
"homepage_url": "https://joplinapp.org"
|
||||
}
|
||||
*/
|
||||
|
||||
joplin.plugins.register({
|
||||
onStart: async function() {
|
||||
await joplin.plugins.registerContentScript('markdownItPlugin', 'justtesting', '${contentScriptPath}');
|
||||
},
|
||||
});
|
||||
`);
|
||||
|
||||
await service.runPlugin(plugin);
|
||||
|
||||
const contentScripts = plugin.contentScriptsByType(ContentScriptType.MarkdownItPlugin);
|
||||
expect(contentScripts.length).toBe(1);
|
||||
expect(!!contentScripts[0].path).toBe(true);
|
||||
|
||||
const contentScript = contentScripts[0];
|
||||
|
||||
const mdToHtml = new MdToHtml();
|
||||
const module = require(contentScript.path).default;
|
||||
mdToHtml.loadExtraRendererRule(contentScript.id, module({}));
|
||||
|
||||
const result = await mdToHtml.render([
|
||||
'```justtesting',
|
||||
'something',
|
||||
'```',
|
||||
].join('\n'));
|
||||
|
||||
expect(result.html.includes('JUST TESTING: something')).toBe(true);
|
||||
|
||||
await shim.fsDriver().remove(contentScriptPath);
|
||||
}));
|
||||
|
||||
});
|
||||
|
||||
60
CliClient/tests/services_keychainService.js
Normal file
60
CliClient/tests/services_keychainService.js
Normal file
@@ -0,0 +1,60 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
|
||||
require('app-module-path').addPath(__dirname);
|
||||
|
||||
const { asyncTest, fileContentEqual, setupDatabase, setupDatabaseAndSynchronizer, db, synchronizer, fileApi, sleep, clearDatabase, switchClient, syncTargetId, objectsEqual, checkThrowAsync } = require('test-utils.js');
|
||||
const shim = require('lib/shim').default;
|
||||
const Setting = require('lib/models/Setting').default;
|
||||
const KeychainService = require('lib/services/keychain/KeychainService').default;
|
||||
|
||||
process.on('unhandledRejection', (reason, p) => {
|
||||
console.log('Unhandled Rejection at: Promise', p, 'reason:', reason);
|
||||
});
|
||||
|
||||
function describeIfCompatible(name, fn) {
|
||||
if (['win32', 'darwin'].includes(shim.platformName())) {
|
||||
return describe(name, fn);
|
||||
}
|
||||
}
|
||||
|
||||
describeIfCompatible('services_KeychainService', function() {
|
||||
|
||||
beforeEach(async (done) => {
|
||||
await setupDatabaseAndSynchronizer(1, { keychainEnabled: true });
|
||||
await switchClient(1, { keychainEnabled: true });
|
||||
await Setting.deleteKeychainPasswords();
|
||||
done();
|
||||
});
|
||||
|
||||
afterEach(async (done) => {
|
||||
await Setting.deleteKeychainPasswords();
|
||||
done();
|
||||
});
|
||||
|
||||
it('should be enabled on macOS and Windows', asyncTest(async () => {
|
||||
expect(Setting.value('keychain.supported')).toBe(1);
|
||||
}));
|
||||
|
||||
it('should set, get and delete passwords', asyncTest(async () => {
|
||||
const service = KeychainService.instance();
|
||||
|
||||
const isSet = await service.setPassword('zz_testunit', 'password');
|
||||
expect(isSet).toBe(true);
|
||||
|
||||
const password = await service.password('zz_testunit');
|
||||
expect(password).toBe('password');
|
||||
|
||||
await service.deletePassword('zz_testunit');
|
||||
|
||||
expect(await service.password('zz_testunit')).toBe(null);
|
||||
}));
|
||||
|
||||
it('should save and load secure settings', asyncTest(async () => {
|
||||
Setting.setObjectValue('encryption.passwordCache', 'testing', '123456');
|
||||
await Setting.saveAll();
|
||||
await Setting.load();
|
||||
const passwords = Setting.value('encryption.passwordCache');
|
||||
expect(passwords.testing).toBe('123456');
|
||||
}));
|
||||
|
||||
});
|
||||
@@ -1,94 +0,0 @@
|
||||
import KeychainService from 'lib/services/keychain/KeychainService';
|
||||
import shim from 'lib/shim';
|
||||
import Setting from 'lib/models/Setting';
|
||||
|
||||
const { db, asyncTest, setupDatabaseAndSynchronizer, switchClient } = require('test-utils.js');
|
||||
|
||||
function describeIfCompatible(name:string, fn:any) {
|
||||
if (['win32', 'darwin'].includes(shim.platformName())) {
|
||||
return describe(name, fn);
|
||||
}
|
||||
}
|
||||
|
||||
describeIfCompatible('services_KeychainService', function() {
|
||||
|
||||
beforeEach(async (done:Function) => {
|
||||
await setupDatabaseAndSynchronizer(1, { keychainEnabled: true });
|
||||
await switchClient(1, { keychainEnabled: true });
|
||||
await Setting.deleteKeychainPasswords();
|
||||
done();
|
||||
});
|
||||
|
||||
afterEach(async (done:Function) => {
|
||||
await Setting.deleteKeychainPasswords();
|
||||
done();
|
||||
});
|
||||
|
||||
it('should be enabled on macOS and Windows', asyncTest(async () => {
|
||||
expect(Setting.value('keychain.supported')).toBe(1);
|
||||
}));
|
||||
|
||||
it('should set, get and delete passwords', asyncTest(async () => {
|
||||
const service = KeychainService.instance();
|
||||
|
||||
const isSet = await service.setPassword('zz_testunit', 'password');
|
||||
expect(isSet).toBe(true);
|
||||
|
||||
const password = await service.password('zz_testunit');
|
||||
expect(password).toBe('password');
|
||||
|
||||
await service.deletePassword('zz_testunit');
|
||||
|
||||
expect(await service.password('zz_testunit')).toBe(null);
|
||||
}));
|
||||
|
||||
it('should save and load secure settings', asyncTest(async () => {
|
||||
Setting.setObjectValue('encryption.passwordCache', 'testing', '123456');
|
||||
await Setting.saveAll();
|
||||
await Setting.load();
|
||||
const passwords = Setting.value('encryption.passwordCache');
|
||||
expect(passwords.testing).toBe('123456');
|
||||
}));
|
||||
|
||||
it('should delete db settings if they have been saved in keychain', asyncTest(async () => {
|
||||
// First save some secure settings and make sure it ends up in the databse
|
||||
KeychainService.instance().enabled = false;
|
||||
|
||||
Setting.setValue('sync.5.password', 'password');
|
||||
await Setting.saveAll();
|
||||
|
||||
{
|
||||
// Check that it is in the database
|
||||
const row = await db().selectOne('SELECT * FROM settings WHERE key = "sync.5.password"');
|
||||
expect(row.value).toBe('password');
|
||||
}
|
||||
|
||||
KeychainService.instance().enabled = true;
|
||||
|
||||
// Change any setting to make sure a save operation is triggered
|
||||
Setting.setValue('sync.5.path', '/tmp');
|
||||
|
||||
// Save the settings - now db secure keys should have been cleared and moved to keychain
|
||||
await Setting.saveAll();
|
||||
|
||||
{
|
||||
// Check that it's been removed from the database
|
||||
const row = await db().selectOne('SELECT * FROM settings WHERE key = "sync.5.password"');
|
||||
expect(row).toBe(undefined);
|
||||
}
|
||||
|
||||
// However we should still get it via the Setting class, since it will use the keychain
|
||||
expect(Setting.value('sync.5.password')).toBe('password');
|
||||
|
||||
// Now do it again - because there was a bug that would cause the second attempt to save to the db instead
|
||||
Setting.setValue('sync.5.username', 'john');
|
||||
await Setting.saveAll();
|
||||
|
||||
{
|
||||
// Check that it's been removed from the database
|
||||
const row = await db().selectOne('SELECT * FROM settings WHERE key = "sync.5.password"');
|
||||
expect(row).toBe(undefined);
|
||||
}
|
||||
}));
|
||||
|
||||
});
|
||||
@@ -1,2 +0,0 @@
|
||||
dist/*
|
||||
node_modules/
|
||||
@@ -1,14 +0,0 @@
|
||||
# Joplin Plugin
|
||||
|
||||
This is a template to create a new Joplin plugin.
|
||||
|
||||
The main two files you will want to look at are:
|
||||
|
||||
- `/src/index.ts`, which contains the entry point for the plugin source code.
|
||||
- `/src/manifest.json`, which is the plugin manifest. It contains information such as the plugin a name, version, etc.
|
||||
|
||||
The plugin is built using webpack, which create the compiled code in `/dist`. The project is setup to use TypeScript, although you can change the configuration to use plain JavaScript.
|
||||
|
||||
## Building the plugin
|
||||
|
||||
To build the plugin, simply run `npm run dist`.
|
||||
@@ -1,15 +0,0 @@
|
||||
import Plugin from '../Plugin';
|
||||
import Joplin from './Joplin';
|
||||
import Logger from 'lib/Logger';
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
export default class Global {
|
||||
private joplin_;
|
||||
private requireWhiteList_;
|
||||
constructor(logger: Logger, implementation: any, plugin: Plugin, store: any);
|
||||
get joplin(): Joplin;
|
||||
private requireWhiteList;
|
||||
require(filePath: string): any;
|
||||
get process(): any;
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
import Plugin from '../Plugin';
|
||||
import JoplinData from './JoplinData';
|
||||
import JoplinPlugins from './JoplinPlugins';
|
||||
import JoplinWorkspace from './JoplinWorkspace';
|
||||
import JoplinFilters from './JoplinFilters';
|
||||
import JoplinCommands from './JoplinCommands';
|
||||
import JoplinViews from './JoplinViews';
|
||||
import JoplinInterop from './JoplinInterop';
|
||||
import JoplinSettings from './JoplinSettings';
|
||||
import Logger from 'lib/Logger';
|
||||
/**
|
||||
* This is the main entry point to the Joplin API. You can access various services using the provided accessors.
|
||||
*/
|
||||
export default class Joplin {
|
||||
private data_;
|
||||
private plugins_;
|
||||
private workspace_;
|
||||
private filters_;
|
||||
private commands_;
|
||||
private views_;
|
||||
private interop_;
|
||||
private settings_;
|
||||
constructor(logger: Logger, implementation: any, plugin: Plugin, store: any);
|
||||
get data(): JoplinData;
|
||||
get plugins(): JoplinPlugins;
|
||||
get workspace(): JoplinWorkspace;
|
||||
/**
|
||||
* @ignore
|
||||
*
|
||||
* Not sure if it's the best way to hook into the app
|
||||
* so for now disable filters.
|
||||
*/
|
||||
get filters(): JoplinFilters;
|
||||
get commands(): JoplinCommands;
|
||||
get views(): JoplinViews;
|
||||
get interop(): JoplinInterop;
|
||||
get settings(): JoplinSettings;
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
import { Command } from './types';
|
||||
/**
|
||||
* This class allows executing or registering new Joplin commands. Commands can be executed or associated with
|
||||
* {@link JoplinViewsToolbarButtons | toolbar buttons} or {@link JoplinViewsMenuItems | menu items}.
|
||||
*
|
||||
* [View the demo plugin](https://github.com/laurent22/joplin/tree/dev/CliClient/tests/support/plugins/register_command)
|
||||
*
|
||||
* ## Executing Joplin's internal commands
|
||||
*
|
||||
* It is also possible to execute internal Joplin's commands which, as of now, are not well documented.
|
||||
* You can find the list directly on GitHub though at the following locations:
|
||||
*
|
||||
* https://github.com/laurent22/joplin/tree/dev/ElectronClient/gui/MainScreen/commands
|
||||
* https://github.com/laurent22/joplin/tree/dev/ElectronClient/commands
|
||||
* https://github.com/laurent22/joplin/tree/dev/ElectronClient/gui/NoteEditor/commands/editorCommandDeclarations.ts
|
||||
*
|
||||
* To view what arguments are supported, you can open any of these files and look at the `execute()` command.
|
||||
*/
|
||||
export default class JoplinCommands {
|
||||
/**
|
||||
* <span class="platform-desktop">desktop</span> Executes the given command.
|
||||
* The `props` are the arguments passed to the command, and they vary based on the command
|
||||
*
|
||||
* ```typescript
|
||||
* // Create a new note in the current notebook:
|
||||
* await joplin.commands.execute('newNote');
|
||||
*
|
||||
* // Create a new sub-notebook under the provided notebook
|
||||
* // Note: internally, notebooks are called "folders".
|
||||
* await joplin.commands.execute('newFolder', { parent_id: "SOME_FOLDER_ID" });
|
||||
* ```
|
||||
*/
|
||||
execute(commandName: string, props?: any): Promise<any>;
|
||||
/**
|
||||
* <span class="platform-desktop">desktop</span> Registers a new command.
|
||||
*
|
||||
* ```typescript
|
||||
* // Register a new commmand called "testCommand1"
|
||||
*
|
||||
* await joplin.commands.register({
|
||||
* name: 'testCommand1',
|
||||
* label: 'My Test Command 1',
|
||||
* iconName: 'fas fa-music',
|
||||
* execute: () => {
|
||||
* alert('Testing plugin command 1');
|
||||
* },
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
register(command: Command): Promise<void>;
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
import { Path } from './types';
|
||||
/**
|
||||
* This module provides access to the Joplin data API: https://joplinapp.org/api/references/rest_api/
|
||||
* This is the main way to retrieve data, such as notes, notebooks, tags, etc.
|
||||
* or to update them or delete them.
|
||||
*
|
||||
* This is also what you would use to search notes, via the `search` endpoint.
|
||||
*
|
||||
* [View the demo plugin](https://github.com/laurent22/joplin/tree/dev/CliClient/tests/support/plugins/simple)
|
||||
*
|
||||
* In general you would use the methods in this class as if you were using a REST API. There are four methods that map to GET, POST, PUT and DELETE calls.
|
||||
* And each method takes these parameters:
|
||||
*
|
||||
* * `path`: This is an array that represents the path to the resource in the form `["resouceName", "resourceId", "resourceLink"]` (eg. ["tags", ":id", "notes"]). The "resources" segment is the name of the resources you want to access (eg. "notes", "folders", etc.). If not followed by anything, it will refer to all the resources in that collection. The optional "resourceId" points to a particular resources within the collection. Finally, an optional "link" can be present, which links the resource to a collection of resources. This can be used in the API for example to retrieve all the notes associated with a tag.
|
||||
* * `query`: (Optional) The query parameters. In a URL, this is the part after the question mark "?". In this case, it should be an object with key/value pairs.
|
||||
* * `data`: (Optional) Applies to PUT and POST calls only. The request body contains the data you want to create or modify, for example the content of a note or folder.
|
||||
* * `files`: (Optional) Used to create new resources and associate them with files.
|
||||
*
|
||||
* Please refer to the [Joplin API documentation](https://joplinapp.org/api/references/rest_api/) for complete details about each call. As the plugin runs within the Joplin application **you do not need an authorisation token** to use this API.
|
||||
*
|
||||
* For example:
|
||||
*
|
||||
* ```typescript
|
||||
* // Get a note ID, title and body
|
||||
* const noteId = 'some_note_id';
|
||||
* const note = await joplin.data.get(['notes', noteId], { fields: ['id', 'title', 'body'] });
|
||||
*
|
||||
* // Get all folders
|
||||
* const folders = await joplin.data.get(['folders']);
|
||||
*
|
||||
* // Set the note body
|
||||
* await joplin.data.put(['notes', noteId], null, { body: "New note body" });
|
||||
*
|
||||
* // Create a new note under one of the folders
|
||||
* await joplin.data.post(['notes'], null, { body: "my new note", title: "some title", parent_id: folders[0].id });
|
||||
* ```
|
||||
*/
|
||||
export default class JoplinData {
|
||||
private api_;
|
||||
private pathSegmentRegex_;
|
||||
private serializeApiBody;
|
||||
private pathToString;
|
||||
get(path: Path, query?: any): Promise<any>;
|
||||
post(path: Path, query?: any, body?: any, files?: any[]): Promise<any>;
|
||||
put(path: Path, query?: any, body?: any, files?: any[]): Promise<any>;
|
||||
delete(path: Path, query?: any): Promise<any>;
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
/**
|
||||
* @ignore
|
||||
*
|
||||
* Not sure if it's the best way to hook into the app
|
||||
* so for now disable filters.
|
||||
*/
|
||||
export default class JoplinFilters {
|
||||
on(name: string, callback: Function): Promise<void>;
|
||||
off(name: string, callback: Function): Promise<void>;
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
import { ExportModule, ImportModule } from './types';
|
||||
/**
|
||||
* Provides a way to create modules to import external data into Joplin or to export notes into any arbitrary format.
|
||||
*
|
||||
* [View the demo plugin](https://github.com/laurent22/joplin/tree/dev/CliClient/tests/support/plugins/json_export)
|
||||
*
|
||||
* To implement an import or export module, you would simply define an object with various event handlers that are called
|
||||
* by the application during the import/export process.
|
||||
*
|
||||
* See the documentation of the [[ExportModule]] and [[ImportModule]] for more information.
|
||||
*
|
||||
* You may also want to refer to the Joplin API documentation to see the list of properties for each item (note, notebook, etc.) - https://joplinapp.org/api/references/rest_api/
|
||||
*/
|
||||
export default class JoplinInterop {
|
||||
registerExportModule(module: ExportModule): Promise<void>;
|
||||
registerImportModule(module: ImportModule): Promise<void>;
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
import Plugin from '../Plugin';
|
||||
import Logger from 'lib/Logger';
|
||||
import { Script } from './types';
|
||||
/**
|
||||
* This class provides access to plugin-related features.
|
||||
*/
|
||||
export default class JoplinPlugins {
|
||||
private logger;
|
||||
private plugin;
|
||||
constructor(logger: Logger, plugin: Plugin);
|
||||
/**
|
||||
* Registers a new plugin. This is the entry point when creating a plugin. You should pass a simple object with an `onStart` method to it.
|
||||
* That `onStart` method will be executed as soon as the plugin is loaded.
|
||||
*
|
||||
* ```typescript
|
||||
* joplin.plugins.register({
|
||||
* onStart: async function() {
|
||||
* // Run your plugin code here
|
||||
* }
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
register(script: Script): Promise<void>;
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
import Plugin from '../Plugin';
|
||||
import { SettingItem, SettingSection } from './types';
|
||||
/**
|
||||
* This API allows registering new settings and setting sections, as well as getting and setting settings. Once a setting has been registered it will appear in the config screen and be editable by the user.
|
||||
*
|
||||
* Settings are essentially key/value pairs.
|
||||
*
|
||||
* Note: Currently this API does **not** provide access to Joplin's built-in settings. This is by design as plugins that modify user settings could give unexpected results
|
||||
*
|
||||
* [View the demo plugin](https://github.com/laurent22/joplin/tree/dev/CliClient/tests/support/plugins/settings)
|
||||
*/
|
||||
export default class JoplinSettings {
|
||||
private plugin_;
|
||||
constructor(plugin: Plugin);
|
||||
private namespacedKey;
|
||||
/**
|
||||
* Registers a new setting. Note that registering a setting item is dynamic and will be gone next time Joplin starts.
|
||||
* What it means is that you need to register the setting every time the plugin starts (for example in the onStart event).
|
||||
* The setting value however will be preserved from one launch to the next so there is no risk that it will be lost even if for some
|
||||
* reason the plugin fails to start at some point.
|
||||
*/
|
||||
registerSetting(key: string, settingItem: SettingItem): Promise<void>;
|
||||
/**
|
||||
* Registers a new setting section. Like for registerSetting, it is dynamic and needs to be done every time the plugin starts.
|
||||
*/
|
||||
registerSection(name: string, section: SettingSection): Promise<void>;
|
||||
/**
|
||||
* Gets a setting value (only applies to setting you registered from your plugin)
|
||||
*/
|
||||
value(key: string): Promise<any>;
|
||||
/**
|
||||
* Sets a setting value (only applies to setting you registered from your plugin)
|
||||
*/
|
||||
setValue(key: string, value: any): Promise<void>;
|
||||
/**
|
||||
* Gets a global setting value, including app-specific settings and those set by other plugins.
|
||||
*
|
||||
* The list of available settings is not documented yet, but can be found by looking at the source code:
|
||||
*
|
||||
* https://github.com/laurent22/joplin/blob/3539a452a359162c461d2849829d2d42973eab50/ReactNativeClient/lib/models/Setting.ts#L142
|
||||
*/
|
||||
globalValue(key: string): Promise<any>;
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
import Plugin from '../Plugin';
|
||||
import JoplinViewsDialogs from './JoplinViewsDialogs';
|
||||
import JoplinViewsMenuItems from './JoplinViewsMenuItems';
|
||||
import JoplinViewsMenus from './JoplinViewsMenus';
|
||||
import JoplinViewsToolbarButtons from './JoplinViewsToolbarButtons';
|
||||
import JoplinViewsPanels from './JoplinViewsPanels';
|
||||
/**
|
||||
* This namespace provides access to view-related services.
|
||||
*
|
||||
* All view services provide a `create()` method which you would use to create the view object, whether it's a dialog, a toolbar button or a menu item.
|
||||
* In some cases, the `create()` method will return a [[ViewHandle]], which you would use to act on the view, for example to set certain properties or call some methods.
|
||||
*/
|
||||
export default class JoplinViews {
|
||||
private store;
|
||||
private plugin;
|
||||
private dialogs_;
|
||||
private panels_;
|
||||
private menuItems_;
|
||||
private menus_;
|
||||
private toolbarButtons_;
|
||||
private implementation_;
|
||||
constructor(implementation: any, plugin: Plugin, store: any);
|
||||
get dialogs(): JoplinViewsDialogs;
|
||||
get panels(): JoplinViewsPanels;
|
||||
get menuItems(): JoplinViewsMenuItems;
|
||||
get menus(): JoplinViewsMenus;
|
||||
get toolbarButtons(): JoplinViewsToolbarButtons;
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
import Plugin from '../Plugin';
|
||||
import { ButtonSpec, ViewHandle, ButtonId } from './types';
|
||||
/**
|
||||
* Allows creating and managing dialogs. A dialog is modal window that contains a webview and a row of buttons. You can update the update the webview using the `setHtml` method.
|
||||
* Dialogs are hidden by default and you need to call `open()` to open them. Once the user clicks on a button, the `open` call will return and provide the button ID that was
|
||||
* clicked on. There is currently no "close" method since the dialog should be thought as a modal one and thus can only be closed by clicking on one of the buttons.
|
||||
*
|
||||
* [View the demo plugin](https://github.com/laurent22/joplin/tree/dev/CliClient/tests/support/plugins/dialog)
|
||||
*/
|
||||
export default class JoplinViewsDialogs {
|
||||
private store;
|
||||
private plugin;
|
||||
private implementation_;
|
||||
constructor(implementation: any, plugin: Plugin, store: any);
|
||||
private controller;
|
||||
/**
|
||||
* Creates a new dialog
|
||||
*/
|
||||
create(): Promise<ViewHandle>;
|
||||
/**
|
||||
* Displays a message box with OK/Cancel buttons. Returns the button index that was clicked - "0" for OK and "1" for "Cancel"
|
||||
*/
|
||||
showMessageBox(message: string): Promise<number>;
|
||||
/**
|
||||
* Sets the dialog HTML content
|
||||
*/
|
||||
setHtml(handle: ViewHandle, html: string): Promise<string>;
|
||||
/**
|
||||
* Sets the dialog buttons.
|
||||
*/
|
||||
setButtons(handle: ViewHandle, buttons: ButtonSpec[]): Promise<ButtonSpec[]>;
|
||||
/**
|
||||
* Opens the dialog
|
||||
*/
|
||||
open(handle: ViewHandle): Promise<ButtonId>;
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
import { CreateMenuItemOptions, MenuItemLocation } from './types';
|
||||
import Plugin from '../Plugin';
|
||||
/**
|
||||
* Allows creating and managing menu items.
|
||||
*
|
||||
* [View the demo plugin](https://github.com/laurent22/joplin/tree/dev/CliClient/tests/support/plugins/register_command)
|
||||
*/
|
||||
export default class JoplinViewsMenuItems {
|
||||
private store;
|
||||
private plugin;
|
||||
constructor(plugin: Plugin, store: any);
|
||||
/**
|
||||
* Creates a new menu item and associate it with the given command. You can specify under which menu the item should appear using the `location` parameter.
|
||||
*/
|
||||
create(commandName: string, location?: MenuItemLocation, options?: CreateMenuItemOptions): Promise<void>;
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
import { MenuItem, MenuItemLocation } from './types';
|
||||
import Plugin from '../Plugin';
|
||||
/**
|
||||
* Allows creating menus.
|
||||
*
|
||||
* [View the demo plugin](https://github.com/laurent22/joplin/tree/dev/CliClient/tests/support/plugins/menu)
|
||||
*/
|
||||
export default class JoplinViewsMenus {
|
||||
private store;
|
||||
private plugin;
|
||||
constructor(plugin: Plugin, store: any);
|
||||
private registerCommandAccelerators;
|
||||
/**
|
||||
* Creates a new menu from the provided menu items and place it at the given location. As of now, it is only possible to place the
|
||||
* menu as a sub-menu of the application build-in menus.
|
||||
*/
|
||||
create(label: string, menuItems: MenuItem[], location?: MenuItemLocation): Promise<void>;
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
import Plugin from '../Plugin';
|
||||
import { ViewHandle } from './types';
|
||||
/**
|
||||
* Allows creating and managing view panels. View panels currently are displayed at the right of the sidebar and allows displaying any HTML content (within a webview) and update it in real-time. For example
|
||||
* it could be used to display a table of content for the active note, or display various metadata or graph.
|
||||
*
|
||||
* [View the demo plugin](https://github.com/laurent22/joplin/tree/dev/CliClient/tests/support/plugins/toc)
|
||||
*/
|
||||
export default class JoplinViewsPanels {
|
||||
private store;
|
||||
private plugin;
|
||||
constructor(plugin: Plugin, store: any);
|
||||
private controller;
|
||||
/**
|
||||
* Creates a new panel
|
||||
*/
|
||||
create(): Promise<ViewHandle>;
|
||||
/**
|
||||
* Sets the panel webview HTML
|
||||
*/
|
||||
setHtml(handle: ViewHandle, html: string): Promise<string>;
|
||||
/**
|
||||
* Adds and loads a new JS or CSS files into the panel.
|
||||
*/
|
||||
addScript(handle: ViewHandle, scriptPath: string): Promise<void>;
|
||||
/**
|
||||
* Called when a message is sent from the webview (using postMessage).
|
||||
*/
|
||||
onMessage(handle: ViewHandle, callback: Function): Promise<void>;
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
import { ToolbarButtonLocation } from './types';
|
||||
import Plugin from '../Plugin';
|
||||
/**
|
||||
* Allows creating and managing toolbar buttons.
|
||||
*
|
||||
* [View the demo plugin](https://github.com/laurent22/joplin/tree/dev/CliClient/tests/support/plugins/register_command)
|
||||
*/
|
||||
export default class JoplinViewsToolbarButtons {
|
||||
private store;
|
||||
private plugin;
|
||||
constructor(plugin: Plugin, store: any);
|
||||
/**
|
||||
* Creates a new toolbar button and associate it with the given command.
|
||||
*/
|
||||
create(commandName: string, location: ToolbarButtonLocation): Promise<void>;
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
/**
|
||||
* The workspace service provides access to all the parts of Joplin that are being worked on - i.e. the currently selected notes or notebooks as well
|
||||
* as various related events, such as when a new note is selected, or when the note content changes.
|
||||
*
|
||||
* [View the demo plugin](https://github.com/laurent22/joplin/tree/dev/CliClient/tests/support/plugins)
|
||||
*/
|
||||
export default class JoplinWorkspace {
|
||||
private store;
|
||||
constructor(_implementation: any, store: any);
|
||||
/**
|
||||
* Called when a new note or notes are selected.
|
||||
*/
|
||||
onNoteSelectionChange(callback: Function): Promise<void>;
|
||||
/**
|
||||
* Called when the content of a note changes.
|
||||
*/
|
||||
onNoteContentChange(callback: Function): Promise<void>;
|
||||
/**
|
||||
* Called when an alarm associated with a to-do is triggered.
|
||||
*/
|
||||
onNoteAlarmTrigger(callback: Function): Promise<void>;
|
||||
/**
|
||||
* Called when the synchronisation process has finished.
|
||||
*/
|
||||
onSyncComplete(callback: Function): Promise<void>;
|
||||
/**
|
||||
* Gets the currently selected note
|
||||
*/
|
||||
selectedNote(): Promise<any>;
|
||||
/**
|
||||
* Gets the IDs of the selected notes (can be zero, one, or many). Use the data API to retrieve information about these notes.
|
||||
*/
|
||||
selectedNoteIds(): Promise<string[]>;
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
import type Joplin from './Joplin';
|
||||
|
||||
declare const joplin:Joplin;
|
||||
|
||||
export default joplin;
|
||||
@@ -1,279 +0,0 @@
|
||||
// =================================================================
|
||||
// Command API types
|
||||
// =================================================================
|
||||
|
||||
export interface Command {
|
||||
name: string
|
||||
label: string
|
||||
iconName?: string,
|
||||
execute(props:any):Promise<any>
|
||||
isEnabled?(props:any):boolean
|
||||
mapStateToProps?(state:any):any
|
||||
}
|
||||
|
||||
// =================================================================
|
||||
// Interop API types
|
||||
// =================================================================
|
||||
|
||||
export enum FileSystemItem {
|
||||
File = 'file',
|
||||
Directory = 'directory',
|
||||
}
|
||||
|
||||
export enum ImportModuleOutputFormat {
|
||||
Markdown = 'md',
|
||||
Html = 'html',
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to implement a module to export data from Joplin. [View the demo plugin](https://github.com/laurent22/joplin/tree/dev/CliClient/tests/support/plugins/json_export) for an example.
|
||||
*
|
||||
* In general, all the event handlers you'll need to implement take a `context` object as a first argument. This object will contain the export or import path as well as various optional properties, such as which notes or notebooks need to be exported.
|
||||
*
|
||||
* To get a better sense of what it will contain it can be useful to print it using `console.info(context)`.
|
||||
*/
|
||||
export interface ExportModule {
|
||||
/**
|
||||
* The format to be exported, eg "enex", "jex", "json", etc.
|
||||
*/
|
||||
format: string,
|
||||
|
||||
/**
|
||||
* The description that will appear in the UI, for example in the menu item.
|
||||
*/
|
||||
description: string,
|
||||
|
||||
/**
|
||||
* Whether the module will export a single file or multiple files in a directory. It affects the open dialog that will be presented to the user when using your exporter.
|
||||
*/
|
||||
target: FileSystemItem,
|
||||
|
||||
/**
|
||||
* Only applies to single file exporters or importers
|
||||
* It tells whether the format can package multiple notes into one file.
|
||||
* For example JEX or ENEX can, but HTML cannot.
|
||||
*/
|
||||
isNoteArchive: boolean,
|
||||
|
||||
/**
|
||||
* The extensions of the files exported by your module. For example, it is `["htm", "html"]` for the HTML module, and just `["jex"]` for the JEX module.
|
||||
*/
|
||||
fileExtensions?: string[],
|
||||
|
||||
/**
|
||||
* Called when the export process starts.
|
||||
*/
|
||||
onInit(context:ExportContext): Promise<void>;
|
||||
|
||||
/**
|
||||
* Called when an item needs to be processed. An "item" can be any Joplin object, such as a note, a folder, a notebook, etc.
|
||||
*/
|
||||
onProcessItem(context:ExportContext, itemType:number, item:any):Promise<void>;
|
||||
|
||||
/**
|
||||
* Called when a resource file needs to be exported.
|
||||
*/
|
||||
onProcessResource(context:ExportContext, resource:any, filePath:string):Promise<void>;
|
||||
|
||||
/**
|
||||
* Called when the export process is done.
|
||||
*/
|
||||
onClose(context:ExportContext):Promise<void>;
|
||||
}
|
||||
|
||||
export interface ImportModule {
|
||||
/**
|
||||
* The format to be exported, eg "enex", "jex", "json", etc.
|
||||
*/
|
||||
format: string,
|
||||
|
||||
/**
|
||||
* The description that will appear in the UI, for example in the menu item.
|
||||
*/
|
||||
description: string,
|
||||
|
||||
/**
|
||||
* Only applies to single file exporters or importers
|
||||
* It tells whether the format can package multiple notes into one file.
|
||||
* For example JEX or ENEX can, but HTML cannot.
|
||||
*/
|
||||
isNoteArchive: boolean,
|
||||
|
||||
/**
|
||||
* The type of sources that are supported by the module. Tells whether the module can import files or directories or both.
|
||||
*/
|
||||
sources: FileSystemItem[],
|
||||
|
||||
/**
|
||||
* Tells the file extensions of the exported files.
|
||||
*/
|
||||
fileExtensions?: string[],
|
||||
|
||||
/**
|
||||
* Tells the type of notes that will be generated, either HTML or Markdown (default).
|
||||
*/
|
||||
outputFormat?: ImportModuleOutputFormat,
|
||||
|
||||
/**
|
||||
* Called when the import process starts. There is only one event handler within which you should import the complete data.
|
||||
*/
|
||||
onExec(context:ImportContext): Promise<void>;
|
||||
}
|
||||
|
||||
export interface ExportOptions {
|
||||
format?: string,
|
||||
path?:string,
|
||||
sourceFolderIds?: string[],
|
||||
sourceNoteIds?: string[],
|
||||
modulePath?:string,
|
||||
target?:FileSystemItem,
|
||||
}
|
||||
|
||||
export interface ExportContext {
|
||||
destPath: string,
|
||||
options: ExportOptions,
|
||||
|
||||
/**
|
||||
* You can attach your own custom data using this propery - it will then be passed to each event handler, allowing you to keep state from one event to the next.
|
||||
*/
|
||||
userData?: any,
|
||||
}
|
||||
|
||||
export interface ImportContext {
|
||||
sourcePath: string,
|
||||
options: any,
|
||||
warnings: string[],
|
||||
}
|
||||
|
||||
// =================================================================
|
||||
// Misc types
|
||||
// =================================================================
|
||||
|
||||
export interface Script {
|
||||
onStart?(event:any):Promise<void>,
|
||||
}
|
||||
|
||||
// =================================================================
|
||||
// Menu types
|
||||
// =================================================================
|
||||
|
||||
export interface CreateMenuItemOptions {
|
||||
accelerator: string,
|
||||
}
|
||||
|
||||
export enum MenuItemLocation {
|
||||
File = 'file',
|
||||
Edit = 'edit',
|
||||
View = 'view',
|
||||
Note = 'note',
|
||||
Tools = 'tools',
|
||||
Help = 'help',
|
||||
Context = 'context',
|
||||
}
|
||||
|
||||
export interface MenuItem {
|
||||
/**
|
||||
* Command that should be associated with the menu item. All menu item should
|
||||
* have a command associated with them unless they are a sub-menu.
|
||||
*/
|
||||
commandName?: string,
|
||||
|
||||
/**
|
||||
* Accelerator associated with the menu item
|
||||
*/
|
||||
accelerator?: string,
|
||||
|
||||
/**
|
||||
* Menu items that should appear below this menu item. Allows creating a menu tree.
|
||||
*/
|
||||
submenu?: MenuItem[],
|
||||
|
||||
/**
|
||||
* Menu item label. If not specified, the command label will be used instead.
|
||||
*/
|
||||
label?: string,
|
||||
}
|
||||
|
||||
// =================================================================
|
||||
// View API types
|
||||
// =================================================================
|
||||
|
||||
export interface ButtonSpec {
|
||||
id: ButtonId,
|
||||
title?: string,
|
||||
onClick?():void,
|
||||
}
|
||||
|
||||
export type ButtonId = string;
|
||||
|
||||
export enum ToolbarButtonLocation {
|
||||
/**
|
||||
* This toolbar in the top right corner of the application. It applies to the note as a whole, including its metadata.
|
||||
*/
|
||||
NoteToolbar = 'noteToolbar',
|
||||
|
||||
/**
|
||||
* This toolbar is right above the text editor. It applies to the note body only.
|
||||
*/
|
||||
EditorToolbar = 'editorToolbar',
|
||||
}
|
||||
|
||||
export type ViewHandle = string;
|
||||
|
||||
export interface EditorCommand {
|
||||
name: string;
|
||||
value?: any;
|
||||
}
|
||||
|
||||
// =================================================================
|
||||
// Settings types
|
||||
// =================================================================
|
||||
|
||||
export enum SettingItemType {
|
||||
Int = 1,
|
||||
String = 2,
|
||||
Bool = 3,
|
||||
Array = 4,
|
||||
Object = 5,
|
||||
Button = 6,
|
||||
}
|
||||
|
||||
// Redefine a simplified interface to mask internal details
|
||||
// and to remove function calls as they would have to be async.
|
||||
export interface SettingItem {
|
||||
value: any,
|
||||
type: SettingItemType,
|
||||
public: boolean,
|
||||
label:string,
|
||||
|
||||
description?:string,
|
||||
isEnum?: boolean,
|
||||
section?: string,
|
||||
options?:any,
|
||||
appTypes?:string[],
|
||||
secure?: boolean,
|
||||
advanced?: boolean,
|
||||
minimum?: number,
|
||||
maximum?: number,
|
||||
step?: number,
|
||||
}
|
||||
|
||||
export interface SettingSection {
|
||||
label: string,
|
||||
iconName?: string,
|
||||
description?: string,
|
||||
name?: string,
|
||||
}
|
||||
|
||||
// =================================================================
|
||||
// Data API types
|
||||
// =================================================================
|
||||
|
||||
/**
|
||||
* An array of at least one element and at most three elements.
|
||||
*
|
||||
* [0]: Resource name (eg. "notes", "folders", "tags", etc.)
|
||||
* [1]: (Optional) Resource ID.
|
||||
* [2]: (Optional) Resource link.
|
||||
*/
|
||||
export type Path = string[];
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,20 +0,0 @@
|
||||
{
|
||||
"name": "joplin_plugin",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"scripts": {
|
||||
"dist": "webpack",
|
||||
"postinstall": "npm run dist"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@types/node": "^14.0.14",
|
||||
"copy-webpack-plugin": "^6.1.0",
|
||||
"ts-loader": "^7.0.5",
|
||||
"typescript": "^3.9.3",
|
||||
"webpack": "^4.43.0",
|
||||
"webpack-cli": "^3.3.11"
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
import joplin from 'api';
|
||||
|
||||
joplin.plugins.register({
|
||||
onStart: async function() {
|
||||
await (joplin.plugins as any).registerContentScript('markdownItPlugin', 'justtesting', './markdownItTestPlugin.js');
|
||||
},
|
||||
});
|
||||
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"manifest_version": 1,
|
||||
"name": "Content Script Test",
|
||||
"description": "",
|
||||
"version": "1.0.0",
|
||||
"author": "",
|
||||
"homepage_url": ""
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
function plugin(markdownIt, _options) {
|
||||
const defaultRender = markdownIt.renderer.rules.fence || function(tokens, idx, options, env, self) {
|
||||
return self.renderToken(tokens, idx, options, env, self);
|
||||
};
|
||||
|
||||
markdownIt.renderer.rules.fence = function(tokens, idx, options, env, self) {
|
||||
const token = tokens[idx];
|
||||
if (token.info !== 'justtesting') return defaultRender(tokens, idx, options, env, self);
|
||||
return `JUST TESTING: ${token.content}`;
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
default: function(_context) {
|
||||
return {
|
||||
plugin: plugin,
|
||||
}
|
||||
},
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"outDir": "./dist/",
|
||||
"module": "commonjs",
|
||||
"target": "es2015",
|
||||
"jsx": "react",
|
||||
"allowJs": true,
|
||||
"baseUrl": "."
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
const path = require('path');
|
||||
const CopyPlugin = require('copy-webpack-plugin');
|
||||
|
||||
module.exports = {
|
||||
mode: 'production',
|
||||
entry: './src/index.ts',
|
||||
target: 'node',
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.tsx?$/,
|
||||
use: 'ts-loader',
|
||||
exclude: /node_modules/,
|
||||
},
|
||||
],
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
api: path.resolve(__dirname, 'api')
|
||||
},
|
||||
extensions: [ '.tsx', '.ts', '.js' ],
|
||||
},
|
||||
output: {
|
||||
filename: 'index.js',
|
||||
path: path.resolve(__dirname, 'dist'),
|
||||
},
|
||||
plugins: [
|
||||
new CopyPlugin({
|
||||
patterns: [
|
||||
{
|
||||
from: "**/*",
|
||||
context: path.resolve(__dirname, 'src'),
|
||||
to: path.resolve(__dirname, 'dist'),
|
||||
globOptions: {
|
||||
ignore: [
|
||||
'**/*.ts',
|
||||
'**/*.tsx',
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
}),
|
||||
],
|
||||
};
|
||||
@@ -24,7 +24,7 @@ const { FileApiDriverDropbox } = require('lib/file-api-driver-dropbox.js');
|
||||
const { FileApiDriverOneDrive } = require('lib/file-api-driver-onedrive.js');
|
||||
const { FileApiDriverAmazonS3 } = require('lib/file-api-driver-amazon-s3.js');
|
||||
const BaseService = require('lib/services/BaseService').default;
|
||||
const FsDriverNode = require('lib/fs-driver-node').default;
|
||||
const { FsDriverNode } = require('lib/fs-driver-node.js');
|
||||
const { time } = require('lib/time-utils.js');
|
||||
const { shimInit } = require('lib/shim-init-node.js');
|
||||
const shim = require('lib/shim').default;
|
||||
|
||||
@@ -425,7 +425,7 @@ class Application extends BaseApplication {
|
||||
const contextMenu = Menu.buildFromTemplate([
|
||||
{ label: _('Open %s', app.electronApp().name), click: () => { app.window().show(); } },
|
||||
{ type: 'separator' },
|
||||
{ label: _('Quit'), click: () => { app.quit(); } },
|
||||
{ label: _('Exit'), click: () => { app.quit(); } },
|
||||
]);
|
||||
app.createTray(contextMenu);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import ElectronAppWrapper from './ElectronAppWrapper';
|
||||
import shim from 'lib/shim';
|
||||
|
||||
import { _, setLocale } from 'lib/locale';
|
||||
const { dirname, toSystemSlashes } = require('lib/path-utils');
|
||||
const { dirname, toSystemSlashes } = require('lib/path-utils.js');
|
||||
const { BrowserWindow, nativeTheme } = require('electron');
|
||||
|
||||
interface LastSelectedPath {
|
||||
|
||||
@@ -3,7 +3,7 @@ const shim = require('lib/shim').default;
|
||||
const Logger = require('lib/Logger').default;
|
||||
const { _ } = require('lib/locale');
|
||||
const fetch = require('node-fetch');
|
||||
const { fileExtension } = require('lib/path-utils');
|
||||
const { fileExtension } = require('lib/path-utils.js');
|
||||
const packageInfo = require('./packageInfo.js');
|
||||
const compareVersions = require('compare-versions');
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import { _ } from 'lib/locale';
|
||||
const { connect } = require('react-redux');
|
||||
const Setting = require('lib/models/Setting').default;
|
||||
const { themeStyle } = require('lib/theme');
|
||||
const pathUtils = require('lib/path-utils');
|
||||
const pathUtils = require('lib/path-utils.js');
|
||||
const SyncTargetRegistry = require('lib/SyncTargetRegistry');
|
||||
const shared = require('lib/components/shared/config-shared.js');
|
||||
const bridge = require('electron').remote.require('./bridge').default;
|
||||
|
||||
@@ -3,7 +3,7 @@ const { connect } = require('react-redux');
|
||||
const Folder = require('lib/models/Folder.js');
|
||||
const { themeStyle } = require('lib/theme');
|
||||
const { _ } = require('lib/locale');
|
||||
const { filename, basename } = require('lib/path-utils');
|
||||
const { filename, basename } = require('lib/path-utils.js');
|
||||
const { importEnex } = require('lib/import-enex');
|
||||
|
||||
class ImportScreenComponent extends React.Component {
|
||||
|
||||
@@ -4,7 +4,7 @@ import { _ } from 'lib/locale';
|
||||
const { themeStyle } = require('lib/theme');
|
||||
const DialogButtonRow = require('./DialogButtonRow.min');
|
||||
const Countable = require('countable');
|
||||
const markupLanguageUtils = require('lib/markupLanguageUtils').default;
|
||||
const markupLanguageUtils = require('lib/markupLanguageUtils');
|
||||
|
||||
interface NoteContentPropertiesDialogProps {
|
||||
themeId: number,
|
||||
|
||||
@@ -14,18 +14,20 @@ import Editor from './Editor';
|
||||
import usePluginServiceRegistration from '../../utils/usePluginServiceRegistration';
|
||||
import Setting from 'lib/models/Setting';
|
||||
import { _ } from 'lib/locale';
|
||||
import bridge from '../../../../services/bridge';
|
||||
import markdownUtils from 'lib/markdownUtils';
|
||||
import shim from 'lib/shim';
|
||||
|
||||
// @ts-ignore
|
||||
const bridge = require('electron').remote.require('./bridge').default;
|
||||
// @ts-ignore
|
||||
const Note = require('lib/models/Note.js');
|
||||
const { clipboard } = require('electron');
|
||||
const shared = require('lib/components/shared/note-screen-shared.js');
|
||||
const Menu = bridge().Menu;
|
||||
const MenuItem = bridge().MenuItem;
|
||||
const markdownUtils = require('lib/markdownUtils').default;
|
||||
const { reg } = require('lib/registry.js');
|
||||
const dialogs = require('../../../dialogs');
|
||||
const { themeStyle } = require('lib/theme');
|
||||
const shim = require('lib/shim').default;
|
||||
|
||||
function markupRenderOptions(override: any = null) {
|
||||
return { ...override };
|
||||
@@ -35,19 +37,20 @@ function CodeMirror(props: NoteBodyEditorProps, ref: any) {
|
||||
const styles = styles_(props);
|
||||
|
||||
const [renderedBody, setRenderedBody] = useState<RenderedBody>(defaultRenderedBody()); // Viewer content
|
||||
const [renderedBodyContentKey, setRenderedBodyContentKey] = useState<string>(null);
|
||||
|
||||
const [webviewReady, setWebviewReady] = useState(false);
|
||||
|
||||
const previousContent = usePrevious(props.content);
|
||||
const previousRenderedBody = usePrevious(renderedBody);
|
||||
const previousSearchMarkers = usePrevious(props.searchMarkers);
|
||||
const previousContentKey = usePrevious(props.contentKey);
|
||||
|
||||
const editorRef = useRef(null);
|
||||
const rootRef = useRef(null);
|
||||
const webviewRef = useRef(null);
|
||||
const props_onChangeRef = useRef<Function>(null);
|
||||
props_onChangeRef.current = props.onChange;
|
||||
const contentKeyHasChangedRef = useRef(false);
|
||||
contentKeyHasChangedRef.current = previousContentKey !== props.contentKey;
|
||||
|
||||
const rootSize = useRootSize({ rootRef });
|
||||
|
||||
@@ -487,10 +490,7 @@ function CodeMirror(props: NoteBodyEditorProps, ref: any) {
|
||||
useEffect(() => {
|
||||
let cancelled = false;
|
||||
|
||||
// When a new note is loaded (contentKey is different), we want the note to be displayed
|
||||
// right away. However once that's done, we put a small delay so that the view is not
|
||||
// being constantly updated while the user changes the note.
|
||||
const interval = renderedBodyContentKey !== props.contentKey ? 0 : 500;
|
||||
const interval = contentKeyHasChangedRef.current ? 0 : 500;
|
||||
|
||||
const timeoutId = shim.setTimeout(async () => {
|
||||
let bodyToRender = props.content;
|
||||
@@ -501,25 +501,15 @@ function CodeMirror(props: NoteBodyEditorProps, ref: any) {
|
||||
}
|
||||
|
||||
const result = await props.markupToHtml(props.contentMarkupLanguage, bodyToRender, markupRenderOptions({ resourceInfos: props.resourceInfos }));
|
||||
|
||||
if (cancelled) return;
|
||||
|
||||
setRenderedBody(result);
|
||||
|
||||
// Since we set `renderedBodyContentKey` here, it means this effect is going to
|
||||
// be triggered again, but that's hard to avoid and the second call would be cheap
|
||||
// anyway since the renderered markdown is cached by MdToHtml. We could use a ref
|
||||
// to avoid this, but a second rendering might still happens anyway to render images,
|
||||
// resources, or for other reasons. So it's best to focus on making any second call
|
||||
// to this effect as cheap as possible with caching, etc.
|
||||
setRenderedBodyContentKey(props.contentKey);
|
||||
}, interval);
|
||||
|
||||
return () => {
|
||||
cancelled = true;
|
||||
shim.clearTimeout(timeoutId);
|
||||
};
|
||||
}, [props.content, props.contentKey, renderedBodyContentKey, props.contentMarkupLanguage, props.visiblePanes, props.resourceInfos, props.markupToHtml]);
|
||||
}, [props.content, props.contentMarkupLanguage, props.visiblePanes, props.resourceInfos, props.markupToHtml]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!webviewReady) return;
|
||||
|
||||
@@ -27,7 +27,7 @@ function markupRenderOptions(override:any = null) {
|
||||
return {
|
||||
plugins: {
|
||||
checkbox: {
|
||||
checkboxRenderingType: 2,
|
||||
renderingType: 2,
|
||||
},
|
||||
link_open: {
|
||||
linkRenderingType: 2,
|
||||
|
||||
@@ -26,20 +26,20 @@ import { AppState } from '../../app';
|
||||
import ToolbarButtonUtils from 'lib/services/commands/ToolbarButtonUtils';
|
||||
import { _ } from 'lib/locale';
|
||||
import stateToWhenClauseContext from 'lib/services/commands/stateToWhenClauseContext';
|
||||
import TagList from '../TagList';
|
||||
|
||||
const { themeStyle } = require('lib/theme');
|
||||
const { substrWithEllipsis } = require('lib/string-utils');
|
||||
const NoteSearchBar = require('../NoteSearchBar.min.js');
|
||||
const { reg } = require('lib/registry.js');
|
||||
const { time } = require('lib/time-utils.js');
|
||||
const markupLanguageUtils = require('lib/markupLanguageUtils').default;
|
||||
const markupLanguageUtils = require('lib/markupLanguageUtils');
|
||||
const usePrevious = require('lib/hooks/usePrevious').default;
|
||||
const Setting = require('lib/models/Setting').default;
|
||||
const Note = require('lib/models/Note.js');
|
||||
const bridge = require('electron').remote.require('./bridge').default;
|
||||
const ExternalEditWatcher = require('lib/services/ExternalEditWatcher');
|
||||
const NoteRevisionViewer = require('../NoteRevisionViewer.min');
|
||||
const TagList = require('../TagList.min.js');
|
||||
|
||||
const commands = [
|
||||
require('./commands/showRevisions'),
|
||||
@@ -150,11 +150,7 @@ function NoteEditor(props: NoteEditorProps) {
|
||||
return formNote.saveActionQueue.waitForAllDone();
|
||||
}
|
||||
|
||||
const markupToHtml = useMarkupToHtml({
|
||||
themeId: props.themeId,
|
||||
customCss: props.customCss,
|
||||
plugins: props.plugins,
|
||||
});
|
||||
const markupToHtml = useMarkupToHtml({ themeId: props.themeId, customCss: props.customCss });
|
||||
|
||||
const allAssets = useCallback(async (markupLanguage: number): Promise<any[]> => {
|
||||
const theme = themeStyle(props.themeId);
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
import { PluginStates } from 'lib/services/plugins/reducer';
|
||||
import contentScriptsToRendererRules from 'lib/services/plugins/utils/contentScriptsToRendererRules';
|
||||
import { useCallback, useMemo } from 'react';
|
||||
import { useCallback } from 'react';
|
||||
import { ResourceInfos } from './types';
|
||||
import markupLanguageUtils from 'lib/markupLanguageUtils';
|
||||
import Setting from 'lib/models/Setting';
|
||||
|
||||
const { themeStyle } = require('lib/theme');
|
||||
const Note = require('lib/models/Note');
|
||||
const Setting = require('lib/models/Setting').default;
|
||||
const markupLanguageUtils = require('lib/markupLanguageUtils');
|
||||
|
||||
interface HookDependencies {
|
||||
themeId: number,
|
||||
customCss: string,
|
||||
plugins: PluginStates,
|
||||
}
|
||||
|
||||
interface MarkupToHtmlOptions {
|
||||
@@ -19,15 +15,8 @@ interface MarkupToHtmlOptions {
|
||||
resourceInfos?: ResourceInfos,
|
||||
}
|
||||
|
||||
export default function useMarkupToHtml(deps:HookDependencies) {
|
||||
const { themeId, customCss, plugins } = deps;
|
||||
|
||||
const markupToHtml = useMemo(() => {
|
||||
return markupLanguageUtils.newMarkupToHtml({
|
||||
resourceBaseUrl: `file://${Setting.value('resourceDir')}/`,
|
||||
extraRendererRules: contentScriptsToRendererRules(plugins),
|
||||
});
|
||||
}, [plugins]);
|
||||
export default function useMarkupToHtml(dependencies:HookDependencies) {
|
||||
const { themeId, customCss } = dependencies;
|
||||
|
||||
return useCallback(async (markupLanguage: number, md: string, options: MarkupToHtmlOptions = null): Promise<any> => {
|
||||
options = {
|
||||
@@ -49,6 +38,10 @@ export default function useMarkupToHtml(deps:HookDependencies) {
|
||||
|
||||
delete options.replaceResourceInternalToExternalLinks;
|
||||
|
||||
const markupToHtml = markupLanguageUtils.newMarkupToHtml({
|
||||
resourceBaseUrl: `file://${Setting.value('resourceDir')}/`,
|
||||
});
|
||||
|
||||
const result = await markupToHtml.render(markupLanguage, md, theme, Object.assign({}, {
|
||||
codeTheme: theme.codeThemeCss,
|
||||
userCss: customCss || '',
|
||||
@@ -59,5 +52,5 @@ export default function useMarkupToHtml(deps:HookDependencies) {
|
||||
}, options));
|
||||
|
||||
return result;
|
||||
}, [themeId, customCss, markupToHtml]);
|
||||
}, [themeId, customCss]);
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ const { time } = require('lib/time-utils.js');
|
||||
const ReactTooltip = require('react-tooltip');
|
||||
const { urlDecode, substrWithEllipsis } = require('lib/string-utils');
|
||||
const bridge = require('electron').remote.require('./bridge').default;
|
||||
const markupLanguageUtils = require('lib/markupLanguageUtils').default;
|
||||
const markupLanguageUtils = require('lib/markupLanguageUtils');
|
||||
|
||||
class NoteRevisionViewerComponent extends React.PureComponent {
|
||||
constructor() {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import * as React from 'react';
|
||||
import app from '../app';
|
||||
import MainScreen from './MainScreen/MainScreen';
|
||||
import ConfigScreen from './ConfigScreen/ConfigScreen';
|
||||
@@ -9,7 +10,6 @@ import { themeStyle } from 'lib/theme';
|
||||
import { Size } from './ResizableLayout/ResizableLayout';
|
||||
import MenuBar from './MenuBar';
|
||||
import { _ } from 'lib/locale';
|
||||
const React = require('react');
|
||||
|
||||
const { render } = require('react-dom');
|
||||
const { connect, Provider } = require('react-redux');
|
||||
|
||||
@@ -569,20 +569,6 @@ class SideBarComponent extends React.Component<Props, State> {
|
||||
CommandService.instance().execute('newFolder');
|
||||
}
|
||||
|
||||
// componentDidUpdate(prevProps:any, prevState:any) {
|
||||
// for (const n in prevProps) {
|
||||
// if (prevProps[n] !== (this.props as any)[n]) {
|
||||
// console.info('CHANGED PROPS', n);
|
||||
// }
|
||||
// }
|
||||
|
||||
// for (const n in prevState) {
|
||||
// if (prevState[n] !== (this.state as any)[n]) {
|
||||
// console.info('CHANGED STATE', n);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
render() {
|
||||
const theme = themeStyle(this.props.themeId);
|
||||
|
||||
|
||||
52
ElectronClient/gui/TagList.jsx
Normal file
52
ElectronClient/gui/TagList.jsx
Normal file
@@ -0,0 +1,52 @@
|
||||
const React = require('react');
|
||||
const { connect } = require('react-redux');
|
||||
const { themeStyle } = require('lib/theme');
|
||||
const TagItem = require('./TagItem.min.js');
|
||||
|
||||
class TagListComponent extends React.Component {
|
||||
render() {
|
||||
const style = Object.assign({}, this.props.style);
|
||||
const theme = themeStyle(this.props.themeId);
|
||||
const tags = this.props.items;
|
||||
|
||||
style.display = 'flex';
|
||||
style.flexDirection = 'row';
|
||||
// style.borderBottom = `1px solid ${theme.dividerColor}`;
|
||||
style.boxSizing = 'border-box';
|
||||
style.fontSize = theme.fontSize;
|
||||
style.whiteSpace = 'nowrap';
|
||||
// style.height = 40;
|
||||
style.paddingTop = 8;
|
||||
style.paddingBottom = 8;
|
||||
|
||||
const tagItems = [];
|
||||
if (tags && tags.length > 0) {
|
||||
|
||||
tags.sort((a, b) => {
|
||||
return a.title < b.title ? -1 : +1;
|
||||
});
|
||||
|
||||
for (let i = 0; i < tags.length; i++) {
|
||||
const props = {
|
||||
title: tags[i].title,
|
||||
key: tags[i].id,
|
||||
};
|
||||
tagItems.push(<TagItem {...props} />);
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="tag-list" style={style}>
|
||||
{tagItems}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const mapStateToProps = state => {
|
||||
return { themeId: state.settings.theme };
|
||||
};
|
||||
|
||||
const TagList = connect(mapStateToProps)(TagListComponent);
|
||||
|
||||
module.exports = TagList;
|
||||
@@ -1,63 +0,0 @@
|
||||
import * as React from 'react';
|
||||
import { useMemo } from 'react';
|
||||
import { AppState } from '../app';
|
||||
|
||||
const { connect } = require('react-redux');
|
||||
const { themeStyle } = require('lib/theme');
|
||||
const TagItem = require('./TagItem.min.js');
|
||||
|
||||
interface Props {
|
||||
themeId: number,
|
||||
style: any,
|
||||
items: any[],
|
||||
}
|
||||
|
||||
function TagList(props:Props) {
|
||||
const style = useMemo(() => {
|
||||
const theme = themeStyle(props.themeId);
|
||||
|
||||
const output = { ...props.style };
|
||||
output.display = 'flex';
|
||||
output.flexDirection = 'row';
|
||||
output.boxSizing = 'border-box';
|
||||
output.fontSize = theme.fontSize;
|
||||
output.whiteSpace = 'nowrap';
|
||||
output.paddingTop = 8;
|
||||
output.paddingBottom = 8;
|
||||
return output;
|
||||
}, [props.style, props.themeId]);
|
||||
|
||||
const tags = useMemo(() => {
|
||||
const output = props.items.slice();
|
||||
|
||||
output.sort((a:any, b:any) => {
|
||||
return a.title < b.title ? -1 : +1;
|
||||
});
|
||||
|
||||
return output;
|
||||
}, [props.items]);
|
||||
|
||||
const tagItems = useMemo(() => {
|
||||
const output = [];
|
||||
for (let i = 0; i < tags.length; i++) {
|
||||
const props = {
|
||||
title: tags[i].title,
|
||||
key: tags[i].id,
|
||||
};
|
||||
output.push(<TagItem {...props} />);
|
||||
}
|
||||
return output;
|
||||
}, [tags]);
|
||||
|
||||
return (
|
||||
<div className="tag-list" style={style}>
|
||||
{tagItems}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
const mapStateToProps = (state:AppState) => {
|
||||
return { themeId: state.settings.theme };
|
||||
};
|
||||
|
||||
export default connect(mapStateToProps)(TagList);
|
||||
@@ -24,7 +24,7 @@ const MasterKey = require('lib/models/MasterKey');
|
||||
const Setting = require('lib/models/Setting').default;
|
||||
const Revision = require('lib/models/Revision.js');
|
||||
const Logger = require('lib/Logger').default;
|
||||
const FsDriverNode = require('lib/fs-driver-node').default;
|
||||
const { FsDriverNode } = require('lib/fs-driver-node.js');
|
||||
const { shimInit } = require('lib/shim-init-node.js');
|
||||
const EncryptionService = require('lib/services/EncryptionService');
|
||||
const bridge = require('electron').remote.require('./bridge').default;
|
||||
|
||||
@@ -7,7 +7,7 @@ const electronApp = require('electron').app;
|
||||
const ElectronAppWrapper = require('./ElectronAppWrapper').default;
|
||||
const { initBridge } = require('./bridge');
|
||||
const Logger = require('lib/Logger').default;
|
||||
const FsDriverNode = require('lib/fs-driver-node').default;
|
||||
const { FsDriverNode } = require('lib/fs-driver-node.js');
|
||||
const envFromArgs = require('lib/envFromArgs');
|
||||
|
||||
process.on('unhandledRejection', (reason, p) => {
|
||||
|
||||
2
ElectronClient/package-lock.json
generated
2
ElectronClient/package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "Joplin",
|
||||
"version": "1.3.7",
|
||||
"version": "1.3.5",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "Joplin",
|
||||
"version": "1.3.7",
|
||||
"version": "1.3.5",
|
||||
"description": "Joplin for Desktop",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
|
||||
@@ -16,7 +16,7 @@ const { ItemList } = require('../gui/ItemList.min');
|
||||
const HelpButton = require('../gui/HelpButton.min');
|
||||
const { surroundKeywords, nextWhitespaceIndex, removeDiacritics } = require('lib/string-utils.js');
|
||||
const { mergeOverlappingIntervals } = require('lib/ArrayUtils.js');
|
||||
const markupLanguageUtils = require('lib/markupLanguageUtils').default;
|
||||
const markupLanguageUtils = require('lib/markupLanguageUtils');
|
||||
|
||||
const PLUGIN_NAME = 'gotoAnything';
|
||||
|
||||
|
||||
@@ -96,14 +96,11 @@ export default class PluginRunner extends BasePluginRunner {
|
||||
if (message.pluginId !== plugin.id) return;
|
||||
|
||||
const mappedArgs = mapEventIdsToHandlers(plugin.id, message.args);
|
||||
const fullPath = `joplin.${message.path}`;
|
||||
|
||||
this.logger().debug(`PluginRunner: execute call: ${fullPath}: ${mappedArgs}`);
|
||||
|
||||
let result:any = null;
|
||||
let error:any = null;
|
||||
try {
|
||||
result = await executeSandboxCall(plugin.id, pluginApi, fullPath, mappedArgs, this.eventHandler);
|
||||
result = await executeSandboxCall(plugin.id, pluginApi, `joplin.${message.path}`, mappedArgs, this.eventHandler);
|
||||
} catch (e) {
|
||||
error = e ? e : new Error('Unknown error');
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ export interface Props {
|
||||
onMessage:Function,
|
||||
pluginId:string,
|
||||
viewId:string,
|
||||
themeId:number,
|
||||
themeId:string,
|
||||
minWidth?: number,
|
||||
minHeight?: number,
|
||||
fitToContent?: boolean,
|
||||
|
||||
@@ -6,7 +6,7 @@ const { camelCaseToDash, formatCssSize } = require('lib/string-utils');
|
||||
|
||||
interface HookDependencies {
|
||||
pluginId: string,
|
||||
themeId: number,
|
||||
themeId: string,
|
||||
}
|
||||
|
||||
function themeToCssVariables(theme:any) {
|
||||
|
||||
@@ -3,5 +3,5 @@
|
||||
# This is a convenient way to build and test a plugin demo.
|
||||
# It could be used to develop plugins too.
|
||||
|
||||
PLUGIN_PATH=/home/laurent/source/joplin/CliClient/tests/support/plugins/content_script
|
||||
PLUGIN_PATH=/home/laurent/source/joplin/CliClient/tests/support/plugins/settings
|
||||
npm i --prefix="$PLUGIN_PATH" && npm start -- --dev-plugins "$PLUGIN_PATH"
|
||||
15
README.md
15
README.md
@@ -48,7 +48,7 @@ There are other ways to install the terminal application. However, they are not
|
||||
Operating system | Method
|
||||
-----------------|----------------
|
||||
macOS | `brew install joplin`
|
||||
Arch Linux | An Arch Linux package is available [here](https://aur.archlinux.org/packages/joplin/). To install it, use an AUR wrapper such as yay: `yay -S joplin`. Both the CLI tool (type `joplin`) and desktop app (type `joplin-desktop`) are packaged. You can also install a compiled version with the [chaotic-aur](https://wiki.archlinux.org/index.php/Unofficial_user_repositories#chaotic-aur) repository. For support, please go to the [GitHub repo](https://github.com/masterkorp/joplin-pkgbuild). If you are interested in [pre-release](https://joplinapp.org/prereleases/) you have [joplin-beta](https://aur.archlinux.org/packages/joplin-beta).
|
||||
Arch Linux | An Arch Linux package is available [here](https://aur.archlinux.org/packages/joplin/). To install it, use an AUR wrapper such as yay: `yay -S joplin`. Both the CLI tool (type `joplin`) and desktop app (type `joplin-desktop`) are packaged. You can also install a compiled version with the [chaotic-aur](https://wiki.archlinux.org/index.php/Unofficial_user_repositories#chaotic-aur) repository. For support, please go to the [GitHub repo](https://github.com/masterkorp/joplin-pkgbuild).
|
||||
|
||||
## Web Clipper
|
||||
|
||||
@@ -322,9 +322,6 @@ The currently supported template variables are:
|
||||
# Searching
|
||||
|
||||
Joplin implements the SQLite Full Text Search (FTS4) extension. It means the content of all the notes is indexed in real time and search queries return results very fast. Both [Simple FTS Queries](https://www.sqlite.org/fts3.html#simple_fts_queries) and [Full-Text Index Queries](https://www.sqlite.org/fts3.html#full_text_index_queries) are supported. See below for the list of supported queries:
|
||||
|
||||
## Supported queries
|
||||
|
||||
Search type | Description | Example
|
||||
------------|-------------|---------
|
||||
Single word | Returns all the notes that contain this term. | For example, searching for `cat` will return all the notes that contain this exact word. Note: it will not return the notes that contain the substring - thus, for "cat", notes that contain "cataclysmic" or "prevaricate" will **not** be returned.
|
||||
@@ -333,10 +330,8 @@ Phrase | Add double quotes to return the notes that contain exactly this phrase.
|
||||
Prefix | Add a wildcard to return all the notes that contain a term with a specified prefix. | `swim*` - will return all the notes that contain eg. "swim", but also "swimming", "swimsuit", etc. IMPORTANT: The wildcard **can only be at the end** - it will be ignored at the beginning of a word (eg. `*swim`) and will be treated as a literal asterisk in the middle of a word (eg. `ast*rix`)
|
||||
Switch to basic search | One drawback of Full Text Search is that it ignores most non-alphabetical characters. However in some cases you might want to search for this too. To do that, you can use basic search. You switch to this mode by prefixing your search with a slash `/`. This won't provide the benefits of FTS but it will allow searching exactly for what you need. Note that it can also be much slower, even extremely slow, depending on your query. | `/"- [ ]"` - will return all the notes that contain unchecked checkboxes.
|
||||
|
||||
## Search filters
|
||||
|
||||
You can also use search filters to further restrict the search.
|
||||
|
||||
| Operator | Description | Example |
|
||||
| --- | --- | --- |
|
||||
|**-**|If placed before a text term, it excludes the notes that contain that term. You can also place it before a filter to negate it. |`-spam` searches for all notes without the word `spam`.<br>`office -trash` searches for all notes with the word`office` and without the word `trash`.|
|
||||
@@ -354,14 +349,6 @@ You can also use search filters to further restrict the search.
|
||||
Note: In CliClient you have to escape the query using `--` when using negated filters.
|
||||
Eg. `:search -- "-tag:tag1"`.
|
||||
|
||||
The filters are implicitely connected by and/or connective depending on the following rules;
|
||||
|
||||
- By default, all filters are connected by "AND".
|
||||
- To override this default behaviour, use the `any` filter, in which case the search terms will be connected by "OR" instead.
|
||||
- There's an exception for the `notebook` filters which are connected by "OR". The reason being that no note can be in multiple notebooks at once.
|
||||
|
||||
## Search order
|
||||
|
||||
Notes are sorted by "relevance". Currently it means the notes that contain the requested terms the most times are on top. For queries with multiple terms, it also matters how close to each other the terms are. This is a bit experimental so if you notice a search query that returns unexpected results, please report it in the forum, providing as many details as possible to replicate the issue.
|
||||
|
||||
# Goto Anything
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import shim from 'lib/shim';
|
||||
const { dirname } = require('lib/path-utils');
|
||||
const { dirname } = require('lib/path-utils.js');
|
||||
const Setting = require('lib/models/Setting').default;
|
||||
const pluginAssets = require('./pluginAssets/index');
|
||||
const KvStore = require('lib/services/KvStore.js');
|
||||
|
||||
@@ -43,7 +43,7 @@ const DecryptionWorker = require('lib/services/DecryptionWorker');
|
||||
const { loadKeychainServiceAndSettings } = require('lib/services/SettingUtils');
|
||||
const KvStore = require('lib/services/KvStore');
|
||||
const MigrationService = require('lib/services/MigrationService');
|
||||
const { toSystemSlashes } = require('lib/path-utils');
|
||||
const { toSystemSlashes } = require('lib/path-utils.js');
|
||||
const { setAutoFreeze } = require('immer');
|
||||
|
||||
// const ntpClient = require('lib/vendor/ntp-client');
|
||||
@@ -546,13 +546,7 @@ export default class BaseApplication {
|
||||
await this.refreshNotes(newState, refreshNotesUseSelectedNoteId, refreshNotesHash);
|
||||
}
|
||||
|
||||
if (action.type === 'NOTE_UPDATE_ONE') {
|
||||
if (!action.changedFields.length || action.changedFields.includes('parent_id') || action.changedFields.includes('encryption_applied')) {
|
||||
refreshFolders = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (action.type === 'NOTE_DELETE') {
|
||||
if (action.type === 'NOTE_UPDATE_ONE' || action.type === 'NOTE_DELETE') {
|
||||
refreshFolders = true;
|
||||
}
|
||||
|
||||
@@ -702,9 +696,7 @@ export default class BaseApplication {
|
||||
initArgs = Object.assign(initArgs, extraFlags);
|
||||
|
||||
this.logger_.addTarget(TargetType.File, { path: `${profileDir}/log.txt` });
|
||||
if (Setting.value('env') === 'dev' && !shim.isTestingEnv()) {
|
||||
// this.logger_.addTarget(TargetType.Console, { level: Logger.LEVEL_DEBUG });
|
||||
}
|
||||
// this.logger_.addTarget(TargetType.Console, { level: Logger.LEVEL_DEBUG });
|
||||
this.logger_.setLevel(initArgs.logLevel);
|
||||
|
||||
reg.setLogger(this.logger_);
|
||||
|
||||
@@ -2,7 +2,7 @@ import shim from 'lib/shim';
|
||||
import { _ } from 'lib/locale';
|
||||
const Logger = require('lib/Logger').default;
|
||||
const JoplinError = require('lib/JoplinError');
|
||||
const { rtrimSlashes } = require('lib/path-utils');
|
||||
const { rtrimSlashes } = require('lib/path-utils.js');
|
||||
const base64 = require('base-64');
|
||||
|
||||
interface JoplinServerApiOptions {
|
||||
|
||||
@@ -41,8 +41,6 @@ class SyncTargetAmazonS3 extends BaseSyncTarget {
|
||||
accessKeyId: Setting.value('sync.8.username'),
|
||||
secretAccessKey: Setting.value('sync.8.password'),
|
||||
s3UseArnRegion: true, // override the request region with the region inferred from requested resource's ARN
|
||||
s3ForcePathStyle: true,
|
||||
endpoint: Setting.value('sync.8.url'),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -58,8 +56,6 @@ class SyncTargetAmazonS3 extends BaseSyncTarget {
|
||||
accessKeyId: options.username(),
|
||||
secretAccessKey: options.password(),
|
||||
s3UseArnRegion: true,
|
||||
s3ForcePathStyle: true,
|
||||
endpoint: options.url(),
|
||||
};
|
||||
|
||||
const api = new S3(apiOptions);
|
||||
|
||||
@@ -3,7 +3,7 @@ const shim = require('lib/shim').default;
|
||||
const parseXmlString = require('xml2js').parseString;
|
||||
const JoplinError = require('lib/JoplinError');
|
||||
const URL = require('url-parse');
|
||||
const { rtrimSlashes } = require('lib/path-utils');
|
||||
const { rtrimSlashes } = require('lib/path-utils.js');
|
||||
const base64 = require('base-64');
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { useEffect, useState, useMemo } from 'react';
|
||||
import shim from 'lib/shim';
|
||||
import Setting from 'lib/models/Setting';
|
||||
const { themeStyle } = require('lib/components/global-style.js');
|
||||
const markupLanguageUtils = require('lib/markupLanguageUtils').default;
|
||||
const markupLanguageUtils = require('lib/markupLanguageUtils');
|
||||
const { assetsToHeaders } = require('lib/joplin-renderer');
|
||||
|
||||
interface Source {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import * as React from 'react';
|
||||
import { View, Button, Text } from 'react-native';
|
||||
import { themeStyle } from 'lib/theme';
|
||||
import { _ } from 'lib/locale';
|
||||
const { View, Button, Text } = require('react-native');
|
||||
|
||||
const PopupDialog = require('react-native-popup-dialog').default;
|
||||
const { DialogTitle, DialogButton } = require('react-native-popup-dialog');
|
||||
|
||||
@@ -22,7 +22,7 @@ const { BackButtonService } = require('lib/services/back-button.js');
|
||||
const NavService = require('lib/services/NavService.js');
|
||||
const BaseModel = require('lib/BaseModel.js');
|
||||
const { ActionButton } = require('lib/components/action-button.js');
|
||||
const { fileExtension, safeFileExtension } = require('lib/path-utils');
|
||||
const { fileExtension, safeFileExtension } = require('lib/path-utils.js');
|
||||
const mimeUtils = require('lib/mime-utils.js').mime;
|
||||
const { ScreenHeader } = require('lib/components/screen-header.js');
|
||||
const NoteTagsDialog = require('lib/components/screens/NoteTagsDialog');
|
||||
|
||||
@@ -43,11 +43,8 @@ const reduxSharedMiddleware = async function(store, next, action) {
|
||||
DecryptionWorker.instance().scheduleStart();
|
||||
}
|
||||
|
||||
// 2020-10-19: Removed "NOTE_UPDATE_ONE" because there's no property in a note that
|
||||
// should trigger a refreshing of the tags.
|
||||
// Trying to fix this: https://github.com/laurent22/joplin/issues/3893
|
||||
if (action.type == 'NOTE_DELETE' ||
|
||||
// action.type == 'NOTE_UPDATE_ONE' ||
|
||||
action.type == 'NOTE_UPDATE_ONE' ||
|
||||
action.type == 'NOTE_UPDATE_ALL' ||
|
||||
action.type == 'NOTE_TAG_REMOVE' ||
|
||||
action.type == 'TAG_UPDATE_ONE') {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const moment = require('moment');
|
||||
const { dirname, basename } = require('lib/path-utils');
|
||||
const { dirname, basename } = require('lib/path-utils.js');
|
||||
const shim = require('lib/shim').default;
|
||||
|
||||
class FileApiDriverOneDrive {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const { basicDelta } = require('lib/file-api');
|
||||
const { rtrimSlashes, ltrimSlashes } = require('lib/path-utils');
|
||||
const { rtrimSlashes, ltrimSlashes } = require('lib/path-utils.js');
|
||||
const JoplinError = require('lib/JoplinError');
|
||||
|
||||
class FileApiDriverWebDav {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { isHidden } = require('lib/path-utils');
|
||||
const { isHidden } = require('lib/path-utils.js');
|
||||
const Logger = require('lib/Logger').default;
|
||||
const shim = require('lib/shim').default;
|
||||
const BaseItem = require('lib/models/BaseItem.js');
|
||||
|
||||
@@ -1,24 +1,21 @@
|
||||
import { resolve as nodeResolve } from 'path';
|
||||
|
||||
const fs = require('fs-extra');
|
||||
const { time } = require('lib/time-utils.js');
|
||||
const FsDriverBase = require('lib/fs-driver-base');
|
||||
|
||||
export default class FsDriverNode extends FsDriverBase {
|
||||
|
||||
private fsErrorToJsError_(error:any, path:string = null) {
|
||||
class FsDriverNode extends FsDriverBase {
|
||||
fsErrorToJsError_(error, path = null) {
|
||||
let msg = error.toString();
|
||||
if (path !== null) msg += `. Path: ${path}`;
|
||||
const output:any = new Error(msg);
|
||||
const output = new Error(msg);
|
||||
if (error.code) output.code = error.code;
|
||||
return output;
|
||||
}
|
||||
|
||||
public appendFileSync(path:string, string:string) {
|
||||
appendFileSync(path, string) {
|
||||
return fs.appendFileSync(path, string);
|
||||
}
|
||||
|
||||
public async appendFile(path:string, string:string, encoding:string = 'base64') {
|
||||
async appendFile(path, string, encoding = 'base64') {
|
||||
try {
|
||||
return await fs.appendFile(path, string, { encoding: encoding });
|
||||
} catch (error) {
|
||||
@@ -26,7 +23,7 @@ export default class FsDriverNode extends FsDriverBase {
|
||||
}
|
||||
}
|
||||
|
||||
public async writeBinaryFile(path:string, content:any) {
|
||||
async writeBinaryFile(path, content) {
|
||||
try {
|
||||
// let buffer = new Buffer(content);
|
||||
const buffer = Buffer.from(content);
|
||||
@@ -36,7 +33,7 @@ export default class FsDriverNode extends FsDriverBase {
|
||||
}
|
||||
}
|
||||
|
||||
public async writeFile(path:string, string:string, encoding:string = 'base64') {
|
||||
async writeFile(path, string, encoding = 'base64') {
|
||||
try {
|
||||
if (encoding === 'buffer') {
|
||||
return await fs.writeFile(path, string);
|
||||
@@ -49,7 +46,7 @@ export default class FsDriverNode extends FsDriverBase {
|
||||
}
|
||||
|
||||
// same as rm -rf
|
||||
public async remove(path:string) {
|
||||
async remove(path) {
|
||||
try {
|
||||
const r = await fs.remove(path);
|
||||
return r;
|
||||
@@ -58,7 +55,7 @@ export default class FsDriverNode extends FsDriverBase {
|
||||
}
|
||||
}
|
||||
|
||||
public async move(source:string, dest:string) {
|
||||
async move(source, dest) {
|
||||
let lastError = null;
|
||||
|
||||
for (let i = 0; i < 5; i++) {
|
||||
@@ -80,11 +77,11 @@ export default class FsDriverNode extends FsDriverBase {
|
||||
throw lastError;
|
||||
}
|
||||
|
||||
public exists(path:string) {
|
||||
exists(path) {
|
||||
return fs.pathExists(path);
|
||||
}
|
||||
|
||||
public async mkdir(path:string) {
|
||||
async mkdir(path) {
|
||||
// Note that mkdirp() does not throw an error if the directory
|
||||
// could not be created. This would make the synchroniser to
|
||||
// incorrectly try to sync with a non-existing dir:
|
||||
@@ -94,7 +91,7 @@ export default class FsDriverNode extends FsDriverBase {
|
||||
return r;
|
||||
}
|
||||
|
||||
public async stat(path:string) {
|
||||
async stat(path) {
|
||||
try {
|
||||
const stat = await fs.stat(path);
|
||||
return {
|
||||
@@ -110,11 +107,11 @@ export default class FsDriverNode extends FsDriverBase {
|
||||
}
|
||||
}
|
||||
|
||||
public async setTimestamp(path:string, timestampDate:any) {
|
||||
async setTimestamp(path, timestampDate) {
|
||||
return fs.utimes(path, timestampDate, timestampDate);
|
||||
}
|
||||
|
||||
public async readDirStats(path:string, options:any = null) {
|
||||
async readDirStats(path, options = null) {
|
||||
if (!options) options = {};
|
||||
if (!('recursive' in options)) options.recursive = false;
|
||||
|
||||
@@ -138,7 +135,7 @@ export default class FsDriverNode extends FsDriverBase {
|
||||
return output;
|
||||
}
|
||||
|
||||
public async open(path:string, mode:any) {
|
||||
async open(path, mode) {
|
||||
try {
|
||||
return await fs.open(path, mode);
|
||||
} catch (error) {
|
||||
@@ -146,7 +143,7 @@ export default class FsDriverNode extends FsDriverBase {
|
||||
}
|
||||
}
|
||||
|
||||
public async close(handle:any) {
|
||||
async close(handle) {
|
||||
try {
|
||||
return await fs.close(handle);
|
||||
} catch (error) {
|
||||
@@ -154,7 +151,7 @@ export default class FsDriverNode extends FsDriverBase {
|
||||
}
|
||||
}
|
||||
|
||||
public async readFile(path:string, encoding:string = 'utf8') {
|
||||
async readFile(path, encoding = 'utf8') {
|
||||
try {
|
||||
if (encoding === 'Buffer') return await fs.readFile(path); // Returns the raw buffer
|
||||
return await fs.readFile(path, encoding);
|
||||
@@ -164,7 +161,7 @@ export default class FsDriverNode extends FsDriverBase {
|
||||
}
|
||||
|
||||
// Always overwrite destination
|
||||
public async copy(source:string, dest:string) {
|
||||
async copy(source, dest) {
|
||||
try {
|
||||
return await fs.copy(source, dest, { overwrite: true });
|
||||
} catch (error) {
|
||||
@@ -172,7 +169,7 @@ export default class FsDriverNode extends FsDriverBase {
|
||||
}
|
||||
}
|
||||
|
||||
public async unlink(path:string) {
|
||||
async unlink(path) {
|
||||
try {
|
||||
await fs.unlink(path);
|
||||
} catch (error) {
|
||||
@@ -181,7 +178,7 @@ export default class FsDriverNode extends FsDriverBase {
|
||||
}
|
||||
}
|
||||
|
||||
public async readFileChunk(handle:any, length:number, encoding:string = 'base64') {
|
||||
async readFileChunk(handle, length, encoding = 'base64') {
|
||||
// let buffer = new Buffer(length);
|
||||
let buffer = Buffer.alloc(length);
|
||||
const result = await fs.read(handle, buffer, 0, length, null);
|
||||
@@ -192,17 +189,10 @@ export default class FsDriverNode extends FsDriverBase {
|
||||
throw new Error(`Unsupported encoding: ${encoding}`);
|
||||
}
|
||||
|
||||
public resolve(path:string) {
|
||||
resolve(path) {
|
||||
return require('path').resolve(path);
|
||||
}
|
||||
|
||||
// Resolves the provided relative path to an absolute path within baseDir. The function
|
||||
// also checks that the absolute path is within baseDir, to avoid security issues.
|
||||
// It is expected that baseDir is a safe path (not user-provided).
|
||||
public resolveRelativePathWithinDir(baseDir:string, relativePath:string) {
|
||||
const resolvedPath = nodeResolve(baseDir, relativePath);
|
||||
if (resolvedPath.indexOf(baseDir) !== 0) throw new Error('Resolved path for relative path "' + relativePath + '" is not within base directory "' + baseDir + '"');
|
||||
return resolvedPath;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports.FsDriverNode = FsDriverNode;
|
||||
@@ -160,10 +160,6 @@ class FsDriverRN extends FsDriverBase {
|
||||
resolve(path) {
|
||||
throw new Error(`Not implemented: resolve(): ${path}`);
|
||||
}
|
||||
|
||||
resolveRelativePathWithinDir(_baseDir, relativePath) {
|
||||
throw new Error(`Not implemented: resolveRelativePathWithinDir(): ${relativePath}`);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports.FsDriverRN = FsDriverRN;
|
||||
|
||||
@@ -556,7 +556,7 @@ function enexXmlToMdArray(stream, resources) {
|
||||
} else if (isStrongTag(n)) {
|
||||
section.lines.push('**');
|
||||
} else if (isStrikeTag(n)) {
|
||||
section.lines.push('<s>');
|
||||
section.lines.push('(');
|
||||
} else if (isInlineCodeTag(n)) {
|
||||
section.lines.push('`');
|
||||
} else if (n == 'q') {
|
||||
@@ -739,7 +739,7 @@ function enexXmlToMdArray(stream, resources) {
|
||||
} else if (isStrongTag(n)) {
|
||||
section.lines.push('**');
|
||||
} else if (isStrikeTag(n)) {
|
||||
section.lines.push('</s>');
|
||||
section.lines.push(')');
|
||||
} else if (isInlineCodeTag(n)) {
|
||||
section.lines.push('`');
|
||||
} else if (isEmTag(n)) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
const htmlUtils = require('./htmlUtils');
|
||||
const utils = require('./utils');
|
||||
const noteStyle = require('./noteStyle').default;
|
||||
const noteStyle = require('./noteStyle');
|
||||
const Setting = require('lib/models/Setting').default;
|
||||
const { themeStyle } = require('lib/theme');
|
||||
const InMemoryCache = require('lib/InMemoryCache').default;
|
||||
|
||||
@@ -1,31 +1,20 @@
|
||||
const MdToHtml = require('./MdToHtml').default;
|
||||
const MdToHtml = require('./MdToHtml');
|
||||
const HtmlToHtml = require('./HtmlToHtml');
|
||||
const htmlUtils = require('lib/htmlUtils');
|
||||
const MarkdownIt = require('markdown-it');
|
||||
|
||||
export enum MarkupLanguage {
|
||||
Markdown = 1,
|
||||
Html = 2,
|
||||
}
|
||||
|
||||
export default class MarkupToHtml {
|
||||
|
||||
static MARKUP_LANGUAGE_MARKDOWN:number = MarkupLanguage.Markdown;
|
||||
static MARKUP_LANGUAGE_HTML:number = MarkupLanguage.Html;
|
||||
|
||||
private renderers_:any = {};
|
||||
private options_:any;
|
||||
private rawMarkdownIt_:any;
|
||||
|
||||
constructor(options:any) {
|
||||
class MarkupToHtml {
|
||||
constructor(options) {
|
||||
this.options_ = Object.assign({}, {
|
||||
ResourceModel: {
|
||||
isResourceUrl: () => false,
|
||||
},
|
||||
}, options);
|
||||
|
||||
this.renderers_ = {};
|
||||
}
|
||||
|
||||
renderer(markupLanguage:MarkupLanguage) {
|
||||
renderer(markupLanguage) {
|
||||
if (this.renderers_[markupLanguage]) return this.renderers_[markupLanguage];
|
||||
|
||||
let RendererClass = null;
|
||||
@@ -42,7 +31,11 @@ export default class MarkupToHtml {
|
||||
return this.renderers_[markupLanguage];
|
||||
}
|
||||
|
||||
stripMarkup(markupLanguage:MarkupLanguage, markup:string, options:any = null) {
|
||||
injectedJavaScript() {
|
||||
return '';
|
||||
}
|
||||
|
||||
stripMarkup(markupLanguage, markup, options = null) {
|
||||
if (!markup) return '';
|
||||
|
||||
options = Object.assign({}, {
|
||||
@@ -70,16 +63,21 @@ export default class MarkupToHtml {
|
||||
return output;
|
||||
}
|
||||
|
||||
clearCache(markupLanguage:MarkupLanguage) {
|
||||
clearCache(markupLanguage) {
|
||||
const r = this.renderer(markupLanguage);
|
||||
if (r.clearCache) r.clearCache();
|
||||
}
|
||||
|
||||
async render(markupLanguage:MarkupLanguage, markup:string, theme:any, options:any) {
|
||||
async render(markupLanguage, markup, theme, options) {
|
||||
return this.renderer(markupLanguage).render(markup, theme, options);
|
||||
}
|
||||
|
||||
async allAssets(markupLanguage:MarkupLanguage, theme:any) {
|
||||
async allAssets(markupLanguage, theme) {
|
||||
return this.renderer(markupLanguage).allAssets(theme);
|
||||
}
|
||||
}
|
||||
|
||||
MarkupToHtml.MARKUP_LANGUAGE_MARKDOWN = 1;
|
||||
MarkupToHtml.MARKUP_LANGUAGE_HTML = 2;
|
||||
|
||||
module.exports = MarkupToHtml;
|
||||
@@ -1,51 +1,31 @@
|
||||
import InMemoryCache from 'lib/InMemoryCache';
|
||||
import noteStyle from './noteStyle';
|
||||
import { fileExtension } from './pathUtils';
|
||||
|
||||
const MarkdownIt = require('markdown-it');
|
||||
const md5 = require('md5');
|
||||
|
||||
interface RendererRule {
|
||||
install(context:any, ruleOptions:any):any,
|
||||
assets?(theme:any):any,
|
||||
plugin?: any,
|
||||
}
|
||||
|
||||
interface RendererRules {
|
||||
[pluginName:string]: RendererRule,
|
||||
}
|
||||
|
||||
interface RendererPlugin {
|
||||
module: any,
|
||||
options?: any,
|
||||
}
|
||||
|
||||
interface RendererPlugins {
|
||||
[pluginName:string]: RendererPlugin,
|
||||
}
|
||||
const noteStyle = require('./noteStyle');
|
||||
const { fileExtension } = require('./pathUtils');
|
||||
const InMemoryCache = require('lib/InMemoryCache').default;
|
||||
|
||||
// /!\/!\ Note: the order of rules is important!! /!\/!\
|
||||
const rules:RendererRules = {
|
||||
const rules = {
|
||||
fence: require('./MdToHtml/rules/fence').default,
|
||||
sanitize_html: require('./MdToHtml/rules/sanitize_html').default,
|
||||
image: require('./MdToHtml/rules/image').default,
|
||||
image: require('./MdToHtml/rules/image'),
|
||||
checkbox: require('./MdToHtml/rules/checkbox').default,
|
||||
katex: require('./MdToHtml/rules/katex').default,
|
||||
link_open: require('./MdToHtml/rules/link_open').default,
|
||||
html_image: require('./MdToHtml/rules/html_image').default,
|
||||
highlight_keywords: require('./MdToHtml/rules/highlight_keywords').default,
|
||||
code_inline: require('./MdToHtml/rules/code_inline').default,
|
||||
fountain: require('./MdToHtml/rules/fountain').default,
|
||||
katex: require('./MdToHtml/rules/katex'),
|
||||
link_open: require('./MdToHtml/rules/link_open'),
|
||||
html_image: require('./MdToHtml/rules/html_image'),
|
||||
highlight_keywords: require('./MdToHtml/rules/highlight_keywords'),
|
||||
code_inline: require('./MdToHtml/rules/code_inline'),
|
||||
fountain: require('./MdToHtml/rules/fountain'),
|
||||
mermaid: require('./MdToHtml/rules/mermaid').default,
|
||||
};
|
||||
|
||||
// const eventManager = require('lib/eventManager').default;
|
||||
const setupLinkify = require('./MdToHtml/setupLinkify');
|
||||
const hljs = require('highlight.js');
|
||||
const uslug = require('uslug');
|
||||
const markdownItAnchor = require('markdown-it-anchor');
|
||||
|
||||
// The keys must match the corresponding entry in Setting.js
|
||||
const plugins:RendererPlugins = {
|
||||
const plugins = {
|
||||
mark: { module: require('markdown-it-mark') },
|
||||
footnote: { module: require('markdown-it-footnote') },
|
||||
sub: { module: require('markdown-it-sub') },
|
||||
@@ -60,119 +40,29 @@ const plugins:RendererPlugins = {
|
||||
};
|
||||
const defaultNoteStyle = require('./defaultNoteStyle');
|
||||
|
||||
function slugify(s:string):string {
|
||||
function slugify(s) {
|
||||
return uslug(s);
|
||||
}
|
||||
|
||||
// Share across all instances of MdToHtml
|
||||
const inMemoryCache = new InMemoryCache(20);
|
||||
|
||||
export interface ExtraRendererRule {
|
||||
id: string,
|
||||
module: any,
|
||||
}
|
||||
|
||||
export interface Options {
|
||||
resourceBaseUrl?: string,
|
||||
ResourceModel?: any,
|
||||
pluginOptions?: any,
|
||||
tempDir?: string,
|
||||
fsDriver?: any,
|
||||
extraRendererRules?: ExtraRendererRule[],
|
||||
}
|
||||
|
||||
interface PluginAsset {
|
||||
mime?: string,
|
||||
inline?: boolean,
|
||||
name?: string,
|
||||
text?: string,
|
||||
}
|
||||
|
||||
// Types are a bit of a mess when it comes to plugin assets. Something
|
||||
// called "pluginAsset" in this class might refer to sublty different
|
||||
// types. The logic should be cleaned up before types are added.
|
||||
interface PluginAssets {
|
||||
[pluginName:string]: PluginAsset[];
|
||||
}
|
||||
|
||||
interface PluginContext {
|
||||
css: any
|
||||
pluginAssets: any,
|
||||
cache: any,
|
||||
userData: any,
|
||||
}
|
||||
|
||||
interface RenderResultPluginAsset {
|
||||
name: string,
|
||||
path: string,
|
||||
mime: string,
|
||||
}
|
||||
|
||||
interface RenderResult {
|
||||
html: string,
|
||||
pluginAssets: RenderResultPluginAsset[];
|
||||
cssStrings: string[],
|
||||
}
|
||||
|
||||
export interface RuleOptions {
|
||||
context: PluginContext,
|
||||
theme: any,
|
||||
postMessageSyntax: string,
|
||||
ResourceModel: any,
|
||||
resourceBaseUrl: string,
|
||||
resources: any, // resourceId: Resource
|
||||
|
||||
// Used by checkboxes to specify how it should be rendered
|
||||
checkboxRenderingType?: number,
|
||||
|
||||
// Used by the keyword highlighting plugin (mobile only)
|
||||
highlightedKeywords?: any[],
|
||||
|
||||
// Use by resource-rendering logic to signify that it should be rendered
|
||||
// as a plain HTML string without any attached JavaScript. Used for example
|
||||
// when exporting to HTML.
|
||||
plainResourceRendering?: boolean,
|
||||
|
||||
// Use in mobile app to enable long-pressing an image or a linkg
|
||||
// to display a context menu. Used in `image.ts` and `link_open.ts`
|
||||
enableLongPress?: boolean,
|
||||
|
||||
// Used in mobile app when enableLongPress = true. Tells for how long
|
||||
// the resource should be pressed before the menu is shown.
|
||||
longPressDelay?: number,
|
||||
|
||||
// Use by `link_open` rule.
|
||||
// linkRenderingType = 1 is the regular rendering and clicking on it is handled via embedded JS (in onclick attribute)
|
||||
// linkRenderingType = 2 gives a plain link with no JS. Caller needs to handle clicking on the link.
|
||||
linkRenderingType?: number,
|
||||
}
|
||||
|
||||
export default class MdToHtml {
|
||||
|
||||
private resourceBaseUrl_:string;
|
||||
private ResourceModel_:any;
|
||||
private contextCache_:any;
|
||||
private fsDriver_:any;
|
||||
|
||||
private cachedOutputs_:any = {};
|
||||
private lastCodeHighlightCacheKey_:string = null;
|
||||
private cachedHighlightedCode_:any = {};
|
||||
|
||||
// Markdown-It plugin options (not Joplin plugin options)
|
||||
private pluginOptions_:any = {};
|
||||
private extraRendererRules_:RendererRules = {};
|
||||
private allProcessedAssets_:any = {};
|
||||
|
||||
public constructor(options:Options = null) {
|
||||
class MdToHtml {
|
||||
constructor(options = null) {
|
||||
if (!options) options = {};
|
||||
|
||||
// Must include last "/"
|
||||
this.resourceBaseUrl_ = 'resourceBaseUrl' in options ? options.resourceBaseUrl : null;
|
||||
|
||||
this.cachedOutputs_ = {};
|
||||
|
||||
this.lastCodeHighlightCacheKey_ = null;
|
||||
this.cachedHighlightedCode_ = {};
|
||||
this.ResourceModel_ = options.ResourceModel;
|
||||
this.pluginOptions_ = options.pluginOptions ? options.pluginOptions : {};
|
||||
this.contextCache_ = inMemoryCache;
|
||||
|
||||
this.tempDir_ = options.tempDir;
|
||||
this.fsDriver_ = {
|
||||
writeFile: (/* path, content, encoding = 'base64'*/) => { throw new Error('writeFile not set'); },
|
||||
exists: (/* path*/) => { throw new Error('exists not set'); },
|
||||
@@ -184,26 +74,24 @@ export default class MdToHtml {
|
||||
if (options.fsDriver.exists) this.fsDriver_.exists = options.fsDriver.exists;
|
||||
if (options.fsDriver.cacheCssToFile) this.fsDriver_.cacheCssToFile = options.fsDriver.cacheCssToFile;
|
||||
}
|
||||
|
||||
if (options.extraRendererRules) {
|
||||
for (const rule of options.extraRendererRules) {
|
||||
this.loadExtraRendererRule(rule.id, rule.module);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fsDriver() {
|
||||
fsDriver() {
|
||||
return this.fsDriver_;
|
||||
}
|
||||
|
||||
public static pluginNames() {
|
||||
tempDir() {
|
||||
return this.tempDir_;
|
||||
}
|
||||
|
||||
static pluginNames() {
|
||||
const output = [];
|
||||
for (const n in rules) output.push(n);
|
||||
for (const n in plugins) output.push(n);
|
||||
return output;
|
||||
}
|
||||
|
||||
private pluginOptions(name:string) {
|
||||
pluginOptions(name) {
|
||||
let o = this.pluginOptions_[name] ? this.pluginOptions_[name] : {};
|
||||
o = Object.assign({
|
||||
enabled: true,
|
||||
@@ -211,18 +99,12 @@ export default class MdToHtml {
|
||||
return o;
|
||||
}
|
||||
|
||||
private pluginEnabled(name:string) {
|
||||
pluginEnabled(name) {
|
||||
return this.pluginOptions(name).enabled;
|
||||
}
|
||||
|
||||
// `module` is a file that has already been `required()`
|
||||
public loadExtraRendererRule(id:string, module:any) {
|
||||
if (this.extraRendererRules_[id]) throw new Error(`A renderer rule with this ID has already been loaded: ${id}`);
|
||||
this.extraRendererRules_[id] = module;
|
||||
}
|
||||
|
||||
private processPluginAssets(pluginAssets:PluginAssets):RenderResult {
|
||||
const files:RenderResultPluginAsset[] = [];
|
||||
processPluginAssets(pluginAssets) {
|
||||
const files = [];
|
||||
const cssStrings = [];
|
||||
for (const pluginName in pluginAssets) {
|
||||
for (const asset of pluginAssets[pluginName]) {
|
||||
@@ -258,59 +140,29 @@ export default class MdToHtml {
|
||||
}
|
||||
|
||||
return {
|
||||
html: '',
|
||||
pluginAssets: files,
|
||||
cssStrings: cssStrings,
|
||||
};
|
||||
}
|
||||
|
||||
// This return all the assets for all the plugins. Since it is called
|
||||
// on each render, the result is cached.
|
||||
private allProcessedAssets(theme:any, codeTheme:string) {
|
||||
const cacheKey:string = theme.cacheKey + codeTheme;
|
||||
|
||||
if (this.allProcessedAssets_[cacheKey]) return this.allProcessedAssets_[cacheKey];
|
||||
|
||||
const assets:any = {};
|
||||
async allAssets(theme) {
|
||||
const assets = {};
|
||||
for (const key in rules) {
|
||||
if (!this.pluginEnabled(key)) continue;
|
||||
const rule = rules[key];
|
||||
|
||||
if (rule.assets) {
|
||||
assets[key] = rule.assets(theme);
|
||||
}
|
||||
}
|
||||
|
||||
assets['highlight.js'] = [{ name: codeTheme }];
|
||||
|
||||
const output = this.processPluginAssets(assets);
|
||||
|
||||
this.allProcessedAssets_ = {
|
||||
[cacheKey]: output,
|
||||
};
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
// This is similar to allProcessedAssets() but used only by the Rich Text editor
|
||||
public async allAssets(theme:any) {
|
||||
const assets:any = {};
|
||||
for (const key in rules) {
|
||||
if (!this.pluginEnabled(key)) continue;
|
||||
const rule = rules[key];
|
||||
|
||||
if (rule.assets) {
|
||||
assets[key] = rule.assets(theme);
|
||||
if (rule.style) {
|
||||
assets[key] = rule.style(theme);
|
||||
}
|
||||
}
|
||||
|
||||
const processedAssets = this.processPluginAssets(assets);
|
||||
processedAssets.cssStrings.splice(0, 0, noteStyle(theme).join('\n'));
|
||||
processedAssets.cssStrings.splice(0, 0, noteStyle(theme));
|
||||
const output = await this.outputAssetsToExternalAssets_(processedAssets);
|
||||
return output.pluginAssets;
|
||||
}
|
||||
|
||||
private async outputAssetsToExternalAssets_(output:any) {
|
||||
async outputAssetsToExternalAssets_(output) {
|
||||
for (const cssString of output.cssStrings) {
|
||||
output.pluginAssets.push(await this.fsDriver().cacheCssToFile(cssString));
|
||||
}
|
||||
@@ -318,7 +170,7 @@ export default class MdToHtml {
|
||||
return output;
|
||||
}
|
||||
|
||||
private removeMarkdownItWrappingParagraph_(html:string) {
|
||||
removeMarkdownItWrappingParagraph_(html) {
|
||||
// <p></p>\n
|
||||
if (html.length < 8) return html;
|
||||
if (html.substr(0, 3) !== '<p>') return html;
|
||||
@@ -326,12 +178,12 @@ export default class MdToHtml {
|
||||
return html.substring(3, html.length - 5);
|
||||
}
|
||||
|
||||
public clearCache() {
|
||||
clearCache() {
|
||||
this.cachedOutputs_ = {};
|
||||
}
|
||||
|
||||
// "theme" is the theme as returned by themeStyle()
|
||||
public async render(body:string, theme:any = null, options:any = null):Promise<RenderResult> {
|
||||
async render(body, theme = null, options = null) {
|
||||
options = Object.assign({}, {
|
||||
// In bodyOnly mode, the rendered Markdown is returned without the wrapper DIV
|
||||
bodyOnly: false,
|
||||
@@ -361,24 +213,23 @@ export default class MdToHtml {
|
||||
const cachedOutput = this.cachedOutputs_[cacheKey];
|
||||
if (cachedOutput) return cachedOutput;
|
||||
|
||||
const context = {
|
||||
css: {},
|
||||
pluginAssets: {},
|
||||
cache: this.contextCache_,
|
||||
};
|
||||
|
||||
const ruleOptions = Object.assign({}, options, {
|
||||
resourceBaseUrl: this.resourceBaseUrl_,
|
||||
ResourceModel: this.ResourceModel_,
|
||||
});
|
||||
|
||||
const context:PluginContext = {
|
||||
css: {},
|
||||
pluginAssets: {},
|
||||
cache: this.contextCache_,
|
||||
userData: {},
|
||||
};
|
||||
|
||||
const markdownIt = new MarkdownIt({
|
||||
breaks: !this.pluginEnabled('softbreaks'),
|
||||
typographer: this.pluginEnabled('typographer'),
|
||||
linkify: true,
|
||||
html: true,
|
||||
highlight: (str:string, lang:string) => {
|
||||
highlight: (str, lang) => {
|
||||
let outputCodeHtml = '';
|
||||
|
||||
// The strings includes the last \n that is part of the fence,
|
||||
@@ -402,6 +253,10 @@ export default class MdToHtml {
|
||||
this.cachedHighlightedCode_[cacheKey] = hlCode;
|
||||
}
|
||||
|
||||
context.pluginAssets['highlight.js'] = [
|
||||
{ name: options.codeTheme },
|
||||
];
|
||||
|
||||
outputCodeHtml = hlCode;
|
||||
} catch (error) {
|
||||
outputCodeHtml = markdownIt.utils.escapeHtml(trimmedStr);
|
||||
@@ -441,18 +296,11 @@ export default class MdToHtml {
|
||||
// Using the `context` object, a plugin can define what additional assets they need (css, fonts, etc.) using context.pluginAssets.
|
||||
// The calling application will need to handle loading these assets.
|
||||
|
||||
const allRules = Object.assign({}, rules, this.extraRendererRules_);
|
||||
|
||||
for (const key in allRules) {
|
||||
for (const key in rules) {
|
||||
if (!this.pluginEnabled(key)) continue;
|
||||
|
||||
const rule = allRules[key];
|
||||
|
||||
markdownIt.use(rule.plugin, {
|
||||
context: context,
|
||||
...ruleOptions,
|
||||
...(ruleOptions.plugins[key] ? ruleOptions.plugins[key] : {}),
|
||||
});
|
||||
const rule = rules[key];
|
||||
const ruleInstall = rule.install ? rule.install : rule;
|
||||
markdownIt.use(ruleInstall(context, { ...ruleOptions }));
|
||||
}
|
||||
|
||||
markdownIt.use(markdownItAnchor, { slugify: slugify });
|
||||
@@ -463,13 +311,18 @@ export default class MdToHtml {
|
||||
}
|
||||
}
|
||||
|
||||
// const extraPlugins = eventManager.filterEmit('mdToHtmlPlugins', {});
|
||||
// for (const key in extraPlugins) {
|
||||
// markdownIt.use(extraPlugins[key].module, extraPlugins[key].options);
|
||||
// }
|
||||
|
||||
setupLinkify(markdownIt);
|
||||
|
||||
const renderedBody = markdownIt.render(body, context);
|
||||
const renderedBody = markdownIt.render(body);
|
||||
|
||||
let cssStrings = noteStyle(options.theme);
|
||||
|
||||
let output = { ...this.allProcessedAssets(options.theme, options.codeTheme) };
|
||||
let output = this.processPluginAssets(context.pluginAssets);
|
||||
cssStrings = cssStrings.concat(output.cssStrings);
|
||||
|
||||
if (options.userCss) cssStrings.push(options.userCss);
|
||||
@@ -501,4 +354,9 @@ export default class MdToHtml {
|
||||
return output;
|
||||
}
|
||||
|
||||
injectedJavaScript() {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = MdToHtml;
|
||||
@@ -1,21 +1,24 @@
|
||||
import { RuleOptions } from '../../MdToHtml';
|
||||
|
||||
let checkboxIndex_ = -1;
|
||||
|
||||
function pluginAssets(theme:any) {
|
||||
const pluginAssets:Function[] = [];
|
||||
|
||||
pluginAssets[1] = function() {
|
||||
return [
|
||||
{
|
||||
inline: true,
|
||||
mime: 'text/css',
|
||||
text: `
|
||||
/*
|
||||
FOR THE MARKDOWN EDITOR
|
||||
*/
|
||||
|
||||
/* Remove the indentation from the checkboxes at the root of the document
|
||||
(otherwise they are too far right), but keep it for their children to allow
|
||||
nested lists. Make sure this value matches the UL margin. */
|
||||
|
||||
/*
|
||||
.md-checkbox .checkbox-wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
*/
|
||||
|
||||
li.md-checkbox {
|
||||
list-style-type: none;
|
||||
}
|
||||
@@ -23,16 +26,30 @@ function pluginAssets(theme:any) {
|
||||
li.md-checkbox input[type=checkbox] {
|
||||
margin-left: -1.71em;
|
||||
margin-right: 0.7em;
|
||||
}
|
||||
}`,
|
||||
},
|
||||
];
|
||||
};
|
||||
|
||||
pluginAssets[2] = function(theme:any) {
|
||||
return [
|
||||
{
|
||||
inline: true,
|
||||
mime: 'text/css',
|
||||
text: `
|
||||
/* https://stackoverflow.com/questions/7478336/only-detect-click-event-on-pseudo-element#comment39751366_7478344 */
|
||||
/* Not doing this trick anymore. See Modules/TinyMCE/JoplinLists/src/main/ts/ui/Buttons.ts */
|
||||
|
||||
/*
|
||||
ul.joplin-checklist li {
|
||||
pointer-events: none;
|
||||
}
|
||||
*/
|
||||
|
||||
ul.joplin-checklist {
|
||||
list-style:none;
|
||||
}
|
||||
|
||||
/*
|
||||
FOR THE RICH TEXT EDITOR
|
||||
*/
|
||||
|
||||
ul.joplin-checklist li::before {
|
||||
content:"\\f14a";
|
||||
font-family:"Font Awesome 5 Free";
|
||||
@@ -51,7 +68,7 @@ function pluginAssets(theme:any) {
|
||||
}`,
|
||||
},
|
||||
];
|
||||
}
|
||||
};
|
||||
|
||||
function createPrefixTokens(Token:any, id:string, checked:boolean, label:string, postMessageSyntax:string, sourceToken:any):any[] {
|
||||
let token = null;
|
||||
@@ -112,8 +129,9 @@ function createSuffixTokens(Token:any):any[] {
|
||||
];
|
||||
}
|
||||
|
||||
function checkboxPlugin(markdownIt:any, options:RuleOptions) {
|
||||
const renderingType = options.checkboxRenderingType || 1;
|
||||
// @ts-ignore: Keep the function signature as-is despite unusued arguments
|
||||
function installRule(markdownIt:any, mdOptions:any, ruleOptions:any, context:any) {
|
||||
const pluginOptions = { renderingType: 1, ...ruleOptions.plugins['checkbox'] };
|
||||
|
||||
markdownIt.core.ruler.push('checkbox', (state:any) => {
|
||||
const tokens = state.tokens;
|
||||
@@ -162,14 +180,14 @@ function checkboxPlugin(markdownIt:any, options:RuleOptions) {
|
||||
|
||||
const currentList = lists[lists.length - 1];
|
||||
|
||||
if (renderingType === 1) {
|
||||
if (pluginOptions.renderingType === 1) {
|
||||
checkboxIndex_++;
|
||||
const id = `md-checkbox-${checkboxIndex_}`;
|
||||
|
||||
// Prepend the text content with the checkbox markup and the opening <label> tag
|
||||
// then append the </label> tag at the end of the text content.
|
||||
|
||||
const prefix = createPrefixTokens(Token, id, checked, label, options.postMessageSyntax, token);
|
||||
const prefix = createPrefixTokens(Token, id, checked, label, ruleOptions.postMessageSyntax, token);
|
||||
const suffix = createSuffixTokens(Token);
|
||||
|
||||
token.children = markdownIt.utils.arrayReplaceAt(token.children, 0, prefix);
|
||||
@@ -196,12 +214,20 @@ function checkboxPlugin(markdownIt:any, options:RuleOptions) {
|
||||
currentListItem.attrSet('class', (`${currentListItem.attrGet('class') || ''} checked`).trim());
|
||||
}
|
||||
}
|
||||
|
||||
if (!('checkbox' in context.pluginAssets)) {
|
||||
context.pluginAssets['checkbox'] = pluginAssets[pluginOptions.renderingType](ruleOptions.theme);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export default {
|
||||
plugin: checkboxPlugin,
|
||||
assets: pluginAssets,
|
||||
install: function(context:any, ruleOptions:any) {
|
||||
return function(md:any, mdOptions:any) {
|
||||
installRule(md, mdOptions, ruleOptions, context);
|
||||
};
|
||||
},
|
||||
style: pluginAssets[2],
|
||||
};
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
function plugin(markdownIt:any) {
|
||||
function installRule(markdownIt) {
|
||||
const defaultRender =
|
||||
markdownIt.renderer.rules.code_inline ||
|
||||
function(tokens:any, idx:any, options:any, _env:any, self:any) {
|
||||
function(tokens, idx, options, env, self) {
|
||||
return self.renderToken(tokens, idx, options);
|
||||
};
|
||||
|
||||
markdownIt.renderer.rules.code_inline = (tokens:any[], idx:number, options:any, env:any, self:any) => {
|
||||
markdownIt.renderer.rules.code_inline = (tokens, idx, options, env, self) => {
|
||||
const token = tokens[idx];
|
||||
let tokenClass = token.attrGet('class');
|
||||
if (!tokenClass) tokenClass = '';
|
||||
@@ -15,6 +15,8 @@ function plugin(markdownIt:any) {
|
||||
};
|
||||
}
|
||||
|
||||
export default {
|
||||
plugin,
|
||||
module.exports = function(context, ruleOptions) {
|
||||
return function(md, mdOptions) {
|
||||
installRule(md, mdOptions, ruleOptions);
|
||||
};
|
||||
};
|
||||
@@ -8,7 +8,7 @@
|
||||
// So we modify the code below to allow highlight() to return an object that tells how to render
|
||||
// the code.
|
||||
|
||||
function plugin(markdownIt:any) {
|
||||
function installRule(markdownIt:any) {
|
||||
// @ts-ignore: Keep the function signature as-is despite unusued arguments
|
||||
markdownIt.renderer.rules.fence = function(tokens:any[], idx:number, options:any, env:any, slf:any) {
|
||||
let token = tokens[idx],
|
||||
@@ -63,7 +63,8 @@ function plugin(markdownIt:any) {
|
||||
};
|
||||
}
|
||||
|
||||
export default {
|
||||
plugin,
|
||||
};
|
||||
|
||||
export default function() {
|
||||
return function(md:any) {
|
||||
installRule(md);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
const fountain = require('../../vendor/fountain.min.js');
|
||||
|
||||
const pluginAssets = function() {
|
||||
const fountainCss = function() {
|
||||
return [
|
||||
{
|
||||
inline: true,
|
||||
@@ -102,7 +102,7 @@ const pluginAssets = function() {
|
||||
];
|
||||
};
|
||||
|
||||
function renderFountainScript(markdownIt:any, content:string) {
|
||||
function renderFountainScript(markdownIt, content) {
|
||||
const result = fountain.parse(content);
|
||||
|
||||
return `
|
||||
@@ -118,19 +118,30 @@ function renderFountainScript(markdownIt:any, content:string) {
|
||||
`;
|
||||
}
|
||||
|
||||
function plugin(markdownIt:any) {
|
||||
const defaultRender = markdownIt.renderer.rules.fence || function(tokens:any[], idx:number, options:any, _env:any, self:any) {
|
||||
function addContextAssets(context) {
|
||||
if ('fountain' in context.pluginAssets) return;
|
||||
|
||||
context.pluginAssets['fountain'] = fountainCss();
|
||||
}
|
||||
|
||||
function installRule(markdownIt, mdOptions, ruleOptions, context) {
|
||||
const defaultRender = markdownIt.renderer.rules.fence || function(tokens, idx, options, env, self) {
|
||||
return self.renderToken(tokens, idx, options);
|
||||
};
|
||||
|
||||
markdownIt.renderer.rules.fence = function(tokens:any[], idx:number, options:any, env:any, self:any) {
|
||||
markdownIt.renderer.rules.fence = function(tokens, idx, options, env, self) {
|
||||
const token = tokens[idx];
|
||||
if (token.info !== 'fountain') return defaultRender(tokens, idx, options, env, self);
|
||||
addContextAssets(context);
|
||||
return renderFountainScript(markdownIt, token.content);
|
||||
};
|
||||
}
|
||||
|
||||
export default {
|
||||
plugin,
|
||||
assets: pluginAssets,
|
||||
module.exports = {
|
||||
install: function(context, ruleOptions) {
|
||||
return function(md, mdOptions) {
|
||||
installRule(md, mdOptions, ruleOptions, context);
|
||||
};
|
||||
},
|
||||
style: fountainCss,
|
||||
};
|
||||
@@ -1,11 +1,7 @@
|
||||
// This plugin is used only on mobile, to highlight search results.
|
||||
|
||||
import { RuleOptions } from "lib/joplin-renderer/MdToHtml";
|
||||
|
||||
const stringUtils = require('../../stringUtils.js');
|
||||
const md5 = require('md5');
|
||||
|
||||
function createHighlightedTokens(Token:any, splitted:string[]) {
|
||||
function createHighlightedTokens(Token, splitted) {
|
||||
let token;
|
||||
const output = [];
|
||||
|
||||
@@ -34,11 +30,10 @@ function createHighlightedTokens(Token:any, splitted:string[]) {
|
||||
return output;
|
||||
}
|
||||
|
||||
// function installRule(markdownIt, mdOptions, ruleOptions) {
|
||||
function plugin(markdownIt:any, ruleOptions:RuleOptions) {
|
||||
function installRule(markdownIt, mdOptions, ruleOptions) {
|
||||
const divider = md5(Date.now().toString() + Math.random().toString());
|
||||
|
||||
markdownIt.core.ruler.push('highlight_keywords', (state:any) => {
|
||||
markdownIt.core.ruler.push('highlight_keywords', state => {
|
||||
const keywords = ruleOptions.highlightedKeywords;
|
||||
if (!keywords || !keywords.length) return;
|
||||
|
||||
@@ -65,6 +60,8 @@ function plugin(markdownIt:any, ruleOptions:RuleOptions) {
|
||||
});
|
||||
}
|
||||
|
||||
export default {
|
||||
plugin,
|
||||
}
|
||||
module.exports = function(context, ruleOptions) {
|
||||
return function(md, mdOptions) {
|
||||
installRule(md, mdOptions, ruleOptions);
|
||||
};
|
||||
};
|
||||
@@ -1,40 +1,39 @@
|
||||
import { RuleOptions } from "lib/joplin-renderer/MdToHtml";
|
||||
|
||||
// const Resource = require('lib/models/Resource.js');
|
||||
const htmlUtils = require('../../htmlUtils.js');
|
||||
const utils = require('../../utils');
|
||||
|
||||
function renderImageHtml(before:string, src:string, after:string, ruleOptions:RuleOptions) {
|
||||
function renderImageHtml(before, src, after, ruleOptions) {
|
||||
const r = utils.imageReplacement(ruleOptions.ResourceModel, src, ruleOptions.resources, ruleOptions.resourceBaseUrl);
|
||||
if (typeof r === 'string') return r;
|
||||
if (r) return `<img ${before} ${htmlUtils.attributesHtml(r)} ${after}/>`;
|
||||
return `[Image: ${src}]`;
|
||||
}
|
||||
|
||||
function plugin(markdownIt:any, ruleOptions:RuleOptions) {
|
||||
function installRule(markdownIt, mdOptions, ruleOptions) {
|
||||
const Resource = ruleOptions.ResourceModel;
|
||||
|
||||
const htmlBlockDefaultRender =
|
||||
markdownIt.renderer.rules.html_block ||
|
||||
function(tokens:any[], idx:number, options:any, _env:any, self:any) {
|
||||
function(tokens, idx, options, env, self) {
|
||||
return self.renderToken(tokens, idx, options);
|
||||
};
|
||||
|
||||
const htmlInlineDefaultRender =
|
||||
markdownIt.renderer.rules.html_inline ||
|
||||
function(tokens:any[], idx:number, options:any, _env:any, self:any) {
|
||||
function(tokens, idx, options, env, self) {
|
||||
return self.renderToken(tokens, idx, options);
|
||||
};
|
||||
|
||||
const imageRegex = /<img(.*?)src=["'](.*?)["'](.*?)>/gi;
|
||||
|
||||
const handleImageTags = function(defaultRender:Function) {
|
||||
return function(tokens:any[], idx:number, options:any, env:any, self:any) {
|
||||
const handleImageTags = function(defaultRender) {
|
||||
return function(tokens, idx, options, env, self) {
|
||||
const token = tokens[idx];
|
||||
const content = token.content;
|
||||
|
||||
if (!content.match(imageRegex)) return defaultRender(tokens, idx, options, env, self);
|
||||
|
||||
return content.replace(imageRegex, (_v:any, before:string, src:string, after:string) => {
|
||||
return content.replace(imageRegex, (v, before, src, after) => {
|
||||
if (!Resource.isResourceUrl(src)) return `<img${before}src="${src}"${after}>`;
|
||||
return renderImageHtml(before, src, after, ruleOptions);
|
||||
});
|
||||
@@ -47,4 +46,8 @@ function plugin(markdownIt:any, ruleOptions:RuleOptions) {
|
||||
markdownIt.renderer.rules.html_inline = handleImageTags(htmlInlineDefaultRender);
|
||||
}
|
||||
|
||||
export default { plugin }
|
||||
module.exports = function(context, ruleOptions) {
|
||||
return function(md, mdOptions) {
|
||||
installRule(md, mdOptions, ruleOptions);
|
||||
};
|
||||
};
|
||||
@@ -1,13 +1,11 @@
|
||||
import { RuleOptions } from 'lib/joplin-renderer/MdToHtml';
|
||||
|
||||
// const Resource = require('lib/models/Resource.js');
|
||||
const utils = require('../../utils');
|
||||
const htmlUtils = require('../../htmlUtils.js');
|
||||
|
||||
function plugin(markdownIt:any, ruleOptions:RuleOptions) {
|
||||
function installRule(markdownIt, mdOptions, ruleOptions) {
|
||||
const defaultRender = markdownIt.renderer.rules.image;
|
||||
|
||||
markdownIt.renderer.rules.image = (tokens:any[], idx:number, options:any, env:any, self:any) => {
|
||||
markdownIt.renderer.rules.image = (tokens, idx, options, env, self) => {
|
||||
const Resource = ruleOptions.ResourceModel;
|
||||
|
||||
const token = tokens[idx];
|
||||
@@ -21,13 +19,15 @@ function plugin(markdownIt:any, ruleOptions:RuleOptions) {
|
||||
if (r) {
|
||||
let js = '';
|
||||
if (ruleOptions.enableLongPress) {
|
||||
const longPressDelay = ruleOptions.longPressDelay ? ruleOptions.longPressDelay : 500;
|
||||
const id = r['data-resource-id'];
|
||||
|
||||
const longPressHandler = `${ruleOptions.postMessageSyntax}('longclick:${id}')`;
|
||||
const touchStart = `t=setTimeout(()=>{t=null; ${longPressHandler};}, ${ruleOptions.longPressDelay});`;
|
||||
const cancel = 'if (!!t) clearTimeout(t); t=null';
|
||||
|
||||
js = ` ontouchstart="${touchStart}" ontouchend="${cancel}" ontouchcancel="${cancel}" ontouchmove="${cancel}"`;
|
||||
const touchStart = `t=setTimeout(()=>{t=null; ${longPressHandler};}, ${longPressDelay});`;
|
||||
const touchEnd = 'if (!!t) clearTimeout(t); t=null';
|
||||
|
||||
js = ` ontouchstart="${touchStart}" ontouchend="${touchEnd}"`;
|
||||
}
|
||||
|
||||
return `<img data-from-md ${htmlUtils.attributesHtml(Object.assign({}, r, { title: title }))}${js}/>`;
|
||||
@@ -36,4 +36,8 @@ function plugin(markdownIt:any, ruleOptions:RuleOptions) {
|
||||
};
|
||||
}
|
||||
|
||||
export default { plugin };
|
||||
module.exports = function(context, ruleOptions) {
|
||||
return function(md, mdOptions) {
|
||||
installRule(md, mdOptions, ruleOptions);
|
||||
};
|
||||
};
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user