day notes changes

azivner 2018-08-29 23:59:34 +02:00
parent 01a688050c
commit 60e2d2a142
8 changed files with 48 additions and 30 deletions

@ -1,14 +0,0 @@
A common pattern in note taking is that a lot of notes will be centered around certain date - e.g. you have some tasks which needs to be done on certain date, you have meeting minutes from certain date, you have your thoughts etc. and it all revolves around a date on which they occurred. For this reason it makes sense to create certain "day workspace" which will centralize all those notes relevant for certain date.
For this, Trilium provides a concept of "day note". Trilium semi-automatically generates a single note for each day. Under this note you can save ([[clone|Cloning notes]]) all those relevant notes.
## Demo
[[gifs/day-note.gif]]
In the demo you can see clicking on "Today" button (actually a [[script|Scripts]]) which will show today's "day note". Day note itself is empty except for showing list of edited notes that day (this functionality is also provided by script), but contains today's important and relevant notes.
This pattern works well also because of [[cloning|Cloning notes]] functionality - note can appear in multiple places in the note tree so besides appearing under day note, it can also be categorized into other notes (e.g. "Trusted timestamping" note is also categorized under Tech -> Security note).
## Automation
In the demo you can notice that day note has a label - `@dateNote=2018-08-16`. This is useful for scripts to understand the date hierarchy. As an example, you can have a script which will download your reddit comments and save them automatically under day note (on which the comments have been created).

22
Day notes.md Normal file

@ -0,0 +1,22 @@
A common pattern in note taking is that a lot of notes will be centered around certain date - e.g. you have some tasks which needs to be done on certain date, you have meeting minutes from certain date, you have your thoughts etc. and it all revolves around a date on which they occurred. For this reason it makes sense to create certain "day workspace" which will centralize all those notes relevant for certain date.
For this, Trilium provides a concept of "day note". Trilium semi-automatically generates a single note for each day. Under this note you can save all those relevant notes.
This pattern works well also because of [[cloning|Cloning notes]] functionality - note can appear in multiple places in the note tree so besides appearing under day note, it can also be categorized into other notes.
## Demo
[[images/day-notes.png]]
You can see structure of day notes appearing under "Journal" note - there's a note for the whole year 2017, under it you have "12 - December" which then contains "18 - Monday". This is our "day note" which contains some text in its content and also has some child notes (some of them are from [[Task manager]]).
You can also notice how this day note has [[promoted attribute|Promoted attributes]] "weight" where you can track your daily weight. This data is then used in [[Weight tracker]];
## Implementation
Trilium has some special support for day notes in the form of [backend Script API](https://zadam.github.io/trilium/backend_api/BackendScriptApi.html) - see e.g. getDateNote() function.
Day (and year, month) notes are created with a label - e.g. `@dateNote=2018-08-16` this can then be used by other scripts to add new notes to day note etc.
Journal has [[attributes]] `@sorted @child:sorted @child:sorted:sorted` which keeps notes sorted on all three levels of years, months and dates.
Journal also has relation "child:child:child:template=Day template" which effectively adds [[template]] to day notes (grand-grand-grand children of Journal). The template is pretty simple - it just adds "weight" promoted attribute to keep track of our daily weight.

@ -4,4 +4,11 @@ It's stored in single file, by default in `trilium-data/document.db`
If you want to backup your Trilium data, just backup this single file - it contains everything you need.
Trilium has been originally created as a web interface to the [Notecase Pro](http://www.notecasepro.com/), as such it used same database format as Notecase Pro. Database format evolved and today it's not compatible with Notecase Pro even though there are still some similarities in its schema.
## Demo document
When you run Trilium for the first time, it will generate a demo document for you as a starting point. It's also pretty useful for demonstration of some of Trilium's features, e.g.:
* [[Day notes]]
* [[Weight tracker]]
* [[Task manager]]
* [[Family tree]]

@ -1,6 +1,11 @@
Trilium supports searching in notes. In essence it consists of
* [[attribute|Attributes]] search - you can e.g. search for notes having certain label - see *Attribute query syntax* below.
* full text search - search in text and code note content. Since this is implemented as a database search, this works only for not protected notes (doesn't matter if you're in protected session or not)
## Filter query syntax
You can activate search by clicking on magnifier icon on the left or pressing `CTRL-S` keyboard shortcut.
## Attribute query syntax
Following examples demonstrates syntax:

@ -12,20 +12,7 @@ This means that there's one central server (we'll call this instance _sync serve
This approach is used when you already have a desktop instance of Trilium and you want to [[setup sync server on your web host|Server installation]].
### Sync server setup
1. Run Trilium in your new environment - this will generate default directory `trilium-data` in your home directory, default config etc.
2. Stop Trilium in the new environment
3. Copy your existing trilium [[document|Document]] file (by default located in your home directory under `trilium-data/document.db`) into your target environment into `trilium-data` directory
4. Edit client's `trilium-data/config.ini` and set `syncServerHost` to the host and port where the sync server is running
5. Start the sync server
6. Start the client
You should be able to see in the client logs that sync connection has been established.
### Additional sync client(s) setup
Setting up extra sync clients is very similar to setting up a server - make sure everything is stopped, copy the [[document|Document]], set up client's `syncServerHost` in `config.ini` to point to the sync server and then start everything up.
So let's assume your server instance is already setup. Then open your desktop instance, click on Options ->
## Conflict resolution

11
Template.md Normal file

@ -0,0 +1,11 @@
Template is a concept related to [[promoted attributes]].
Often we have some kind of note "class" - e.g. we want to keep track of books we've read and there are some common attributes we'd like to fill for all such books - we want to have author's name there, link to amazon or wikipedia, genre or publication date.
To make these attributes really obvious, we make them "promoted" so they are visible on the UI on the first sight. But we don't want to set them as promoted for each note separately so what we'll do is that we'll create a "Book template" note where we'll define all those promoted attribute.
Then whenever we create a new note for book we'll just link the template to the book note via [[relation|Attributes]] "template". Book note will then automatically inherit all the promoted attributes and display them.
To make this even more automated, we can create "child:template" attribute on common parent note of our books and whenever we create new note inside this parent, the book note will get the template relation automatically.
You can check out the concept in the [[demo document|Document#demo-document]] in e.g. [[Family tree]], [[Task manager]] or [[Day notes]].

Binary file not shown.

Before

Width:  |  Height:  |  Size: 190 KiB

BIN
images/day-notes.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB