mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-19 11:19:56 +09:00
- 2022년 3월 개발팀 결정사항 적용 - 모듈 등 서드파티 자료 개발시 composer를 사용하면 상위 경로에 있는 코어의 composer.json을 수정하고, 코어의 vendor 디렉토리를 건드리는 것이 기본값임 - 이를 방지하기 위해 코어의 composer.json과 vendor를 common 디렉토리 안으로 이동하여, 모듈 경로에서 상위 폴더로 인식하지 않도록 함
70 lines
2.1 KiB
Markdown
70 lines
2.1 KiB
Markdown
jBBCode
|
|
=======
|
|
[](https://github.com/jbowens/jBBCode/releases)
|
|
[](LICENSE.md)
|
|
[](https://travis-ci.org/jbowens/jBBCode)
|
|
|
|
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](http://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
|
|
<?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:
|
|
|
|
```json
|
|
"require": {
|
|
"jbbcode/jbbcode": "1.3.*"
|
|
}
|
|
```
|
|
|
|
In your php file:
|
|
|
|
```php
|
|
require 'vendor/autoloader.php';
|
|
|
|
$parser = new JBBCode\Parser();
|
|
```
|
|
|
|
Contribute
|
|
----------
|
|
|
|
I would love help maintaining jBBCode. Look at [open issues](http://github.com/jbowens/jBBCode/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](http://github.com/sebastianbergmann/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](LICENSE.md) for details.
|