Skip to content

doxygen: add documentation for doxygen #9975

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 11, 2025

Conversation

unicornx
Copy link
Contributor

@unicornx unicornx commented Feb 9, 2025

Fixed #9970

如果要查看最终的效果,可以参考修改后的 documentation/0.doxygen/INDEX.md 中 ubuntu 的环境编译方式,在本地查看修改效果。新建的具体页面 url 是:http://localhost:8000/howto_doxygen.html

Documentation is provided to clarify how to write
doxygen documentation for RT-Thread. This document is also integrated as part of RT-Thread doxygen
documentation.

An example is also provided.

The original README.md is removed and integrated into this document.

拉取/合并请求描述:(PR description)

[

为什么提交这份PR (why to submit this PR)

你的解决方案是什么 (what is your solution)

请提供验证的bsp和config (provide the config and bsp)

  • BSP:
  • .config:
  • action:

]

当前拉取/合并请求的状态 Intent for your PR

必须选择一项 Choose one (Mandatory):

  • 本拉取/合并请求是一个草稿版本 This PR is for a code-review and is intended to get feedback
  • 本拉取/合并请求是一个成熟版本 This PR is mature, and ready to be integrated into the repo

代码质量 Code Quality:

我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:

  • 已经仔细查看过代码改动的对比 Already check the difference between PR and old code
  • 代码风格正确,包括缩进空格,命名及其他风格 Style guide is adhered to, including spacing, naming and other styles
  • 没有垃圾代码,代码尽量精简,不包含#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up
  • 所有变更均有原因及合理的,并且不会影响到其他软件组件代码或BSP All modifications are justified and not affect other components or BSP
  • 对难懂代码均提供对应的注释 I've commented appropriately where code is tricky
  • 代码是高质量的 Code in this PR is of high quality
  • 已经使用formatting 等源码格式化工具确保格式符合RT-Thread代码规范 This PR complies with RT-Thread code specification
  • 如果是新增bsp, 已经添加ci检查到.github/workflows/bsp_buildings.yml 详细请参考链接BSP自查

@unicornx unicornx added the Doc This PR/issue related with documents label Feb 9, 2025
@unicornx unicornx force-pushed the dev-9970-doxygen-guide branch from 25ab79e to 2b6abda Compare February 9, 2025 05:24
@supperthomas
Copy link
Member

supperthomas commented Feb 9, 2025

doxygen.yml的ci相关的路径加一下,触发doxygen的ci

paths:
- 'documentation/doxygen/**'
- 'src/**'
- 'include/**'
- 'components/drivers/include/drivers/**'
- 'components/dfs/dfs_v2/include/**'
- 'components/dfs/dfs_v2/src/**'
- 'components/finsh/**'
- '.github/workflows/doxygen.yml'
# Runs at 16:00 UTC (BeiJing 00:00) on the 30st of every month
push:
branches: [master]
paths:
- 'documentation/doxygen/**'
- 'src/**'
- 'include/**'
- 'components/drivers/include/drivers/**'
- 'components/dfs/dfs_v2/include/**'
- 'components/dfs/dfs_v2/src/**'
- 'components/finsh/**'
- '.github/workflows/doxygen.yml'

@unicornx unicornx force-pushed the dev-9970-doxygen-guide branch from 2b6abda to 2ce7c1d Compare February 10, 2025 01:53
@github-actions github-actions bot added the action github action yml imporve label Feb 10, 2025
@unicornx
Copy link
Contributor Author

doxygen.yml的ci相关的路径加一下,触发doxygen的ci

Done, path 信息保持和 documentation/Doxyfile 的 INPUT 值同步了

@unicornx unicornx force-pushed the dev-9970-doxygen-guide branch from 2ce7c1d to 8442aa6 Compare February 10, 2025 02:04
/**
* @page page_howto_function How to write doxygen documentation for function.
*
* Function comments can be placed in the header file (before the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

请问这里所说的注释指的是非doxygen注释么?doxygen注释统一放在c文件中吧?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"comments" 指的都是符合 doxygen 语法的注释,对于函数(function), doxygen 注释可以放在头文件中也可以放在源文件中。

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

下面不是推荐了函数注释要放在源文件中么?为什么这里还说可以放在头文件里?头文件只放数据结构和宏的注释吧?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

下面不是推荐了函数注释要放在源文件中么?为什么这里还说可以放在头文件里?头文件只放数据结构和宏的注释吧?

不矛盾啊,你也get 了这是 ”推荐“,本身不强制,因为现在已有很多模块的函数注释已经放在头文件中,我觉得也没有必要再整改一遍了吧,所以下面

So, it is strongly recommended to put comments in the source file when writing new functions or annotating functions.

这句话是有前提条件的:翻译过来是:

因此,强烈建议在编写新函数或注释函数时在源文件中添加注释。

所以是对 新写的 注释我们 强烈建议。已经存在的就尽量保持现状好了,除非出现我列举的因为头文件中 API 太多,导致注释写在头文件中不方便查看的原因出现,我们再去整改。

p.s. 这个 PR 本身所有的内容也就是一个指导规范(Guide),尽量统一大家思路而已,代码规范都很难 100% 统一,何况文档格式?所以我也这是说 recommended, 没有用 ”must“ :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

原来如此,我还以为要把之前的注释重构下😂

* define a group anywhere, not necessarily in the same file as the members
* of the group. Generally, we define a group in a header file.
*
* To make an entity (structure, function etc. or another group) a menber of
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是拼写错误么?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是拼写错误么?

“menber” 应该是 “member", I will fix it. Thanks.

@Rbb666 Rbb666 closed this Feb 10, 2025
@Rbb666 Rbb666 reopened this Feb 10, 2025
Documentation is provided to clarify how to write
doxygen documentation for RT-Thread. This document
is also integrated as part of RT-Thread doxygen
documentation.

An example is also provided.

The original README.md is removed and integrated into
this document.

Updated github actions for doxygen too.

Signed-off-by: Chen Wang <[email protected]>
@unicornx unicornx force-pushed the dev-9970-doxygen-guide branch from 8442aa6 to 74396b7 Compare February 10, 2025 10:55
@Rbb666 Rbb666 merged commit 761bb89 into RT-Thread:master Feb 11, 2025
48 checks passed
@unicornx unicornx deleted the dev-9970-doxygen-guide branch February 12, 2025 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action github action yml imporve Doc This PR/issue related with documents
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] provde guide on how to add doxygen style comment for API
4 participants