Fix format and typos, Add Update section, Remove "Maintainer needed" section

This commit is contained in:
Kristjan ESPERANTO 2024-09-13 21:05:18 +02:00
parent 4fe8c3558f
commit 12f2d82295

146
readme.md
View file

@ -1,27 +1,6 @@
# Maintainer needed
Hello, it's been 5 years since I've written this! While I'm happy to see it
thriving, it's also about time I step away. I haven't had a MagicMirror up
in years, and to be frank, I'm hoping someone else will be willing to take
up maintainership of the project.
I find this project to be in a near complete form. Other than a few mishaps of
me not having proper testing before pushing out code, more often than not any
problems that people have usually isn't often because of this project. The few
issues that do exist aren't very hard to fix nor are they severe that they
impact the project in any large manner. It's just I haven't had the time nor
motivation to fix them.
I don't think there are expectations for this project to have new features, so
a maintainer should really only need to just make sure people are getting help
when they raise issues and fix the rare bug that pops out every so often. If
you're interested, please don't hesitate to reach out.
---
# MMM-pages # MMM-pages
This [MagicMirror²][mm] Module allows you to have pages in your MagicMirror! This [MagicMirror²][mm] module allows you to have pages in your MagicMirror!
Want to have more modules in your MagicMirror, but want to keep the format? Want to have more modules in your MagicMirror, but want to keep the format?
Or, want to have grouped modules that are themed together? Look no further! Or, want to have grouped modules that are themed together? Look no further!
@ -31,9 +10,11 @@ Note that this module does not provide any method of manually changing the page!
You should ask other developers to add a notification to their modules, or add You should ask other developers to add a notification to their modules, or add
one yourself! one yourself!
To display what page you're on, check out the [page indicator module][page indicator].
## Installation ## Installation
In your terminal, go to your MagicMirror's Module folder: In your terminal, go to your MagicMirror's module folder:
```bash ```bash
cd ~/MagicMirror/modules cd ~/MagicMirror/modules
@ -42,69 +23,74 @@ cd ~/MagicMirror/modules
Clone this repository: Clone this repository:
```bash ```bash
git clone https://github.com/sdetweil/MMM-pages.git git clone https://github.com/sdetweil/MMM-pages
``` ```
Configure the module in your config.js file. ## Update
*\<self-promotion>* Go to the modules folder inside your MagicMirror's module folder and pull the latest version:
To display what page you're on, I'd highly recommend checking out my ```bash
[page indicator module][page indicator]. cd ~/MagicMirror/modules/MMM-pages
git pull
```
*\<\\self-promotion>* ## Configuration
## Using the module
To use this module, add it to the modules array in the `config/config.js` file. To use this module, add it to the modules array in the `config/config.js` file.
Note: module names used in the following example are fictitious.
this approach uses the module names as the page organization technique, as the modulename is added as a css class in the MM page content. Note: module names used in the following example are fictitious.
Because the modulename is used, this approach does not support multiple instances of the same module with data
on different pages. (like your calendar on page 1, and someone elses on page 2) This approach uses the module names as the page organization technique, as the modulename is added as a CSS class in the MM page content.
Because the modulename is used, this approach does not support multiple instances of the same module with data
on different pages (like your calendar on page 1, and someone elses on page 2).
```js ```js
modules: [ modules: [
{ {
module: 'MMM-pages', module: "MMM-pages",
config: { config: {
modules: modules: [
[[ "newsfeed" ], ["newsfeed"],
[ "calendar", "compliments" ]], ["calendar", "compliments"]
fixed: [ "clock", "weather", "MMM-page-indicator" ], ],
hiddenPages: { fixed: ["clock", "weather", "MMM-page-indicator"],
"screenSaver": [ "clock", "MMM-SomeBackgroundImageModule" ], hiddenPages: {
"admin": [ "MMM-ShowMeSystemStatsModule", "MMM-AnOnScreenMenuModule" ], "screenSaver": ["clock", "MMM-SomeBackgroundImageModule"],
}, "admin": ["MMM-ShowMeSystemStatsModule", "MMM-AnOnScreenMenuModule"]
} }
} }
] },
];
``` ```
and alternative approach, is to define a fixed MMM-pages config and alternative approach, is to define a fixed MMM-pages config
```js ```js
modules: [ modules: [
{ {
module: 'MMM-pages', module: "MMM-pages",
config: { config: {
modules: modules: [
[[ "page1" ], ["page1"],
[ "page2" ], ["page2"],
[ "page3" ], ["page3"]
], ],
fixed: [ "fixed_page" ], fixed: ["fixed_page"],
hiddenPages: { hiddenPages: {
"screenSaver": [ "screensaver_page" ], "screenSaver": ["screensaver_page"],
"admin": [ "admin_page" ], "admin": ["admin_page"]
}, }
}
} }
] },
];
``` ```
and then at each module, add a classes: property to indicate the page(s) this module is supposed to appear on and then at each module, add a classes: property to indicate the page(s) this module is supposed to appear on
```
{ ```js
{
module:"newsfeed", module:"newsfeed",
classes:"page1", classes:"page1",
}, },
@ -117,11 +103,13 @@ and then at each module, add a classes: property to indicate the page(s) this mo
classes:"page2", classes:"page2",
} }
``` ```
etc
if u want a modules content on multiple pages the classes would list those page names etc.
```
{ If u want a modules content on multiple pages the classes would list those page names
```js
{
module:"newsfeed", module:"newsfeed",
classes:"page1", classes:"page1",
}, },
@ -132,14 +120,14 @@ if u want a modules content on multiple pages the classes would list those page
{ {
module:"calendar", // second calendar instance on page 3 module:"calendar", // second calendar instance on page 3
classes:"page3", classes:"page3",
}, },
{ {
module:"compliments", module:"compliments",
classes:"page1 page2", // this module appears on multiple pages classes:"page1 page2", // this module appears on multiple pages
} }
``` ```
## Configuration options ### Configuration options
| Option | Type | Default Value | Description | | Option | Type | Default Value | Description |
| --- | --- | --- | --- | | --- | --- | --- | --- |
@ -153,13 +141,11 @@ if u want a modules content on multiple pages the classes would list those page
| `rotationHomePage` | `int` | `0` | Time, in milliseconds, before automatically returning to the home page. If a home page is not set, this returns to the leftmost page instead. | | `rotationHomePage` | `int` | `0` | Time, in milliseconds, before automatically returning to the home page. If a home page is not set, this returns to the leftmost page instead. |
| `rotationFirstPage` | *NA* | *NA* | **Deprecated**. Use `rotationHomePage` instead. | | `rotationFirstPage` | *NA* | *NA* | **Deprecated**. Use `rotationHomePage` instead. |
| `homePage` | `int` | `0` | Which page index is the home page. If none is set, this returns to the leftmost page instead. | | `homePage` | `int` | `0` | Which page index is the home page. If none is set, this returns to the leftmost page instead. |
| `useLockString` | `bool` | `true` | Whether or not to use a lock string to show or hide pages. If disabled, other modules may override when modules may be shown. _Advanced users only. Only override this if you know what you're doing._ | `useLockString` | `bool` | `true` | Whether or not to use a lock string to show or hide pages. If disabled, other modules may override when modules may be shown. *Advanced users only. Only override this if you know what you're doing.* |
| `pageTimeout ` | `[]` | `{pageNumber:x,timeout:nnnn}`| array of structures, enable different timeouts for different pages | `pageTimeout` | `[]` | `{pageNumber:x,timeout:nnnn}`| array of structures, enable different timeouts for different pages. |
|||| pageNumber starts at 1 for the first page, timeout is in milliseconds |||| `pageNumber` starts at 1 for the first page, timeout is in milliseconds. |
For the `module` configuration option, the first element of the outer array For the `module` configuration option, the first element of the outer array should consist of elements that should be on the first page. The second element should consist of elements that should be on the second page, and so forth.
should consist of elements that should be on the first page. The second element
should consist of elements that should be on the second page, and so forth.
## Notifications ## Notifications
@ -197,7 +183,7 @@ index of 1, and the page to the right of that has an index of 2. Thus, to change
to the third page, your module should send out: to the third page, your module should send out:
```js ```js
this.sendNotification("PAGE_CHANGED", 2); this.sendNotification("PAGE_CHANGED", 2);
``` ```
This module keeps internal track of how many pages you have, defined by your This module keeps internal track of how many pages you have, defined by your
@ -209,8 +195,8 @@ MMM-pages notifications.
### Initialization ### Initialization
_This section provides documentation on what notifications the module sends on *This section provides documentation on what notifications the module sends on
startup. This section isn't necessary to read for most users._ startup. This section isn't necessary to read for most users.*
MMM-pages doesn't activate until we receive the `DOM_OBJECTS_CREATED` MMM-pages doesn't activate until we receive the `DOM_OBJECTS_CREATED`
notification, as that notification ensures all modules have been loaded. On this notification, as that notification ensures all modules have been loaded. On this