54 const QCString &srcFile,
int srcLine)
74 if (i != -1) baseName = baseName.
left(i);
78 QCString mmdName = baseName +
".mmd";
87 err_full(srcFile, srcLine,
"Could not open file {} for writing", mmdName);
111 imgName = imgName.
mid(i + 1);
120 if (contentList.empty())
return;
123 if (mermaidPath.
isEmpty())
return;
141 for (
const auto &mc : contentList)
143 if (mc.content.isEmpty())
continue;
145 QCString inputFile = mc.baseName +
".mmd";
146 QCString outputFile = mc.baseName +
"." + ext;
153 if (cachedContent == mc.content)
continue;
158 args +=
"-i \"" + inputFile +
"\" ";
159 args +=
"-o \"" + outputFile +
"\" ";
161 if (!mermaidConfigFile.
isEmpty())
163 args +=
"-c \"" + mermaidConfigFile +
"\" ";
166 msg(
"Generating Mermaid {} file {}\n", ext, outputFile);
173 "Problems running Mermaid (mmdc). Verify that the command '{}' works from the command line. Exit code: {}.",
static void print(DebugMask mask, int prio, fmt::format_string< Args... > fmt, Args &&... args)
static IndexList * indexList
Minimal replacement for QFileInfo.
void run()
Run mmdc tool for all collected diagrams.
OutputFormat
Mermaid output image formats.
QCString writeMermaidSource(const QCString &outDirArg, const QCString &fileName, const QCString &content, OutputFormat format, const QCString &srcFile, int srcLine)
Write a Mermaid source file and register it for CLI rendering.
void generateMermaidOutput(const QCString &baseName, const QCString &outDir, OutputFormat format)
Register a generated Mermaid image with the index.
static MermaidManager & instance()
static QCString imageExtension(OutputFormat format)
std::vector< MermaidContent > ContentList
This is an alternative implementation of QCString.
QCString & prepend(const char *s)
size_t length() const
Returns the length of the string, not counting the 0-terminator.
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
char & at(size_t i)
Returns a reference to the character at index i.
bool isEmpty() const
Returns TRUE iff the string is empty.
const std::string & str() const
QCString & setNum(short n)
int findRev(char c, int index=-1, bool cs=TRUE) const
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
QCString left(size_t len) const
#define Config_getString(name)
static std::mutex g_mermaidMutex
static int g_mermaidIndex
static void runMermaidContent(const MermaidManager::ContentList &contentList, MermaidManager::OutputFormat format)
#define err_full(file, line, fmt,...)
std::ofstream openOutputStream(const QCString &name, bool append=false)
int system(const QCString &command, const QCString &args, bool commandHasConsole=true)
Portable versions of functions that are platform dependent.
QCString fileToString(const QCString &name, bool filter, bool isSourceCode)
A bunch of utility functions.