Skip to content

Commit

Permalink
3.5, get rid of duplicated docs in help
Browse files Browse the repository at this point in the history
  • Loading branch information
kovetskiy committed Dec 3, 2020
1 parent d4008a5 commit ff17a40
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 86 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Mark

Mark — tool for syncing your markdown documentation with Atlassian Confluence
Mark — a tool for syncing your markdown documentation with Atlassian Confluence
pages.

Read the blog post discussing the tool — https://samizdat.dev/use-markdown-for-confluence/
Expand Down
88 changes: 3 additions & 85 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,91 +19,9 @@ import (
)

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
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.
Docs: /~https://github.com/kovetskiy/mark
Usage:
mark [options] [-u <username>] [-p <token>] [-k] [-l <url>] -f <file>
Expand Down Expand Up @@ -133,7 +51,7 @@ Options:
)

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 {
panic(err)
}
Expand Down

0 comments on commit ff17a40

Please sign in to comment.