mirror of
https://github.com/kovetskiy/mark.git
synced 2026-04-26 17:22:34 +00:00
Simplify config handling
* Switch to urfave/cli/v2 * Add more environment variables
This commit is contained in:
58
README.md
58
README.md
@@ -597,35 +597,33 @@ $ cp mark /usr/local/bin
|
||||
|
||||
## Usage
|
||||
|
||||
```
|
||||
mark [options] [-u <username>] [-p <password>] [-k] [-l <url>] -f <file>
|
||||
mark [options] [-u <username>] [-p <password>] [-k] [-b <url>] -f <file>
|
||||
mark [options] [-u <username>] [-p <password>] [--drop-h1] -f <file>
|
||||
mark -v | --version
|
||||
mark -h | --help
|
||||
```
|
||||
|
||||
- `-u <username>` — Use specified username for updating Confluence page.
|
||||
- `-p <password>` — Use specified password for updating Confluence page.
|
||||
Specify `-` as password to read password from stdin.
|
||||
- `-l <url>` — Edit specified Confluence page.
|
||||
If -l is not specified, file should contain metadata (see above).
|
||||
- `-b <url>` or `--base-url <url>` – Base URL for Confluence.
|
||||
Alternative option for `base_url` config field.
|
||||
- `-f <file>` — Use specified markdown file(s) for converting to html. Supports file globbing patterns (needs to be quoted).
|
||||
- `-c <path>` or `--config <path>` — Specify a path to the configuration file.
|
||||
- `-k` — Lock page editing to current user only to prevent accidental
|
||||
manual edits over Confluence Web UI.
|
||||
- `--space <space>` - Use specified space key. If the space key is not specified, it must be set in the page metadata.
|
||||
- `--drop-h1` – Don't include H1 headings in Confluence output.
|
||||
This option corresponds to the `h1_drop` setting in the configuration file.
|
||||
- `--title-from-h1` - Extract page title from a leading H1 heading. If no H1 heading on a page exists, then title must be set in the page metadata.
|
||||
This option corresponds to the `h1_title` setting in the configuration file.
|
||||
- `--dry-run` — Show resulting HTML and don't update Confluence page content.
|
||||
- `--minor-edit` — Don't send notifications while updating Confluence page.
|
||||
- `--trace` — Enable trace logs.
|
||||
- `-v | --version` — Show version.
|
||||
- `-h | --help` — Show help screen and call 911.
|
||||
USAGE:
|
||||
mark [global options] [arguments...]
|
||||
|
||||
GLOBAL OPTIONS:
|
||||
--files value, -f value use specified markdown file(s) for converting to html. Supports file globbing patterns (needs to be quoted). [$MARK_FILES]
|
||||
--compile-only show resulting HTML and don't update Confluence page content. (default: false) [$MARK_COMPILE_ONLY]
|
||||
--dry-run resolve page and ancestry, show resulting HTML and exit. (default: false) [$MARK_DRY_RUN]
|
||||
--edit-lock, -k lock page editing to current user only to prevent accidental manual edits over Confluence Web UI. (default: false) [$MARK_EDIT_LOCK]
|
||||
--drop-h1 don't include H1 headings in Confluence output. (default: false) [$MARK_H1_DROP]
|
||||
--title-from-h1 extract page title from a leading H1 heading. If no H1 heading on a page exists, then title must be set in the page metadata. (default: false) [$MARK_H1_TITLE]
|
||||
--minor-edit don't send notifications while updating Confluence page. (default: false) [$MARK_MINOR_EDIT]
|
||||
--color value display logs in color. Possible values: auto, never. (default: "auto") [$MARK_COLOR]
|
||||
--debug enable debug logs. (default: false) [$MARK_DEBUG]
|
||||
--trace enable trace logs. (default: false) [$MARK_TRACE]
|
||||
--username value, -u value use specified username for updating Confluence page. [$MARK_USERNAME]
|
||||
--password value, -p value use specified token for updating Confluence page. Specify - as password to read password from stdin, or your Personal access token. Username is not mandatory if personal access token is provided. For more info please see: https://developer.atlassian.com/server/confluence/confluence-server-rest-api/#authentication. [$MARK_PASSWORD]
|
||||
--target-url value, -l value edit specified Confluence page. If -l is not specified, file should contain metadata (see above). [$MARK_TARGET_URL]
|
||||
--base-url value, -b value base URL for Confluence. Alternative option for base_url config field. [$MARK_BASE_URL]
|
||||
--config value, -c value use the specified configuration file. (default: "/home/mruger/.config/mark") [$MARK_CONFIG]
|
||||
--ci run on CI mode. It won't fail if files are not found. (default: false) [$MARK_CI]
|
||||
--space value use specified space key. If the space key is not specified, it must be set in the page metadata. [$MARK_SPACE]
|
||||
--help, -h show help
|
||||
--version, -v print the version
|
||||
|
||||
```
|
||||
|
||||
You can store user credentials in the configuration file, which should be
|
||||
located in ~/.config/mark (or specified via `-c --config <path>`) with the following format (TOML):
|
||||
@@ -634,9 +632,9 @@ located in ~/.config/mark (or specified via `-c --config <path>`) with the follo
|
||||
username = "your-email"
|
||||
password = "password-or-api-key-for-confluence-cloud"
|
||||
# If you are using Confluence Cloud add the /wiki suffix to base_url
|
||||
base_url = "http://confluence.local"
|
||||
h1_title = true
|
||||
h1_drop = true
|
||||
base-url = "http://confluence.local"
|
||||
h1-title = true
|
||||
h1-drop = true
|
||||
```
|
||||
|
||||
**NOTE**: Labels aren't supported when using `minor-edit`!
|
||||
|
||||
Reference in New Issue
Block a user