如何生成rdoc样式的可折叠代码段? [英] How to generate rdoc-style collapsable code sections?

查看:201
本文介绍了如何生成rdoc样式的可折叠代码段?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Doxygen为C ++项目创建内部文档.我让Doxygen包含了方法等的来源,但这使页面难以扫描.我希望它的行为像rdoc一样,并将源隐藏在默认情况下折叠的块中.

I am creating internal documentation for a C++ project using Doxygen. I am having Doxygen include the source for methods, etc., but this makes the page kind of hard to scan. I'd like it to behave like rdoc and hide the source in a block that is collapsed by default.

我以为HTML_DYNAMIC_SECTIONS可能会让我这样做,但是可惜,变更日志说该选项只影响图表.

I thought that HTML_DYNAMIC_SECTIONS might let me do this, but alas, the changelog says that option only affects diagrams and graphs.

也许我可以通过编辑LAYOUT_FILE来做到这一点?

Maybe I could do it by editing the LAYOUT_FILE?

无论如何,聪明的人,我如何强迫Doxygen生成可折叠的代码段?

Anyhow, smart people, how can I coerce Doxygen to generate collapsable code sections?

推荐答案

如果包含方法等的源代码,则[...]使得该页面难以扫描,为什么不直接链接到它( SOURCE_BROWSER = YES )而不是包括( INLINE_SOURCES = YES )?这将使页面更易于扫描并且加载速度更快,并且仍然可以访问源(以增加源页面的加载为代价).我想这取决于您实际上需要多久访问一次源.

if includ[ing] the source for methods, etc, [...] makes the page kind of hard to scan, why don't you just link to it (SOURCE_BROWSER = YES) instead of including it (INLINE_SOURCES = YES)? this would make the pages easier to scan and faster to load, and the source would still be accessible (at the expense of one more source page load). depends on how often you actually need to access the source, i guess.

话虽这么说, 是一种生成可折叠代码段的方法(不过,您将不得不修改源代码并重新编译Doxygen):

that being said, there is a way to generate collapsible code sections (you will have to modify the source and recompile Doxygen, though):

    Doxygen HTML输出中的
  • 可折叠部分
  • collapsible sections in Doxygen's HTML output are marked with two nested <div>s like so:
    <div class="dynheader"><div class="dynsection">
    [collapsible section]
    </div></div>

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