Skip to content

Automatic insertion of header/footer comments, and generates professional-looking documentation as html or md out of C++ code

License

Notifications You must be signed in to change notification settings

JoJos1220/CppCodeDoc

Repository files navigation

Banner

Build Codacy Badge Codacy Badge License Release Version Release Date Last commit Contributors vscode.dev preview Dependabot GitHub Actions PayPal Ko-Fi

📚 Table of Contents
  1. Idea and Motivation behind the Project
  2. Functional Features in Software
  3. Getting Started
  4. Innovations in future release (Roadmap)
  5. Contributing
  6. License
  7. Contact
  8. Support

💡 Idea and Motivation behind the Project

(back to top)

While working on C++ projects—mainly using PlatformIO and ESP32/ESP8266/Arduino—I always aim to maintain a consistent and high-quality coding style. This ensures not only functional code, but also consistent comment styles in function headers and footers.

However, after editing multiple files and debugging complex code, this structure often becomes inconsistent or lost altogether.

To address this, I began creating a tool that searches for uncommented functions or functions with non-standard documentation. After several iterations, the parser's output became satisfying.

That's when the idea was born: “Why not auto-generate function header comments?”

And so, the CppCodeDoc project came to life. The tool now enables automatic detection and insertion of header/footer comments, and generates professional-looking documentation as .html or .md. The report highlights open TODOs and provides a clear overview of documentation progress.

🚀 Functional Features in Software

(back to top)

Software Preview

  1. Automatic Commenting in .cpp, .h, .hpp, .ino and .cxx files If no header or footer comment is found, the software can automatically insert one—either in default or Doxygen style.
  • Footer comment example
    //FunctionBevore;
    } /* "functionName()" */   
  • Default Header Comment
    /*------------------------------------------------------
    * functionName() ToDo
    --------------------------------------------------------*/
    int functionName(){
        // blabla
    }
  • Doxygen Header Comment
    /**------------------------------------------------------
    * @brief functionName() ToDo
    * @param foo TODO
    * @return TODO
    --------------------------------------------------------*/
    int functionName(int foo){
        // blabla
    }
  • Single-line comment conversion example

From:

    // Hi I am a singleLine comment
    void functionName(int foo){
        // blabla
    }

To:

    /*------------------------------------------------------
    * Hi I am a singleLine comment
    --------------------------------------------------------*/
    void functionName(int foo) {
        // blabla
    }
  1. Auto Documentation Generation

    • Output formats: .md or .html
    • Highlights TODOs in comments
    • Calculates documentation completion percentage
  2. Optional Backup Before Edit

  3. Various Project-Based-Configuration possibilitys

  4. Update Checker

🧭 Getting Started

You have several options to use the application:

  1. Run with Python (recommended for developers): First, install requirements. Then launch via terminal:
python .\CppCodeDoc.py
  1. Use the installer (simplest setup) Download the latest .exe, call it with administrator privilegs and follow the setup wizard. Python is not required.

  2. Use the CLI (advanced) For command-line usage without the GUI, run:

python .\CppCodeDoc.py --NoGui

Regardless of the method you choose, the repository must be cloned locally first:

git clone https://github.com/JoJos1220/CppCodeDoc.git
cd CppCodeDoc

*) For command-line usage, make sure Python is installed.

*) When using the installer, Python is not required — all necessary packages are bundled with the installer. Ensure running the installer with admin privilegs.

🛣️ Innovations in future release (Roadmap)

(back to top)

  1. Support for more output formats
    Currently, only .md and .html are supported. PDF export is planned.

  2. Live Preview of Settings in GUI
    When adjusting settings that affect documentation appearance, the GUI should immediately show a live preview.

  3. Class-based Grouping of Functions
    Functions will be grouped by class in the report, improving clarity.

  4. Add File Header/Footer
    Automatic insertion of license headers/footers per file will be implemented.

  5. Feature Requests Welcome
    Have a great idea? Don’t hesitate to ask!

🤝 Contributing

Everybody is welcome to contribute the project - regardless of the experience level!

  1. fork the repository
  2. clone your fork on your PC
  3. create a branch for your changes 4a) add you changes 4b) make a test-case to ensure the design meets your specification 4c) make and test the software-installer by calling .\scripts\Convert_PyToExe.py script
  4. commit and push
  5. create a pull request
  6. after the pull request is successfull, new release will be created by .\scripts\CreateTagRelease.py script.

(back to top)

📄 License

See also LICENSE for more information about license rights and limitations about this project.

(back to top)

📬 Contact

You can reach me out directly on Github

Project Link Github

(back to top)

☕ Support

You Like the Project and want to Support me and my work?

Well, I like coffee ;) Maybe we got a deal?

ko-fi

Donate with PayPal

About

Automatic insertion of header/footer comments, and generates professional-looking documentation as html or md out of C++ code

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published