1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-11-27 08:21:03 +02:00

Also set tags on Welcome notes

This commit is contained in:
Laurent Cozic 2019-02-03 20:19:17 +00:00
parent 9c00dc4cab
commit e76094c546
8 changed files with 87 additions and 30 deletions

View File

@ -200,6 +200,10 @@ Joplin supports end-to-end encryption (E2EE) on all the applications. E2EE is a
For a more technical description, mostly relevant for development or to review the method being used, please see the [Encryption specification](https://joplin.cozic.net/spec).
# External text editor
Joplin notes can be opened and edited using an external editor of your choice. It can be a simple text editor like Notepad++ or Sublime Text or an actual Markdown editor like Typora. In that case, images will also be displayed within the editor. To open the note in an external editor, click on the icon in the toolbar or press Ctrl+E (or Cmd+E). Your default text editor will be used to open the note. If needed, you can also specify the editor directly in the General Options, under "Text editor command".
# Attachments / Resources
Any kind of file can be attached to a note. In Markdown, links to these files are represented as a simple ID to the resource. 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.

View File

@ -2,6 +2,7 @@ const welcomeAssets = require('./welcomeAssets');
const Note = require('lib/models/Note');
const Setting = require('lib/models/Setting');
const Folder = require('lib/models/Folder');
const Tag = require('lib/models/Tag');
const Resource = require('lib/models/Resource');
const { shim } = require('lib/shim');
const { uuid } = require('lib/uuid');
@ -17,7 +18,6 @@ class WelcomeUtils {
const folderAssets = welcomeAssets.folders;
const tempDir = Setting.value('resourceDir');
// TODO: Check if asset exist before creating
// TODO: Update createResourceFromPath for mobile
// TODO: Update BaseApplication
// TODO: Update mobile root.js
@ -90,6 +90,8 @@ class WelcomeUtils {
title: noteAsset.title,
body: noteBody,
}, { isNew: true });
if (noteAsset.tags) await Tag.setNoteTagsByTitles(noteId, noteAsset.tags);
}
}

View File

