From cabd5ee7a40c327188ebe1b1ab7f871039519ff3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dr=2E=20Patrick=20Urbanke=20=28=E5=8A=89=E8=87=AA=E6=88=90?= =?UTF-8?q?=29?= Date: Mon, 6 Jan 2025 18:20:00 +0100 Subject: [PATCH] Minor improvements to the documentation (#327) --- README.md | 2 ++ docs/docs-readme.md | 4 ++-- docs/{supported_formats => }/json_schema.md | 0 docs/supported_formats/avro.md | 3 ++- docs/supported_formats/bson.md | 4 +++- docs/supported_formats/capnproto.md | 4 ++-- docs/supported_formats/cbor.md | 4 +++- docs/supported_formats/flexbuffers.md | 4 +++- docs/supported_formats/msgpack.md | 4 +++- docs/supported_formats/toml.md | 5 ++++- docs/supported_formats/ubjson.md | 4 +++- docs/supported_formats/xml.md | 5 ++++- docs/supported_formats/yaml.md | 5 ++++- mkdocs.yaml | 3 +-- 14 files changed, 36 insertions(+), 15 deletions(-) rename docs/{supported_formats => }/json_schema.md (100%) diff --git a/README.md b/README.md index b22da3c3..b5fe8e70 100644 --- a/README.md +++ b/README.md @@ -149,6 +149,7 @@ and any supported format, except where explicitly noted otherwise: ```cpp rfl::avro::write(homer); rfl::bson::write(homer); +rfl::capnproto::write(homer); rfl::cbor::write(homer); rfl::flexbuf::write(homer); rfl::msgpack::write(homer); @@ -158,6 +159,7 @@ rfl::xml::write(homer); rfl::avro::read(avro_bytes); rfl::bson::read(bson_bytes); +rfl::capnproto::read(capnproto_bytes); rfl::cbor::read(cbor_bytes); rfl::flexbuf::read(flexbuf_bytes); rfl::msgpack::read(msgpack_bytes); diff --git a/docs/docs-readme.md b/docs/docs-readme.md index 7ab3453f..0e81573e 100644 --- a/docs/docs-readme.md +++ b/docs/docs-readme.md @@ -44,7 +44,7 @@ [Size validation](size_validation.md) - For imposing size constraints on containers such as `std::vector` or `std::string`. -[JSON schema](supported_formats/json_schema.md) - For validating your schema before you even send it to your C++ backend. +[JSON schema](json_schema.md) - For validating your schema before you even send it to your C++ backend. ## Generic elements @@ -80,4 +80,4 @@ [Benchmarks](benchmarks.md) - Extensive benchmarks of popular libraries for serialization, deserialization. -
\ No newline at end of file +
diff --git a/docs/supported_formats/json_schema.md b/docs/json_schema.md similarity index 100% rename from docs/supported_formats/json_schema.md rename to docs/json_schema.md diff --git a/docs/supported_formats/avro.md b/docs/supported_formats/avro.md index 65a92a9b..cd668603 100644 --- a/docs/supported_formats/avro.md +++ b/docs/supported_formats/avro.md @@ -1,6 +1,7 @@ # Avro -For Avro support, you must also include the header `` and link to the `avro-c` library (https://avro.apache.org/docs/1.6.3/api/c/index.html). +For Avro support, you must also include the header `` and link to the [avro-c](https://avro.apache.org/docs/1.11.1/api/c/) library. +Furthermore, when compiling reflect-cpp, you need to pass `-DREFLECTCPP_AVRO=ON` to cmake. Avro is a schemaful binary format. This sets it apart from most other formats supported by reflect-cpp, which are schemaless. diff --git a/docs/supported_formats/bson.md b/docs/supported_formats/bson.md index 4f800941..63c477d2 100644 --- a/docs/supported_formats/bson.md +++ b/docs/supported_formats/bson.md @@ -1,6 +1,8 @@ # BSON -For BSON support, you must also include the header `` and link to the libbson library (https://github.com/mongodb/libbson). +For BSON support, you must also include the header `` and link to the [libbson](https://github.com/mongodb/mongo-c-driver) library. +Furthermore, when compiling reflect-cpp, you need to pass `-DREFLECTCPP_BSON=ON` to cmake. If you are using vcpkg, there +should be an appropriate feature that will abstract this away for you. Like the name implies, BSON is a JSON-like binary format. It is most notably used by MongoDB. diff --git a/docs/supported_formats/capnproto.md b/docs/supported_formats/capnproto.md index 9e7e962e..0bd55e66 100644 --- a/docs/supported_formats/capnproto.md +++ b/docs/supported_formats/capnproto.md @@ -1,8 +1,8 @@ # Cap'n Proto -For Cap'n Proto support, you must also include the header `` and link to the capnproto library (https://capnproto.org). +For Cap'n Proto support, you must also include the header `` and link to the [capnproto](https://capnproto.org) library. Furthermore, when compiling reflect-cpp, you need to pass `-DREFLECTCPP_CAPNPROTO=ON` to cmake. If you are using vcpkg or Conan, there -should be an appropriate feature (vcpkg) or options that will abstract this away for you. +should be an appropriate feature (vcpkg) or option (Conan) that will abstract this away for you. Cap'n Proto is a schemaful binary format. This sets it apart from most other formats supported by reflect-cpp, which are schemaless. diff --git a/docs/supported_formats/cbor.md b/docs/supported_formats/cbor.md index 9995fb4e..4f72a31d 100644 --- a/docs/supported_formats/cbor.md +++ b/docs/supported_formats/cbor.md @@ -1,6 +1,8 @@ # CBOR -For CBOR support, you must also include the header `` and include the jsoncons library (https://github.com/danielaparker/jsoncons). Note that it is header-only. +For CBOR support, you must also include the header `` and include the [jsoncons](https://github.com/danielaparker/jsoncons) library. +Note that it is header-only. Furthermore, when compiling reflect-cpp, you need to pass `-DREFLECTCPP_CBOR=ON` to cmake. If you are using vcpkg or Conan, there +should be an appropriate feature (vcpkg) or option (Conan) that will abstract this away for you. CBOR or Concise Binary Object Representation, is a JSON-like binary format with an emphasis on small binary sizes. diff --git a/docs/supported_formats/flexbuffers.md b/docs/supported_formats/flexbuffers.md index 864171cf..8605805a 100644 --- a/docs/supported_formats/flexbuffers.md +++ b/docs/supported_formats/flexbuffers.md @@ -1,6 +1,8 @@ # Flexbuffers -For flexbuffers support, you must also include the header `` and link to the flatbuffers library (https://github.com/google/flatbuffers). +For flexbuffers support, you must also include the header `` and link to the [flatbuffers](https://github.com/google/flatbuffers) library. +Furthermore, when compiling reflect-cpp, you need to pass `-DREFLECTCPP_FLEXBUFFERS=ON` to cmake. If you are using vcpkg or Conan, there +should be an appropriate feature (vcpkg) or option (Conan) that will abstract this away for you. Flexbuffers is part of the flatbuffers library, which is a binary format developed by Google. diff --git a/docs/supported_formats/msgpack.md b/docs/supported_formats/msgpack.md index 45524de0..ac363d9a 100644 --- a/docs/supported_formats/msgpack.md +++ b/docs/supported_formats/msgpack.md @@ -1,6 +1,8 @@ # msgpack -For msgpack support, you must also include the header `` and link to the msgpack-c library (https://github.com/msgpack/msgpack-c). +For msgpack support, you must also include the header `` and link to the [msgpack-c](https://github.com/msgpack/msgpack-c) library. +Furthermore, when compiling reflect-cpp, you need to pass `-DREFLECTCPP_MSGPACK=ON` to cmake. If you are using vcpkg or Conan, there +should be an appropriate feature (vcpkg) or option (Conan) that will abstract this away for you. msgpack is a JSON-like binary format with an emphasis on small binary sizes. diff --git a/docs/supported_formats/toml.md b/docs/supported_formats/toml.md index 52d05ff8..1abd7e25 100644 --- a/docs/supported_formats/toml.md +++ b/docs/supported_formats/toml.md @@ -1,6 +1,9 @@ # TOML -For TOML support, you must also include the header `` and include the toml++ library (https://github.com/marzer/tomlplusplus) in your project. +For TOML support, you must also include the header `` and include the [toml++](https://github.com/marzer/tomlplusplus) library. +Furthermore, when compiling reflect-cpp, you need to pass `-DREFLECTCPP_TOML=ON` to cmake. If you are using vcpkg or Conan, there +should be an appropriate feature (vcpkg) or option (Conan) that will abstract this away for you. + ## Reading and writing diff --git a/docs/supported_formats/ubjson.md b/docs/supported_formats/ubjson.md index 8620596d..7f061e6e 100644 --- a/docs/supported_formats/ubjson.md +++ b/docs/supported_formats/ubjson.md @@ -1,6 +1,8 @@ # UBJSON -For UBJSON support, you must also include the header `` and include the jsoncons library (https://github.com/danielaparker/jsoncons). Note that it is header-only. +For UBJSON support, you must also include the header `` and include the [jsoncons](https://github.com/danielaparker/jsoncons) library. +Note that it is header-only. Furthermore, when compiling reflect-cpp, you need to pass `-DREFLECTCPP_UBJSON=ON` to cmake. If you are using vcpkg or Conan, there +should be an appropriate feature (vcpkg) or option (Conan) that will abstract this away for you. UBJSON is a JSON-like binary format. diff --git a/docs/supported_formats/xml.md b/docs/supported_formats/xml.md index 827c0f62..533f60f5 100644 --- a/docs/supported_formats/xml.md +++ b/docs/supported_formats/xml.md @@ -1,6 +1,9 @@ # XML -For XML support, you must also include the header `` and include the pugixml library (https://github.com/zeux/pugixml) in your project. +For XML support, you must also include the header `` and include the [pugixml](https://github.com/zeux/pugixml) library. +Furthermore, when compiling reflect-cpp, you need to pass `-DREFLECTCPP_XML=ON` to cmake. If you are using vcpkg or Conan, there +should be an appropriate feature (vcpkg) or option (Conan) that will abstract this away for you. + ## Simple example diff --git a/docs/supported_formats/yaml.md b/docs/supported_formats/yaml.md index 12589e1f..57903312 100644 --- a/docs/supported_formats/yaml.md +++ b/docs/supported_formats/yaml.md @@ -1,6 +1,9 @@ # YAML -For YAML support, you must also include the header `` and include the yaml-cpp library (https://github.com/jbeder/yaml-cpp) in your project. +For YAML support, you must also include the header `` and include the [yaml-cpp](https://github.com/jbeder/yaml-cpp) library. +Furthermore, when compiling reflect-cpp, you need to pass `-DREFLECTCPP_YAML=ON` to cmake. If you are using vcpkg or Conan, there +should be an appropriate feature (vcpkg) or option (Conan) that will abstract this away for you. + ## Reading and writing diff --git a/mkdocs.yaml b/mkdocs.yaml index cd3ee8be..f35a346a 100644 --- a/mkdocs.yaml +++ b/mkdocs.yaml @@ -98,7 +98,6 @@ nav: - CBOR: supported_formats/cbor.md - FlexBuffers: supported_formats/flexbuffers.md - JSON: supported_formats/json.md - - JSON Schema: supported_formats/json_schema.md - MessagePack: supported_formats/msgpack.md - TOML: supported_formats/toml.md - UBJSON: supported_formats/ubjson.md @@ -131,7 +130,7 @@ nav: - Validating numbers: validating_numbers.md - Composing validators: composing_validators.md - Size validation: size_validation.md - - JSON schema: supported_formats/json_schema.md + - JSON schema: json_schema.md - Generic elements: - rfl::Object: object.md - rfl::Generic: generic.md