Skip to content

Commit 3f14052

Browse files
committed
tidy generators for single-page config
1 parent 1bf25d4 commit 3f14052

File tree

5 files changed

+12
-6
lines changed

5 files changed

+12
-6
lines changed

include/mrdox/Config.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ class MRDOX_VISIBLE
8080
*/
8181
bool ignoreFailures = false;
8282

83+
/** `true` if everything should be output to a single page.
84+
*/
85+
bool singlePage = false;
86+
8387
/** `true` if tool output should be verbose.
8488
8589
@code
@@ -88,6 +92,8 @@ class MRDOX_VISIBLE
8892
*/
8993
bool verboseOutput = false;
9094

95+
//--------------------------------------------
96+
9197
/** A string holding the complete configuration YAML.
9298
*/
9399
std::string_view configYaml;

source/api/ConfigImpl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ struct llvm::yaml::MappingTraits<
4545
IO& io, clang::mrdox::ConfigImpl& cfg)
4646
{
4747
io.mapOptional("ignore-failures", cfg.ignoreFailures);
48+
io.mapOptional("single-page", cfg.singlePage);
4849
io.mapOptional("verbose", cfg.verboseOutput);
4950

5051
io.mapOptional("concurrency", cfg.concurrency_);
5152
io.mapOptional("defines", cfg.additionalDefines_);
52-
io.mapOptional("single-page", cfg.singlePage_);
5353
io.mapOptional("source-root", cfg.sourceRoot_);
5454
io.mapOptional("with-private", cfg.includePrivate_);
5555

source/api/ConfigImpl.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ class ConfigImpl
3939

4040
int concurrency_ = 0;
4141
std::vector<std::string> additionalDefines_;
42-
bool singlePage_ = false;
4342
std::string sourceRoot_;
4443
bool includePrivate_ = false;
4544

source/api/_adoc/AdocGenerator.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ build(
3333
Corpus const& corpus,
3434
Reporter& R) const
3535
{
36-
//if(corpus.config().
37-
return AdocPagesBuilder(llvm::StringRef(outputPath), corpus, R).build();
36+
if(corpus.config.singlePage)
37+
return Generator::build(outputPath, corpus, R);
38+
return AdocPagesBuilder(
39+
llvm::StringRef(outputPath), corpus, R).build();
3840
}
3941

4042
Err

source/tool/ToolMain.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,7 @@ toolMain(
143143
// Run the generator.
144144
if(config->verboseOutput)
145145
llvm::outs() << "Generating docs...\n";
146-
auto err = generator->build(
147-
OutputPath.getValue(), **corpus, R);
146+
auto err = generator->build(OutputPath.getValue(), **corpus, R);
148147
if(err)
149148
R.print(err.message(), "generate '", OutputPath, "'");
150149
}

0 commit comments

Comments
 (0)