diff --git a/ElectronClient/app/gui/Root.jsx b/ElectronClient/app/gui/Root.jsx index 6bd5f3bec..a8e2450d8 100644 --- a/ElectronClient/app/gui/Root.jsx +++ b/ElectronClient/app/gui/Root.jsx @@ -15,6 +15,7 @@ const { ConfigScreen } = require('./ConfigScreen.min.js'); const { EncryptionConfigScreen } = require('./EncryptionConfigScreen.min.js'); const { ClipperConfigScreen } = require('./ClipperConfigScreen.min.js'); const { Navigator } = require('./Navigator.min.js'); +const WelcomeUtils = require('lib/WelcomeUtils'); const { app } = require('../app'); @@ -71,6 +72,16 @@ class RootComponent extends React.Component { state: 'ready', }); } + + if (!Setting.value('welcome.wasBuilt')) { + const result = await WelcomeUtils.createWelcomeItems(); + Setting.setValue('welcome.wasBuilt', true); + + this.props.dispatch({ + type: 'FOLDER_SELECT', + id: result.defaultFolderId, + }); + } } render() { diff --git a/ReactNativeClient/lib/BaseApplication.js b/ReactNativeClient/lib/BaseApplication.js index 5217fac71..6f629a600 100644 --- a/ReactNativeClient/lib/BaseApplication.js +++ b/ReactNativeClient/lib/BaseApplication.js @@ -38,7 +38,6 @@ const SearchEngineUtils = require('lib/services/SearchEngineUtils'); const DecryptionWorker = require('lib/services/DecryptionWorker'); const BaseService = require('lib/services/BaseService'); const SearchEngine = require('lib/services/SearchEngine'); -const WelcomeUtils = require('lib/WelcomeUtils'); SyncTargetRegistry.addClass(SyncTargetFilesystem); SyncTargetRegistry.addClass(SyncTargetOneDrive); @@ -565,11 +564,6 @@ class BaseApplication { if (!currentFolder) currentFolder = await Folder.defaultFolder(); Setting.setValue('activeFolderId', currentFolder ? currentFolder.id : ''); - if (!Setting.value('welcome.wasBuilt')) { - await WelcomeUtils.createWelcomeItems(); - Setting.setValue('welcome.wasBuilt', true); - } - return argv; } diff --git a/ReactNativeClient/lib/WelcomeUtils.js b/ReactNativeClient/lib/WelcomeUtils.js index 2a3d8e6cb..cd45e6b7a 100644 --- a/ReactNativeClient/lib/WelcomeUtils.js +++ b/ReactNativeClient/lib/WelcomeUtils.js @@ -14,6 +14,10 @@ class WelcomeUtils { static async createWelcomeItems() { const overwriteExisting = Setting.value('env') === 'dev'; + const output = { + defaultFolderId: null, + }; + const noteAssets = welcomeAssets.notes; const folderAssets = welcomeAssets.folders; const tempDir = Setting.value('resourceDir'); @@ -21,11 +25,14 @@ class WelcomeUtils { // TODO: Update mobile root.js // TODO: Update CLI // TODO: Test CLI + // TODO: Use less tags? for (let i = 0; i < folderAssets.length; i++) { const folderAsset = folderAssets[i]; const folderId = folderAsset.id; + if (!output.defaultFolderId) output.defaultFolderId = folderId; + let existingFolder = await Folder.load(folderId); if (existingFolder && overwriteExisting) { @@ -93,6 +100,8 @@ class WelcomeUtils { if (noteAsset.tags) await Tag.setNoteTagsByTitles(noteId, noteAsset.tags); } + + return output; } } diff --git a/ReactNativeClient/lib/welcomeAssets.js b/ReactNativeClient/lib/welcomeAssets.js index 03ff2d733..0b784cd4c 100644 --- a/ReactNativeClient/lib/welcomeAssets.js +++ b/ReactNativeClient/lib/welcomeAssets.js @@ -47,7 +47,7 @@ module.exports = { { "id": "2ee48f80889447429a3cccb04a466072", "title": "4. Tips 💡", - "body": "# Tips 💡\n\nThe first few notes should have given you an overview of the main functionalities of Joplin, but there's more it can do. See below for some of these features and how to get more help using the app:\n\n## Web clipper\n\n![](./WebClipper.png)\n\nThe Web Clipper is a browser extension that allows you to save web pages and screenshots from your browser. To start using it, open the Joplin desktop application, go to the Web Clipper Options and follow the instructions.\n\nMore info on the official website: https://joplin.cozic.net/clipper\n\n## Attachments\n\nAny kind of file can be attached to a note. In Markdown, links to these files are represented as an ID. In the note viewer, these files, if they are images, will be displayed or, if they are other files (PDF, text files, etc.) they will be displayed as links. Clicking on this link will open the file in the default application.\n\nImages can be attached either by clicking on \"Attach file\" or by pasting (with `Ctrl+V` or `Cmd+V`) an image directly in the editor, or by drag and dropping an image.\n\nMore info about attachments: https://joplin.cozic.net#attachments--resources\n\n## Search\n\nJoplin supports advanced search queries, which are fully documented on the official website: https://joplin.cozic.net#searching\n\n## Alarms\n\nAn alarm can be associated with any to-do. It will be triggered at the given time by displaying a notification. To use this feature, see the documentation: https://joplin.cozic.net#notifications\n\n## Community and further help\n\n- For general discussion about Joplin, user support, software development questions, and to discuss new features, go to the [Joplin Forum](https://discourse.joplin.cozic.net/). It is possible to login with your GitHub account.\n- The latest news are posted [on the Patreon page](https://www.patreon.com/joplin).\n- For bug reports and feature requests, go to the [GitHub Issue Tracker](https://joplin.cozic.net/issues).\n\n## Donations\n\nDonations to Joplin support the development of the project. Developing quality applications mostly takes time, but there are also some expenses, such as digital certificates to sign the applications, app store fees, hosting, etc. Most of all, your donation will make it possible to keep up the current development standard.\n\nPlease see the [donation page](https://joplin.cozic.net/donate/) for information on how to support the development of Joplin.", + "body": "# Tips 💡\n\nThe first few notes should have given you an overview of the main functionalities of Joplin, but there's more it can do. See below for some of these features and how to get more help using the app:\n\n## Web clipper\n\n![](./WebClipper.png)\n\nThe Web Clipper is a browser extension that allows you to save web pages and screenshots from your browser. To start using it, open the Joplin desktop application, go to the Web Clipper Options and follow the instructions.\n\nMore info on the official website: https://joplin.cozic.net/clipper\n\n## Attachments\n\nAny kind of file can be attached to a note. In Markdown, links to these files are represented as an ID. In the note viewer, these files, if they are images, will be displayed or, if they are other files (PDF, text files, etc.) they will be displayed as links. Clicking on this link will open the file in the default application.\n\nImages can be attached either by clicking on \"Attach file\" or by pasting (with `Ctrl+V` or `Cmd+V`) an image directly in the editor, or by drag and dropping an image.\n\nMore info about attachments: https://joplin.cozic.net#attachments--resources\n\n## Search\n\nJoplin supports advanced search queries, which are fully documented on the official website: https://joplin.cozic.net#searching\n\n## Alarms\n\nAn alarm can be associated with any to-do. It will be triggered at the given time by displaying a notification. To use this feature, see the documentation: https://joplin.cozic.net#notifications\n\n## Markdown advanced tips\n\nJoplin uses and renders [Github-flavoured Markdown](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) with a few variations and additions.\n\nFor example, tables are supported:\n\n| Tables | Are | Cool |\n| ------------- |:-------------:| -----:|\n| col 3 is | right-aligned | $1600 |\n| col 2 is | centered | $12 |\n| zebra stripes | are neat | $1 |\n\nYou can also create lists of checkboxes. These checkboxes can be ticked directly in the viewer, or by adding an \"x\" inside:\n\n- [ ] Milk\n- [ ] Eggs\n- [x] Beer\n\nMath expressions can be added using the [KaTeX notation](https://khan.github.io/KaTeX/):\n\n$$\nf(x) = \\int_{-\\infty}^\\infty\n \\hat f(\\xi)\\,e^{2 \\pi i \\xi x}\n \\,d\\xi\n$$\n\nVarious other tricks are possible, such as using HTML, or customising the CSS. See the Markdown documentation for more info - https://joplin.cozic.net#markdown\n\n## Community and further help\n\n- For general discussion about Joplin, user support, software development questions, and to discuss new features, go to the [Joplin Forum](https://discourse.joplin.cozic.net/). It is possible to login with your GitHub account.\n- The latest news are posted [on the Patreon page](https://www.patreon.com/joplin).\n- For bug reports and feature requests, go to the [GitHub Issue Tracker](https://joplin.cozic.net/issues).\n\n## Donations\n\nDonations to Joplin support the development of the project. Developing quality applications mostly takes time, but there are also some expenses, such as digital certificates to sign the applications, app store fees, hosting, etc. Most of all, your donation will make it possible to keep up the current development standard.\n\nPlease see the [donation page](https://joplin.cozic.net/donate/) for information on how to support the development of Joplin.", "tags": [ "welcome", "attachment", diff --git a/Tools/build-all.sh b/Tools/build-all.sh index f2661241e..bc748edbf 100644 --- a/Tools/build-all.sh +++ b/Tools/build-all.sh @@ -1,4 +1,4 @@ #!/bin/bash ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -"$ROOT_DIR/../CliClient/run.sh" apidoc > "$ROOT_DIR/../readme/api.md" && node "$ROOT_DIR/update-readme-download.js" && node "$ROOT_DIR/build-release-stats.js" && node "$ROOT_DIR/build-website.js" && git add -A && git commit -m "Update website" && git pull && git push \ No newline at end of file +"$ROOT_DIR/../CliClient/run.sh" apidoc > "$ROOT_DIR/../readme/api.md" && node "$ROOT_DIR/update-readme-download.js" && node "$ROOT_DIR/build-release-stats.js" && node "$ROOT_DIR/build-welcome.js" && node "$ROOT_DIR/build-website.js" && git add -A && git commit -m "Update website" && git pull && git push \ No newline at end of file diff --git a/readme/welcome/4_tips.md b/readme/welcome/4_tips.md index 175ebc3d9..06d250ef1 100644 --- a/readme/welcome/4_tips.md +++ b/readme/welcome/4_tips.md @@ -26,6 +26,34 @@ Joplin supports advanced search queries, which are fully documented on the offic An alarm can be associated with any to-do. It will be triggered at the given time by displaying a notification. To use this feature, see the documentation: https://joplin.cozic.net#notifications +## Markdown advanced tips + +Joplin uses and renders [Github-flavoured Markdown](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) with a few variations and additions. + +For example, tables are supported: + +| Tables | Are | Cool | +| ------------- |:-------------:| -----:| +| col 3 is | right-aligned | $1600 | +| col 2 is | centered | $12 | +| zebra stripes | are neat | $1 | + +You can also create lists of checkboxes. These checkboxes can be ticked directly in the viewer, or by adding an "x" inside: + +- [ ] Milk +- [ ] Eggs +- [x] Beer + +Math expressions can be added using the [KaTeX notation](https://khan.github.io/KaTeX/): + +$$ +f(x) = \int_{-\infty}^\infty + \hat f(\xi)\,e^{2 \pi i \xi x} + \,d\xi +$$ + +Various other tricks are possible, such as using HTML, or customising the CSS. See the Markdown documentation for more info - https://joplin.cozic.net#markdown + ## Community and further help - For general discussion about Joplin, user support, software development questions, and to discuss new features, go to the [Joplin Forum](https://discourse.joplin.cozic.net/). It is possible to login with your GitHub account.