Skip to main content

A package to convert HTML to Jira Wiki Markup

Project description

HTML to Jira Wiki Markup Converter

PyPI version License: MIT

A Python package that converts HTML content to Jira Wiki Markup format. It supports various HTML elements including headers, paragraphs, lists, links, tables, inline styles, and images within table cells.

Features

  • Converts HTML headers (<h1>, <h2>, <h3>) to Jira Wiki headers.
  • Converts paragraphs (<p>) and inline text styles (<em>, <strong>, <span style="color">).
  • Converts unordered lists (<ul>) and ordered lists (<ol>) to Jira Wiki lists.
  • Converts links (<a>) to Jira Wiki link format.
  • Converts tables (<table>, <tr>, <th>, <td>) to Jira Wiki table format.
  • Supports images (<img>) within table cells.

Installation

You can install the package via pip:

pip install html-to-jira

Usage

Converting HTML to Jira Wiki Markup

You can use the html_to_jira function from the html_to_jira package to convert your HTML content to Jira Wiki Markup.

from html_to_jira.converter import html_to_jira

html_string = '''
<h1>Welcome to Jira!</h1>
<p>This is a <em>sample</em> HTML string with <strong>bold</strong> text and <span style="color:red;">colored text</span>.</p>
<ul>
  <li>Item 1 with <strong>bold</strong> text</li>
  <li>Item 2 with <span style="color:blue;">colored text</span></li>
</ul>
<ol>
  <li>First with <em>italic</em> text</li>
  <li>Second with <span style="color:green;">green text</span></li>
</ol>
<p>Visit <a href="https://example.com">this link</a> for more information.</p>
<table>
  <tr>
    <th>Heading 1</th>
    <th>Heading 2</th>
  </tr>
  <tr>
    <td>Col A1 with <strong>bold</strong> text</td>
    <td>Col A2 with <span style="color:purple;">purple text</span> and <img src="https://example.com/image.png" alt="Example Image"></td>
  </tr>
</table>
'''

jira_markup = html_to_jira(html_string)
print(jira_markup)

Example Output

h1. Welcome to Jira!

This is a _sample_ HTML string with *bold* text and {color:red}colored text{color}.

* Item 1 with *bold* text
* Item 2 with {color:blue}colored text{color}

# First with _italic_ text
# Second with {color:green}green text{color}

Visit [this link|https://example.com] for more information.

||Heading 1|Heading 2||
|Col A1 with *bold* text|Col A2 with {color:purple}purple text{color} and !https://example.com/image.png|alt=Example Image!|

License

This project is licensed under the MIT License. See the LICENSE file for details.

Project details


Download files

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

Source Distribution

html_to_jira-0.1.2.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

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

html_to_jira-0.1.2-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file html_to_jira-0.1.2.tar.gz.

File metadata

  • Download URL: html_to_jira-0.1.2.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.6

File hashes

Hashes for html_to_jira-0.1.2.tar.gz
Algorithm Hash digest
SHA256 3aa36e395f31135176476f2a5d5b0f41fac12c650b17369f7c8707bf00daaab9
MD5 26cd5936418a3658a1ab702ee8bb1710
BLAKE2b-256 be52a277e4e94aa384c4c25bd149fef4c1cbb3c91caa4225358cfc3f67c635e2

See more details on using hashes here.

File details

Details for the file html_to_jira-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: html_to_jira-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.6

File hashes

Hashes for html_to_jira-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5a5603733c9da4f2fcde4506574a5a54365e0ab8fcb1a4e665c8fce1fe75b583
MD5 485c4ddf6882b32847aa33f956b3b19e
BLAKE2b-256 97fe4f95ae50cc2e25960b9f4aefa92eceb9c0d3ef1548062d2dbdde17498050

See more details on using hashes here.

Supported by

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