chore: fix lint:js-in-markdown script (#38260)
This commit is contained in:
parent
0149ae72e6
commit
eeb1e7d499
26 changed files with 1078 additions and 586 deletions
|
@ -17,29 +17,29 @@ Notification objects created using this module do not appear unless their `show(
|
|||
method is called.
|
||||
|
||||
```js title='Main Process'
|
||||
const { Notification } = require("electron");
|
||||
const { Notification } = require('electron')
|
||||
|
||||
const NOTIFICATION_TITLE = "Basic Notification";
|
||||
const NOTIFICATION_BODY = "Notification from the Main process";
|
||||
const NOTIFICATION_TITLE = 'Basic Notification'
|
||||
const NOTIFICATION_BODY = 'Notification from the Main process'
|
||||
|
||||
new Notification({
|
||||
title: NOTIFICATION_TITLE,
|
||||
body: NOTIFICATION_BODY,
|
||||
}).show();
|
||||
body: NOTIFICATION_BODY
|
||||
}).show()
|
||||
```
|
||||
|
||||
Here's a full example that you can open with Electron Fiddle:
|
||||
|
||||
```javascript fiddle='docs/fiddles/features/notifications/main'
|
||||
const { Notification } = require("electron");
|
||||
const { Notification } = require('electron')
|
||||
|
||||
const NOTIFICATION_TITLE = "Basic Notification";
|
||||
const NOTIFICATION_BODY = "Notification from the Main process";
|
||||
const NOTIFICATION_TITLE = 'Basic Notification'
|
||||
const NOTIFICATION_BODY = 'Notification from the Main process'
|
||||
|
||||
new Notification({
|
||||
title: NOTIFICATION_TITLE,
|
||||
body: NOTIFICATION_BODY,
|
||||
}).show();
|
||||
body: NOTIFICATION_BODY
|
||||
}).show()
|
||||
```
|
||||
|
||||
### Show notifications in the renderer process
|
||||
|
@ -48,25 +48,25 @@ Notifications can be displayed directly from the renderer process with the
|
|||
[web Notifications API](https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API/Using_the_Notifications_API).
|
||||
|
||||
```js title='Renderer Process'
|
||||
const NOTIFICATION_TITLE = "Title";
|
||||
const NOTIFICATION_TITLE = 'Title'
|
||||
const NOTIFICATION_BODY =
|
||||
"Notification from the Renderer process. Click to log to console.";
|
||||
const CLICK_MESSAGE = "Notification clicked";
|
||||
'Notification from the Renderer process. Click to log to console.'
|
||||
const CLICK_MESSAGE = 'Notification clicked'
|
||||
|
||||
new Notification(NOTIFICATION_TITLE, { body: NOTIFICATION_BODY }).onclick =
|
||||
() => console.log(CLICK_MESSAGE);
|
||||
() => console.log(CLICK_MESSAGE)
|
||||
```
|
||||
|
||||
Here's a full example that you can open with Electron Fiddle:
|
||||
|
||||
```javascript fiddle='docs/fiddles/features/notifications/renderer'
|
||||
const NOTIFICATION_TITLE = "Title";
|
||||
const NOTIFICATION_TITLE = 'Title'
|
||||
const NOTIFICATION_BODY =
|
||||
"Notification from the Renderer process. Click to log to console.";
|
||||
const CLICK_MESSAGE = "Notification clicked";
|
||||
'Notification from the Renderer process. Click to log to console.'
|
||||
const CLICK_MESSAGE = 'Notification clicked'
|
||||
|
||||
new Notification(NOTIFICATION_TITLE, { body: NOTIFICATION_BODY }).onclick =
|
||||
() => console.log(CLICK_MESSAGE);
|
||||
() => console.log(CLICK_MESSAGE)
|
||||
```
|
||||
|
||||
## Platform considerations
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue