Improve readme snippets

This commit is contained in:
th-ch
2019-04-26 15:23:54 +02:00
committed by GitHub
parent 708ba3167e
commit 253e82a2d7

View File

@ -28,7 +28,7 @@ Here are the links to the current version:
## Dev ## Dev
``` ```sh
git clone https://github.com/th-ch/youtube-music git clone https://github.com/th-ch/youtube-music
cd youtube-music cd youtube-music
npm install npm install
@ -48,7 +48,7 @@ Create a folder in `plugins/YOUR-PLUGIN-NAME`:
- if you need to manipulate the BrowserWindow, create a file `back.js` with the following template: - if you need to manipulate the BrowserWindow, create a file `back.js` with the following template:
``` ```node
module.exports = win => { module.exports = win => {
// win is the BrowserWindow object // win is the BrowserWindow object
}; };
@ -56,7 +56,7 @@ module.exports = win => {
- if you need to change the front, create a file `front.js` with the following template: - if you need to change the front, create a file `front.js` with the following template:
``` ```node
module.exports = () => { module.exports = () => {
// This function will be called as a preload script // This function will be called as a preload script
// So you can use front features like `document.querySelector` // So you can use front features like `document.querySelector`
@ -67,7 +67,10 @@ module.exports = () => {
- injecting custom CSS: create a `style.css` file in the same folder then: - injecting custom CSS: create a `style.css` file in the same folder then:
``` ```node
const path = require("path");
const { injectCSS } = require("../utils");
// back.js // back.js
module.exports = win => { module.exports = win => {
injectCSS(win.webContents, path.join(__dirname, "style.css")); injectCSS(win.webContents, path.join(__dirname, "style.css"));
@ -76,7 +79,7 @@ module.exports = win => {
- changing the HTML: - changing the HTML:
``` ```node
// front.js // front.js
module.exports = () => { module.exports = () => {
// Remove the login button // Remove the login button
@ -88,7 +91,7 @@ module.exports = () => {
## Build ## Build
``` ```sh
npm run build npm run build
``` ```