Giter Club home page Giter Club logo

jbbcode's Introduction

jBBCode

GitHub release Software License Build Status

jBBCode is a bbcode parser written in php 5.3. It's relatively lightweight and parses bbcodes without resorting to expensive regular expressions.

Documentation

For complete documentation and examples visit jbbcode.com.

A basic example

jBBCode includes a few optional, default bbcode definitions that may be loaded through the DefaultCodeDefinitionSet class. Below is a simple example of using these codes to convert a bbcode string to html.

<?php
require_once "/path/to/jbbcode/Parser.php";

$parser = new JBBCode\Parser();
$parser->addCodeDefinitionSet(new JBBCode\DefaultCodeDefinitionSet());

$text = "The default codes include: [b]bold[/b], [i]italics[/i], [u]underlining[/u], ";
$text .= "[url=http://jbbcode.com]links[/url], [color=red]color![/color] and more.";

$parser->parse($text);

print $parser->getAsHtml();

Composer

You may load jBBCode via composer. In your composer.json file:

"require": {
    "jbbcode/jbbcode": "1.3.*"
}

In your php file:

require 'vendor/autoloader.php';

$parser = new JBBCode\Parser();

Contribute

I would love help maintaining jBBCode. Look at open issues for ideas on what needs to be done. Before submitting a pull request, verify that all unit tests still pass.

Running unit tests

To run the unit tests, ensure that phpunit is installed, or install it through the composer dev dependencies. Then run phpunit from the project directory. If you're adding new functionality, writing additional unit tests is a great idea.

License

The project is under MIT license. Please see the license file for details.

jbbcode's People

Contributors

dasourcerer avatar jbowens avatar art4 avatar schlaefer avatar fale avatar shmax avatar oohnoitz avatar ingramz avatar bryant1410 avatar

Watchers

 avatar  avatar

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.