dsh-doxygen
为C/C++源码生成和维护Doxygen注释 适合C/C++及Qt开发者,可自动对齐并填充Doxygen注释块。
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:FantastyQAQ/dsh-doxygen说明文档
阅读完整 README ↗Usage notes
- Existing comment blocks are always filled in, never rewritten; a
//note above a function is preserved and the Doxygen block is inserted directly above the function. - The fingerprint line is written and refreshed only by the script — do not hand-write it, and do not
put it after
*/. - Comments are always UTF-8; avoid non-ASCII glyphs such as
?or→inside comments so that a source encoding conversion cannot silently drop characters. - Indentation follows the target line: comments for class members and for Qt
signals:/slots:entries are aligned automatically. - Look at the diff before writing; run
--scanbefore a bulk change.
模块分组头 / 尾(成对使用)
python scripts/gen_doxygen.py --file src/rtc.cpp --kind module --line 30
--group rtc_api --title "RTC API" --brief "RTC 对外接口" --desc "全部函数可重入" --diff
python scripts/gen_doxygen.py --file src/rtc.cpp --kind module-end --line 120 --diff
使用注意
- 已有注释块一律只补不重写;函数上方原有的
//说明保留,Doxygen 块插在函数正上方。 - 指纹行只由脚本写入/刷新,不要手写,也不要放到
*/之后。 - 注释统一 UTF-8;不要写
?、→之类的非 ASCII 特殊字形,避免源码转换时丢字。 - 缩进跟随目标行:类内成员、Qt
signals:/slots:下的注释会自动对齐。 - 落盘前先看 diff;批量改动前先
--scan。