mirror of
https://github.com/kovetskiy/mark.git
synced 2025-04-23 21:32:41 +08:00
3.5, get rid of duplicated docs in help
This commit is contained in:
parent
d4008a5b72
commit
ff17a4034c
@ -1,6 +1,6 @@
|
|||||||
# Mark
|
# Mark
|
||||||
|
|
||||||
Mark — tool for syncing your markdown documentation with Atlassian Confluence
|
Mark — a tool for syncing your markdown documentation with Atlassian Confluence
|
||||||
pages.
|
pages.
|
||||||
|
|
||||||
Read the blog post discussing the tool — https://samizdat.dev/use-markdown-for-confluence/
|
Read the blog post discussing the tool — https://samizdat.dev/use-markdown-for-confluence/
|
||||||
|
88
main.go
88
main.go
@ -19,91 +19,9 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
usage = `mark - tool for updating Atlassian Confluence pages from markdown.
|
usage = `mark - a tool for updating Atlassian Confluence pages from markdown.
|
||||||
|
|
||||||
This is very usable if you store documentation to your orthodox software in git
|
Docs: https://github.com/kovetskiy/mark
|
||||||
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
|
|
||||||
located in ~/.config/mark with following format:
|
|
||||||
username = "smith"
|
|
||||||
password = "matrixishere"
|
|
||||||
base_url = "http://confluence.local"
|
|
||||||
where 'smith' it's your username, 'matrixishere' it's your password and
|
|
||||||
'http://confluence.local' is base URL for your Confluence instance.
|
|
||||||
|
|
||||||
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:
|
|
||||||
|
|
||||||
<!-- Space: <space key> -->
|
|
||||||
<!-- Parent: <parent 1> -->
|
|
||||||
<!-- Parent: <parent 2> -->
|
|
||||||
<!-- Title: <title> -->
|
|
||||||
|
|
||||||
<page contents>
|
|
||||||
|
|
||||||
There can be any number of 'Parent' headers, if mark can't find specified
|
|
||||||
parent by title, it will be created.
|
|
||||||
|
|
||||||
Also, optional following headers are supported:
|
|
||||||
|
|
||||||
* <!-- Layout: (article|plain) -->
|
|
||||||
|
|
||||||
- (default) article: content will be put in narrow column for ease of
|
|
||||||
reading;
|
|
||||||
- plain: content will fill all page;
|
|
||||||
|
|
||||||
Mark supports Go templates, which can be included into article by using path
|
|
||||||
to the template relative to current working dir, e.g.:
|
|
||||||
|
|
||||||
<!-- Include: <path> -->
|
|
||||||
|
|
||||||
Templates may accept configuration data in YAML format which immediately
|
|
||||||
follows include tag:
|
|
||||||
|
|
||||||
<!-- Include: <path>
|
|
||||||
<yaml-data> -->
|
|
||||||
|
|
||||||
Mark also supports macro definitions, which are defined as regexps which will
|
|
||||||
be replaced with specified template:
|
|
||||||
|
|
||||||
<!-- Macro: <regexp>
|
|
||||||
Template: <path>
|
|
||||||
<yaml-data> -->
|
|
||||||
|
|
||||||
Capture groups can be defined in the macro's <regexp> which can be later
|
|
||||||
referenced in the <yaml-data> using ${<number>} syntax, where <number> is
|
|
||||||
number of a capture group in regexp (${0} is used for entire regexp match), for
|
|
||||||
example:
|
|
||||||
|
|
||||||
<!-- Macro: MYJIRA-\d+
|
|
||||||
Template: ac:jira:ticket
|
|
||||||
Ticket: ${0} -->
|
|
||||||
|
|
||||||
By default, mark provides several built-in templates and macros:
|
|
||||||
|
|
||||||
* template 'ac:status' to include badge-like text, which accepts following
|
|
||||||
parameters:
|
|
||||||
- Title: text to display in the badge
|
|
||||||
- Color: color to use as background/border for badge
|
|
||||||
- Grey
|
|
||||||
- Yellow
|
|
||||||
- Red
|
|
||||||
- Blue
|
|
||||||
- Subtle: specify to fill badge with background or not
|
|
||||||
- true
|
|
||||||
- false
|
|
||||||
|
|
||||||
See: https://confluence.atlassian.com/conf59/status-macro-792499207.html
|
|
||||||
|
|
||||||
* template 'ac:jira:ticket' to include JIRA ticket link. Parameters:
|
|
||||||
- Ticket: Jira ticket number like BUGS-123.
|
|
||||||
|
|
||||||
* macro '@{...}' to mention user by name specified in the braces.
|
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
mark [options] [-u <username>] [-p <token>] [-k] [-l <url>] -f <file>
|
mark [options] [-u <username>] [-p <token>] [-k] [-l <url>] -f <file>
|
||||||
@ -133,7 +51,7 @@ Options:
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
args, err := docopt.Parse(usage, nil, true, "3.4", false)
|
args, err := docopt.Parse(usage, nil, true, "3.5", false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user