Module lua.nd.note
A note object, representing a file on your system in memory.
Functions
Note:sync () | Sync the note. |
Note:add_link (link) | Add a link to the note. |
Note:flush_to_file () | Flush the note to it's file. |
Note:has_link (note) | Check if the current note has a link to another one. |
Note:sync_links () | Sync links between notes. |
Note:new (opts) | Instantiate a new note. |
Note:from_path (path) | Read a file, and create a note in memory. |
Functions
- Note:sync ()
-
Sync the note.
Creates a new note from it's current path and replaces the object.
Returns:
-
Note: The new note
- Note:add_link (link)
-
Add a link to the note.
Parameters:
- link Link: A link object
- Note:flush_to_file ()
- Flush the note to it's file. Only operates on the header. Might make some assumptions about how you want your notes to look.
- Note:has_link (note)
-
Check if the current note has a link to another one.
Parameters:
- note Note: The note to check
Returns:
-
bool: Do we have a link to the other note?
- Note:sync_links ()
-
Sync links between notes.
Checks if all notes linked from this one have a backlink.
If not create them and write the file.
Returns:
-
string: Output to show the user
- Note:new (opts)
-
Instantiate a new note.
Parameters:
- opts table: A table of options
Returns:
-
table: The new Note object
- Note:from_path (path)
-
Read a file, and create a note in memory.
Parameters:
- path string: The path to the file
Returns:
-
Note: The new note object