Skip to content

Commit

Permalink
Adds plantuml support Qt compressed help file
Browse files Browse the repository at this point in the history
Plantuml generated diagrams will be included in the
index.qcp file which defines what files to include
in the Qt compressed help file. This means that
plantuml diagrams will work in the Qt creator help
viewer.

Signed-off-by: Anders Wallander <anders.wallander@volvocars.com>
  • Loading branch information
Anders Wallander committed Oct 18, 2016
1 parent adb44ae commit c7b740d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/htmldocvisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2082,15 +2082,15 @@ void HtmlDocVisitor::writePlantUMLFile(const QCString &fileName,
QCString imgExt = getDotImageExtension();
if (imgExt=="svg")
{
generatePlantUMLOutput(fileName,outDir,PUML_SVG);
generatePlantUMLOutput(baseName,outDir,PUML_SVG);
//m_t << "<iframe scrolling=\"no\" frameborder=\"0\" src=\"" << relPath << baseName << ".svg" << "\" />" << endl;
//m_t << "<p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p>";
//m_t << "</iframe>" << endl;
m_t << "<object type=\"image/svg+xml\" data=\"" << relPath << baseName << ".svg\"></object>" << endl;
}
else
{
generatePlantUMLOutput(fileName,outDir,PUML_BITMAP);
generatePlantUMLOutput(baseName,outDir,PUML_BITMAP);
m_t << "<img src=\"" << relPath << baseName << ".png" << "\" />" << endl;
}
}
Expand Down
15 changes: 10 additions & 5 deletions src/plantuml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#include "plantuml.h"
#include "portable.h"
#include "config.h"
#include "doxygen.h"
#include "index.h"
#include "message.h"

#include <qdir.h>
Expand Down Expand Up @@ -84,28 +86,30 @@ void generatePlantUMLOutput(const char *baseName,const char *outDir,PlantUMLOutp
pumlArgs+="-o \"";
pumlArgs+=outDir;
pumlArgs+="\" ";
QCString extension;
QCString imgName = baseName;
switch (format)
{
case PUML_BITMAP:
pumlArgs+="-tpng";
extension=".png";
imgName+=".png";
break;
case PUML_EPS:
pumlArgs+="-teps";
extension=".eps";
imgName+=".eps";
break;
case PUML_SVG:
pumlArgs+="-tsvg";
extension=".svg";
imgName+=".svg";
break;
}
pumlArgs+=" \"";
pumlArgs+=outDir;
pumlArgs+="/";
pumlArgs+=baseName;
pumlArgs+=".pu\" ";
pumlArgs+="-charset UTF-8 ";
int exitCode;
//printf("*** running: %s %s outDir:%s %s\n",pumlExe.data(),pumlArgs.data(),outDir,outFile);
//printf("*** running: %s %s outDir:%s %s\n",pumlExe.data(),pumlArgs.data(),outDir,baseName);
msg("Running PlantUML on generated file %s.pu\n",baseName);
portable_sysTimerStart();
if ((exitCode=portable_system(pumlExe,pumlArgs,TRUE))!=0)
Expand All @@ -129,5 +133,6 @@ void generatePlantUMLOutput(const char *baseName,const char *outDir,PlantUMLOutp
}
portable_sysTimerStop();
}
Doxygen::indexList->addImageFile(imgName);
}

0 comments on commit c7b740d

Please sign in to comment.