@ -64,10 +64,10 @@ reg.scheduleSync = async (delay = null, syncOptions = null) => {
reg.logger().info('Scheduling sync operation...');
// if (Setting.value("env") === "dev" && delay !== 0) {
// reg.logger().info("Schedule sync DISABLED!!!");
// return;
// }
if (Setting.value("env") === "dev" && delay !== 0) {
reg.logger().info("Schedule sync DISABLED!!!");
return;
}
const timeoutCallback = async () => {
reg.scheduleSyncId_ = null;

File diff suppressed because one or more lines are too long

View File

@ -8,20 +8,45 @@ const markdownUtils = require('lib/markdownUtils.js');
const rootDir = dirname(__dirname);
const welcomeDir = rootDir + '/readme/welcome';
function itemIdFromPath(path) {
const ids = {
'1_welcome_to_joplin.md': '8a1556e382704160808e9a7bef7135d3',
'2_importing_and_exporting_notes.md': 'b863cbc514cb4cafbae8dd6a4fcad919',
'3_synchronising_your_notes.md': '25b656aac0564d1a91ab98295aa3cc58',
'4_tips.md': '2ee48f80889447429a3cccb04a466072',
'AllClients.png': '5c05172554194f95b60971f6d577cc1a',
'folder_Welcome': '9bb5d498aba74cc6a047cfdc841e82a1',
};
const itemMetadata_ = {
'1_welcome_to_joplin.md': {
id: '8a1556e382704160808e9a7bef7135d3',
tags: 'welcome,markdown,organizing',
},
'2_importing_and_exporting_notes.md': {
id: 'b863cbc514cb4cafbae8dd6a4fcad919',
tags: 'welcome,importing,exporting',
},
'3_synchronising_your_notes.md': {
id: '25b656aac0564d1a91ab98295aa3cc58',
tags: 'welcome,synchronizing',
},
'4_tips.md': {
id: '2ee48f80889447429a3cccb04a466072',
tags: 'welcome,attachment,search,alarm',
},
'AllClients.png': { id: '5c05172554194f95b60971f6d577cc1a' },
'SubNotebooks.png': { id: '3a851ab0c0e849b7bc9e8cd5c4feb34a' },
'folder_Welcome': { id: '9bb5d498aba74cc6a047cfdc841e82a1' },
};
function itemMetadata(path) {
const f = basename(path);
const id = ids[f];
if (!id) throw new Error('No ID for filename: ' + f);
return id;
const md = itemMetadata_[f];
if (!md) throw new Error('No metadata for: ' + path);
return md;
}
function noteTags(path) {
const md = itemMetadata(path);
if (!md.tags) throw new Error('No tags for: ' + path);
return md.tags.split(',');
}
function itemIdFromPath(path) {
const md = itemMetadata(path);
if (!md.id) throw new Error('No ID for ' + path);
return md.id;
}
function fileToBase64(filePath) {
@ -53,6 +78,7 @@ async function parseNoteFile(filePath) {
id: itemIdFromPath(filePath),
title: title,
body: body,
tags: noteTags(filePath),
resources: resources,
};
}
@ -88,4 +114,5 @@ async function main() {
main().catch((error) => {
console.error(error);
process.exit(1);
});

View File

@ -424,6 +424,8 @@
<h1 id="encryption">Encryption</h1>
<p>Joplin supports end-to-end encryption (E2EE) on all the applications. E2EE is a system where only the owner of the notes, notebooks, tags or resources can read them. It prevents potential eavesdroppers - including telecom providers, internet providers, and even the developers of Joplin from being able to access the data. Please see the <a href="https://joplin.cozic.net/e2ee">End-To-End Encryption Tutorial</a> for more information about this feature and how to enable it.</p>
<p>For a more technical description, mostly relevant for development or to review the method being used, please see the <a href="https://joplin.cozic.net/spec">Encryption specification</a>.</p>
<h1 id="external-text-editor">External text editor</h1>
<p>Joplin notes can be opened and edited using an external editor of your choice. It can be a simple text editor like Notepad++ or Sublime Text or an actual Markdown editor like Typora. In that case, images will also be displayed within the editor. To open the note in an external editor, click on the icon in the toolbar or press Ctrl+E (or Cmd+E). Your default text editor will be used to open the note. If needed, you can also specify the editor directly in the General Options, under &quot;Text editor command&quot;.</p>
<h1 id="attachments-resources">Attachments / Resources</h1>
<p>Any kind of file can be attached to a note. In Markdown, links to these files are represented as a simple ID to the resource. 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.</p>
<p>On the <strong>desktop application</strong>, images can be attached either by clicking on &quot;Attach file&quot; or by pasting (with Ctrl+V) an image directly in the editor, or by drag and dropping an image.</p>

View File

@ -10,9 +10,7 @@ Joplin has three main columns:
- **Sidebar**: It contains the list of your notebooks and tags, as well as the synchronisation status.
- **Note List**: It contains the current list of notes - either the notes in the currently selected notebook, or the notes in the currently selected tag.
- **Note Editor**: The note editor contains both an editor panel, where your write your note in Markdown, and a viewer panel, which shows the rendered note. To edit notes, you may also use an [external editor](). If you like WYSIWYG editors, you can use something like Typora as an external editor and it will display the note as well as any embedded image.
**TODO: CREATE TEXT EDITOR HELP INFO ON WEBSITE**
- **Note Editor**: The note editor contains both an editor panel, where your write your note in Markdown, and a viewer panel, which shows the rendered note. To edit notes, you may also use an [external editor](https://joplin.cozic.net/#external-text-editor). For example, if you like WYSIWYG editors, you can use something like Typora as an external editor and it will display the note as well as any embedded image.
## Writing notes in Markdown
@ -26,21 +24,19 @@ In general, while Markdown is a markup language, it is meant to be human readabl
## Sub-heading
Paragraphs are separated by a blank line. Text attributes _italic_, **bold** and `monospace` are supported.
You can create bullet list:
Paragraphs are separated by a blank line. Text attributes _italic_, **bold** and `monospace` are supported. You can create bullet lists:
* apples
* oranges
* pears
Or numbered list:
Or numbered lists:
1. wash
2. rinse
3. repeat
And this is a [link](https://joplin.cozic.net).
This is a [link](https://joplin.cozic.net) and, finally, below is an horizontal rule:
* * *
@ -48,18 +44,20 @@ A lot more is possible including adding code samples, math formulas or checkbox
## Organising your notes
### With notebooks
Joplin notes are organised into a tree of notebooks and sub-notebooks.
- On **💻 desktop**, you can create a notebook by clicking on New Notebook, then you can drag and drop them into other notebooks to organise them as you wish.
- On **📱 mobile**, press the "+" icon and select "New notebook".
- On **🔡 terminal**, press `:mn`!
**TODO: ADD SUB-NOTEBOOK IMAGE**
![](./SubNotebooks.png)
### With tags
The second way to organise your notes is using tags:
- On **💻 desktop**, right-click on any note in the Note List, and select "Edit tags". You can then add the tags, separating each one by a comma.
- On **📱 mobile**, open the note and press the "⋮" button and select "Tags".
- On **🔡 terminal**, type `:help tag` for the available commands.
**TODO: ADD TAGS TO EACH OF THESE NOTES (eg. "welcome", "markdown", "notebook" tag)**
- On **🔡 terminal**, type `:help tag` for the available commands.

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB