Skip to content

Commit 253e82a

Browse files
authored
Improve readme snippets
1 parent 708ba31 commit 253e82a

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

readme.md

+9-6
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Here are the links to the current version:
2828

2929
## Dev
3030

31-
```
31+
```sh
3232
git clone https://github.com/th-ch/youtube-music
3333
cd youtube-music
3434
npm install
@@ -48,15 +48,15 @@ Create a folder in `plugins/YOUR-PLUGIN-NAME`:
4848

4949
- if you need to manipulate the BrowserWindow, create a file `back.js` with the following template:
5050

51-
```
51+
```node
5252
module.exports = win => {
5353
// win is the BrowserWindow object
5454
};
5555
```
5656

5757
- if you need to change the front, create a file `front.js` with the following template:
5858

59-
```
59+
```node
6060
module.exports = () => {
6161
// This function will be called as a preload script
6262
// So you can use front features like `document.querySelector`
@@ -67,7 +67,10 @@ module.exports = () => {
6767

6868
- injecting custom CSS: create a `style.css` file in the same folder then:
6969

70-
```
70+
```node
71+
const path = require("path");
72+
const { injectCSS } = require("../utils");
73+
7174
// back.js
7275
module.exports = win => {
7376
injectCSS(win.webContents, path.join(__dirname, "style.css"));
@@ -76,7 +79,7 @@ module.exports = win => {
7679

7780
- changing the HTML:
7881

79-
```
82+
```node
8083
// front.js
8184
module.exports = () => {
8285
// Remove the login button
@@ -88,7 +91,7 @@ module.exports = () => {
8891

8992
## Build
9093

91-
```
94+
```sh
9295
npm run build
9396
```
9497

0 commit comments

Comments
 (0)