fix main page code formatting

This commit is contained in:
Mark Gillard 2023-10-13 22:12:18 +03:00
parent 30172438ce
commit f1a38d23b7
2 changed files with 107 additions and 111 deletions

View File

@ -10,7 +10,7 @@ trim_trailing_whitespace = true
charset = utf-8 charset = utf-8
max_line_length = 120 max_line_length = 120
[*.{gitattributes,yaml,yml,vcxproj,vcxproj.filters,sln,rc,clang-format,toml,py,cmake}] [*.{gitattributes,yaml,yml,vcxproj,vcxproj.filters,sln,rc,clang-format,toml,py,cmake,md,markdown}]
indent_style = space indent_style = space
[{Doxyfile,Doxyfile-mcss,CMakeLists.txt}] [{Doxyfile,Doxyfile-mcss,CMakeLists.txt}]

View File

@ -53,7 +53,6 @@ return 1;
} }
return 0; return 0;
} }
@endcpp @endcpp
@ -89,7 +88,6 @@ cpp = 17
try try
{ {
// parse directly from a string view: // parse directly from a string view:
{ {
toml::table tbl = toml::parse(some_toml); toml::table tbl = toml::parse(some_toml);
@ -149,6 +147,7 @@ the parsing functions return a toml::parse_result instead of a toml::table:
int main() int main()
{ {
toml::parse_result result = toml::parse_file("configuration.toml"); toml::parse_result result = toml::parse_file("configuration.toml");
if (!result) if (!result)
{ {
std::cerr << "Parsing failed:\n" << result.error() << "\n"; std::cerr << "Parsing failed:\n" << result.error() << "\n";
@ -157,7 +156,6 @@ return 1;
do_stuff_with_your_config(std::move(result).table()); // 'steal' the table from the result do_stuff_with_your_config(std::move(result).table()); // 'steal' the table from the result
return 0; return 0;
} }
@endcpp @endcpp
@ -225,7 +223,6 @@ minerals = [ "quartz", "iron", "copper", "diamond" ]
cats = [ "tiger", "lion", "puma" ] cats = [ "tiger", "lion", "puma" ]
birds = [ "macaw", "pigeon", "canary" ] birds = [ "macaw", "pigeon", "canary" ]
fish = [ "salmon", "trout", "carp" ] fish = [ "salmon", "trout", "carp" ]
)"sv; )"sv;
toml::table tbl = toml::parse(source); toml::table tbl = toml::parse(source);
@ -390,7 +387,6 @@ github: 'https://github.com/marzer'
name: 'Mark Gillard' name: 'Mark Gillard'
twitter: 'https://twitter.com/marzer8789' twitter: 'https://twitter.com/marzer8789'
cpp: cpp:
- 17 - 17
- 20 - 20
- 'and beyond' - 'and beyond'