qdoc: Add CLI option to not generate example docs.

Change-Id: I059ae76430adada020d338905b39ba3089c89615
Reviewed-by: Martin Smith <martin.smith@nokia.com>
This commit is contained in:
Casper van Donderen 2012-03-23 14:09:33 +01:00 committed by Qt by Nokia
parent 419b4abed6
commit 89be197b92
4 changed files with 19 additions and 10 deletions

View File

@ -148,6 +148,7 @@ QStringList MetaStack::getExpanded(const Location& location)
}
QT_STATIC_CONST_IMPL QString Config::dot = QLatin1String(".");
bool Config::generateExamples = true;
QString Config::overrideOutputDir;
QSet<QString> Config::overrideOutputFormats;
QMap<QString, QString> Config::extractedDirs;

View File

@ -110,6 +110,7 @@ public:
QT_STATIC_CONST QString dot;
static bool generateExamples;
static QString overrideOutputDir;
static QSet<QString> overrideOutputFormats;

View File

@ -684,9 +684,11 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc,
return node;
}
else if (command == COMMAND_EXAMPLE) {
ExampleNode* en = new ExampleNode(tre->root(), arg);
createExampleFileNodes(en);
return en;
if (Config::generateExamples) {
ExampleNode* en = new ExampleNode(tre->root(), arg);
createExampleFileNodes(en);
return en;
}
}
else if (command == COMMAND_EXTERNALPAGE) {
return new FakeNode(tre->root(), arg, Node::ExternalPage, Node::ArticlePage);

View File

@ -108,22 +108,24 @@ static void printHelp()
{
Location::information(tr("Usage: qdoc [options] file1.qdocconf ...\n"
"Options:\n"
" -help "
"Display this information and exit\n"
" -version "
"Display version of qdoc and exit\n"
" -D<name> "
"Define <name> as a macro while parsing sources\n"
" -help "
"Display this information and exit\n"
" -highlighting "
"Turn on syntax highlighting (makes qdoc run slower)\n"
" -showinternal "
"Include stuff marked internal\n"
" -no-examples "
"Do not generate documentation for examples"
" -obsoletelinks "
"Report links from obsolete items to non-obsolete items\n"
" -outputdir "
"Specify output directory, overrides setting in qdocconf file\n"
" -outputformat "
"Specify output format, overrides setting in qdocconf file") );
"Specify output format, overrides setting in qdocconf file"
" -showinternal "
"Include content marked internal\n"
" -version "
"Display version of qdoc and exit\n") );
}
/*!
@ -427,6 +429,9 @@ int main(int argc, char **argv)
else if (opt == "-showinternal") {
showInternal = true;
}
else if (opt == "-no-examples") {
Config::generateExamples = false;
}
else if (opt == "-obsoletelinks") {
obsoleteLinks = true;
}