Skip to content

Commit

Permalink
chore(doxygen): modify config and add commenting examples to doc
Browse files Browse the repository at this point in the history
  • Loading branch information
kstdl committed May 25, 2022
1 parent 7da6c95 commit bf255c5
Show file tree
Hide file tree
Showing 19 changed files with 72 additions and 22 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,7 @@ libraries/config/include/config/version.hpp
__pycache__/

# do not include into git chart dependencies
charts/*/charts/*.tgz
charts/*/charts/*.tgz

# do not include generated documentation
doxygen_docs
8 changes: 4 additions & 4 deletions Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ EXTRACT_ALL = YES
# be included in the documentation.
# The default value is: NO.

EXTRACT_PRIVATE = NO
EXTRACT_PRIVATE = YES

# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual
# methods of a class will be included in the documentation.
Expand All @@ -522,7 +522,7 @@ EXTRACT_PACKAGE = NO
# included in the documentation.
# The default value is: NO.

EXTRACT_STATIC = NO
EXTRACT_STATIC = YES

# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined
# locally in source files will be included in the documentation. If set to NO,
Expand Down Expand Up @@ -1598,7 +1598,7 @@ DISABLE_INDEX = NO
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.

GENERATE_TREEVIEW = NO
GENERATE_TREEVIEW = YES

# When both GENERATE_TREEVIEW and DISABLE_INDEX are set to YES, then the
# FULL_SIDEBAR option determines if the side bar is limited to only the treeview
Expand Down Expand Up @@ -2539,7 +2539,7 @@ CALLER_GRAPH = NO
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.

GRAPHICAL_HIERARCHY = NO
GRAPHICAL_HIERARCHY = YES

# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the
# dependencies a directory has on other directories in a graphical way. The
Expand Down
49 changes: 48 additions & 1 deletion doc/doxygen.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,51 @@ brew install doxygen graphviz

## Generating documentation

To generate documentation you need to call `doxygen` from project source root. It should generate all needed files in `doxygen_docs` folder. You can open `index.html` in your browser to check result.
To generate documentation you need to call `doxygen` from project source root. It should generate all needed files in `doxygen_docs` folder. You can open `index.html` in your browser to check result.

## Commenting

Full description on [doxygen site](https://www.doxygen.nl/manual/docblocks.html)

### Basic example

```cpp
/** @brief Brief description which ends at this dot.
*
* Details follows here.
* @see anotherMethod()
* @param param1 description
* @param params2 description
* @return return value description
*/
```

### Grouping to modules

We should also group code to modules, so it will be easier to navigate in documentation. Class with all methods would be added as `Test` module. Example:

```cpp
/** @addtogroup Test
* @{
*/

class TestClass {}

/**
* @}
*/
```
### Graphs
Collaboration diagrams enabled by default for all classes. Additionally we could add `call graph` and `caller graph` for functions and method. To do that you need to specify additional attributes to comment:
```cpp
/**
* @callergraph
* @callgraph
* @brief brief description of function or method
....
*/
```
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

namespace taraxa {

/** \addtogroup DAG
/** @addtogroup DAG
* @{
*/

Expand Down
2 changes: 1 addition & 1 deletion libraries/core_libs/consensus/include/dag/dag.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include "transaction/transaction_manager.hpp"
namespace taraxa {

/** \addtogroup DAG
/** @addtogroup DAG
* @{
*/
class DagManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "vdf/sortition.hpp"

namespace taraxa {
/** \addtogroup DAG
/** @addtogroup DAG
* @{
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace taraxa {

using EfficienciesMap = std::map<uint16_t, int32_t>;

/** \addtogroup DAG
/** @addtogroup DAG
* @{
*/

Expand Down
2 changes: 1 addition & 1 deletion libraries/core_libs/consensus/include/final_chain/data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

namespace taraxa::final_chain {

/** \addtogroup FinalChain
/** @addtogroup FinalChain
* @{
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

namespace taraxa::final_chain {

/** \addtogroup FinalChain
/** @addtogroup FinalChain
* @{
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace taraxa::final_chain {

/** \addtogroup FinalChain
/** @addtogroup FinalChain
* @{
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace taraxa::state_api {

/** \addtogroup FinalChain
/** @addtogroup FinalChain
* @{
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

namespace taraxa::state_api {

/** \addtogroup FinalChain
/** @addtogroup FinalChain
* @{
*/

Expand Down
2 changes: 1 addition & 1 deletion libraries/core_libs/consensus/include/pbft/pbft_chain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace taraxa {

/** \addtogroup PBFT
/** @addtogroup PBFT
* @{
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

namespace taraxa {

/** \addtogroup PBFT
/** @addtogroup PBFT
* @{
*/

Expand Down
2 changes: 1 addition & 1 deletion libraries/core_libs/consensus/include/pbft/sync_queue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace taraxa {

/** \addtogroup PBFT
/** @addtogroup PBFT
* @{
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace taraxa {

/** \addtogroup Transaction
/** @addtogroup Transaction
* @{
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace taraxa {

/** \addtogroup Transaction
/** @addtogroup Transaction
* @{
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace taraxa {

/** \addtogroup Transaction
/** @addtogroup Transaction
* @{
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace taraxa {

/** \addtogroup Vote
/** @addtogroup Vote
* @{
*/

Expand Down

0 comments on commit bf255c5

Please sign in to comment.