A package to convert HTML to Jira Wiki Markup
Project description
HTML to Jira Wiki Markup Converter
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file html_to_jira-0.1.4.tar.gz.
File metadata
- Download URL: html_to_jira-0.1.4.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0c3739311a81184b89f367ed557e6d0b6c94fef5c8ed34c9af65a2ca5d2993f4
|
|
| MD5 |
ccbcd61240e5501fcf0c0324e8d97125
|
|
| BLAKE2b-256 |
6d9149725dee85bcb0f775b50e9e7724c247df04240c1be7dd98d987ebbd7e6f
|
File details
Details for the file html_to_jira-0.1.4-py3-none-any.whl.
File metadata
- Download URL: html_to_jira-0.1.4-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
059b65d5832ccee0a2ac99d57e2d7d05ca225fdebe05be6cbcd4e5e5cd127c0c
|
|
| MD5 |
b8bd90f7193e5ce61a60a74162f15fe5
|
|
| BLAKE2b-256 |
c176536e2bf0acae9570a57b93576048d0231193398f32ae65af1ee38b580e20
|