From a69b408661b9d28dd00ddcc04d8721270cb98e6a Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Fri, 16 Apr 2021 14:39:20 +0200 Subject: [PATCH] docs: examples chapter reorganized --- docs/CMakeLists.txt | 34 ++++++++++++------- docs/examples.rst | 22 +++--------- docs/examples/basics.rst | 18 ++++++++++ docs/examples/{ => basics}/avg_speed.rst | 0 docs/examples/{ => basics}/box_example.rst | 0 .../{ => basics}/capacitor_time_curve.rst | 0 docs/examples/{ => basics}/clcpp_response.rst | 0 .../{ => basics}/experimental_angle.rst | 0 .../{ => basics}/foot_pound_second.rst | 0 docs/examples/{ => basics}/glide_computer.rst | 0 docs/examples/{ => basics}/hello_units.rst | 0 docs/examples/{ => basics}/total_energy.rst | 0 .../{ => basics}/unknown_dimension.rst | 0 docs/examples/custom_representation.rst | 10 ++++++ .../linear_algebra.rst | 0 .../measurement.rst | 0 docs/examples/custom_systems.rst | 12 ++++--- .../custom_systems/custom_systems.rst | 7 ++++ docs/examples/custom_utilities.rst | 9 +++++ .../conversion_factor.rst | 0 20 files changed, 78 insertions(+), 34 deletions(-) create mode 100644 docs/examples/basics.rst rename docs/examples/{ => basics}/avg_speed.rst (100%) rename docs/examples/{ => basics}/box_example.rst (100%) rename docs/examples/{ => basics}/capacitor_time_curve.rst (100%) rename docs/examples/{ => basics}/clcpp_response.rst (100%) rename docs/examples/{ => basics}/experimental_angle.rst (100%) rename docs/examples/{ => basics}/foot_pound_second.rst (100%) rename docs/examples/{ => basics}/glide_computer.rst (100%) rename docs/examples/{ => basics}/hello_units.rst (100%) rename docs/examples/{ => basics}/total_energy.rst (100%) rename docs/examples/{ => basics}/unknown_dimension.rst (100%) create mode 100644 docs/examples/custom_representation.rst rename docs/examples/{ => custom_representation}/linear_algebra.rst (100%) rename docs/examples/{ => custom_representation}/measurement.rst (100%) create mode 100644 docs/examples/custom_systems/custom_systems.rst create mode 100644 docs/examples/custom_utilities.rst rename docs/examples/{ => custom_utilities}/conversion_factor.rst (100%) diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt index 8b802429..dd7cd84c 100644 --- a/docs/CMakeLists.txt +++ b/docs/CMakeLists.txt @@ -54,15 +54,29 @@ set(unitsSphinxDocs "${CMAKE_CURRENT_SOURCE_DIR}/design/quantity_kind.rst" "${CMAKE_CURRENT_SOURCE_DIR}/examples.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/examples/avg_speed.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/examples/box_example.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/examples/capacitor_time_curve.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/examples/clcpp_response.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/examples/conversion_factor.rst" + + "${CMAKE_CURRENT_SOURCE_DIR}/examples/basics.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/examples/basics/avg_speed.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/examples/basics/box_example.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/examples/basics/capacitor_time_curve.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/examples/basics/clcpp_response.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/examples/basics/experimental_angle.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/examples/basics/foot_pound_second.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/examples/basics/glide_computer.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/examples/basics/hello_units.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/examples/basics/total_energy.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/examples/basics/unknown_dimension.rst" + + "${CMAKE_CURRENT_SOURCE_DIR}/examples/custom_representation.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/examples/custom_representation/linear_algebra.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/examples/custom_representation/measurement.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/examples/custom_systems.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/examples/foot_pound_second.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/examples/glide_computer.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/examples/hello_units.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/examples/custom_systems/custom_systems.rst" + + "${CMAKE_CURRENT_SOURCE_DIR}/examples/custom_utilities.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/examples/custom_utilities/conversion_factor.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/examples/kalman_filter.rst" "${CMAKE_CURRENT_SOURCE_DIR}/examples/kalman_filter/example_1.rst" "${CMAKE_CURRENT_SOURCE_DIR}/examples/kalman_filter/example_2.rst" @@ -73,10 +87,6 @@ set(unitsSphinxDocs "${CMAKE_CURRENT_SOURCE_DIR}/examples/kalman_filter/example_7.rst" "${CMAKE_CURRENT_SOURCE_DIR}/examples/kalman_filter/example_8.rst" "${CMAKE_CURRENT_SOURCE_DIR}/examples/kalman_filter/kalman.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/examples/linear_algebra.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/examples/measurement.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/examples/total_energy.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/examples/unknown_dimension.rst" "${CMAKE_CURRENT_SOURCE_DIR}/faq.rst" diff --git a/docs/examples.rst b/docs/examples.rst index e5c9f6ad..342dadd1 100644 --- a/docs/examples.rst +++ b/docs/examples.rst @@ -2,22 +2,10 @@ Examples ======== .. toctree:: - :maxdepth: 1 - - examples/hello_units - examples/avg_speed - examples/box_example - examples/unknown_dimension - examples/measurement - examples/linear_algebra - examples/foot_pound_second - examples/custom_systems - examples/glide_computer - - examples/capacitor_time_curve - examples/clcpp_response - examples/conversion_factor - examples/experimental_angle - examples/total_energy + :maxdepth: 2 + examples/basics examples/kalman_filter + examples/custom_representation + examples/custom_systems + examples/custom_utilities diff --git a/docs/examples/basics.rst b/docs/examples/basics.rst new file mode 100644 index 00000000..8db47e03 --- /dev/null +++ b/docs/examples/basics.rst @@ -0,0 +1,18 @@ +Basics +====== + +The following examples highlight the basics of the library design. + +.. toctree:: + :maxdepth: 1 + + basics/hello_units + basics/clcpp_response + basics/avg_speed + basics/box_example + basics/capacitor_time_curve + basics/unknown_dimension + basics/foot_pound_second + basics/experimental_angle + basics/total_energy + basics/glide_computer diff --git a/docs/examples/avg_speed.rst b/docs/examples/basics/avg_speed.rst similarity index 100% rename from docs/examples/avg_speed.rst rename to docs/examples/basics/avg_speed.rst diff --git a/docs/examples/box_example.rst b/docs/examples/basics/box_example.rst similarity index 100% rename from docs/examples/box_example.rst rename to docs/examples/basics/box_example.rst diff --git a/docs/examples/capacitor_time_curve.rst b/docs/examples/basics/capacitor_time_curve.rst similarity index 100% rename from docs/examples/capacitor_time_curve.rst rename to docs/examples/basics/capacitor_time_curve.rst diff --git a/docs/examples/clcpp_response.rst b/docs/examples/basics/clcpp_response.rst similarity index 100% rename from docs/examples/clcpp_response.rst rename to docs/examples/basics/clcpp_response.rst diff --git a/docs/examples/experimental_angle.rst b/docs/examples/basics/experimental_angle.rst similarity index 100% rename from docs/examples/experimental_angle.rst rename to docs/examples/basics/experimental_angle.rst diff --git a/docs/examples/foot_pound_second.rst b/docs/examples/basics/foot_pound_second.rst similarity index 100% rename from docs/examples/foot_pound_second.rst rename to docs/examples/basics/foot_pound_second.rst diff --git a/docs/examples/glide_computer.rst b/docs/examples/basics/glide_computer.rst similarity index 100% rename from docs/examples/glide_computer.rst rename to docs/examples/basics/glide_computer.rst diff --git a/docs/examples/hello_units.rst b/docs/examples/basics/hello_units.rst similarity index 100% rename from docs/examples/hello_units.rst rename to docs/examples/basics/hello_units.rst diff --git a/docs/examples/total_energy.rst b/docs/examples/basics/total_energy.rst similarity index 100% rename from docs/examples/total_energy.rst rename to docs/examples/basics/total_energy.rst diff --git a/docs/examples/unknown_dimension.rst b/docs/examples/basics/unknown_dimension.rst similarity index 100% rename from docs/examples/unknown_dimension.rst rename to docs/examples/basics/unknown_dimension.rst diff --git a/docs/examples/custom_representation.rst b/docs/examples/custom_representation.rst new file mode 100644 index 00000000..f8c48445 --- /dev/null +++ b/docs/examples/custom_representation.rst @@ -0,0 +1,10 @@ +Custom Representation Types +=========================== + +The following examples show how to work with custom represenation types. + +.. toctree:: + :maxdepth: 1 + + custom_representation/measurement + custom_representation/linear_algebra diff --git a/docs/examples/linear_algebra.rst b/docs/examples/custom_representation/linear_algebra.rst similarity index 100% rename from docs/examples/linear_algebra.rst rename to docs/examples/custom_representation/linear_algebra.rst diff --git a/docs/examples/measurement.rst b/docs/examples/custom_representation/measurement.rst similarity index 100% rename from docs/examples/measurement.rst rename to docs/examples/custom_representation/measurement.rst diff --git a/docs/examples/custom_systems.rst b/docs/examples/custom_systems.rst index a4e93583..19600114 100644 --- a/docs/examples/custom_systems.rst +++ b/docs/examples/custom_systems.rst @@ -1,7 +1,9 @@ -custom_systems +Custom Systems ============== -.. literalinclude:: ../../example/custom_systems.cpp - :caption: custom_systems.cpp - :start-at: #include - :linenos: +The following examples show how to define custom systems of units and quantities. + +.. toctree:: + :maxdepth: 1 + + custom_systems/custom_systems diff --git a/docs/examples/custom_systems/custom_systems.rst b/docs/examples/custom_systems/custom_systems.rst new file mode 100644 index 00000000..a4e93583 --- /dev/null +++ b/docs/examples/custom_systems/custom_systems.rst @@ -0,0 +1,7 @@ +custom_systems +============== + +.. literalinclude:: ../../example/custom_systems.cpp + :caption: custom_systems.cpp + :start-at: #include + :linenos: diff --git a/docs/examples/custom_utilities.rst b/docs/examples/custom_utilities.rst new file mode 100644 index 00000000..47149287 --- /dev/null +++ b/docs/examples/custom_utilities.rst @@ -0,0 +1,9 @@ +Custom Utilites +=============== + +The following examples present how to reuse library facilities to create custom utilities. + +.. toctree:: + :maxdepth: 1 + + custom_utilities/conversion_factor diff --git a/docs/examples/conversion_factor.rst b/docs/examples/custom_utilities/conversion_factor.rst similarity index 100% rename from docs/examples/conversion_factor.rst rename to docs/examples/custom_utilities/conversion_factor.rst