Skip to content

Commit 789822a

Browse files
authored
Incorporated feedback from patrick, exposed docs0readme as navigation, fixed htmlproofer, added anonymous_fields.md to documentation.
1 parent 2e2b89f commit 789822a

File tree

7 files changed

+66
-129
lines changed

7 files changed

+66
-129
lines changed

.github/workflows/update-people.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ name: update-people
33
on:
44
push:
55
branches:
6-
- feature/docs_migration_mkdocs
6+
- f/mkdocs
7+
- main
78
schedule:
89
- cron: "0 12 1 * *"
910
workflow_dispatch: {}

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ As the aforementioned libraries are among the most widely used in the respective
3131
- Simple [installation](https://rfl.getml.com/install)
3232
- Simple extendability to [other serialization formats](https://rfl.getml.com/supported_formats/supporting_your_own_format)
3333
- Simple extendability to [custom classes](https://rfl.getml.com/concepts/custom_classes)
34-
- Being one of the fastest serialization libraries in existence, as demonstrated by our [benchmarks](https://getml.com/benchmarks)
34+
- Being one of the fastest serialization libraries in existence, as demonstrated by our [benchmarks](https://rfl.getml.com/benchmarks)
3535

3636
<br>
3737

@@ -83,9 +83,9 @@ Support for more serialization formats is in development. Refer to the [issues](
8383
Please also refer to the *vcpkg.json* in this repository.
8484

8585

86-
# Feature Overview
86+
## Feature Overview
8787

88-
## Simple Example
88+
### Simple Example
8989

9090
```cpp
9191
#include <rfl/json.hpp>
@@ -168,7 +168,7 @@ rfl::ubjson::read<Person>(ubjson_bytes);
168168
rfl::xml::read<Person>(xml_string);
169169
```
170170

171-
## More Comprehensive Example
171+
### More Comprehensive Example
172172

173173
```cpp
174174
#include <iostream>
@@ -241,7 +241,7 @@ std::cout << "Hello, my name is " << homer2.first_name() << " "
241241
<< homer2.last_name() << "." << std::endl;
242242
```
243243

244-
## Error messages
244+
### Error messages
245245

246246
reflect-cpp returns clear and comprehensive error messages:
247247

@@ -262,7 +262,7 @@ Found 5 errors:
262262
5) Field named 'children' not found.
263263
```
264264

265-
## JSON schema
265+
### JSON schema
266266

267267
reflect-cpp also supports generating JSON schemata:
268268

@@ -291,7 +291,7 @@ The resulting JSON schema looks like this:
291291

292292
Note that this is currently supported for JSON only, since most other formats do not support schemata in the first place.
293293

294-
## Enums
294+
### Enums
295295

296296
reflect-cpp supports scoped enumerations:
297297

@@ -324,7 +324,7 @@ This results in the following JSON string:
324324
You can also directly convert between enumerator values and strings with `rfl::enum_to_string()` and `rfl::string_to_enum()`, or
325325
obtain list of enumerator name and value pairs with `rfl::get_enumerators<EnumType>()` or `rfl::get_enumerator_array<EnumType>()`.
326326

327-
## Algebraic data types
327+
### Algebraic data types
328328

329329
reflect-cpp supports Pydantic-style tagged unions, which allow you to form algebraic data types:
330330

@@ -357,7 +357,7 @@ This results in the following JSON string:
357357

358358
Other forms of tagging are supported as well. Refer to the [documentation](https://rfl.getml.com/docs-readme) for details.
359359

360-
## Extra fields
360+
### Extra fields
361361

362362
If you don't know all of your fields at compile time, no problem. Just use `rfl::ExtraFields`:
363363

@@ -381,7 +381,7 @@ This results in the following JSON string:
381381
{"firstName":"Homer","lastName":"Simpson","age":45,"email":"[email protected]","town":"Springfield"}
382382
```
383383

384-
## Reflective programming
384+
### Reflective programming
385385

386386
Beyond serialization and deserialization, reflect-cpp also supports reflective programming in general.
387387

@@ -480,9 +480,9 @@ const auto c2 = rfl::replace(c, a);
480480
```
481481
482482
483-
## Support for containers
483+
### Support for containers
484484
485-
### C++ standard library
485+
#### C++ standard library
486486
487487
reflect-cpp supports the following containers from the C++ standard library:
488488
@@ -509,7 +509,7 @@ reflect-cpp supports the following containers from the C++ standard library:
509509
- `std::vector`
510510
- `std::wstring`
511511
512-
### Additional containers
512+
#### Additional containers
513513
514514
In addition, it supports the following custom containers:
515515
@@ -529,7 +529,7 @@ In addition, it supports the following custom containers:
529529
- `rfl::Validator`: Allows for automatic input validation.
530530
- `rfl::Variant`: An alternative to `std::variant` that compiles considerably faster.
531531
532-
### Custom classes
532+
#### Custom classes
533533
534534
Finally, it is very easy to extend full support to your own classes, refer to the [documentation](https://rfl.getml.com/docs-readme) for details.
535535

docs/README.md

Lines changed: 0 additions & 101 deletions
This file was deleted.

docs/concepts/structs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,5 +82,5 @@ Person{"Bart", "Simpson", ...};
8282
But if you create a custom constructor, then C++ will no longer allow this kind of constructions.
8383
8484
If you want to create the struct from one of your classes (the most like reason, you want to create custom constructors in the first place),
85-
you might want to check out the section on [custom classes](https://github.com/getml/reflect-cpp/blob/main/docs/custom_classes.md) or [custom parsers](https://github.com/getml/reflect-cpp/blob/main/docs/custom_parser.md).
85+
you might want to check out the section on [custom classes](custom_classes.md) or [custom parsers](../custom_parser.md).
8686

docs/docs-readme.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
---
2-
hide:
3-
- navigation
4-
---
5-
6-
71
# Documentation
82

93
## The basics
@@ -40,6 +34,8 @@ hide:
4034

4135
[rfl::Binary, rfl::Hex and rfl::Oct](number_systems.md)- For expressing numbers in different formats.
4236

37+
[Anonymous fields](anonymous_fields.md) - For defining fields without using `rfl::Field`.
38+
4339
## Validation
4440

4541
[Regex patterns](patterns.md) - For requiring that strings follow used-defined regex patterns.
@@ -50,7 +46,7 @@ hide:
5046

5147
[Size validation](size_validation.md) - For imposing size constraints on containers such as `std::vector` or `std::string`.
5248

53-
[JSON schema](json_schema.md) - For validating your schema before you even send it to your C++ backend.
49+
[JSON schema](supported_formats/json_schema.md) - For validating your schema before you even send it to your C++ backend.
5450

5551
## Generic elements
5652

docs/index.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,10 @@ reflect-cpp fills an important gap in C++ development. It minimizes boilerplate
4141
- Simple [installation](https://rfl.getml.com/install)
4242
- Simple extendability to [other serialization formats](https://rfl.getml.com/supported_formats/supporting_your_own_format)
4343
- Simple extendability to [custom classes](https://rfl.getml.com/concepts/custom_classes)
44-
- Being one of the fastest serialization libraries in existence, as demonstrated by our [benchmarks](https://getml.com/benchmarks)
44+
- Being one of the fastest serialization libraries in existence, as demonstrated by our [benchmarks](https://rfl.getml.com/benchmarks)
4545

4646

47-
## reflect-cpp in a nutshell
48-
49-
<h3> Why do we need this?</h3>
47+
## Why do we need this?
5048

5149
Suppose your C++ program has complex data structures it needs to save and load. Or maybe it needs to interact with some kind of external API. If you do this the traditional way, you will have a lot of boilerplate code. This is annoying and error-prone.
5250

mkdocs.yaml

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,49 @@ nav:
105105
- Custom Format: supported_formats/supporting_your_own_format.md
106106
# - Reflective Programming: ./reflective_programming.md
107107
- Installation: install.md
108-
- Documentation: docs-readme.md
108+
- Documentation:
109+
- docs-readme.md
110+
- The basics:
111+
- Structs: concepts/structs.md
112+
- Optional fields: optional_fields.md
113+
- Struct flattening: flatten_structs.md
114+
- Processors: concepts/processors.md
115+
- The rfl::Field-syntax: concepts/field_syntax.md
116+
- String literals: literals.md
117+
- Enums: enums.md
118+
- std::variant and rfl::TaggedUnion: variants_and_tagged_unions.md
119+
- rfl::Box and rfl::Ref: rfl_ref.md
120+
- rfl::Timestamp: timestamps.md
121+
- rfl::Skip: rfl_skip.md
122+
- rfl::Result: result.md
123+
- Standard containers: standard_containers.md
124+
- C arrays and inheritance: c_arrays_and_inheritance.md
125+
- rfl::Bytestring: bytestring.md
126+
- rfl::Binary, rfl::Hex and rfl::Oct: number_systems.md
127+
- Anonymous fields: anonymous_fields.md
128+
- Validation:
129+
- Regex patterns: patterns.md
130+
- Validating numbers: validating_numbers.md
131+
- Composing validators: composing_validators.md
132+
- Size validation: size_validation.md
133+
- JSON schema: supported_formats/json_schema.md
134+
- Generic elements:
135+
- rfl::Object: object.md
136+
- rfl::Generic: generic.md
137+
- rfl::ExtraFields: extra_fields.md
138+
- Custom classes:
139+
- Custom classes: concepts/custom_classes.md
140+
- Custom parsers for your classes: custom_parser.md
141+
- Useful helper functions and classes:
142+
- rfl::replace: replace.md
143+
- rfl::as: as.md
144+
- rfl::NamedTuple: named_tuple.md
145+
- rfl::Tuple: rfl_tuple.md
146+
- rfl::to_view: to_view.md
147+
- Advanced topics:
148+
- Supporting your own format: supported_formats/supporting_your_own_format.md
149+
- Maintaining backwards compatability: backwards_compatability.md
150+
- Benchmarks: benchmarks.md
109151
- Contributing: contributing.md
110152
- People: people.md
111153

@@ -146,6 +188,7 @@ plugins:
146188
- mailto:*
147189
- 'data:image/*'
148190
- '#*'
191+
- https://github.com/getml/reflect-cpp/tree/main/.github/actions/people/people.py
149192

150193

151194
hooks:

0 commit comments

Comments
 (0)