build: move to the new docs parser (#18103)

* build: move to the new docs parser

* chore: remove the bad getTitle param doc

* build: update parser/ts gen deps + fix some docs issues highlighted by GH desktop

* chore: apply suggestions from code review

Co-Authored-By: MarshallOfSound <samuel.r.attard@gmail.com>

* chore: update docs for accidentally removed things

* chore: update docs/api/command-line.md

Co-Authored-By: MarshallOfSound <samuel.r.attard@gmail.com>
This commit is contained in:
Samuel Attard 2019-05-06 08:29:01 -07:00 committed by John Kleinschmidt
parent 9ec59cbc6c
commit a96b6e2c96
28 changed files with 461 additions and 1234 deletions

54
docs/api/command-line.md Normal file
View file

@ -0,0 +1,54 @@
## Class: CommandLine
> Manipulate the command line arguments for your app that Chromium reads
Process: [Main](../glossary.md#main-process)
The following example shows how to check if the `--disable-gpu` flag is set.
```javascript
const { app } = require('electron')
app.commandLine.hasSwitch('disable-gpu')
```
For more information on what kinds of flags and switches you can use, check
out the [Chrome Command Line Switches](./chrome-command-line-switches.md)
document.
### Instance Methods
#### `commandLine.appendSwitch(switch[, value])`
* `switch` String - A command-line switch, without the leading `--`
* `value` String (optional) - A value for the given switch
Append a switch (with optional `value`) to Chromium's command line.
**Note:** This will not affect `process.argv`. The intended usage of this function is to
control Chromium's behavior.
#### `commandLine.appendArgument(value)`
* `value` String - The argument to append to the command line
Append an argument to Chromium's command line. The argument will be quoted
correctly. Switches will precede arguments regardless of appending order.
If you're appending an argument like `--switch=value`, consider using `appendSwitch('switch', 'value')` instead.
**Note:** This will not affect `process.argv`. The intended usage of this function is to
control Chromium's behavior.
#### `commandLine.hasSwitch(switch)`
* `switch` String - A command-line switch
Returns `Boolean` - Whether the command-line switch is present.
#### `commandLine.getSwitchValue(switch)`
* `switch` String - A command-line switch
Returns `String` - The command-line switch value.
**Note:** When the switch is not present or has no value, it returns empty string.