【问题标题】:Specify title of a doxygen auto-gen class指定 doxygen 自动生成类的标题
【发布时间】:2013-07-03 01:09:02
【问题描述】:

有没有办法指定 doxygen 自动生成的课程页面的标题?所以我可以使用我自己的文本来代替页面顶部的“ClassName Class Reference”吗?

或者,如果不是我自己的文本,我会满足于只显示“ClassName”(没有“Class Reference”)。

下面的屏幕截图以绿色显示了我要删除的文本......所以在这个页面上我希望标题简单地是“WindSpeedSetting”。或者更理想的是,我希望标题是“WindSpeedSetting Table”。

这是我的 doxy 文件的摘录:

<navindex>
  <tab type="mainpage" visible="yes" title=""/>
  <tab type="classes" visible="no" title="">
    <tab type="classlist" visible="no" title="" intro=""/>
    <tab type="classindex" visible="no" title=""/>
    <tab type="hierarchy" visible="no" title=""/>
    <tab type="classmembers" visible="no" title=""/>
  </tab>
  <tab type="usergroup" url="[none]" visible="yes" title="Tables">
    <tab type="usergroup" url="[none]" visible="yes" title="SCADA">
      ...
      <tab type="user" title="WindSpeedSetting" url="@ref Radiance::Model::Scada::v12::WindSpeedSetting" />
    </tab>
    ...
  </tab>
</navindex>

<class>
  <briefdescription visible="no"/>
  <detaileddescription title="Description"/>
  <memberdef>
    <inlineclasses title=""/>
    <typedefs title=""/>
    <enums title=""/>
    <constructors title=""/>
    <functions title="" visible="no"/>
    <related title=""/>
    <variables title=""/>
    <properties title="Columns"/>
    <events title=""/>
  </memberdef>
  <allmemberslink visible="no"/>
  <usedfiles visible="no"/>
  <authorsection visible="no"/>
</class>

然后我的 C# 类看起来像这样:

/// <summary>
/// \class WindSpeedSetting
/// A list of available anemometers in the system.
/// </summary>
public class WindSpeedSetting
{
  /// <summary>
  /// \property AlarmSpeed
  /// \a float <br /><br />
  /// </summary>
  public virtual double AlarmSpeed { get; set; }

  /// <summary>
  /// \property AlarmTime
  /// \a bigint <br /><br />
  /// </summary>
  public virtual TimeSpan AlarmTime { get; set; }
}

【问题讨论】:

  • +1。我们有完全相同的问题。这一直困扰着我们。

标签: doxygen


【解决方案1】:

如果您没有 DoxygenLayout.xml,您可以按照 doxygen 手册 Changing the layout of pages 中描述的步骤创建一个。

在文件顶部,您会找到包含 classes 选项卡的 &lt;navindex&gt; 标记。

<navindex>
...
<tab type="classes" visible="yes" title="">
  <tab type="classes" visible="no" title="THISISANEXAMPLE"/>
  <tab type="classindex" visible="$ALPHABETICAL_INDEX" title="THISISMYTITLE"/> 
  <tab type="hierarchy" visible="yes" title=""/>
  <tab type="classmembers" visible="yes" title=""/>
</tab>
...

关注title="THISISANEXAMPLE"andvisible="no"`,更改可见性和/或标题,您就完成了。

【讨论】:

  • 这对我不起作用。我想我正在尝试更改 &lt;class&gt; 标签内的某些内容?
  • 你是否得到了 DoxygenLayout.xml 并且你能看到&lt;navindex&gt;,如果是这样,你想摆脱Class Reference put &lt;tab type="classes" visible="yes" title="THISISANEXAMPLE"/&gt; set classindex hierarchy classmembers visible="no" 这应该可以解决问题。玩一点,如果它不起作用,也许你可以发布一些你的代码。如果没有确切的参数,真的很难分辨出哪里出了问题,截图之类的也不错。
【解决方案2】:

我从 github 上抓取了 Doxygen 的源代码,并追踪到 "Class Reference" 字符串是在 translate_en.h 的第 585 行定义的例程,具体如下:

/*! used as the title of the HTML page of a class/struct/union */
virtual QCString trCompoundReference(const char *clName,
                                ClassDef::CompoundType compType,
                                bool isTemplate)
{
  QCString result=(QCString)clName;
  switch(compType)
  {
    case ClassDef::Class:      result+=" Class"; break;
    case ClassDef::Struct:     result+=" Struct"; break;
    case ClassDef::Union:      result+=" Union"; break;
    case ClassDef::Interface:  result+=" Interface"; break;
    case ClassDef::Protocol:   result+=" Protocol"; break;
    case ClassDef::Category:   result+=" Category"; break;
    case ClassDef::Exception:  result+=" Exception"; break;
    default: break;
  }
  if (isTemplate) result+=" Template";
  result+=" Reference";
  return result;
}

这意味着使“类引用”文本消失的唯一方法是更改​​语言,将“类引用”替换为等效的外语或修补代码。

【讨论】:

    【解决方案3】:

    要显示没有“类引用”字符串的类名,您可以检查标签 HIDE_COMPOUND_REFERENCE。

    【讨论】:

      猜你喜欢
      • 2014-02-19
      • 1970-01-01
      • 2012-01-15
      • 1970-01-01
      • 2014-01-07
      • 1970-01-01
      • 2012-06-23
      • 2015-09-13
      • 2019-03-31
      相关资源
      最近更新 更多