Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I suppress vacuous 'More...' links on Doxygen class reference pages?

Tags:

doxygen

A Doxygen class reference page consists primarily of lists of class members, each followed by its brief description (if such exists). The member proper is a link to a details page for that member. Invariably the brief description is followed by a 'More...' link. The content of this link is identical to that of the member proper. This 'More...' link suggests - at least to me - that a more extended description is available at the other end of that link. This is misleading when the member has only a brief description. In that case the link points to a page which simply repeats that brief description and then states "Definition at line NN of file abcxyz.ext."

Is there anyway to get Doxygen to suppress these frustratingly vacuous 'More...' links?

like image 797
John Yates Avatar asked Apr 18 '14 18:04

John Yates


1 Answers

Experimental patch for doxygen 1.8.10, which allows you to remove the "More..." links by using "USE_MORE_LINK = NO" in Doxyfile.

<!-- 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();
       }
like image 112
Демьянов Максим Avatar answered Oct 24 '22 15:10

Демьянов Максим