You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: guides/README.md
+21-1Lines changed: 21 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,4 +10,24 @@ Please help use to improve this guide. If you have any suggestions, please creat
10
10
11
11
## Hint "No ESLint configuration was found. ESLint is very helpful, it is worth using it even for small projects."
12
12
13
-
To get started with ESLint checkout [ESLint](eslint.md).
13
+
To get started with ESLint, check out [ESLint](eslint.md).
14
+
15
+
## Hint "Recommendation: The README seems not to have a config example. Please add one."
16
+
17
+
For information on best practices for a README config section, check out [Config Instructions](readme_bestpractices.md#Config-Instructions).
18
+
19
+
## Hint "Recommendation: The README seems not to have an install section (like ## Installation). Please add one."
20
+
21
+
For information on best practices for a README installation section, check out [Installation Instructions](readme_bestpractices.md#Installation-Instructions).
22
+
23
+
## Hint "Recommendation: The README seems not to have an update section (like ## Update). Please add one."
24
+
25
+
For information on best practices for a README update section, check out [Update Instructions](readme_bestpractices.md#Update-Instructions).
26
+
27
+
## Hint "Recommendation: The README seems to have a config example without a trailing comma. Please add one."
28
+
29
+
For information on best practices for a README config section, check out [Config Instructions](readme_bestpractices.md#Config-Instructions).
30
+
31
+
## Hint "Recommendation: The README seems to have a modules array (Found modules: [). This is usually not necessary. Please remove it if it is not needed."
32
+
33
+
For information on best practices for a README config section, check out [Config Instructions](readme_bestpractices.md#Config-Instructions).
This file contains suggested best practices for creating a README file for your MagicMirror² module.
2
+
3
+
# Installation Instructions
4
+
5
+
Your README file should have an "Installation" section that includes a code block that can be pasted into a user's terminal to fully install your module. Here is a good example of an install code block:
* The code block should not be broken up into multiple separate blocks for each line of code so that users can copy and paste the entire block into their terminal and execute the install with one click.
30
+
* The opening `` ``` `` of your code block should be followed by "`sh`" or "`bash`" so that the code block is styled as shell script.
31
+
* If your module has required dependencies, `npm ci` is preferable to `npm install` in many circumstances because it will repeatably instruct users' machines not to recreate the `package-lock.json` file.
32
+
* Adding `--omit=dev` to the `npm ci` or `npm install` command will instruct users' machines not to install developer dependencies that are unneeded by most users, which will save on install time and disk space.
33
+
34
+
# Update Instructions
35
+
36
+
Your README file should have an "Update" section that includes a code block that can be pasted into a user's terminal to update your module.
37
+
38
+
# Config Instructions
39
+
40
+
Your README file should have a "Config" or "Configuration" section that includes an example config block that can be pasted into user's `config.js` files. Here is a good example of a config code block:
41
+
42
+
````
43
+
```js
44
+
{
45
+
module: MMM-MyModule,
46
+
position: bottom_bar,
47
+
config: {
48
+
myCustomVariable: 400,
49
+
MySecondCustomVariable: false
50
+
}
51
+
},
52
+
```
53
+
````
54
+
55
+
## Tips
56
+
57
+
* The opening `` ``` `` of your code block should be followed by "`js`" or "`javascript`" so that the code block is styled as javasript.
58
+
* The final `}` should be followed by a `,` so that the block can be copied and pasted straight into users' `config.js` files without throwing errors.
59
+
* The example config should provide a minimal demo configuration that will get your module working if pasted directly into a user's `config.js` file.
Copy file name to clipboardExpand all lines: scripts/check_modules.py
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -359,15 +359,15 @@ def check_modules():
359
359
file_path, "## Updat")
360
360
ifnotfound_update_section:
361
361
module["issues"].append(
362
-
"Recommendation: The README seems not to have an update section (like `## Update`). Please add one."
362
+
"Recommendation: The README seems not to have an update section (like `## Update`). Please add one ([basic instructions](https://github.com/MagicMirrorOrg/MagicMirror-3rd-Party-Modules/blob/main/guides/readme_bestpractices.md#Update-Instructions))."
363
363
)
364
364
365
365
# Search for an install section in README
366
366
found_install_section=search_in_file(
367
367
file_path, "## Install")
368
368
ifnotfound_install_section:
369
369
module["issues"].append(
370
-
"Recommendation: The README seems not to have an install section (like `## Installation`). Please add one."
370
+
"Recommendation: The README seems not to have an install section (like `## Installation`). Please add one ([basic instructions](https://github.com/MagicMirrorOrg/MagicMirror-3rd-Party-Modules/blob/main/guides/readme_bestpractices.md#Installation-Instructions))."
"Recommendation: The README seems to have a modules array (Found `modules: [`). This is usually not necessary. Please remove it if it is not needed."
380
+
"Recommendation: The README seems to have a modules array (Found `modules: [`). This is usually not necessary. Please remove it if it is not needed ([basic instructions](https://github.com/MagicMirrorOrg/MagicMirror-3rd-Party-Modules/blob/main/guides/readme_bestpractices.md#Config-Instructions))."
381
381
)
382
382
383
383
# Search for config example with regex "\{\s*[^}]*?\s*config:\s*\{\s*[^}]*\}(?!\s*,\s*\})\s*\}"
"Recommendation: The README seems not to have a config example. Please add one."
392
+
"Recommendation: The README seems not to have a config example. Please add one ([basic instructions](https://github.com/MagicMirrorOrg/MagicMirror-3rd-Party-Modules/blob/main/guides/readme_bestpractices.md#Config-Instructions))."
393
393
)
394
394
else:
395
395
# Check if the config example has an trailing comma
"Recommendation: The README seems to have a config example without a trailing comma. Please add one."
401
+
"Recommendation: The README seems to have a config example without a trailing comma. Please add one ([basic instructions](https://github.com/MagicMirrorOrg/MagicMirror-3rd-Party-Modules/blob/main/guides/readme_bestpractices.md#Config-Instructions))."
0 commit comments