-
Notifications
You must be signed in to change notification settings - Fork 433
Description
Our repo has a structure to it. We have services contained in libraries. If the generator configuration reflects that, it will help us maintain consistency and confidence in our documentation across all libraries. I am thinking something like:
message LibraryConfiguration {
string name = 1;
string display_name = 2;
string description = 3;
string cloud_service_root = 4;
string cloud_service_docs = 5;
string cloud_quickstart = 6;
bool experimental = 7;
repeated ServiceConfiguration service = 8;
// we can add more knobs, but we should be cautious about doing so.
}
message GeneratorConfiguration {
repeated LibraryConfiguration library = 1;
// Support standalone services, for libraries that have handwritten documentation.
repeated ServiceConfiguration service = 2;
}At the moment, we generate many things in the scaffolding.
google-cloud-cpp/generator/internal/scaffold_generator.cc
Lines 118 to 132 in a590dc4
| {"config.cmake.in", GenerateCmakeConfigIn}, | |
| {"README.md", GenerateReadme}, | |
| {"BUILD.bazel", GenerateBuild}, | |
| {"CMakeLists.txt", GenerateCMakeLists}, | |
| {"doc/main.dox", GenerateDoxygenMainPage}, | |
| {"doc/options.dox", GenerateDoxygenOptionsPage}, | |
| {"quickstart/README.md", GenerateQuickstartReadme}, | |
| {"quickstart/quickstart.cc", GenerateQuickstartSkeleton}, | |
| {"quickstart/CMakeLists.txt", GenerateQuickstartCMake}, | |
| {"quickstart/Makefile", GenerateQuickstartMakefile}, | |
| {"quickstart/WORKSPACE.bazel", GenerateQuickstartWorkspace}, | |
| {"quickstart/BUILD.bazel", GenerateQuickstartBuild}, | |
| {"quickstart/.bazelrc", GenerateQuickstartBazelrc}, | |
| {"samples/BUILD.bazel", GenerateSamplesBuild}, | |
| {"samples/CMakeLists.txt", GenerateSamplesCMake}, |
I think (at least) the following should be generated for each LibraryConfiguration:
README.mddoc/main.doxdoc/options.doxquickstart/.bazelrcsamples/BUILD.bazelsamples/CMakeLists.txt
We do not want to move things to the generator config, just because. Some things are easier to maintain in place, and impossible to generalize. An obvious example would be the quickstart/quickstart.cc's.
I explored this some in a branch. I started with the README.md and doc/main.dox:
https://github.com/googleapis/google-cloud-cpp/compare/main...dbolduc:google-cloud-cpp:generator-library-config-dev?expand=1