chore: fix lint:js-in-markdown script (#38260)

This commit is contained in:
David Sanders 2023-05-15 00:58:35 -07:00 committed by GitHub
parent 0149ae72e6
commit eeb1e7d499
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 1078 additions and 586 deletions

View file

@ -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