我能在Doxygen类参考页面上抑制空洞的“More…”链接吗?

12
一个Doxygen类参考页面主要由类成员的列表组成,每个成员后面跟着它的简短描述(如果有的话)。 成员本身是一个指向该成员详细信息页面的链接。 通常,在简短的描述后面会跟着一个“更多...”链接。 这个链接的内容与成员本身相同。 这个“更多...”链接暗示——至少对我来说——在该链接的另一端可以获得更加详尽的描述。 当成员只有简短描述时,这是具有误导性的。 在这种情况下,该链接指向一个页面,该页面仅重复该简短描述,然后说明“文件abcxyz.ext的第NN行定义”。
是否有任何方法可以让Doxygen抑制这些令人沮丧的空洞的“更多...”链接?
3个回答

2
(作为临时答案,因为我从未需要做过这样的事情。)

如果您想删除所有详细描述(因此,可能也会删除链接),则可以修改“布局”文件使该部分不可见。

参考资料:http://www.doxygen.nl/manual/customize.html#layout

或者...

根据您的描述,似乎已经设置了REPEAT_BRIEF。如果真的没有超出第一个句号的描述,则关闭REPEAT_BRIEF可能会删除链接,因为那里的文本确实是空洞无物的。


2

Doxygen 1.8.10的实验性补丁,可以通过在Doxyfile中使用“USE_MORE_LINK = NO”来删除“More…”链接。

<!-- language: diff -->
=== modified file 'src/classdef.cpp'
--- src/classdef.cpp    2015-07-06 11:29:12 +0000
+++ src/classdef.cpp    2015-07-06 11:37:57 +0000
@@ -1802,12 +1802,14 @@

   // HTML only
   ol.pushGeneratorState();
-  ol.disableAllBut(OutputGenerator::Html);
-  ol.docify(" ");
-  ol.startTextLink(getOutputFileBase(),
-      anchor.isEmpty() ? QCString("details") : anchor);
-  ol.parseText(theTranslator->trMore());
-  ol.endTextLink();
+  if (Config_getBool("USE_MORE_LINK")) {
+    ol.disableAllBut(OutputGenerator::Html);
+    ol.docify(" ");
+    ol.startTextLink(getOutputFileBase(),
+        anchor.isEmpty() ? QCString("details") : anchor);
+    ol.parseText(theTranslator->trMore());
+    ol.endTextLink();
+  }
   ol.popGeneratorState();

   if (!anchor.isEmpty())

=== modified file 'src/config.xml'
--- src/config.xml  2015-07-06 11:29:12 +0000
+++ src/config.xml  2015-07-06 11:57:09 +0000
@@ -366,6 +366,13 @@
 ]]>
       </docs>
     </option>
+    <option type='bool' id='USE_MORE_LINK' defval='1'>
+      <docs>
+<![CDATA[
+ Experimental parameter, which allows you to remove the "More..." links by using USE_MORE_LINK = NO.
+]]>
+      </docs>
+    </option>
     <option type='list' id='ABBREVIATE_BRIEF' format='string'>
       <docs>
 <![CDATA[

=== modified file 'src/filedef.cpp'
--- src/filedef.cpp 2015-07-06 11:29:12 +0000
+++ src/filedef.cpp 2015-07-06 11:31:41 +0000
@@ -373,8 +373,8 @@
       ol.writeString(" \n");
       ol.enable(OutputGenerator::RTF);

-      if (Config_getBool("REPEAT_BRIEF") ||
-          !documentation().isEmpty()
+      if ( (Config_getBool("REPEAT_BRIEF") || !documentation().isEmpty() ) &&
+          Config_getBool("USE_MORE_LINK")
          )
       {
         ol.disableAllBut(OutputGenerator::Html);

=== modified file 'src/memberdef.cpp'
--- src/memberdef.cpp   2015-07-06 11:29:12 +0000
+++ src/memberdef.cpp   2015-07-06 11:37:48 +0000
@@ -1805,22 +1805,24 @@
       {
         static bool separateMemberPages = Config_getBool("SEPARATE_MEMBER_PAGES");
         ol.pushGeneratorState();
-        ol.disableAllBut(OutputGenerator::Html);
-        //ol.endEmphasis();
-        ol.docify(" ");
-        if (separateMemberPages ||
-            (m_impl->group!=0 && gd==0) ||
-            (m_impl->nspace!=0 && nd==0)
-           ) // forward link to the page or group or namespace
-        {
-          ol.startTextLink(getOutputFileBase(),anchor());
-        }
-        else // local link
-        {
-          ol.startTextLink(0,anchor());
-        }
-        ol.parseText(theTranslator->trMore());
-        ol.endTextLink();
+        if (Config_getBool("USE_MORE_LINK")) {
+          ol.disableAllBut(OutputGenerator::Html);
+          //ol.endEmphasis();
+          ol.docify(" ");
+          if (separateMemberPages ||
+              (m_impl->group!=0 && gd==0) ||
+              (m_impl->nspace!=0 && nd==0)
+             ) // forward link to the page or group or namespace
+          {
+            ol.startTextLink(getOutputFileBase(),anchor());
+          }
+          else // local link
+          {
+            ol.startTextLink(0,anchor());
+          }
+          ol.parseText(theTranslator->trMore());
+          ol.endTextLink();
+        }
         //ol.startEmphasis();
         ol.popGeneratorState();
       }

1
这绝对不是我所期望的语义。我努力为每个符号编写简要定义,有时会提供额外的材料。它被写作简要描述的阐述。因此,我指定REPEAT_BRIEF = YES我想让doxygen确定一个符号是否有超出简要描述之外的任何文档。当没有文档时,我希望“More...”被抑制,因为它错误地暗示实际上还有更多内容可读。相反,当有详细说明时,我希望“More...”可以引导到以简要描述开头的段落。 - John Yates
我可以尝试实现设置:USE_MORE_LINK = NOhttp://doxygen.10944.n7.nabble.com/Get-rid-of-quot-More-quot-td6612.html - Демьянов Максим
4
根据我原问题的标题,我想要抑制那些毫无意义的“更多...”链接。当有额外的文档说明时,我希望保留“更多...”链接;当链接是毫无意义的,即没有任何文档说明或者仅有简单的描述时,我希望它被抑制。我认为这不需要一个新的Doxyfile标签。我会主张这是所有用户都会喜欢的行为方式。至少,如果有一个新的标签,那么上述行为应该是默认的,并且该标签应该允许恢复当前不幸的行为。 - John Yates

-1

可能有点晚了,但我遇到了同样的问题,并通过以下的doxyfile配置轻松解决了它:

ALWAYS_DETAILED_SEC = NO
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = NO
EXTRACT_ALL = NO
# Since EXTRACT_ALL is NO, configure the following as you wish. In my case
EXTRACT_PRIVATE = YES
EXTRACT_STATIC = YES
EXTRACT_LOCAL_CLASSES = YES
EXTRACT_LOCAL_METHODS = YES

希望这能有所帮助。


仍然使用此配置获取“更多...”链接 - JP Garza

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接