Menu

Home

Nereare

NereCode

Since BBCode requires much trouble to get it running, and not every project needs something so solid (sometimes it's just a admin posting engine, or a small microblogging engine with little or no user-content injections).

NereCode comes to aim such gap.

A minimally comprehensive syntax easily customizable. PHP only. Single file library.

Usage

Installing

There is no need to install anything.
You must only download the NereCode.php and include it in your code.

The library comes with an optional stylesheet with the basic classes referenced by the functions. You can, however, style them through your project own stylesheet. See the [Style Reference] for more info on that.

The PNG image is included only for it is referenced by the stylesheet.

Depedencies

A working PHP in your server of choice.
No need to install Pearl!

Functions

There are two basic functions in the library:

<?php
    eat_html($txt);
    parse_nerecode($txt);

eat_html

This function is intended for trimming away HTML tags.
It replaces <> for {}. The faux-tag remains there, however, it is not HTML anymore.

parse_nerecode

The main function.
It replaces the NereCode in the given string into valid HTML.
As said above, there are some CSS classes used in order to work. These are better described at the [Style Reference] page.
* REMEMBER! * Always echo the output of this function inside a paragraph tag (p), for it is assumed in code that this happens - and its important for conformity with the HTML5 standards.


Project Members: