Merge pull request #11178 from electron/fenced-code-block-lang
enforce rules on code blocks style in docs
This commit is contained in:
commit
70643a865b
20 changed files with 91 additions and 69 deletions
6
.remarkrc
Normal file
6
.remarkrc
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"plugins": [
|
||||||
|
["remark-lint-code-block-style", "fenced"],
|
||||||
|
["remark-lint-fenced-code-flag"]
|
||||||
|
]
|
||||||
|
}
|
|
@ -112,7 +112,7 @@ A comma-separated list of servers for which integrated authentication is enabled
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
--auth-server-whitelist='*example.com, *foobar.com, *baz'
|
--auth-server-whitelist='*example.com, *foobar.com, *baz'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -314,7 +314,7 @@ Template:
|
||||||
|
|
||||||
Menu:
|
Menu:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
- 1
|
- 1
|
||||||
- 2
|
- 2
|
||||||
- 3
|
- 3
|
||||||
|
@ -337,7 +337,7 @@ Template:
|
||||||
|
|
||||||
Menu:
|
Menu:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
- ---
|
- ---
|
||||||
- a
|
- a
|
||||||
- b
|
- b
|
||||||
|
|
|
@ -146,7 +146,7 @@ of the main process.
|
||||||
|
|
||||||
e.g.
|
e.g.
|
||||||
|
|
||||||
```
|
```sh
|
||||||
project/
|
project/
|
||||||
├── main
|
├── main
|
||||||
│ ├── foo.js
|
│ ├── foo.js
|
||||||
|
|
|
@ -78,7 +78,7 @@ Note that it is not enough to call
|
||||||
code runs after it is possible to make changes to chromium sandbox settings. The
|
code runs after it is possible to make changes to chromium sandbox settings. The
|
||||||
switch must be passed to electron on the command-line:
|
switch must be passed to electron on the command-line:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
electron --enable-sandbox app.js
|
electron --enable-sandbox app.js
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -151,10 +151,12 @@ Important things to notice in the preload script:
|
||||||
To create a browserify bundle and use it as a preload script, something like
|
To create a browserify bundle and use it as a preload script, something like
|
||||||
the following should be used:
|
the following should be used:
|
||||||
|
|
||||||
|
```sh
|
||||||
browserify preload/index.js \
|
browserify preload/index.js \
|
||||||
-x electron \
|
-x electron \
|
||||||
-x fs \
|
-x fs \
|
||||||
--insert-global-vars=__filename,__dirname -o preload.js
|
--insert-global-vars=__filename,__dirname -o preload.js
|
||||||
|
```
|
||||||
|
|
||||||
The `-x` flag should be used with any required module that is already exposed in
|
The `-x` flag should be used with any required module that is already exposed in
|
||||||
the preload scope, and tells browserify to use the enclosing `require` function
|
the preload scope, and tells browserify to use the enclosing `require` function
|
||||||
|
|
|
@ -140,7 +140,7 @@ option is ignored and `pacScript` configuration is applied.
|
||||||
|
|
||||||
The `proxyRules` has to follow the rules below:
|
The `proxyRules` has to follow the rules below:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
proxyRules = schemeProxies[";"<schemeProxies>]
|
proxyRules = schemeProxies[";"<schemeProxies>]
|
||||||
schemeProxies = [<urlScheme>"="]<proxyURIList>
|
schemeProxies = [<urlScheme>"="]<proxyURIList>
|
||||||
urlScheme = "http" | "https" | "ftp" | "socks"
|
urlScheme = "http" | "https" | "ftp" | "socks"
|
||||||
|
|
|
@ -114,7 +114,7 @@ Make sure you have the latest Visual Studio update installed.
|
||||||
If building under Cygwin, you may see `bootstrap.py` failed with following
|
If building under Cygwin, you may see `bootstrap.py` failed with following
|
||||||
error:
|
error:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
Assertion failed: ((handle))->activecnt >= 0, file src\win\pipe.c, line 1430
|
Assertion failed: ((handle))->activecnt >= 0, file src\win\pipe.c, line 1430
|
||||||
|
|
||||||
Traceback (most recent call last):
|
Traceback (most recent call last):
|
||||||
|
|
|
@ -18,7 +18,9 @@ See also [V8 Development](v8-development.md)
|
||||||
It is possible to debug Chromium with Electron by passing
|
It is possible to debug Chromium with Electron by passing
|
||||||
`--build_debug_libcc` to the bootstrap script:
|
`--build_debug_libcc` to the bootstrap script:
|
||||||
|
|
||||||
$ ./script/bootstrap.py -d --build_debug_libcc
|
```bash
|
||||||
|
$ ./script/bootstrap.py -d --build_debug_libcc
|
||||||
|
```
|
||||||
|
|
||||||
This will download and build libchromiumcontent locally, similarly to the
|
This will download and build libchromiumcontent locally, similarly to the
|
||||||
`--build_release_libcc`, but it will create a shared library build of
|
`--build_release_libcc`, but it will create a shared library build of
|
||||||
|
@ -27,13 +29,17 @@ libchromiumcontent and won't strip any symbols, making it ideal for debugging.
|
||||||
When built like this, you can make changes to files in
|
When built like this, you can make changes to files in
|
||||||
`vendor/libchromiumcontent/src` and rebuild quickly with:
|
`vendor/libchromiumcontent/src` and rebuild quickly with:
|
||||||
|
|
||||||
$ ./script/build.py -c D --libcc
|
```bash
|
||||||
|
$ ./script/build.py -c D --libcc
|
||||||
|
```
|
||||||
|
|
||||||
When developing on linux with gdb, it is recommended to add a gdb index to speed
|
When developing on linux with gdb, it is recommended to add a gdb index to speed
|
||||||
up loading symbols. This doesn't need to be executed on every build, but it is
|
up loading symbols. This doesn't need to be executed on every build, but it is
|
||||||
recommended to do it at least once to index most shared libraries:
|
recommended to do it at least once to index most shared libraries:
|
||||||
|
|
||||||
$ ./vendor/libchromiumcontent/src/build/gdb-add-index ./out/D/electron
|
```bash
|
||||||
|
$ ./vendor/libchromiumcontent/src/build/gdb-add-index ./out/D/electron
|
||||||
|
```
|
||||||
|
|
||||||
Building libchromiumcontent requires a powerful machine and takes a long time
|
Building libchromiumcontent requires a powerful machine and takes a long time
|
||||||
(though incremental rebuilding the shared library component is fast). With an
|
(though incremental rebuilding the shared library component is fast). With an
|
||||||
|
@ -54,13 +60,17 @@ several libchromiumcontent build trees on the same machine(to work on different
|
||||||
branches for example), it is recommended to set the variable to speed up the
|
branches for example), it is recommended to set the variable to speed up the
|
||||||
download of Chromium source. For example:
|
download of Chromium source. For example:
|
||||||
|
|
||||||
$ mkdir ~/.chromium-git-cache
|
```bash
|
||||||
$ LIBCHROMIUMCONTENT_GIT_CACHE=~/.chromium-git-cache ./script/bootstrap.py -d --build_debug_libcc
|
$ mkdir ~/.chromium-git-cache
|
||||||
|
$ LIBCHROMIUMCONTENT_GIT_CACHE=~/.chromium-git-cache ./script/bootstrap.py -d --build_debug_libcc
|
||||||
|
```
|
||||||
|
|
||||||
If the bootstrap script is interrupted while using the git cache, it will leave
|
If the bootstrap script is interrupted while using the git cache, it will leave
|
||||||
the cache locked. To remove the lock, delete the files ending in `.lock`:
|
the cache locked. To remove the lock, delete the files ending in `.lock`:
|
||||||
|
|
||||||
$ find ~/.chromium-git-cache/ -type f -name '*.lock' -delete
|
```bash
|
||||||
|
$ find ~/.chromium-git-cache/ -type f -name '*.lock' -delete
|
||||||
|
```
|
||||||
|
|
||||||
It is possible to share this directory with other machines by exporting it as
|
It is possible to share this directory with other machines by exporting it as
|
||||||
SMB share on linux, but only one process/machine can be using the cache at a
|
SMB share on linux, but only one process/machine can be using the cache at a
|
||||||
|
@ -70,6 +80,8 @@ not work perfectly in a network.
|
||||||
On Windows, SMBv2 has a directory cache that will cause problems with the git
|
On Windows, SMBv2 has a directory cache that will cause problems with the git
|
||||||
cache script, so it is necessary to disable it by setting the registry key
|
cache script, so it is necessary to disable it by setting the registry key
|
||||||
|
|
||||||
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Lanmanworkstation\Parameters\DirectoryCacheLifetime
|
```bash
|
||||||
|
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Lanmanworkstation\Parameters\DirectoryCacheLifetime
|
||||||
|
```
|
||||||
|
|
||||||
to 0. More information: https://stackoverflow.com/a/9935126
|
to 0. More information: https://stackoverflow.com/a/9935126
|
||||||
|
|
|
@ -73,7 +73,7 @@ Tips:
|
||||||
|
|
||||||
For a `patch` release, use the following format:
|
For a `patch` release, use the following format:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
## Bug Fixes
|
## Bug Fixes
|
||||||
|
|
||||||
* Fixed a cross-platform thing. #123
|
* Fixed a cross-platform thing. #123
|
||||||
|
@ -95,7 +95,7 @@ For a `patch` release, use the following format:
|
||||||
|
|
||||||
For a `minor` release, e.g. `1.8.0`, use this format:
|
For a `minor` release, e.g. `1.8.0`, use this format:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
## Upgrades
|
## Upgrades
|
||||||
|
|
||||||
- Upgraded from Node `oldVersion` to `newVersion`. #123
|
- Upgraded from Node `oldVersion` to `newVersion`. #123
|
||||||
|
@ -118,7 +118,7 @@ For a `minor` release, e.g. `1.8.0`, use this format:
|
||||||
```
|
```
|
||||||
|
|
||||||
### Major releases
|
### Major releases
|
||||||
```
|
```sh
|
||||||
## Upgrades
|
## Upgrades
|
||||||
|
|
||||||
- Upgraded from Chromium `oldVersion` to `newVersion`. #123
|
- Upgraded from Chromium `oldVersion` to `newVersion`. #123
|
||||||
|
@ -147,7 +147,7 @@ For a `minor` release, e.g. `1.8.0`, use this format:
|
||||||
|
|
||||||
### Beta releases
|
### Beta releases
|
||||||
Use the same formats as the ones suggested above, but add the following note at the beginning of the changelog:
|
Use the same formats as the ones suggested above, but add the following note at the beginning of the changelog:
|
||||||
```
|
```sh
|
||||||
**Note:** This is a beta release and most likely will have have some instability and/or regressions.
|
**Note:** This is a beta release and most likely will have have some instability and/or regressions.
|
||||||
|
|
||||||
Please file new issues for any bugs you find in it.
|
Please file new issues for any bugs you find in it.
|
||||||
|
|
|
@ -29,7 +29,7 @@ your symbol path (**Note:** you can replace `c:\code\symbols` with any writable
|
||||||
directory on your computer, if you'd prefer a different location for downloaded
|
directory on your computer, if you'd prefer a different location for downloaded
|
||||||
symbols):
|
symbols):
|
||||||
|
|
||||||
```
|
```powershell
|
||||||
SRV*c:\code\symbols\*https://electron-symbols.githubapp.com
|
SRV*c:\code\symbols\*https://electron-symbols.githubapp.com
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ Set this string as `_NT_SYMBOL_PATH` in the environment, using the Windbg menus,
|
||||||
or by typing the `.sympath` command. If you would like to get symbols from
|
or by typing the `.sympath` command. If you would like to get symbols from
|
||||||
Microsoft's symbol server as well, you should list that first:
|
Microsoft's symbol server as well, you should list that first:
|
||||||
|
|
||||||
```
|
```powershell
|
||||||
SRV*c:\code\symbols\*http://msdl.microsoft.com/download/symbols;SRV*c:\code\symbols\*https://electron-symbols.githubapp.com
|
SRV*c:\code\symbols\*http://msdl.microsoft.com/download/symbols;SRV*c:\code\symbols\*https://electron-symbols.githubapp.com
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ SRV*c:\code\symbols\*http://msdl.microsoft.com/download/symbols;SRV*c:\code\symb
|
||||||
|
|
||||||
Type the following commands in Windbg to print why symbols are not loading:
|
Type the following commands in Windbg to print why symbols are not loading:
|
||||||
|
|
||||||
```
|
```powershell
|
||||||
> !sym noisy
|
> !sym noisy
|
||||||
> .reload /f electron.exe
|
> .reload /f electron.exe
|
||||||
```
|
```
|
||||||
|
|
|
@ -9,7 +9,7 @@ to understand the source code better.
|
||||||
|
|
||||||
## Structure of Source Code
|
## Structure of Source Code
|
||||||
|
|
||||||
```
|
```sh
|
||||||
Electron
|
Electron
|
||||||
├── atom/ - C++ source code.
|
├── atom/ - C++ source code.
|
||||||
| ├── app/ - System entry code.
|
| ├── app/ - System entry code.
|
||||||
|
@ -85,7 +85,7 @@ git submodule update --init --recursive
|
||||||
If you find yourself running this command often, you can create an alias for it
|
If you find yourself running this command often, you can create an alias for it
|
||||||
in your `~/.gitconfig` file:
|
in your `~/.gitconfig` file:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
[alias]
|
[alias]
|
||||||
su = submodule update --init --recursive
|
su = submodule update --init --recursive
|
||||||
```
|
```
|
||||||
|
|
|
@ -134,7 +134,7 @@ delete window.module;
|
||||||
|
|
||||||
When using Electron's built-in module you might encounter an error like this:
|
When using Electron's built-in module you might encounter an error like this:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
> require('electron').webFrame.setZoomFactor(1.0)
|
> require('electron').webFrame.setZoomFactor(1.0)
|
||||||
Uncaught TypeError: Cannot read property 'setZoomLevel' of undefined
|
Uncaught TypeError: Cannot read property 'setZoomLevel' of undefined
|
||||||
```
|
```
|
||||||
|
@ -151,7 +151,7 @@ console.log(require.resolve('electron'))
|
||||||
|
|
||||||
and then check if it is in the following form:
|
and then check if it is in the following form:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
"/path/to/Electron.app/Contents/Resources/atom.asar/renderer/api/lib/exports/electron.js"
|
"/path/to/Electron.app/Contents/Resources/atom.asar/renderer/api/lib/exports/electron.js"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -168,7 +168,7 @@ The optional arguments are notated by square brackets `[]` surrounding the optio
|
||||||
as well as the comma required if this optional argument follows another
|
as well as the comma required if this optional argument follows another
|
||||||
argument:
|
argument:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
required[, optional]
|
required[, optional]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -80,7 +80,7 @@ file's name.
|
||||||
|
|
||||||
The structure of a renamed app would be like:
|
The structure of a renamed app would be like:
|
||||||
|
|
||||||
```
|
```text
|
||||||
MyApp.app/Contents
|
MyApp.app/Contents
|
||||||
├── Info.plist
|
├── Info.plist
|
||||||
├── MacOS/
|
├── MacOS/
|
||||||
|
@ -140,7 +140,7 @@ we appreciate your help.
|
||||||
|
|
||||||
2. Create a new S3 bucket and create the following empty directory structure:
|
2. Create a new S3 bucket and create the following empty directory structure:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
- atom-shell/
|
- atom-shell/
|
||||||
- symbols/
|
- symbols/
|
||||||
- dist/
|
- dist/
|
||||||
|
|
|
@ -6,7 +6,7 @@ If you've been using Node and npm for a while, you are probably aware of [Semant
|
||||||
|
|
||||||
Semantic versions are always made up of three numbers:
|
Semantic versions are always made up of three numbers:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
major.minor.patch
|
major.minor.patch
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ Semantic version numbers are bumped (incremented) using the following rules:
|
||||||
|
|
||||||
A simple mnemonic for remembering this scheme is as follows:
|
A simple mnemonic for remembering this scheme is as follows:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
breaking.feature.fix
|
breaking.feature.fix
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ security and bug fixes out fast and to encourage the automation of testing.
|
||||||
You can install the beta by specifying the `beta` dist tag when installing via
|
You can install the beta by specifying the `beta` dist tag when installing via
|
||||||
npm:
|
npm:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
npm install electron@beta
|
npm install electron@beta
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -183,13 +183,13 @@ $ ./node_modules/.bin/electron .
|
||||||
|
|
||||||
#### Windows
|
#### Windows
|
||||||
|
|
||||||
```
|
```bash
|
||||||
$ .\node_modules\.bin\electron .
|
$ .\node_modules\.bin\electron .
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Node v8.2.0 and later
|
#### Node v8.2.0 and later
|
||||||
|
|
||||||
```
|
```bash
|
||||||
$ npx electron .
|
$ npx electron .
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -212,7 +212,7 @@ $ ./electron/electron your-app/
|
||||||
|
|
||||||
#### Windows
|
#### Windows
|
||||||
|
|
||||||
```
|
```bash
|
||||||
$ .\electron\electron.exe your-app\
|
$ .\electron\electron.exe your-app\
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ commands with `xvfb-maybe` and the little tool will automatically configure
|
||||||
xvfb, if required by the current system. On Windows or macOS, it will simply
|
xvfb, if required by the current system. On Windows or macOS, it will simply
|
||||||
do nothing.
|
do nothing.
|
||||||
|
|
||||||
```
|
```sh
|
||||||
## On Windows or macOS, this just invokes electron-mocha
|
## On Windows or macOS, this just invokes electron-mocha
|
||||||
## On Linux, if we are in a headless environment, this will be equivalent
|
## On Linux, if we are in a headless environment, this will be equivalent
|
||||||
## to xvfb-run electron-mocha ./test/*.js
|
## to xvfb-run electron-mocha ./test/*.js
|
||||||
|
|
|
@ -36,7 +36,7 @@ requirements:
|
||||||
|
|
||||||
Then, go and install the `electron-windows-store` CLI:
|
Then, go and install the `electron-windows-store` CLI:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
npm install -g electron-windows-store
|
npm install -g electron-windows-store
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ any module you don't actually need will just increase your application's size.
|
||||||
|
|
||||||
The output should look roughly like this:
|
The output should look roughly like this:
|
||||||
|
|
||||||
```
|
```text
|
||||||
├── Ghost.exe
|
├── Ghost.exe
|
||||||
├── LICENSE
|
├── LICENSE
|
||||||
├── content_resources_200_percent.pak
|
├── content_resources_200_percent.pak
|
||||||
|
@ -79,7 +79,7 @@ From an elevated PowerShell (run it "as Administrator"), run
|
||||||
and output directories, the app's name and version, and confirmation that
|
and output directories, the app's name and version, and confirmation that
|
||||||
`node_modules` should be flattened.
|
`node_modules` should be flattened.
|
||||||
|
|
||||||
```
|
```powershell
|
||||||
electron-windows-store `
|
electron-windows-store `
|
||||||
--input-directory C:\myelectronapp `
|
--input-directory C:\myelectronapp `
|
||||||
--output-directory C:\output\myelectronapp `
|
--output-directory C:\output\myelectronapp `
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
"husky": "^0.14.3",
|
"husky": "^0.14.3",
|
||||||
"minimist": "^1.2.0",
|
"minimist": "^1.2.0",
|
||||||
"nugget": "^2.0.1",
|
"nugget": "^2.0.1",
|
||||||
|
"remark-cli": "^4.0.0",
|
||||||
|
"remark-preset-lint-markdown-style-guide": "^2.1.1",
|
||||||
"request": "^2.68.0",
|
"request": "^2.68.0",
|
||||||
"standard": "^8.4.0",
|
"standard": "^8.4.0",
|
||||||
"standard-markdown": "^4.0.0",
|
"standard-markdown": "^4.0.0",
|
||||||
|
@ -48,7 +50,7 @@
|
||||||
"lint-js": "standard && cd spec && standard",
|
"lint-js": "standard && cd spec && standard",
|
||||||
"lint-cpp": "python ./script/cpplint.py",
|
"lint-cpp": "python ./script/cpplint.py",
|
||||||
"lint-py": "python ./script/pylint.py",
|
"lint-py": "python ./script/pylint.py",
|
||||||
"lint-docs": "npm run lint-js-in-markdown && npm run create-typescript-definitions",
|
"lint-docs": "remark docs -qf && npm run lint-js-in-markdown && npm run create-typescript-definitions",
|
||||||
"lint-js-in-markdown": "standard-markdown docs",
|
"lint-js-in-markdown": "standard-markdown docs",
|
||||||
"create-api-json": "electron-docs-linter docs --outfile=out/electron-api.json --version=$npm_package_version",
|
"create-api-json": "electron-docs-linter docs --outfile=out/electron-api.json --version=$npm_package_version",
|
||||||
"create-typescript-definitions": "npm run create-api-json && electron-typescript-definitions --in=out/electron-api.json --out=out/electron.d.ts",
|
"create-typescript-definitions": "npm run create-api-json && electron-typescript-definitions --in=out/electron-api.json --out=out/electron.d.ts",
|
||||||
|
|
|
@ -161,11 +161,11 @@ def safe_mkdir(path):
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
|
||||||
def execute(argv, env=os.environ):
|
def execute(argv, env=os.environ, cwd=None):
|
||||||
if is_verbose_mode():
|
if is_verbose_mode():
|
||||||
print ' '.join(argv)
|
print ' '.join(argv)
|
||||||
try:
|
try:
|
||||||
output = subprocess.check_output(argv, stderr=subprocess.STDOUT, env=env)
|
output = subprocess.check_output(argv, stderr=subprocess.STDOUT, env=env, cwd=cwd)
|
||||||
if is_verbose_mode():
|
if is_verbose_mode():
|
||||||
print output
|
print output
|
||||||
return output
|
return output
|
||||||
|
@ -183,7 +183,7 @@ def execute_stdout(argv, env=os.environ, cwd=None):
|
||||||
print e.output
|
print e.output
|
||||||
raise e
|
raise e
|
||||||
else:
|
else:
|
||||||
execute(argv, env)
|
execute(argv, env, cwd)
|
||||||
|
|
||||||
|
|
||||||
def electron_gyp():
|
def electron_gyp():
|
||||||
|
|
Loading…
Reference in a new issue