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.
Release files for bbcondeparser 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| bbcondeparser-1.1.0.tar.gz | 19.0 kB | Details |
Release files / bbcondeparser-1.1.0.tar.gz
| Download URL | bbcondeparser-1.1.0.tar.gz |
|---|---|
| Size | 19.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
891b3df2417d2e21049069008dd25c4fdede3ea171a85c8adc66d909f868c641
|
|
BLAKE2b-256 checksum How to use checksums |
5e93971aed9c21728e0fb1c80b8adc711f199ea8f7c8249e37f4f15b6f3ba79e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/2.7.16
|