From 9d7b2003e378cace1640c4204f5ae9da0d1b5860 Mon Sep 17 00:00:00 2001 From: Erick Zhao Date: Wed, 8 May 2024 19:12:29 -0700 Subject: [PATCH] docs: update formatting for mdx3 compatibility (#42099) * docs: update formatting for mdx3 compatibility (#42052) docs: update formatting for mdx3 compat * escape curly braces --- docs/api/base-window.md | 2 +- docs/api/browser-window.md | 2 +- docs/api/net.md | 2 +- docs/api/session.md | 2 +- docs/api/web-contents.md | 2 +- docs/development/debugging-with-symbol-server.md | 2 +- docs/tutorial/esm.md | 3 ++- docs/tutorial/tutorial-1-prerequisites.md | 2 +- docs/tutorial/tutorial-2-first-app.md | 6 ++++-- 9 files changed, 13 insertions(+), 10 deletions(-) diff --git a/docs/api/base-window.md b/docs/api/base-window.md index 2a4848da0e52..cc7503604c51 100644 --- a/docs/api/base-window.md +++ b/docs/api/base-window.md @@ -600,7 +600,7 @@ Perhaps there are 15 pixels of controls on the left edge, 25 pixels of controls on the right edge and 50 pixels of controls below the player. In order to maintain a 16:9 aspect ratio (standard aspect ratio for HD @1920x1080) within the player itself we would call this function with arguments of 16/9 and -{ width: 40, height: 50 }. The second argument doesn't care where the extra width and height +\{ width: 40, height: 50 \}. The second argument doesn't care where the extra width and height are within the content view--only that they exist. Sum any extra width and height areas you have within the overall content view. diff --git a/docs/api/browser-window.md b/docs/api/browser-window.md index 9ee4c92672c7..9c148280043a 100644 --- a/docs/api/browser-window.md +++ b/docs/api/browser-window.md @@ -723,7 +723,7 @@ Perhaps there are 15 pixels of controls on the left edge, 25 pixels of controls on the right edge and 50 pixels of controls below the player. In order to maintain a 16:9 aspect ratio (standard aspect ratio for HD @1920x1080) within the player itself we would call this function with arguments of 16/9 and -{ width: 40, height: 50 }. The second argument doesn't care where the extra width and height +\{ width: 40, height: 50 \}. The second argument doesn't care where the extra width and height are within the content view--only that they exist. Sum any extra width and height areas you have within the overall content view. diff --git a/docs/api/net.md b/docs/api/net.md index 79b2ca2cd320..56d9d4c4fd1a 100644 --- a/docs/api/net.md +++ b/docs/api/net.md @@ -66,7 +66,7 @@ requests according to the specified protocol scheme in the `options` object. ### `net.fetch(input[, init])` * `input` string | [GlobalRequest](https://nodejs.org/api/globals.html#request) -* `init` [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/fetch#options) & { bypassCustomProtocolHandlers?: boolean } (optional) +* `init` [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/fetch#options) & \{ bypassCustomProtocolHandlers?: boolean \} (optional) Returns `Promise` - see [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response). diff --git a/docs/api/session.md b/docs/api/session.md index 23288572c01b..9ec54a8b58e0 100644 --- a/docs/api/session.md +++ b/docs/api/session.md @@ -695,7 +695,7 @@ Returns `Promise` - Resolves when all connections are closed. #### `ses.fetch(input[, init])` * `input` string | [GlobalRequest](https://nodejs.org/api/globals.html#request) -* `init` [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/fetch#options) & { bypassCustomProtocolHandlers?: boolean } (optional) +* `init` [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/fetch#options) & \{ bypassCustomProtocolHandlers?: boolean \} (optional) Returns `Promise` - see [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response). diff --git a/docs/api/web-contents.md b/docs/api/web-contents.md index 75570c328ee1..4f0c2ca1720e 100644 --- a/docs/api/web-contents.md +++ b/docs/api/web-contents.md @@ -1288,7 +1288,7 @@ Ignore application menu shortcuts while this web contents is focused. #### `contents.setWindowOpenHandler(handler)` -* `handler` Function\<{action: 'deny'} | {action: 'allow', outlivesOpener?: boolean, overrideBrowserWindowOptions?: BrowserWindowConstructorOptions}\> +* `handler` Function\<\{action: 'deny'\} | \{action: 'allow', outlivesOpener?: boolean, overrideBrowserWindowOptions?: BrowserWindowConstructorOptions\}\> * `details` Object * `url` string - The _resolved_ version of the URL passed to `window.open()`. e.g. opening a window with `window.open('foo')` will yield something like `https://the-origin/the/current/path/foo`. * `frameName` string - Name of the window provided in `window.open()` diff --git a/docs/development/debugging-with-symbol-server.md b/docs/development/debugging-with-symbol-server.md index 0663675306ae..276490198cf4 100644 --- a/docs/development/debugging-with-symbol-server.md +++ b/docs/development/debugging-with-symbol-server.md @@ -15,7 +15,7 @@ calls, and other compiler optimizations. The only workaround is to build an unoptimized local build. The official symbol server URL for Electron is -. +[https://symbols.electronjs.org](https://symbols.electronjs.org). You cannot visit this URL directly, you must add it to the symbol path of your debugging tool. In the examples below, a local cache directory is used to avoid repeatedly fetching the PDB from the server. Replace `c:\code\symbols` with an diff --git a/docs/tutorial/esm.md b/docs/tutorial/esm.md index 6fb7ea729ba1..c5620b8a1c33 100644 --- a/docs/tutorial/esm.md +++ b/docs/tutorial/esm.md @@ -78,7 +78,8 @@ JavaScript transpilers (e.g. Babel, TypeScript) have historically supported ES M syntax before Node.js supported ESM imports by turning these calls to CommonJS `require` calls. -
Example: @babel/plugin-transform-modules-commonjs +
+Example: @babel/plugin-transform-modules-commonjs The `@babel/plugin-transform-modules-commonjs` plugin will transform ESM imports down to `require` calls. The exact syntax will depend on the diff --git a/docs/tutorial/tutorial-1-prerequisites.md b/docs/tutorial/tutorial-1-prerequisites.md index 3506d01e448f..c0990dfbe2c0 100644 --- a/docs/tutorial/tutorial-1-prerequisites.md +++ b/docs/tutorial/tutorial-1-prerequisites.md @@ -121,7 +121,7 @@ need to install Node.js themselves as a prerequisite to running your app. To check which version of Node.js is running in your app, you can access the global [`process.versions`][] variable in the main process or preload script. You can also reference -. +[https://releases.electronjs.org/releases.json](https://releases.electronjs.org/releases.json). ::: diff --git a/docs/tutorial/tutorial-2-first-app.md b/docs/tutorial/tutorial-2-first-app.md index 5052b37de718..7364d7faf84a 100644 --- a/docs/tutorial/tutorial-2-first-app.md +++ b/docs/tutorial/tutorial-2-first-app.md @@ -222,7 +222,8 @@ with CommonJS module syntax: - [app][app], which controls your application's event lifecycle. - [BrowserWindow][browser-window], which creates and manages app windows. -
Module capitalization conventions +
+Module capitalization conventions You might have noticed the capitalization difference between the **a**pp and **B**rowser**W**indow modules. Electron follows typical JavaScript conventions here, @@ -231,7 +232,8 @@ Notification) whereas camelCase modules are not instantiable (e.g. app, ipcRende
-
Typed import aliases +
+Typed import aliases For better type checking when writing TypeScript code, you can choose to import main process modules from `electron/main`.