I'm making a PySide GUI that submits to Jira. Prior to submission, it would be ideal if I could show the user a "ticket preview" so they know roughly what the ticket will look like or if they made any syntax errors that would cause issues in Jira. To do that, I imagine that I would have to convert their raw text to a png file. I haven't found a way to make that conversion and would like any suggestions people could give.
Example
Imagine a submission text box that looks like this:
{panel:title=Test|borderStyle=none|titleBGColor=#f7d6c1|bgColor=#fdf4ee}
Hello, World!
{panel}
I should be able to take that text into Python and somehow render an image so that looks as it should in Jira. For reference, this is how Jira renders it:
This is the .png that I'm trying to generate, basically.
What I Tried
It's not a great substitute but I was thinking maybe I could use jira2markdown to convert Jira markdown -> common markdown -> pygments -> png
. Unfortunately, information is lost when you go from Jira markdown -> common markdown
using jira2markdown. The example text below
{panel:title=Test|borderStyle=none|titleBGColor=#f7d6c1|bgColor=#fdf4ee}
Hello, World!
{panel}
converts to
> **Test**
> Hello, World!
It removes all background, foreground, and text colors in that case.
So anyway, I'm mostly just looking for an approximation though an ideal "as it looks in Jira" render would be awesome as well. Does anyone know of a way that I could achieve this effect?