Commit 595943c9 authored by albert-github's avatar albert-github
Browse files

Support multiple extra HTML stylesheets.

In regular use it happens that it is more convenient to have multiple extra HTML stylesheets, e.g. in case of different levels of requirements: company, department, project
With this patch it is possible to specify multiple HTML stylesheets.
Note: for compatibility the configuration parameter HTML_EXTRA_STYLESHEET has not been renamed to HTM_EXTRA_STYLESHEETS.
parent 7d9d4320
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -110,8 +110,8 @@ This will create 3 files:
  link to www.doxygen.org and the body and html end tags.
  link to www.doxygen.org and the body and html end tags.
- customdoxygen.css is the default cascading style sheet
- customdoxygen.css is the default cascading style sheet
  used by doxygen. It is recommended only to look into this file and overrule
  used by doxygen. It is recommended only to look into this file and overrule
  some settings you like by putting them in a separate stylesheet and
  some settings you like by putting them in a separate stylesheets and
  referencing that extra file 
  referencing those extra files
  via \ref cfg_html_extra_stylesheet "HTML_EXTRA_STYLESHEET".
  via \ref cfg_html_extra_stylesheet "HTML_EXTRA_STYLESHEET".


You should edit these files and then reference them from the config file.
You should edit these files and then reference them from the config file.
+6 −4
Original line number Original line Diff line number Diff line
@@ -1780,16 +1780,18 @@ doxygen -w html new_header.html new_footer.html new_stylesheet.css YourConfigFil
]]>
]]>
      </docs>
      </docs>
    </option>
    </option>
    <option type='string' id='HTML_EXTRA_STYLESHEET' format='file' defval='' depends='GENERATE_HTML'>
    <option type='list' id='HTML_EXTRA_STYLESHEET' format='file' defval='' depends='GENERATE_HTML'>
      <docs>
      <docs>
<![CDATA[
<![CDATA[
 The \c HTML_EXTRA_STYLESHEET tag can be used to specify an additional 
 The \c HTML_EXTRA_STYLESHEET tag can be used to specify additional 
 user-defined cascading style sheet that is included after the standard 
 user-defined cascading style sheets that are included after the standard 
 style sheets created by doxygen. Using this option one can overrule 
 style sheets created by doxygen. Using this option one can overrule 
 certain style aspects. This is preferred over using \ref cfg_html_stylesheet "HTML_STYLESHEET" 
 certain style aspects. This is preferred over using \ref cfg_html_stylesheet "HTML_STYLESHEET" 
 since it does not replace the standard style sheet and is therefor more 
 since it does not replace the standard style sheet and is therefor more 
 robust against future updates. Doxygen will copy the style sheet file to 
 robust against future updates. Doxygen will copy the style sheet files to 
 the output directory.
 the output directory.
 \note The order of the extra stylesheet files is of importance (e.g. the last
 stylesheet in the list overrules the setting of the previous ones in the list).
]]>
]]>
      </docs>
      </docs>
      <docs doxywizard='0' doxyfile='0'>
      <docs doxywizard='0' doxyfile='0'>
+14 −12
Original line number Original line Diff line number Diff line
@@ -9151,22 +9151,24 @@ static void copyStyleSheet()
      copyFile(htmlStyleSheet,destFileName);
      copyFile(htmlStyleSheet,destFileName);
    }
    }
  }
  }
  QCString &htmlExtraStyleSheet = Config_getString("HTML_EXTRA_STYLESHEET");
  QStrList htmlExtraStyleSheet = Config_getList("HTML_EXTRA_STYLESHEET");
  if (!htmlExtraStyleSheet.isEmpty())
  for (uint i=0; i<htmlExtraStyleSheet.count(); ++i)
  {
  {
    QFileInfo fi(htmlExtraStyleSheet);
    QCString fileName(htmlExtraStyleSheet.at(i));
    if (!fileName.isEmpty())
    {
      QFileInfo fi(fileName);
      if (!fi.exists())
      if (!fi.exists())
      {
      {
      err("Style sheet '%s' specified by HTML_EXTRA_STYLESHEET does not exist!\n",htmlExtraStyleSheet.data());
        err("Style sheet '%s' specified by HTML_EXTRA_STYLESHEET does not exist!\n",fileName.data());
      htmlExtraStyleSheet.resize(0); // revert to the default
      }
      }
      else
      else
      {
      {
        QCString destFileName = Config_getString("HTML_OUTPUT")+"/"+fi.fileName().data();
        QCString destFileName = Config_getString("HTML_OUTPUT")+"/"+fi.fileName().data();
      copyFile(htmlExtraStyleSheet,destFileName);
        copyFile(fileName, destFileName);
      }
    }
    }
  }
  }
  
}
}


static void copyLogo()
static void copyLogo()
+23 −9
Original line number Original line Diff line number Diff line
@@ -1061,7 +1061,7 @@ static QCString substituteHtmlKeywords(const QCString &s,
{
{
  // Build CSS/Javascript tags depending on treeview, search engine settings
  // Build CSS/Javascript tags depending on treeview, search engine settings
  QCString cssFile;
  QCString cssFile;
  QCString extraCssFile;
  QStrList extraCssFile;
  QCString generatedBy;
  QCString generatedBy;
  QCString treeViewCssJs;
  QCString treeViewCssJs;
  QCString searchCssJs;
  QCString searchCssJs;
@@ -1100,10 +1100,20 @@ static QCString substituteHtmlKeywords(const QCString &s,
      cssFile = "doxygen.css";
      cssFile = "doxygen.css";
    }
    }
  }
  }
  extraCssFile = Config_getString("HTML_EXTRA_STYLESHEET");

  if (!extraCssFile.isEmpty())
  extraCssText = "";
  extraCssFile = Config_getList("HTML_EXTRA_STYLESHEET");
  for (uint i=0; i<extraCssFile.count(); ++i)
  {
    QCString fileName(extraCssFile.at(i));
    if (!fileName.isEmpty())
    {
      QFileInfo fi(fileName);
      if (fi.exists())
      {
      {
    extraCssText = "<link href=\"$relpath^"+stripPath(extraCssFile)+"\" rel=\"stylesheet\" type=\"text/css\"/>\n";
        extraCssText += "<link href=\"$relpath^"+stripPath(fileName)+"\" rel=\"stylesheet\" type=\"text/css\"/>\n";
      }
    }
  }
  }


  if (timeStamp) 
  if (timeStamp) 
@@ -1823,10 +1833,13 @@ void HtmlGenerator::writeStyleInfo(int part)
      }
      }
      Doxygen::indexList->addStyleSheetFile(cssfi.fileName().utf8());
      Doxygen::indexList->addStyleSheetFile(cssfi.fileName().utf8());
    }
    }
    static QCString extraCssFile = Config_getString("HTML_EXTRA_STYLESHEET");
    static QStrList extraCssFile = Config_getList("HTML_EXTRA_STYLESHEET");
    if (!extraCssFile.isEmpty())
    for (uint i=0; i<extraCssFile.count(); ++i)
    {
    {
      QFileInfo fi(extraCssFile);
      QCString fileName(extraCssFile.at(i));
      if (!fileName.isEmpty())
      {
        QFileInfo fi(fileName);
        if (fi.exists())
        if (fi.exists())
        {
        {
          Doxygen::indexList->addStyleSheetFile(fi.fileName().utf8());
          Doxygen::indexList->addStyleSheetFile(fi.fileName().utf8());
@@ -1834,6 +1847,7 @@ void HtmlGenerator::writeStyleInfo(int part)
      }
      }
    }
    }
  }
  }
}


void HtmlGenerator::startDoxyAnchor(const char *,const char *,
void HtmlGenerator::startDoxyAnchor(const char *,const char *,
                                    const char *anchor, const char *,
                                    const char *anchor, const char *,