summaryrefslogtreecommitdiff
path: root/API.md
diff options
context:
space:
mode:
authorWuzzy <almikes@aol.com>2016-08-31 20:29:30 +0200
committerWuzzy <almikes@aol.com>2016-08-31 20:29:30 +0200
commit02f9a0b2cc253a3f7ce2120b9fda74b88450444e (patch)
treebee0fa6a7e93578b78955972586ecb22eabddb61 /API.md
parent3275815d3b87bd95ee635af6a705896706062cf8 (diff)
Update API documentation for aliases
Diffstat (limited to 'API.md')
-rw-r--r--API.md18
1 files changed, 13 insertions, 5 deletions
diff --git a/API.md b/API.md
index fe37efb..51c1267 100644
--- a/API.md
+++ b/API.md
@@ -26,6 +26,12 @@ Marking an entry as viewed or revealed is not reversible with this API.
The viewed and hidden states are stored in the file `doc.mt` inside the
world directory.
+### Entry aliases
+Entry aliases are alternative identifiers for entry identifiers. With the
+exception of the alias functions themselves, When a function demands an
+`entry_id` you can either supply the original `entry_id` or any alias of the
+`entry_id`.
+
## Possible use cases
I present to you some possible use cases to give you a rough idea what
this mod is capable and how certain use casescould be implemented.
@@ -281,13 +287,14 @@ effect.
Always `nil`.
### `doc.add_entry_alias(category_id, entry_id, alias)`
-Adds a single alias for an entry. When an entry has an alias, attempting to open
-an entry by an alias name results in opening the entry of the original name.
-Aliases are true within one category only.
+Adds a single alias for an entry. When an entry has an alias, supplying the
+alias to a function which demands an `entry_id` will work as if the original
+`entry_id` has been supplied. Aliases are true within one category only.
#### Parameters
* `category_id`: Category identifier of the category of the entry in question
-* `entry_id`: Entry identifier of the entry to create an alias for
+* `entry_id`: The original (!) entry identifier of the entry to create an alias
+ for
* `alias`: Alias (string) for `entry_id`
#### Return value
@@ -299,7 +306,8 @@ function has the same effect as `doc.add_entry_alias`.
#### Parameters
* `category_id`: Category identifier of the category of the entry in question
-* `entry_id`: Entry identifier of the entry to create aliases for
+* `entry_id`: The original (!) entry identifier of the entry to create aliases
+ for
* `aliases`: Table/list of aliases (strings) for `entry_id`
#### Return value