Skip to main content

parser for Conde Nast BBCode

Project description

A portable, extensible BB Code parser written by Condé Nast Britain

Hello, World!

from bbcondeparser import BaseTag, BaseTreeParser

class ExcitedTag(BaseTag):
    tag_name = 'excite'

    def _render(self):
        child_text = self.render_children()
        return '<b><i>{}</i></b>'.format(child_text)

class Parser(BaseTreeParser):
    tags = [ExcitedTag]


parsed = Parser("[excite]Hello, World![/excite]")

print(parsed.render())
>>> python hello_world.py
<b><i>Hello, World!</i></b>
>>>

Documentation

Further documentation is in the works, and will be present on the github page.

Project details


Release history Release notifications

This version
History Node

1.0.1

History Node

1.0.0

History Node

0.6.0

History Node

0.5.0

History Node

0.4.0

History Node

0.3.0

History Node

0.0.7

History Node

0.0.6

History Node

0.0.5

History Node

0.0.4

History Node

0.0.3

History Node

0.0.2

History Node

0.0.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
bbcondeparser-1.0.1.tar.gz (18.3 kB) Copy SHA256 hash SHA256 Source None Dec 12, 2017

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page