# Documenting root code

**URL:** <https://root-forum.cern.ch/t/documenting-root-code/42959>\
**Category:** Evolution Proposals, Apps & Ideas\
**Created:** [January 6, 2021, 2:05am UTC](https://root-forum.cern.ch/t/documenting-root-code/42959 "2021-01-06T02:05:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rlalik](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/rlalik/32/25117_2.png) [@rlalik](https://root-forum.cern.ch/u/rlalik)\
**Post date:** [January 6, 2021, 2:05am UTC](https://root-forum.cern.ch/t/documenting-root-code/42959/1 "2021-01-06T02:05:35Z")

</div>

Root has great documentation but the generated html has many missing items which are actually present in the code. For example in `TEveRecTrackT` ([ROOT: TEveRecTrackT\< TT \> Class Template Reference](https://root.cern.ch/doc/master/classTEveRecTrackT.html)), the `Public Attributes` are not documented though proper comments exists in the code, e.g.

```
Int_t fLabel; // Label of the track.

```

Doxygen expect comment following to start with e.g. `///<`:

> Most often one only wants to put a brief description after a member. This is done as follows:
> 
> ```
> int var; //!< Brief description after the member
> 
> ```
> 
> or
> 
> ```
> int var; ///< Brief description after the member
> 
> ```

So my kind request is whenever any developer touches header file (ROOT-team or someone forking it, making PR), please check whether the members are commented properly and fix comments if needed. It will allow to fix comments in small steps.

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [January 6, 2021, 2:41pm UTC](https://root-forum.cern.ch/t/documenting-root-code/42959/2 "2021-01-06T14:41:20Z")

</div>

Yes some of these class members’ comments would surely benefit to be doxygen compliant. This code was developed by @matevz. I let him decide if it should be changed or not.

---

<div class="post-metadata">

**Author:** ![rlalik](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/rlalik/32/25117_2.png) [@rlalik](https://root-forum.cern.ch/u/rlalik)\
**Post date:** [January 6, 2021, 2:55pm UTC](https://root-forum.cern.ch/t/documenting-root-code/42959/3 "2021-01-06T14:55:02Z")

</div>

I use this class just as example, because I was digging into it in order to find info. But my comment is in general related to any class that could be improved.

I was also investigating whether common formatters like clang-format would be able to do this and fix a such comments but apparently it cannot. But maybe there are other ideas how this could be done in large scale?

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [January 6, 2021, 2:58pm UTC](https://root-forum.cern.ch/t/documenting-root-code/42959/4 "2021-01-06T14:58:21Z")

</div>

One way would be to submit a pull request when you see some code to be changed.  
I am not sure an automatic tool might be a good solution. Sometimes the developers  
do not want to see these comments in the doxygen doc.  
I guess pull requests are the best way. Moreover they will allow a reviewing of the comments, which is always good.

---

<div class="post-metadata">

**Author:** ![Axel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/axel/32/11084_2.png) [@Axel](https://root-forum.cern.ch/u/Axel)\
**Post date:** [January 7, 2021, 3:42pm UTC](https://root-forum.cern.ch/t/documenting-root-code/42959/5 "2021-01-07T15:42:18Z")

</div>

Indeed, same for the new version [https://root.cern.ch/doc/master/REveVSDStructs\_8hxx\_source.html#l00137](https://root.cern.ch/doc/master/REveVSDStructs_8hxx_source.html#l00137)

@matevz would be so kind… 🙂

---

<div class="post-metadata">

**Author:** ![matevz](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/matevz/32/12824_2.png) [@matevz](https://root-forum.cern.ch/u/matevz)\
**Post date:** [January 7, 2021, 7:44pm UTC](https://root-forum.cern.ch/t/documenting-root-code/42959/6 "2021-01-07T19:44:01Z")

</div>

Yes, no problem at all … it’s been added to my (rather longish) todo list 🙂
