Skip to main content
Warning: You are using the test version of PyPI. This is a pre-production deployment of Warehouse. Changes made here affect the production instance of TestPyPI (testpypi.python.org).
Help us improve Python packaging - Donate today!

A HTML to Kirbytext converter

Project Description

This is a html to Kirbytext converter for python.

It is currently in heavy development.

Installation

HTML2Kirby is tested and suported from Python 3.4 upwards

TBD

Usage

To use this package, simply import the package and feed it some html:

from html2kirby import HTML2Kirby

formatter = HTML2Kirby()
formatter.feed("""<img src="https://placekitten.com/200/300" alt="kittens are cute" />""")

You can then access the result via .kirbytext attribute:

print(formatter.kirbytext)
# prints (image: https://placekitten.com/200/300 alt: kittesn are cute)

Testing

Make sure you have Pytest installed (pip install pytest). Then just invoke it:

pytest

Supported Markup

As of now, following tags are supported:

  • Simple formatting (<b>, <strong>, <i>, <em>)
  • Headings (<h1>, <h2>, …)
  • Images (<img>)
  • line breaks (<br>)
  • Paragraphs (<p>)
  • Blocks (<pre>, <code>, <blockquote>)
  • Links (<a>)
  • Horizontal rulers (<hr>)
  • Lists (<ul>, <ol>, <li>)

Passed markup

Markup tags that aren’t implemented are just dropped except for following tags:

  • table
  • tr
  • td
  • th
  • tbody
  • thead
  • strike
  • u
  • abbr
  • del

They will just be kept in the Kirbytext which should result in a valid output.

Issues

In python3.4, the doesn’t quite convert all of the html 5 escaped characters such as – (en dash).

Release History

This version
History Node

0.1-11

History Node

0.1-10

History Node

0.1-9

History Node

0.1-8

History Node

0.1-7

History Node

0.1-6

History Node

0.1-5

History Node

0.1-4

History Node

0.1-3

History Node

0.1-2

History Node

0.1-1

Download Files

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

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
html2kirby-0.1-11.tar.gz
(4.4 kB) Copy SHA256 Hash SHA256
Source None Aug 15, 2017

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers DreamHost DreamHost Log Hosting