diff --git a/README.md b/README.md index a309c7e5..83f060aa 100644 --- a/README.md +++ b/README.md @@ -720,7 +720,7 @@ reflect-cpp was originally developed for [getml-community](https://github.com/ge ## The Team -reflect-cpp has been developed by [getML (Code17 GmbH)](https://getml.com), a company specializing in software engineering and machine learning for enterprise applications. reflect-cpp is currently maintained by Patrick Urbanke and Manuel Bellersen, with major contributiongs coming from the community. +reflect-cpp has been developed by [getML (Code17 GmbH)](https://getml.com), a company specializing in software engineering and machine learning for enterprise applications. reflect-cpp is currently maintained by Patrick Urbanke and Manuel Bellersen, with major contributions coming from the community. ## Professional Support diff --git a/docs/README.md b/docs/README.md deleted file mode 100644 index a115311f..00000000 --- a/docs/README.md +++ /dev/null @@ -1,99 +0,0 @@ -# Documentation - -![image](banner2.png) - -## 1) The basics - -1.1) [Structs](https://github.com/getml/reflect-cpp/blob/main/docs/structs.md) - Recaps the motivating example in the README. A struct is the equivalent of an AND statement or a product type in type theory. - -1.2) [Optional fields](https://github.com/getml/reflect-cpp/blob/main/docs/optional_fields.md) - For defining fields in your serialized format that might be absent in some cases. - -1.3) [Struct flattening](https://github.com/getml/reflect-cpp/blob/main/docs/flatten_structs.md) - For making struct A "inherit" the fields of struct B. - -1.4) [Processors](https://github.com/getml/reflect-cpp/blob/main/docs/processors.md) - For modifying the structs before serialization and deserialization. For instance, processors can be used to transform all field names from `snake_case` to `camelCase`. - -1.5) [The rfl::Field-syntax](https://github.com/getml/reflect-cpp/blob/main/docs/field_syntax.md) - Describes an alternative syntax which requires slightly more effort, but allows for some powerful functionalities. - -1.6) [String literals](https://github.com/getml/reflect-cpp/blob/main/docs/literals.md) - For representing strings that can only assume a limited number of enumerated values. - -1.7) [Enums](https://github.com/getml/reflect-cpp/blob/main/docs/enums.md) - Describes how reflect-cpp handles C++ enums. - -1.8) [std::variant and rfl::TaggedUnion](https://github.com/getml/reflect-cpp/blob/main/docs/variants_and_tagged_unions.md) - For structs that can be one of several formats. This is the equivalent of an OR statement or a sum type in type theory. - -1.9) [rfl::Box and rfl::Ref](https://github.com/getml/reflect-cpp/blob/main/docs/rfl_ref.md) - For defining recursive structures. - -1.10) [rfl::Timestamp](https://github.com/getml/reflect-cpp/blob/main/docs/timestamps.md) - For serializing and deserializing timestamps. - -1.11) [rfl::Skip](https://github.com/getml/reflect-cpp/blob/main/docs/rfl_skip.md) - For skipping fields during serialization and/or deserialization. - -1.12) [rfl::Result](https://github.com/getml/reflect-cpp/blob/main/docs/result.md) - For error handling without exceptions. - -1.13) [Standard containers](https://github.com/getml/reflect-cpp/blob/main/docs/standard_containers.md) - Describes how reflect-cpp treats containers in the standard library. - -1.14) [C arrays and inheritance](https://github.com/getml/reflect-cpp/blob/main/docs/c_arrays_and_inheritance.md) - Describes how reflect-cpp handles C arrays and inheritance. - -1.15) [rfl::Bytestring](https://github.com/getml/reflect-cpp/blob/main/docs/bytestring.md) - Describes how reflect-cpp handles binary strings for formats that support them. - -1.16) [rfl::Binary, rfl::Hex and rfl::Oct](https://github.com/getml/reflect-cpp/blob/main/docs/number_systems.md)- For expressing numbers in different formats. - -## 2) Validation - -2.1) [Regex patterns](https://github.com/getml/reflect-cpp/blob/main/docs/patterns.md) - For requiring that strings follow used-defined regex patterns. - -2.2) [Validating numbers](https://github.com/getml/reflect-cpp/blob/main/docs/validating_numbers.md) - For imposing constraints on numbers. - -2.3) [Composing validators](https://github.com/getml/reflect-cpp/blob/main/docs/composing_validators.md) - For defining more complex validators using operators such as `rfl::AllOf` or `rfl::AnyOf`. - -2.4) [Size validation](https://github.com/getml/reflect-cpp/blob/main/docs/size_validation.md) - For imposing size constraints on containers such as `std::vector` or `std::string`. - -2.5) [JSON schema](https://github.com/getml/reflect-cpp/blob/main/docs/json_schema.md) - For validating your schema before you even send it to your C++ backend. - -## 3) Generic elements - -3.1) [rfl::Object](https://github.com/getml/reflect-cpp/blob/main/docs/object.md) - A map-like type representing a object with field names that are unknown at compile time. - -3.2) [rfl::Generic](https://github.com/getml/reflect-cpp/blob/main/docs/generic.md) - A catch-all type that can represent (almost) anything. - -3.3) [rfl::ExtraFields](https://github.com/getml/reflect-cpp/blob/main/docs/extra_fields.md) - For adding extra fields to your structs, the names of which are unknown at compile time. - -## 4) Custom classes - -4.1) [Custom classes](https://github.com/getml/reflect-cpp/blob/main/docs/custom_classes.md) - For custom classes with private fields. - -4.2) [Custom parsers for your classes](https://github.com/getml/reflect-cpp/blob/main/docs/custom_parser.md) - For custom classes with private fields that you want to leave absolutely untouched. - -## 5) Useful helper functions and classes - -5.1) [rfl::replace](https://github.com/getml/reflect-cpp/blob/main/docs/replace.md) - For replacing one or several fields in a struct. - -5.2) [rfl::as](https://github.com/getml/reflect-cpp/blob/main/docs/as.md) - For casting structs as other structs. - -5.3) [rfl::NamedTuple](https://github.com/getml/reflect-cpp/blob/main/docs/named_tuple.md) - For structural typing. - -5.4) [rfl::Tuple](https://github.com/getml/reflect-cpp/blob/main/docs/rfl_tuple.md) - An alternative to `std::tuple` that compiles more quickly. - -5.5) [rfl::to_view](https://github.com/getml/reflect-cpp/blob/main/docs/to_view.md) - For accessing fields of a struct by index or name. - -## 6) Supported formats - -6.1) [JSON](https://github.com/getml/reflect-cpp/blob/main/docs/json.md) - -6.2) [BSON](https://github.com/getml/reflect-cpp/blob/main/docs/bson.md) - -6.3) [CBOR](https://github.com/getml/reflect-cpp/blob/main/docs/cbor.md) - -6.4) [flexbuffers](https://github.com/getml/reflect-cpp/blob/main/docs/flexbuffers.md) - -6.5) [msgpack](https://github.com/getml/reflect-cpp/blob/main/docs/msgpack.md) - -6.6) [TOML](https://github.com/getml/reflect-cpp/blob/main/docs/toml.md) - -6.7) [XML](https://github.com/getml/reflect-cpp/blob/main/docs/xml.md) - -6.8) [YAML](https://github.com/getml/reflect-cpp/blob/main/docs/yaml.md) - -## 7) Advanced topics - -7.1) [Supporting your own format](https://github.com/getml/reflect-cpp/blob/main/docs/supporting_your_own_format.md) - For supporting your own serialization and deserialization formats. - -7.2) [Maintaining backwards compatability](https://github.com/getml/reflect-cpp/blob/main/docs/backwards_compatability.md) - Instructions on how to ensure that your API is backwards-compatible with older versions. diff --git a/docs/assets/images/rfl-robot.jpg b/docs/assets/images/rfl-robot.jpg new file mode 100644 index 00000000..fe880261 Binary files /dev/null and b/docs/assets/images/rfl-robot.jpg differ diff --git a/docs/assets/stylesheets/tweaks.css b/docs/assets/stylesheets/tweaks.css new file mode 100644 index 00000000..2b20af45 --- /dev/null +++ b/docs/assets/stylesheets/tweaks.css @@ -0,0 +1,39 @@ +.user-list { + display: flex; + flex-wrap: wrap; + margin-bottom: 2rem; +} + +.user-list-center { + justify-content: space-evenly; +} + +.user { + margin: 1em; + min-width: 7em; +} + +.user .avatar-wrapper { + width: 80px; + height: 80px; + margin: 10px auto; + overflow: hidden; + border-radius: 50%; + position: relative; +} + +.user .avatar-wrapper img { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); +} + +.user .title { + text-align: center; +} + +.user .count { + font-size: 80%; + text-align: center; +} \ No newline at end of file diff --git a/docs/banner2.png b/docs/banner2.png deleted file mode 100644 index 6b736f43..00000000 Binary files a/docs/banner2.png and /dev/null differ diff --git a/docs/custom_classes.md b/docs/concepts/custom_classes.md similarity index 100% rename from docs/custom_classes.md rename to docs/concepts/custom_classes.md diff --git a/docs/field_syntax.md b/docs/concepts/field_syntax.md similarity index 100% rename from docs/field_syntax.md rename to docs/concepts/field_syntax.md diff --git a/docs/processors.md b/docs/concepts/processors.md similarity index 100% rename from docs/processors.md rename to docs/concepts/processors.md diff --git a/docs/structs.md b/docs/concepts/structs.md similarity index 100% rename from docs/structs.md rename to docs/concepts/structs.md diff --git a/docs/docs-readme.md b/docs/docs-readme.md new file mode 100644 index 00000000..d5b5ab02 --- /dev/null +++ b/docs/docs-readme.md @@ -0,0 +1,104 @@ +--- +hide: + - navigation +--- + +![image](/assets/images/rfl-robot.jpg) + +# Documentation + +## 1) The basics + +1.1) [Structs](structs.md) - Recaps the motivating example in the README. A struct is the equivalent of an AND statement or a product type in type theory. + +1.2) [Optional fields](optional_fields.md) - For defining fields in your serialized format that might be absent in some cases. + +1.3) [Struct flattening](flatten_structs.md) - For making struct A "inherit" the fields of struct B. + +1.4) [Processors](processors.md) - For modifying the structs before serialization and deserialization. For instance, processors can be used to transform all field names from `snake_case` to `camelCase`. + +1.5) [The rfl::Field-syntax](field_syntax.md) - Describes an alternative syntax which requires slightly more effort, but allows for some powerful functionalities. + +1.6) [String literals](literals.md) - For representing strings that can only assume a limited number of enumerated values. + +1.7) [Enums](enums.md) - Describes how reflect-cpp handles C++ enums. + +1.8) [std::variant and rfl::TaggedUnion](variants_and_tagged_unions.md) - For structs that can be one of several formats. This is the equivalent of an OR statement or a sum type in type theory. + +1.9) [rfl::Box and rfl::Ref](rfl_ref.md) - For defining recursive structures. + +1.10) [rfl::Timestamp](timestamps.md) - For serializing and deserializing timestamps. + +1.11) [rfl::Skip](rfl_skip.md) - For skipping fields during serialization and/or deserialization. + +1.12) [rfl::Result](result.md) - For error handling without exceptions. + +1.13) [Standard containers](standard_containers.md) - Describes how reflect-cpp treats containers in the standard library. + +1.14) [C arrays and inheritance](c_arrays_and_inheritance.md) - Describes how reflect-cpp handles C arrays and inheritance. + +1.15) [rfl::Bytestring](bytestring.md) - Describes how reflect-cpp handles binary strings for formats that support them. + +1.16) [rfl::Binary, rfl::Hex and rfl::Oct](number_systems.md)- For expressing numbers in different formats. + +## 2) Validation + +2.1) [Regex patterns](patterns.md) - For requiring that strings follow used-defined regex patterns. + +2.2) [Validating numbers](validating_numbers.md) - For imposing constraints on numbers. + +2.3) [Composing validators](composing_validators.md) - For defining more complex validators using operators such as `rfl::AllOf` or `rfl::AnyOf`. + +2.4) [Size validation](size_validation.md) - For imposing size constraints on containers such as `std::vector` or `std::string`. + +2.5) [JSON schema](json_schema.md) - For validating your schema before you even send it to your C++ backend. + +## 3) Generic elements + +3.1) [rfl::Object](object.md) - A map-like type representing a object with field names that are unknown at compile time. + +3.2) [rfl::Generic](generic.md) - A catch-all type that can represent (almost) anything. + +3.3) [rfl::ExtraFields](extra_fields.md) - For adding extra fields to your structs, the names of which are unknown at compile time. + +## 4) Custom classes + +4.1) [Custom classes](custom_classes.md) - For custom classes with private fields. + +4.2) [Custom parsers for your classes](custom_parser.md) - For custom classes with private fields that you want to leave absolutely untouched. + +## 5) Useful helper functions and classes + +5.1) [rfl::replace](replace.md) - For replacing one or several fields in a struct. + +5.2) [rfl::as](as.md) - For casting structs as other structs. + +5.3) [rfl::NamedTuple](named_tuple.md) - For structural typing. + +5.4) [rfl::Tuple](rfl_tuple.md) - An alternative to `std::tuple` that compiles more quickly. + +5.5) [rfl::to_view](to_view.md) - For accessing fields of a struct by index or name. + + + +## 7) Advanced topics + +7.1) [Supporting your own format](supporting_your_own_format.md) - For supporting your own serialization and deserialization formats. + +7.2) [Maintaining backwards compatability](backwards_compatability.md) - Instructions on how to ensure that your API is backwards-compatible with older versions. diff --git a/docs/index.md b/docs/index.md index a309c7e5..83f060aa 100644 --- a/docs/index.md +++ b/docs/index.md @@ -720,7 +720,7 @@ reflect-cpp was originally developed for [getml-community](https://github.com/ge ## The Team -reflect-cpp has been developed by [getML (Code17 GmbH)](https://getml.com), a company specializing in software engineering and machine learning for enterprise applications. reflect-cpp is currently maintained by Patrick Urbanke and Manuel Bellersen, with major contributiongs coming from the community. +reflect-cpp has been developed by [getML (Code17 GmbH)](https://getml.com), a company specializing in software engineering and machine learning for enterprise applications. reflect-cpp is currently maintained by Patrick Urbanke and Manuel Bellersen, with major contributions coming from the community. ## Professional Support diff --git a/docs/people.md b/docs/people.md new file mode 100644 index 00000000..789bea5b --- /dev/null +++ b/docs/people.md @@ -0,0 +1,28 @@ +# People + +reflect-cpp is supported by a group of contributors and reviewers who help improve the project constantly. This page is dedicated to recognizing their efforts and contributions. + +## Maintainers + +The following people maintain the reflect-cpp repository. The main author of the library is Dr Patrick Urbanke ([@liuzicheng1987](https://github.com/liuzicheng1987)). + +{{ maintainers }} + +## Contributors + +Here are the users who have contributed with the pull requests that were successfully merged. + +{{ top_contributors }} + +## Reviewers + +These users have reviewed pull requests from others, improving code quality, fixing bugs, and more. + +{{ top_reviewers }} + +## About the data + +The information shown above is updated monthly using the Github GraphQL API. + +You can find the source code for generating this data [here](https://github.com/getml/reflect-cpp/tree/main/.github/actions/people/people.py). The code is borrowed from the [pydantic project](https://github.com/pydantic/pydantic/blob/main/.github/actions/people/people.py), and modified to work with the reflect-cpp repository. Originally, the logic comes from [FastAPI](https://github.com/tiangolo/fastapi/blob/master/.github/actions/people/app/main.py). + diff --git a/docs/bson.md b/docs/supported_formats/bson.md similarity index 100% rename from docs/bson.md rename to docs/supported_formats/bson.md diff --git a/docs/cbor.md b/docs/supported_formats/cbor.md similarity index 100% rename from docs/cbor.md rename to docs/supported_formats/cbor.md diff --git a/docs/flexbuffers.md b/docs/supported_formats/flexbuffers.md similarity index 100% rename from docs/flexbuffers.md rename to docs/supported_formats/flexbuffers.md diff --git a/docs/json.md b/docs/supported_formats/json.md similarity index 100% rename from docs/json.md rename to docs/supported_formats/json.md diff --git a/docs/json_schema.md b/docs/supported_formats/json_schema.md similarity index 100% rename from docs/json_schema.md rename to docs/supported_formats/json_schema.md diff --git a/docs/msgpack.md b/docs/supported_formats/msgpack.md similarity index 100% rename from docs/msgpack.md rename to docs/supported_formats/msgpack.md diff --git a/docs/supporting_your_own_format.md b/docs/supported_formats/supporting_your_own_format.md similarity index 100% rename from docs/supporting_your_own_format.md rename to docs/supported_formats/supporting_your_own_format.md diff --git a/docs/toml.md b/docs/supported_formats/toml.md similarity index 100% rename from docs/toml.md rename to docs/supported_formats/toml.md diff --git a/docs/xml.md b/docs/supported_formats/xml.md similarity index 100% rename from docs/xml.md rename to docs/supported_formats/xml.md diff --git a/docs/yaml.md b/docs/supported_formats/yaml.md similarity index 100% rename from docs/yaml.md rename to docs/supported_formats/yaml.md