CENTAUR NIGHT2 C++ LIBRARY
--------------------------

Version 2.3
11/22/2026
https://www.centaur.pw
Jon Siragusa <jon@centaur.pw>

TABLE OF CONTENTS
-----------------
1. About
2. Compiling & Installation
3. Usage

1. ABOUT
--------

This function library is derived from Night 2.3 and contains the following C++
functions:

       int lines(string str)
       string* str2array(string str)
       string box(string str)
       string readtag(string str, string begin_str, string end_str)
       string center(string str)
       string replace(string str, string f, string r)
       string strip_ansi(string str)
       string strip_night(string str)
       string night2(string str)
       void night2file(char file[])
       string filecontents(char file[])

Night converts simplified color codes in a file or string to ANSI codes for
styling terminal output. The program accepts file or string input on the
command line, but can also be used to process stand-alone Night scripts.

Night 2.1 introduced text centering.

Night 2.2 introduces many new codes for moving the cursor and box drawing.

This version includes many more codes in a more intuitive format than the
previous versions, but remains compatible with codes from previous versions
of Night, with the exception of the :uncenter: tag, which has been changed
to :.center:.

Full documentation for this program is contained in the manual file, including
a table of codes. The manual can be read after installation using 'man
libnight2' or before installation using 'man ./libnight2.1'.

Additional manuals have been included in the 'nt' subdirectory which make use
of Night features. The files 'libnight2.nt' and 'night2.nt' can be viewed using
'night2 ./nt/libnight2.nt' or 'night2 ./nt/night2.nt'.

2. COMPILING & INSTALLATION
---------------------------

The installation and manual directory can be configured in the Makefile. It is
important that the include path is set correctly for your system.

There are three compile-time options that can be modified at the top of the
'night2.h' source file.

To disable support for old Night (version 1.X) codes, comment out the line:

	#define SUPPORT_OLD_CODES 1

or change the 1 to 0.

To use more simplistic box drawing characters, comment out the line:

	#define BOX_STYLE 1

or change the 1 to 0.

To adjust the maximum number of newlines allowed in a box from the default
value (40), change the number on the line:

	#define MAX_LINES 40

to the desired value.

To compile the 'libnight2.so' library:

	$ make

To move the 'libnight2.so' library to /usr/lib, copy the header file 'night2.h'
to /usr/include/c++/4.6, and copy the manual page file to /usr/share/man/man3:

	$ make install

	Note: This will execute ldconfig using sudo on completion.

To remove the object files generated by make:

	$ make clean

To delete the installed library, manual, and header file:

	$ make uninstall

3. USAGE
--------

To make use of the Night2 library after it has been installed, include the
'night2.h' header file in your code and pass -lnight2 to the C++ compiler.
