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.3.tar.gz (4.3 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.3-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: html_to_jira-0.1.3.tar.gz
  • Upload date:
  • Size: 4.3 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.3.tar.gz
Algorithm Hash digest
SHA256 97269bf017f9051827508d894dbcbbbafc141cbba506847e5bdcae6b9af5bd58
MD5 49b99278b69f27e8ad286c13c152c825
BLAKE2b-256 7641f49c48bfa9c2b4570bfd612140a9db74415d3889aced3f21e286c20074d5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: html_to_jira-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 4.8 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 bc00d1b5bc05b313daa8d1c2f904c5a66d98826e91098aaea780f30ae686226d
MD5 e19298d9f30ea74a32a9e66c37d36bbe
BLAKE2b-256 e5723fdc7853686fe5e9c97006584f9774f27fcc1e158c120b2ebb2cf0048c8a

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