Skip to content

Commit 5ed5b13

Browse files
rejasveeck
andauthored
Add documenation about npm package (#270)
* add line about npm * fix linting * use code block for halloween example --------- Co-authored-by: veeck <[email protected]>
1 parent 754d121 commit 5ed5b13

File tree

6 files changed

+60
-34
lines changed

6 files changed

+60
-34
lines changed

development/core-module-file.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,11 @@ Whenever your module need to be updated, call the `updateDom(speed)` method. It
332332
requests the MagicMirror core to update its dom object. If you define the speed,
333333
the content update will be animated, but only if the content will really change.
334334

335-
Note that the rendering of the updated dom on the screen will happen asynchronously. You can listen for the [`DOM_OBJECTS_UPDATED` notification](/development/notifications.html) to know when the rendering is complete and the new dom is safe to interact with. This notification only fires if the content will really change.
335+
Note that the rendering of the updated dom on the screen will happen
336+
asynchronously. You can listen for the
337+
[`DOM_OBJECTS_UPDATED` notification](/development/notifications.html) to know
338+
when the rendering is complete and the new dom is safe to interact with. This
339+
notification only fires if the content will really change.
336340

337341
As an example: the clock modules calls this method every second:
338342

development/notifications.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ Additional technical information on the notifications can be found in the
1717

1818
The system sends three notifications when starting up:
1919

20-
| Notification | Payload | Description |
21-
| --------------------- | ------- | -------------------------------------------------------------------------------------- |
22-
| `ALL_MODULES_STARTED` | _none_ | All modules are started. You can now send notifications to other modules. |
23-
| `DOM_OBJECTS_CREATED` | _none_ | All dom objects are created. The system is now ready to perform visual changes. |
24-
| `MODULE_DOM_CREATED` | _none_ | This module's dom has been fully loaded. You can now access your module's dom objects. |
20+
| Notification | Payload | Description |
21+
| --------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
22+
| `ALL_MODULES_STARTED` | _none_ | All modules are started. You can now send notifications to other modules. |
23+
| `DOM_OBJECTS_CREATED` | _none_ | All dom objects are created. The system is now ready to perform visual changes. |
24+
| `MODULE_DOM_CREATED` | _none_ | This module's dom has been fully loaded. You can now access your module's dom objects. |
2525
| `MODULE_DOM_UPDATED` | _none_ | This module's dom has been updated and re-rendered. You can now access your module's (updated) dom objects. This notification is sent in response to a call to [`updateDom`](https://docs.magicmirror.builders/development/core-module-file.html#module-instance-methods). |
2626

2727
# Default module notifications

getting-started/installation.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ team. Use these scripts and methods at your own risk.
7272
of the box with a default setup of MagicMirror, under the hood it uses the
7373
[docker setup](https://gitlab.com/khassel/magicmirror).
7474

75+
### NPM
76+
77+
- We also publish the latest version of MagicMirror to the
78+
[npm-registry](https://www.npmjs.com/package/magicmirror).
79+
7580
## Other Operating Systems
7681

7782
### Windows:

modules/compliments.md

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,15 @@ compliments.
5858
Compliments can be set for a specific day in the format `YYYY-MM-DD`. `.` can be
5959
used as a wildcard.
6060

61-
starting in Version 2.29, the compliments configuration can use a cron type specification, which provides more options. In addition to date, one can use hours, minutes and day of week for additional control
62-
the cron format string is 5 groups of space separated values<br><br>
63-
**minute hour day month day_of_week**<br><br>
64-
each can be a range, and use numbers or names
65-
see https://crontab-generator.org for a visual cron syntax creator.. this tool asks for the command to be executed (cron is usually used to execute commands on a schedule), just use anything, and take the first 5 space separated tokens of the result.
61+
starting in Version 2.29, the compliments configuration can use a cron type
62+
specification, which provides more options. In addition to date, one can use
63+
hours, minutes and day of week for additional control the cron format string is
64+
5 groups of space separated values<br><br> **minute hour day month
65+
day_of_week**<br><br> each can be a range, and use numbers or names see
66+
https://crontab-generator.org for a visual cron syntax creator.. this tool asks
67+
for the command to be executed (cron is usually used to execute commands on a
68+
schedule), just use anything, and take the first 5 space separated tokens of the
69+
result.
6670

6771
If set, the weather can be used for compliments. The available properties are:
6872

@@ -98,7 +102,7 @@ config: {
98102
}
99103
```
100104

101-
#### Example use with a cron entry
105+
#### Example use with a cron entry
102106

103107
```javascript
104108
config: {
@@ -109,11 +113,24 @@ config: {
109113
}
110114
}
111115
```
112-
this means, on Friday or Saturday, every week (* (every) month/day) between 16:48-16:50, 17:48-17:50, and 18:48-18:50, the assigned messages will be used. note: like with the date only setting, if these are the only possible messages you want displayed, you need to set **specialDayUnique:true**
113116

114-
another example,. you could use this for scary messages ONLY on between 8 and 9pm Halloween evening
115-
<br>"* 20-21 31 10 *":["Boo!!"]
117+
this means, on Friday or Saturday, every week (\* (every) month/day) between
118+
16:48-16:50, 17:48-17:50, and 18:48-18:50, the assigned messages will be used.
119+
note: like with the date only setting, if these are the only possible messages
120+
you want displayed, you need to set **specialDayUnique:true**
116121

122+
As another example you could use this for scary messages ONLY between 8 and
123+
9pm on Halloween evening:
124+
125+
```javascript
126+
config: {
127+
compliments: {
128+
"* 20-21 31 10 *": [
129+
"Boo!!"
130+
]
131+
}
132+
}
133+
```
117134

118135
#### Example use with weather module
119136

0 commit comments

Comments
 (0)