Skip to main content

Overview

jira2markdown is a text converter from JIRA markup to YouTrack Markdown using parsing expression grammars. The Markdown implementation in YouTrack follows the CommonMark specification with extensions. Thus, jira2markdown can be used to convert text to any Markdown syntax with minimal modifications.

Table of Contents

Prerequisites

  • Python 3.9+

Command line tool

Use pipx to install to isolated environment.

pipx install jira2markdown

There are multiple ways to use command line tool:

  1. Provide text to convert as an argument: jira2markdown "{quote}So many books, so little time{quote}"
  2. Specify path to a file containing Jira markup text: jira2markdown -f path/to/file.txt
  3. Use result of another command as an input: echo "{quote}So many books, so little time{quote}" | jira2markdown

Installation

pip install jira2markdown

Usage

from jira2markdown import convert

convert("Some *Jira text* formatting [example|https://example.com].")
# >>> Some **Jira text** formatting [example](https://example.com).

# To convert user mentions provide a mapping Jira internal account id to username 
# as a second argument to convert function
convert("[Winston Smith|~accountid:internal-id] woke up with the word 'Shakespeare' on his lips", {
    "internal-id": "winston",
})
# >>> @winston woke up with the word 'Shakespeare' on his lips

Conversion tables

Headings

Jira Markdown
h1. Biggest heading # Biggest heading
h2. Bigger heading ## Bigger heading
h3. Big heading ### Big heading
h4. Normal heading #### Normal heading
h5. Small heading ##### Small heading
h6. Smallest heading ###### Smallest heading

Text Effects

Jira Markdown
*strong* **strong**
_emphasis_ Not converted (the same syntax)
??citation?? <q>citation</q>
-deleted- ~~deleted~~
+inserted+ inserted
^superscript^ <sup>superscript</sup>
~subscript~ <sub>subscript</sub>
{{monospaced}} `monospaced`
bq. Some block quoted text > Some block quoted text
{quote}Content to be quoted{quote} > Content to be quoted
{color:red}red text!{color} <font color="red">red text!</font>

Text Breaks

Jira Markdown
\\ Line break
---
--

Links

Jira Markdown
[#anchor] Not converted
[^attachment.ext] [attachment.ext](attachment.ext)
[http://www.example.com] <http://www.example.com>
[Example|http://example.com] [Example](http://example.com)
[mailto:box@example.com] <box@example.com>
[file:///c:/temp/foo.txt] Not converted
{anchor:anchorname} Not converted
[~username] @username

Lists

Jira Markdown
* some
* bullet
** indented
** bullets
* points
- some
- bullet
  - indented
  - bullets
- points
# a
# numbered
# list
1. a
1. numbered
1. list
# a
# numbered
#* with
#* nested
#* bullet
# list
1. a
1. numbered
   - with
   - nested
   - bullet
1. list
* a
* bulleted
*# with
*# nested
*# numbered
* list
- a
- bulleted
  1. with
  1. nested
  1. numbered
- list

Images

Jira Markdown
!image.jpg!
!image.jpg|thumbnail!
!image.gif|align=right, vspace=4!
![image.jpg](image.jpg)
!image.jpg|width=300, height=200!
![image.jpg](image.jpg){width=300 height=200}

Tables

Jira Markdown
||heading 1||heading 2||heading 3||
|col A1|col A2|col A3|
|col B1|col B2|col B3|

|heading 1|heading 2|heading 3|
|---|---|---|
|col A1|col A2|col A3|
|col B1|col B2|col B3|

Advanced Formatting

Jira Markdown
{noformat}
preformatted piece of text
 so *no* further _formatting_ is done here
{noformat}
```
preformatted piece of text
 so *no* further _formatting_ is done here
```
{panel:title=My Title}
Some text with a title
{panel}
> **My Title**
> Some text with a title
{code:xml}
    <test>
        <another tag="attribute"/>
    </test>
{code}
```xml
    <test>
        <another tag="attribute"/>
    </test>
```

Customization

To customize the list of markup elements send it as an optional argument to convert:

from jira2markdown import convert
from jira2markdown.elements import MarkupElements
from jira2markdown.markup.links import Link
from jira2markdown.markup.text_effects import Bold

# Only bold and link tokens will be converted here
elements = MarkupElements([Link, Bold])
convert("Some Jira text here", elements=elements)

Keep in mind that the order of markup elements is important! Elements are matching first from top to bottom in the list.

To override some elements in the default element list use insert_after/replace methods:

from jira2markdown import convert
from jira2markdown.elements import MarkupElements
from jira2markdown.markup.base import AbstractMarkup
from jira2markdown.markup.links import Link
from jira2markdown.markup.text_effects import Color

class CustomColor(Color):
    ...

class MyElement(AbstractMarkup):
    ...

elements = MarkupElements()
elements.replace(Color, CustomColor)
elements.insert_after(Link, MyElement)
convert("Some Jira text here", elements=elements)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jira2markdown-0.5.1.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jira2markdown-0.5.1-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

Details for the file jira2markdown-0.5.1.tar.gz.

File metadata

  • Download URL: jira2markdown-0.5.1.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.14.6 Linux/7.1.8-100.fc43.x86_64

File hashes

Hashes for jira2markdown-0.5.1.tar.gz
Algorithm Hash digest
SHA256 e23f1ae5368ef93399de82ca75d4837ebefbb1a4bf15af153f659ced9ee5fcd7
MD5 fbd24be6d142bbe1637d008a38f8584e
BLAKE2b-256 d2a1601d79910c9dc5ce54532cecc3db66864b03dc116e6706137ab31806e2f3

See more details on using hashes here.

File details

Details for the file jira2markdown-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: jira2markdown-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 15.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.14.6 Linux/7.1.8-100.fc43.x86_64

File hashes

Hashes for jira2markdown-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0c37b7428ea5c0886944c856d24490a6e0a271a62e28d52b07034f46e392279c
MD5 50657320d218e3a7f9a86e25a4a6103c
BLAKE2b-256 f06a6ca58447460d31b6f6c34b1893db5fcded5d066d1158d07c677d8ceb9a19

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.5.1 This release

2 files

0.5

2 files

0.4

2 files

0.3.7

2 files

0.3.6

2 files

0.3.5

2 files

0.3.4

2 files

0.3.3

2 files

0.3.2

2 files

0.3.1

2 files

0.3

2 files

0.2.1

2 files

0.2.0

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page