ntopng/doc/src
Alfredo Cardigliano ad0bf0f74b Doc update
2020-07-08 12:03:39 +02:00
..
_static/css Docs improvements 2020-04-06 16:34:58 +02:00
active_monitoring Updates doc for the active monitor 2020-04-16 21:21:23 +02:00
advanced_features Doc update 2020-07-08 12:03:39 +02:00
api Implements most of #4113 2020-07-06 18:06:40 +02:00
basic_concepts Documents Elasticsearch alerts endpoint 2020-04-19 19:57:13 +02:00
doxygen Fix documentation errors in .lua.cpp files 2019-07-01 18:40:14 +02:00
how_to_start Win fixes 2020-03-26 15:59:59 +01:00
img Add sFLow collection docs 2020-05-19 12:17:37 +02:00
plugins Refactors snmp_utils global methods into module functions 2020-06-10 13:09:30 +02:00
self_monitoring Doc compilation fixes 2020-04-06 15:36:29 +02:00
use_cases Typo fix 2020-05-29 13:04:42 +02:00
using_with_other_tools Doc update 2020-04-20 16:18:56 +02:00
web_gui Documents flows and alerts dump 2020-04-22 20:00:44 +02:00
cli_options.rst Sticky hosts doc update 2019-10-14 18:52:49 +02:00
conf.py Add workaround for missing swaggerdoc 2020-04-02 18:14:21 +02:00
example.rst Improve localization docs 2020-04-02 11:32:45 +02:00
example_api.lua Document the host and network user scripts C API 2020-04-02 18:03:45 +02:00
faq.rst Fixes doc typos 2020-04-20 22:59:22 +02:00
historical_flows.rst Minor doc fix 2020-05-19 21:38:52 +02:00
index.rst Minor changes 2020-04-08 14:02:40 +02:00
Makefile lua doxygen documentation skeleton and integration with read the docs 2018-05-31 01:46:42 +02:00
operating_ntopng_on_large_networks.rst Explain performance impact of local hosts cache 2020-03-10 17:05:30 +01:00
README.md Docs improvements 2020-04-06 16:34:58 +02:00
remote_assistance.rst Updates doc remote assisstance 2020-04-02 16:27:04 +02:00
using_with_nprobe.rst Updates doc to use ntopng with other ntop tools 2020-04-03 18:00:42 +02:00
using_with_nprobe_agent.rst Updates doc to use ntopng with other ntop tools 2020-04-03 18:00:42 +02:00
what_is_ntopng.rst Updates doc with OS X geolocation instructions 2020-04-27 10:42:21 +02:00

Documentation

Ntopng documentation uses read the docs and .rst file format.

Requirements

On ubuntu:

apt-get install doxygen
pip install breathe sphinx==1.7.9

Note: newer sphinx versions (e.g. 1.8.0) have a bug with search: https://github.com/sphinx-doc/sphinx/issues/5460

Generate

The ntopng documentation can be generated by executing make release.

It can be easily tested locally by running a python webserver:

  pushd _build/html; python -m SimpleHTTPServer 8080; popd

Lua C API

The Lua C API documentation can be found inside the api/lua_c directory.

The functions documentation is written in .lua file (e.g. api/lua_c/ntop/ntop_users.lua). These are the files to modify to update the api documentation.

Functions are organized in a directory structure in the form api/lua_c/{object}/{api_group}.lua, where {object} is a C API reg (eg. interface) and {api_group} is a group of api functions relevant to the same topic (e.g. interface_hosts is for api functions that work with hosts).

Only a subset of the functions defined in src/LuaEngine.cpp are documented as API. They are marked with the // ***API*** comment. Whenever an API function is modified, the corresponding documentation file should be updated.

Here is how to perform some recurrent operations on the documentation:

  • Add/modify a function documentation: e.g. to update the ntop.setCache documentation, the file api/lua_c/ntop/ntop_cache.lua should be modified.

  • Add a new group of api functions for an existing C API reg: e.g. to group together all the host pools functions, the following modifications should be performed:

    • create api/lua_c/interface/interface_host_pools.lua.
    • create api/lua_c/interface/interface_host_pools.rst. Adapt this from an existing .rst.
    • edit api/lua_c/interface/index.rst and add interface_host_pools to the toctree section.
  • Add a new C API reg: e.g. to add a new db reg so that we can call db.some_function functions, it's necessary to:

    • create api/lua_c/db/index.rst. Adapt this from an existing .rst.
    • edit api/lua_c/index.rst and add db/index to the toctree section.

Fixing API prefixes

Lua C API usually have a prefix which indicates the lua table under which the api is present, e.g. ntop.isAdministrator has the ntop prefix, whereas interface.getid() has the interface interface prefix. In order to correctly show such prefix in the documentation its necessary to edit the _static/css/ntop.css file and add a css content definition.