### Does this PR have any customer impact? No ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Docs ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) No ### Are you introducing any new config? If yes, do you have tests with and without them being set? No ### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md)) ### Description This PR includes updates to add base Doxygen comments within SQL files, setting up initial documentation structure for functions. Additionally, it includes Doxygen configuration files (Doxyfile, etc.) tailored to support SQL file parsing and documentation generation. ---- #### AI description (iteration 1) #### PR Classification Documentation #### PR Summary This pull request adds Doxygen comments to various `helio_api` functions to improve code documentation. - Added Doxygen comments to functions in `sql/udfs/commands_crud/query_cursors_single_page--latest.sql` - Added Doxygen comments to functions in `sql/udfs/utils/extension_version_utils--latest.sql` - Added Doxygen comments to functions in `sql/udfs/auth/auth_scram--latest.sql` - Added Doxygen comments to functions in `sql/udfs/commands_crud/delete--latest.sql` - Added Doxygen comments to functions in `sql/udfs/schema_mgmt/create_collection_view--latest.sql`
Generating Documentation with Doxygen
You can install doxygen using the commands below or Doxygen website to download executable file for Windows.
-
Ubuntu:
sudo apt-get install doxygen -
macOS:
brew install doxygen
To generate the documentation, run following in the under the oss folder:
doxygen Doxyfile
If you want to see logs, you can save them undera log file:
doxygen Doxyfile -d 2> doxygen_warnings.log
Configuration Tips
Key settings in Doxyfile to be aware of:
-
INPUT: Specifies which directories Doxygen will scan for files to document. Ensure this includes all directories with source files you want in the documentation. -
OUTPUT_DIRECTORY: Defines where Doxygen will save the generated documentation files. By default, this might be set to docs/html/. -
FILTER_PATTERNS: This setting allows you to apply specific filters to file types. For example, our configuration applies filter_sql.py to .sql files to enable custom parsing: -
HTML_FOOTERandHTML_HEADER: We can use these to add custom HTML headers and footers to each documentation page, which can include elements like a logo, navigation links, or project information. -
HTML_STYLESHEETandHTML_EXTRA_STYLESHEET: We can specify our own CSS file with HTML_STYLESHEET to fully customize the look of the documentation. Alternatively, use HTML_EXTRA_STYLESHEET to add additional styles on top of the default styling. -
USE_MDFILE_AS_MAINPAGE: Set this to a specific Markdown file (e.g., README.md) if you’d like it to serve as the main page of the documentation.
Viewing the Generated Documentation
Once Doxygen completes the generation process, you can find the output in the folder specified by OUTPUT_DIRECTORY, typically docs/html/. To view the documentation, locate the index.html file in docs/html directory. Open index.html in your web browser.
Related files
-
Doxyfile: Controls all settings for Doxygen, including input directories, output formats, and filters. -
docs/src/layout.xml: Customizes the layout of the generated Doxygen documentation. The base file is auto-generated by Doxygen and in our case, it is only used for defining the headlines of the pages. -
docs/src/group_definitions.dox: Defines groups in the documentation to organize related code. Currently, the directory name that contains the function is displayed as the group. -
docs/src/filter_sql.py: A filter script that preprocesses SQL files before Doxygen processes them, enabling custom parsing and schema name replacement. The filter is applied using theFILTER_PATTERNSoption in theDoxyfile, which specifies that the script should run on.sqlfiles.
FILTER_PATTERNS = *.sql="docs/src/filter_sql.py"
Doxygen Commenting Guide
Doxygen comments start with /** and use tags like @brief, @param, and @return to define different components.
/**
* @brief Short summary of the function.
* @details Longer description, can span multiple lines.
*
* @param[in] paramName Description of the input parameter.
* @param[out] outputParam Description of the output parameter.
* @param[in,out] inOutParam Parameter used as both input and output.
* @return Description of the return value.
* @ingroup groupName
*/
Note
If you inspect the filter_sql.py file, you'll see that only comments in the /** */ style are included, while other comment styles are ignored. This approach ensures that only the desired content is documented, helping Doxygen process everything correctly and avoiding issues during documentation generation.
Common Tags
@brief: Short summary of the function or method.@details: Longer explanation, if needed. It can span multiple lines.@param: Documents function parameters. Use[in]for input parameters,[out]for output parameters, or[in,out]for parameters that are both input and output.@return: Describes the return value of the function.@ingroup: Groups related functions for better organization.@warning: Warns users about specific issues with the function.@deprecated: Marks a function as deprecated.@note: Adds an additional note for context.@code/@endcode: Inserts a code example in the documentation.@todo: Highlights pending tasks or future improvements.