2015-09-20 00:34:52 +06:00
|
|
|
# Mark
|
|
|
|
|
2016-11-30 18:44:32 +07:00
|
|
|
Mark — tool for syncing your markdown documentation with Atlassian Confluence
|
|
|
|
pages.
|
|
|
|
|
2015-09-20 00:34:52 +06:00
|
|
|
This is very usable if you store documentation to your orthodox software in git
|
|
|
|
repository and don't want to do a handjob with updating Confluence page using
|
|
|
|
fucking tinymce wysiwyg enterprise core editor.
|
|
|
|
|
|
|
|
You can store a user credentials in the configuration file, which should be
|
2016-10-25 17:23:28 +07:00
|
|
|
located in ~/.config/mark with following format:
|
|
|
|
|
|
|
|
```toml
|
2015-09-20 00:34:52 +06:00
|
|
|
username = "smith"
|
|
|
|
password = "matrixishere"
|
2016-10-25 17:23:28 +07:00
|
|
|
base_url = "http://confluence.local"
|
2015-09-20 00:34:52 +06:00
|
|
|
```
|
|
|
|
|
|
|
|
Mark can read Confluence page URL and markdown file path from another specified
|
2016-10-25 17:23:28 +07:00
|
|
|
configuration file, which you can specify using -c <file> flag. It is very
|
2015-09-20 00:34:52 +06:00
|
|
|
usable for git hooks. That file should have following format:
|
|
|
|
```toml
|
|
|
|
url = "http://confluence.local/pages/viewpage.action?pageId=123456"
|
|
|
|
file = "docs/README.md"
|
|
|
|
```
|
|
|
|
|
2016-10-25 17:23:28 +07:00
|
|
|
Mark understands extended file format, which, still being valid markdown,
|
|
|
|
contains several metadata headers, which can be used to locate page inside
|
|
|
|
Confluence instance and update it accordingly.
|
|
|
|
|
|
|
|
File in extended format should follow specification
|
|
|
|
```markdown
|
|
|
|
[]:# (X-Space: <space key>)
|
|
|
|
[]:# (X-Parent: <parent 1>)
|
|
|
|
[]:# (X-Parent: <parent 2>)
|
|
|
|
[]:# (X-Title: <title>)
|
|
|
|
|
|
|
|
<page contents>
|
|
|
|
```
|
|
|
|
|
|
|
|
There can be any number of 'X-Parent' headers, if mark can't find specified
|
|
|
|
parent by title, it will be created.
|
|
|
|
|
2015-09-20 00:34:52 +06:00
|
|
|
## Usage:
|
|
|
|
```
|
2016-10-25 17:23:28 +07:00
|
|
|
mark [options] [-u <username>] [-p <password>] [-k] [-l <url>] -f <file>
|
|
|
|
mark [options] [-u <username>] [-p <password>] [-k] [-n] -c <file>
|
2015-09-20 00:34:52 +06:00
|
|
|
mark -v | --version
|
|
|
|
mark -h | --help
|
|
|
|
```
|
|
|
|
|
|
|
|
- `-u <username>` - Use specified username for updating Confluence page.
|
|
|
|
- `-p <password>` - Use specified password for updating Confluence page.
|
|
|
|
- `-l <url>` - Edit specified Confluence page.
|
2016-10-25 17:23:28 +07:00
|
|
|
If -l is not specified, file should contain metadata (see above).
|
2015-09-20 00:34:52 +06:00
|
|
|
- `-f <file>` - Use specified markdown file for converting to html.
|
2015-09-20 00:58:49 +06:00
|
|
|
- `-c <file>` - Specify configuration file which should be used for reading
|
2016-10-25 17:23:28 +07:00
|
|
|
Confluence page URL and markdown file path.
|
|
|
|
- `-k` - Lock page editing to current user only to prevent accidental
|
|
|
|
manual edits over Confluence Web UI.
|
2015-09-20 00:58:49 +06:00
|
|
|
- `--dry-run` - Show resulting HTML and don't update Confluence page content.
|
2016-10-25 17:23:28 +07:00
|
|
|
- `--trace` - Enable trace logs.
|
2015-09-20 00:34:52 +06:00
|
|
|
- `-v | --version` - Show version.
|
|
|
|
- `-h | --help` - Show help screen and call 911.
|