File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -1382,10 +1382,23 @@ struct DocumentationWriter: Writer
1382
1382
template <typename ... T>
1383
1383
std::string process (std::string_view doc, std::string_view name, T... val)
1384
1384
{
1385
- return format (" ### `{}`\n "
1386
- " {}\n " ,
1387
- name,
1388
- format (replaceCommentPlaceholder (std::string { doc }), val...));
1385
+ return format (
1386
+ " ### `{}`\n "
1387
+ " {}\n " ,
1388
+ [](std::string_view name) -> std::string {
1389
+ // camelCase into snake_case
1390
+ auto result = std::string { name };
1391
+ for (auto i = 0u ; i < result.size (); ++i)
1392
+ {
1393
+ if (std::isupper (result[i]))
1394
+ {
1395
+ result.insert (i, 1 , ' _' );
1396
+ result[i + 1 ] = static_cast <char >(std::tolower (result[i + 1 ]));
1397
+ }
1398
+ }
1399
+ return result;
1400
+ }(name),
1401
+ format (replaceCommentPlaceholder (std::string { doc }), val...));
1389
1402
}
1390
1403
1391
1404
template <typename T, documentation::StringLiteral ConfigDoc, documentation::StringLiteral WebDoc>
You can’t perform that action at this time.
0 commit comments