Skip to content

Commit

Permalink
update docs/ with the last changes in the wiki
Browse files Browse the repository at this point in the history
  • Loading branch information
klaernie committed Nov 29, 2020
1 parent 24dc596 commit d922147
Show file tree
Hide file tree
Showing 7 changed files with 140 additions and 8 deletions.
4 changes: 2 additions & 2 deletions docs/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ There should be AT LEAST one **scene**, one **view** and one **calendar**.
**Concept**
![Concept](scene-view-calendar.png)
![What is a scene, what is a view](scene-view.png)
- You should have at least ONE Scene for display your events.
- You should have at least ONE Scene to display your events.
- Each Scene could have at least ONE View. You can assume each scene as a profile or page.
- Each View decide how to show events. It can could have at least ONE calendar or more. You can choose to show which calendar events and how to be displayed and more by configuration.
- Each View decides how to show events. It must have at least ONE calendar or more. You can choose to show which calendar events and how to be displayed and more by configuration.
- A Calendar is your .ics file or URL. You can manipulate events by configuration.
- To point specific Scene/View/Calendar, It could have `name`. and almost everything will be configurable.

Expand Down
13 changes: 12 additions & 1 deletion docs/Configuration/View.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ These fields could be used in all views. (But some fields might work differently
|position |String | "bottom_bar" | "top_left" | Where to display this view.
|positionOrder |Integer |2 | -1 | view order in position region. `-1`: last of region, `0`: first of region, Any positive integer like `2`: `n`th in region
|calendars |Array of calendar names | ["My Football calendar", "US Holidays"] | [] | Which calendar events will be shown in this view. For all calendars, just set to `[]`
|title |String | "SCHEDULE" | "" | It will be used as module header title.
|title |String or callback | "SCHEDULE" | "" | It will be used as module header title.
|locale |String | "de-DE" | default locale | You can apply specific locale to only this view instead default locale.
|fromNow |Integer | -1 | 0 | When this view calendar will be start. <br> By example; in `view:monthly`, `-1` will be last month, `0` will be this month, `1` will be next month.<br/><br/>In view of `upcoming`, `current`, this value will be ignored.
|slotCount |Integer |4 | 3 | How many periodic calendar slot will be shown. <br> By example; in `view:monthly`, `3` will show 3 `monthly` view slot. <br><br/>`mode:daily`, `fromNow:-1`, `slotCount:3` will be show *3 daily calendar slots from yesterday to tomorrow*
Expand All @@ -59,3 +59,14 @@ These fields could be used in all views. (But some fields might work differently
|filter|Function | (e)=>{} | (e)=>{...} | See [Filtering and Sorting](../Filtering-and-Sorting.md)
|sort|Function | (a,b)=>{} | (a,b)=>{...} | See [Filtering and Sorting](../Filtering-and-Sorting.md)
|transform|Function| (e)=>{} | (e)=>{...} | See [Filtering and Sorting](../Filtering-and-Sorting.md)

#### title callback
If you can set `title` as a callback function, the result of function will be used as module title.
```js
title: (mObj) => {
return mObj.format("[My Weekly:] Wo")
},
```
This example will return "My Weekly: 49th" or similar.

callback function get `moment Object` of first slot start time for arguments. So you can handle it in callback function.
1 change: 1 addition & 0 deletions docs/Configuration/Views/week,-month.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ If you set these view positions as `fullscreen_below` or `fullscreen_above`, the
|showWeekends |Boolean |false |true |Show Saturday and Sunday.
|slotMaxHeight |String |"150px" |"240px" |height of calendar cell. `hideOverflow` is set to `true` by force in this view.
|weeksFormat |String |"[week] wo" |"wo" |Weeks mark of calendar.
|monthFormat |String | "[Month:] MM" | "MMMM" |The title of month in current view. (CSS selector:`.monthViewTitle`)

# View:month
|field |value type |value example |default value |memo |
Expand Down
3 changes: 2 additions & 1 deletion docs/Event-Object.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ isFullday:false
isMoment:false
isOneday:true
isPassed:false
isRecurring:false
location:""
startDate:"1546631100"
startDateJ:"2019-01-04T19:45:00.000Z"
Expand All @@ -34,4 +35,4 @@ By example;
calendars: ["Holiday", "Office Schedule", "Wife"],
}
```
In this example, `Holiday` will have `calendarSeq:0`, then, `Office Schdule` will have `calendarSeq:1`, ...
In this example, `Holiday` will have `calendarSeq:0`, then, `Office Schdule` will have `calendarSeq:1`, ...
2 changes: 1 addition & 1 deletion docs/Event-Time.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ You can define how to show the event time. `timeFormat`, `dateFormat` and `dateT
- e.g) `dateFormat:"ddd MM/DD",` will be displayed as `Mon 12/17` in `en-US` locale.
- **dateTimeFormat**
- This format will be used for all other event.
- e.g) `dateFormat:"HH:mm M/D",` will be displayed as `01:23 1/3`.
- e.g) `dateTimeFormat:"HH:mm M/D",` will be displayed as `01:23 1/3`.

