docs: uniformize module API doc format (#28920)
This PR ensures that all API modules are present in the README doc, as there were a couple missing. It also formats all modules to contain a level-1 heading and a blockquote description.
This commit is contained in:
parent
a1a90ed03b
commit
18a76c6b9d
8 changed files with 28 additions and 10 deletions
|
@ -126,6 +126,8 @@ These individual tutorials expand on topics discussed in the guide above.
|
||||||
* [ipcMain](api/ipc-main.md)
|
* [ipcMain](api/ipc-main.md)
|
||||||
* [Menu](api/menu.md)
|
* [Menu](api/menu.md)
|
||||||
* [MenuItem](api/menu-item.md)
|
* [MenuItem](api/menu-item.md)
|
||||||
|
* [MessageChannelMain](api/message-channel-main.md)
|
||||||
|
* [MessagePortMain](api/message-port-main.md)
|
||||||
* [net](api/net.md)
|
* [net](api/net.md)
|
||||||
* [netLog](api/net-log.md)
|
* [netLog](api/net-log.md)
|
||||||
* [nativeTheme](api/native-theme.md)
|
* [nativeTheme](api/native-theme.md)
|
||||||
|
@ -135,6 +137,7 @@ These individual tutorials expand on topics discussed in the guide above.
|
||||||
* [protocol](api/protocol.md)
|
* [protocol](api/protocol.md)
|
||||||
* [screen](api/screen.md)
|
* [screen](api/screen.md)
|
||||||
* [session](api/session.md)
|
* [session](api/session.md)
|
||||||
|
* [ShareMenu](api/share-menu.md)
|
||||||
* [systemPreferences](api/system-preferences.md)
|
* [systemPreferences](api/system-preferences.md)
|
||||||
* [TouchBar](api/touch-bar.md)
|
* [TouchBar](api/touch-bar.md)
|
||||||
* [Tray](api/tray.md)
|
* [Tray](api/tray.md)
|
||||||
|
|
|
@ -1,14 +1,16 @@
|
||||||
## Class: BrowserView
|
# BrowserView
|
||||||
|
|
||||||
> Create and control views.
|
|
||||||
|
|
||||||
Process: [Main](../glossary.md#main-process)
|
|
||||||
|
|
||||||
A `BrowserView` can be used to embed additional web content into a
|
A `BrowserView` can be used to embed additional web content into a
|
||||||
[`BrowserWindow`](browser-window.md). It is like a child window, except that it is positioned
|
[`BrowserWindow`](browser-window.md). It is like a child window, except that it is positioned
|
||||||
relative to its owning window. It is meant to be an alternative to the
|
relative to its owning window. It is meant to be an alternative to the
|
||||||
`webview` tag.
|
`webview` tag.
|
||||||
|
|
||||||
|
## Class: BrowserView
|
||||||
|
|
||||||
|
> Create and control views.
|
||||||
|
|
||||||
|
Process: [Main](../glossary.md#main-process)
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# Menu
|
||||||
|
|
||||||
## Class: Menu
|
## Class: Menu
|
||||||
|
|
||||||
> Create native application menus and context menus.
|
> Create native application menus and context menus.
|
||||||
|
|
|
@ -9,12 +9,15 @@ channel messaging.
|
||||||
|
|
||||||
## Class: MessageChannelMain
|
## Class: MessageChannelMain
|
||||||
|
|
||||||
|
> Channel interface for channel messaging in the main process.
|
||||||
|
|
||||||
Process: [Main](../glossary.md#main-process)
|
Process: [Main](../glossary.md#main-process)
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
// Main process
|
// Main process
|
||||||
|
const { MessageChannelMain } = require('electron')
|
||||||
const { port1, port2 } = new MessageChannelMain()
|
const { port1, port2 } = new MessageChannelMain()
|
||||||
w.webContents.postMessage('port', null, [port2])
|
w.webContents.postMessage('port', null, [port2])
|
||||||
port1.postMessage({ some: 'message' })
|
port1.postMessage({ some: 'message' })
|
||||||
|
|
|
@ -14,6 +14,8 @@ channel messaging.
|
||||||
|
|
||||||
## Class: MessagePortMain
|
## Class: MessagePortMain
|
||||||
|
|
||||||
|
> Port interface for channel messaging in the main process.
|
||||||
|
|
||||||
Process: [Main](../glossary.md#main-process)
|
Process: [Main](../glossary.md#main-process)
|
||||||
|
|
||||||
### Instance Methods
|
### Instance Methods
|
||||||
|
|
|
@ -1,8 +1,4 @@
|
||||||
## Class: ShareMenu
|
# ShareMenu
|
||||||
|
|
||||||
> Create share menu on macOS.
|
|
||||||
|
|
||||||
Process: [Main](../glossary.md#main-process)
|
|
||||||
|
|
||||||
The `ShareMenu` class creates [Share Menu][share-menu] on macOS, which can be
|
The `ShareMenu` class creates [Share Menu][share-menu] on macOS, which can be
|
||||||
used to share information from the current context to apps, social media
|
used to share information from the current context to apps, social media
|
||||||
|
@ -11,6 +7,12 @@ accounts, and other services.
|
||||||
For including the share menu as a submenu of other menus, please use the
|
For including the share menu as a submenu of other menus, please use the
|
||||||
`shareMenu` role of [`MenuItem`](menu-item.md).
|
`shareMenu` role of [`MenuItem`](menu-item.md).
|
||||||
|
|
||||||
|
## Class: ShareMenu
|
||||||
|
|
||||||
|
> Create share menu on macOS.
|
||||||
|
|
||||||
|
Process: [Main](../glossary.md#main-process)
|
||||||
|
|
||||||
### `new ShareMenu(sharingItem)`
|
### `new ShareMenu(sharingItem)`
|
||||||
|
|
||||||
* `sharingItem` SharingItem - The item to share.
|
* `sharingItem` SharingItem - The item to share.
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# TouchBar
|
||||||
|
|
||||||
## Class: TouchBar
|
## Class: TouchBar
|
||||||
|
|
||||||
> Create TouchBar layouts for native macOS applications
|
> Create TouchBar layouts for native macOS applications
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# Tray
|
||||||
|
|
||||||
## Class: Tray
|
## Class: Tray
|
||||||
|
|
||||||
> Add icons and context menus to the system's notification area.
|
> Add icons and context menus to the system's notification area.
|
||||||
|
|
Loading…
Reference in a new issue