\brief Create a markdown file which contains the information about the option.
| 15 | |
| 16 | /// \brief Create a markdown file which contains the information about the option. |
| 17 | static bool CreateFile(const std::string& optionName, bool optionDefault, const char* description) |
| 18 | { |
| 19 | const std::string mdFileName{"opt-" + optionName + ".md"}; |
| 20 | ofstream mdFile{mdFileName}; |
| 21 | |
| 22 | if(not mdFile.is_open()) { |
| 23 | return false; |
| 24 | } |
| 25 | |
| 26 | cout << "Generating: " << mdFileName << "\n"; |
| 27 | std::string linkName{optionName}; |
| 28 | std::replace(linkName.begin(), linkName.end(), '-', '_'); |
| 29 | |
| 30 | mdFile << "# " << optionName << " {#" << linkName << "}\n"; |
| 31 | mdFile << description << "\n\n"; |
| 32 | mdFile << "__Default:__ " << (optionDefault ? "On" : "Off") << "\n\n"; |
| 33 | mdFile << "__Examples:__\n\n"; |
| 34 | mdFile << "```.cpp\n"; |
| 35 | mdFile << optionName << "-source\n"; |
| 36 | mdFile << "```\n\n"; |
| 37 | mdFile << "transforms into this:\n\n"; |
| 38 | mdFile << "```.cpp\n"; |
| 39 | mdFile << optionName << "-transformed\n"; |
| 40 | mdFile << "```\n"; |
| 41 | mdFile.close(); |
| 42 | |
| 43 | return true; |
| 44 | } |
| 45 | |
| 46 | int main() |
| 47 | { |