- Or You can use more complex calendar-style formatter object to define more humanized time.
- e.g) for `dateTimeFormat`, below format will be displayed as `Yesterday 12:34` or `Last Sat 02:00`.
Expand Down
119 changes: 119 additions & 0 deletions docs/Tip:-Sync-with-MMM-Pages..md
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
Many people are asking me How to use this module with [MMM-Pages](https://github.com/edward-shen/MMM-pages).


Like this;

PAGE1
![](https://raw.githubusercontent.com/eouia/MMM-CalendarExt2/master/doc/Page_1.png)

PAGE2
![](https://raw.githubusercontent.com/eouia/MMM-CalendarExt2/master/doc/Page_2.png)

PAGE3
![](https://raw.githubusercontent.com/eouia/MMM-CalendarExt2/master/doc/Page_3.png)

Let's configure.

**`MMM-Pages`**
```js
{
module: 'MMM-pages',
config: {
modules: [
["clock", ],
["MMM-COVID-19", ],
["MMM-News", ],
],
fixed: ["MMM-page-indicator", "MMM-CalendarExt2"],
rotationTime: 1000 * 5,
}
},
```
I've set 3 pages (page:0, page:1, page:2). Each has some other modules like `clock`. Now I'll show a different view of MMM-CalendarExt2 in each page.

**`MMM-CalendarExt2`**
```js
{
module: 'MMM-CalendarExt2',
position: "top_left", // meaningless.
config: {
rotateInterval: 0,
updateInterval: 1000 * 60 * 60,
calendars : [
{
name: "bundesliga",
url: "webcal://www.google.com/calendar/ical/spielplan.1.bundesliga%40gmail.com/public/basic.ics",
icon: "emojione-flag-for-flag-germany",
},
],
views: [
{
name: "VIEW1",
mode: "daily",
position:"top_right",
slotCount: 1,
calendars: ["bundesliga"],
},
{
name: "VIEW2",
mode: "weekly",
position:"top_right",
slotCount: 1,
calendars: ["bundesliga"],
},
{
name: "VIEW3",
mode: "monthly",
position:"top_right",
slotCount: 1,
calendars: ["bundesliga"],
},
],
scenes: [
{
name: "PAGE1",
views:["VIEW1"],
},
{
name: "PAGE2",
views:["VIEW1", "VIEW2"],
},
{
name: "PAGE3",
views:["VIEW1", "VIEW2", "VIEW3"],
className: "fakeScene"
},
],
notifications: {
"PAGE_INCREMENT" : {
exec: "sceneNext",
},
"PAGE_DECREMENT" : {
exec: "scenePrevious",
}
},
},
},

```
I made 3 views and put them into 3 scenes.
Then, see `notifications` section. When `PAGE_INCREMENT` is coming, **`sceneNext`** command is executed. easy.
The results are above pictures.
And, this is already explained in wiki of github.


**One More Thing**

_Hey, I want page 3 empty. How to remove view or scene in that page?_

I wrote `className:fakeScene,` in 3rd scene config. Let's add this into your `css/custom.css`
```css
.CX2.fakeScene {
display:none;
}
```

Now, the 3rd scene will be displayed like this.

![](https://raw.githubusercontent.com/eouia/MMM-CalendarExt2/master/doc/Page_4.png)

6 changes: 3 additions & 3 deletions docs/Usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ payload: (payload, sender) => {
```

**Available executable functions**
- `nextScene()`
- `previousScene()`
- `sceneNext()`
- `scenePrevious()`
- `changeSceneById(seq)`
- `chageSceneByName(name)`
- `eventQuery({filter:fn(event), callback:fn(events)})`
- `eventQuery({filter:fn(event), callback:fn(events)})`

0 comments on commit d922147

Please sign in to comment.