Giter Club home page Giter Club logo

html-slacker's Introduction

html-slacker

Converts HTML to Slack formatted markdown

Usage

Install HTMLSlacker from pip.

$ pip install html-slacker

Import library.

>>> from htmlslacker import HTMLSlacker

Use it.

>>> HTMLSlacker('<b>Hello</b>, <i>Slack</i>!').get_output()
'*Hello*, _Slack_!'

Test it.

$ python setup.py test

Requirements

  • Python >= 2.5
  • html

Links

Repository: https://github.com/codex-team/html-slacker

Report a bug: https://github.com/codex-team/html-slacker/issues

PyPI Package: https://pypi.python.org/pypi/html-slacker

CodeX Team: https://ifmo.su

html-slacker's People

Contributors

eosman-tibco avatar khaydarov avatar n0str avatar sebbacon avatar talyguryn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

html-slacker's Issues

Python 2 compatibility needed

Not python 2 compatible. Added the following to make it work..

try:
from html.parser import HTMLParser
from html.entities import name2codepoint
except:
from HTMLParser import HTMLParser
from htmlentitydefs import name2codepoint

Add support for lists

Hey - this is a great library.

Thanks for the help. I opened up a PR for adding support for ul and ol

example not working

the example doesnt seem to work. stack is below:

In [4]: HTMLSlacker('<b>Hello</b>, <i>Slack</i>!').get_output()
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-4-22ded15b932d> in <module>()
----> 1 HTMLSlacker('<b>Hello</b>, <i>Slack</i>!').get_output()

/usr/local/lib/python2.7/dist-packages/htmlslacker/htmlslacker.pyc in __init__(self, html, *args, **kwargs)
     13 
     14         # call parent constructor __init__
---> 15         super().__init__(*args, **kwargs)
     16 
     17         # slackified string

TypeError: super() takes at least 1 argument (0 given)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.