#jira

app cmark2jira

Translate good CommonMark into bad JIRA markup

4 releases (breaking)

Uses old Rust 2015

0.4.0 Jun 28, 2017
0.3.0 Jun 28, 2017
0.2.0 Jun 26, 2017
0.1.0 Jun 26, 2017

#29 in #jira

MIT license

13KB
324 lines

cmark2jira Build Status

Translate good CommonMark (Markdown) into bad JIRA markup. This may be useful for anyone locked into Atlassian's prison of bad software.

Functionality is very minimal. It reads CommonMark from stdin and prints the converted content on stdout:

cargo install cmark2jira
echo "*markdown!*" | cmark2jira

Vim Workflow

I have Vim setup so that I can easily pop open a new tab containing an ephemeral file where I can write a comment by pressing <leader>co:

function! NewComment()
    let r = strftime("%Y-%m-%d_%H-%M-%S")
    execute "edit ~/comments/blob_" . fnameescape(r) .  ".md"
endfunction

nnoremap <Leader>co :call NewComment()<CR>

After I'm done I press <leader>ji to run the tab's content through cmark2jira and put the result into my unnamed register (*) which is mapped on Mac OS to my clipboard:

function! ToJIRA()
    let @* = system('cmark2jira', join(getline(1,'$'), "\n"))
endfunction

nnoremap <Leader>ji :call ToJIRA()<CR>

I then make my way over to a browser tab with JIRA open and paste with Cmd+V.

Development

Run tests with:

cargo test

Release

To release the package:

vi Cargo.toml # bump version number
cargo build # ensure that Cargo.lock gets updated
git add Cargo.toml Cargo.lock
git commit
cargo package
cargo publish

Dependencies

~615KB
~15K SLoC