codesoap / jirae

jirae allows you to edit texts in Jira with your local editor instead of Atlassian's WYSIWYG editor
MIT License
3 stars 0 forks source link

Integrate with pandoc for other markup languages #2

Open tbussmann opened 1 year ago

tbussmann commented 1 year ago

This is a very clever little helper, thank you!

We can make use of markdown or virtually any other markup language instead of the old-style jira syntax with a little help of pandoc. As a POC, I created a little wrapper script and set my $EDITOR variable to this:

#!/bin/sh

pandoc --from jira --to markdown "$1" --output "$1"
$REAL_EDITOR "$1"
pandoc --from markdown --to jira "$1" --output "$1"
codesoap commented 1 year ago

Thanks for the input! I was not aware, that pandoc supports the Jira syntax. I'll play around with it a little bit, but I assume that the conversion will sometimes be "lossy", because Markdown does not support all the things that the old-style jira syntax supports (like panels or colored text). Maybe I'll include it as a hint in the README, or something like that.

tbussmann commented 1 year ago

For sure this is a somewhat lossy translation but the basic formatting works well out of the box. But your mileage will vary depending on the features required.

Pandoc supports different flavours of markdown, can configure their features and does allow to trigger scripts during the transformations. As it internally does support more features in its intermediate AST, it can be used in a rather flexible way with some initial effort.