Using Nenav is easy. Firstly, you have to include jQuery and Prettify libraries, after them you can add the Nenav JavaScript file. All this inside the tag:
<script type="text/javascript" src="js/jquery-2.2.1.min.js"></script>
<script type="text/javascript" src="js/prettify.js"></script>
<script type="text/javascript" src="js/nenav.js"></script> <!-- Nenav JS -->
Optionally, but raccommended, you can add the Prettify and Nenav theme. In the example below was added the default theme bootstrap-light.
<link rel='stylesheet' type='text/css' href='css/nenav-bootstrap-light.css'>
<link rel='stylesheet' type='text/css' href='css/prettify.css'>
Initialization of a new view of Nenav happen with a container element and calling the nenav_init () function. Example:
<div id='nenavView'></div>
<script>
nenav_init ('#nenavView', { init_path: 'nenav' });
</script>
function nenav_init () is defined by:
nenav_init (element, properties)
{
/* Required. Identify the path where navigation start. */
init_path: 'root',
/* Optional. If at the begin you want to start navigation from another folder
different from init_path. Default: null */
curr_pos: 'subpath/of/root',
/* Optional. Identify the sort type when nenav is initialized. Default: name.
Values: name, size, time, name-reverse, size-reverse, time-reverse. */
sort: 'size-reverse',
/* Optional. It's the folder where the nenav.php file was located. Default: php */
php_path: 'php',
/* Optional. It's the folder where the file nenav-ui.html was located. Default: html */
ui_path: 'html'
}
You can see the example file to use Nenav inside the uncompressed package.
Finally, maybe you should configure the PHP file at variable:
$nenav_prefix = '../nav_path';
For security reason, Nenav not allow to use a path with relative links such as . or .. in javascript code, because of this is needed set a path with this values inside a variable in the PHP file. This path, in the PHP file, must not have the / at the end, and in the same way, in the javascript file, it must be omitted.