From b3c532e909f9e00e6a19784a6b91dc395219e703 Mon Sep 17 00:00:00 2001 From: Florian Sattler Date: Sun, 6 Feb 2022 22:36:06 +0100 Subject: [PATCH] Reworks repository layout for automatic doc generation --- Readme.md | 39 ++++++++++++++----- .../compile-time-programming}/concepts.md | 0 .../function-templates.md | 0 .../requires-clause.md | 0 .../requires-expressions.md | 0 .../modules/functions}/calling-functions.md | 0 .../functions}/defaulted-parameters.md | 0 .../modules/functions}/member-functions.md | 0 .../functions}/user-defined-literals.md | 0 .../meta-error-handling}/static_assert.md | 0 .../modules/object-model}/constant-objects.md | 0 .../modules/object-model}/constructors.md | 0 .../modules/object-model}/copy-semantics.md | 0 .../modules/object-model}/declarations.md | 0 .../modules/object-model}/move-semantics.md | 0 .../modules/object-model}/objects.md | 0 .../modules/object-model}/rule-of-five.md | 0 .../modules/object-model}/rule-of-zero.md | 0 .../object-model}/special-member-functions.md | 0 .../modules/object-model}/types.md | 0 .../modules/program-design}/concepts.md | 0 .../user-defined-literals.md | 0 .../mgmt_tools/gen_readme.py | 2 +- .../mgmt_tools/topic_updater.py | 2 +- tools/requirements.txt | 1 + 25 files changed, 32 insertions(+), 12 deletions(-) rename {compile-time-programming => sources/modules/compile-time-programming}/concepts.md (100%) rename {compile-time-programming => sources/modules/compile-time-programming}/function-templates.md (100%) rename {compile-time-programming => sources/modules/compile-time-programming}/requires-clause.md (100%) rename {compile-time-programming => sources/modules/compile-time-programming}/requires-expressions.md (100%) rename {functions => sources/modules/functions}/calling-functions.md (100%) rename {functions => sources/modules/functions}/defaulted-parameters.md (100%) rename {functions => sources/modules/functions}/member-functions.md (100%) rename {functions => sources/modules/functions}/user-defined-literals.md (100%) rename {meta-error-handling => sources/modules/meta-error-handling}/static_assert.md (100%) rename {object-model => sources/modules/object-model}/constant-objects.md (100%) rename {object-model => sources/modules/object-model}/constructors.md (100%) rename {object-model => sources/modules/object-model}/copy-semantics.md (100%) rename {object-model => sources/modules/object-model}/declarations.md (100%) rename {object-model => sources/modules/object-model}/move-semantics.md (100%) rename {object-model => sources/modules/object-model}/objects.md (100%) rename {object-model => sources/modules/object-model}/rule-of-five.md (100%) rename {object-model => sources/modules/object-model}/rule-of-zero.md (100%) rename {object-model => sources/modules/object-model}/special-member-functions.md (100%) rename {object-model => sources/modules/object-model}/types.md (100%) rename {program-design => sources/modules/program-design}/concepts.md (100%) rename {user-defined-types => sources/modules/user-defined-types}/user-defined-literals.md (100%) rename gen_readme.py => tools/mgmt_tools/gen_readme.py (99%) rename topic_updater.py => tools/mgmt_tools/topic_updater.py (99%) diff --git a/Readme.md b/Readme.md index b03bbf5..31a5bfa 100644 --- a/Readme.md +++ b/Readme.md @@ -8,24 +8,43 @@ # SG20: Teaching Topics ## Modules: +* [Compile-time programming](#compile-time-programming) +* [Meta-error handling](#meta-error-handling) * [C++ object model](#c-object-model) +* [Program design](#program-design) * [User-defined types](#user-defined-types) * [Functions](#functions) +### Compile-time programming +* [requires-clause](sources/modules/compile-time-programming/requires-clause.md) +* [concepts](sources/modules/compile-time-programming/concepts.md) +* [requires-expressions](sources/modules/compile-time-programming/requires-expressions.md) +* [function-templates](sources/modules/compile-time-programming/function-templates.md) + +### Meta-error handling +* [static_assert](sources/modules/meta-error-handling/static_assert.md) + ### C++ object model -* [rule-of-five](object-model/rule-of-five.md) -* [constant-objects](object-model/constant-objects.md) -* [special-member-functions](object-model/special-member-functions.md) -* [declarations](object-model/declarations.md) -* [objects](object-model/objects.md) -* [types](object-model/types.md) -* [copy-semantics](object-model/copy-semantics.md) -* [rule-of-zero](object-model/rule-of-zero.md) -* [move-semantics](object-model/move-semantics.md) +* [rule-of-five](sources/modules/object-model/rule-of-five.md) +* [constant-objects](sources/modules/object-model/constant-objects.md) +* [special-member-functions](sources/modules/object-model/special-member-functions.md) +* [declarations](sources/modules/object-model/declarations.md) +* [objects](sources/modules/object-model/objects.md) +* [constructors](sources/modules/object-model/constructors.md) +* [types](sources/modules/object-model/types.md) +* [copy-semantics](sources/modules/object-model/copy-semantics.md) +* [rule-of-zero](sources/modules/object-model/rule-of-zero.md) +* [move-semantics](sources/modules/object-model/move-semantics.md) + +### Program design +* [concepts](compile-time-programmings/concepts.md) ### User-defined types * [user-defined-literals](functions/user-defined-literals.md) ### Functions -* [user-defined-literals](functions/user-defined-literals.md) +* [defaulted-parameters](sources/modules/functions/defaulted-parameters.md) +* [calling-functions](sources/modules/functions/calling-functions.md) +* [user-defined-literals](sources/modules/functions/user-defined-literals.md) +* [member-functions](sources/modules/functions/member-functions.md) diff --git a/compile-time-programming/concepts.md b/sources/modules/compile-time-programming/concepts.md similarity index 100% rename from compile-time-programming/concepts.md rename to sources/modules/compile-time-programming/concepts.md diff --git a/compile-time-programming/function-templates.md b/sources/modules/compile-time-programming/function-templates.md similarity index 100% rename from compile-time-programming/function-templates.md rename to sources/modules/compile-time-programming/function-templates.md diff --git a/compile-time-programming/requires-clause.md b/sources/modules/compile-time-programming/requires-clause.md similarity index 100% rename from compile-time-programming/requires-clause.md rename to sources/modules/compile-time-programming/requires-clause.md diff --git a/compile-time-programming/requires-expressions.md b/sources/modules/compile-time-programming/requires-expressions.md similarity index 100% rename from compile-time-programming/requires-expressions.md rename to sources/modules/compile-time-programming/requires-expressions.md diff --git a/functions/calling-functions.md b/sources/modules/functions/calling-functions.md similarity index 100% rename from functions/calling-functions.md rename to sources/modules/functions/calling-functions.md diff --git a/functions/defaulted-parameters.md b/sources/modules/functions/defaulted-parameters.md similarity index 100% rename from functions/defaulted-parameters.md rename to sources/modules/functions/defaulted-parameters.md diff --git a/functions/member-functions.md b/sources/modules/functions/member-functions.md similarity index 100% rename from functions/member-functions.md rename to sources/modules/functions/member-functions.md diff --git a/functions/user-defined-literals.md b/sources/modules/functions/user-defined-literals.md similarity index 100% rename from functions/user-defined-literals.md rename to sources/modules/functions/user-defined-literals.md diff --git a/meta-error-handling/static_assert.md b/sources/modules/meta-error-handling/static_assert.md similarity index 100% rename from meta-error-handling/static_assert.md rename to sources/modules/meta-error-handling/static_assert.md diff --git a/object-model/constant-objects.md b/sources/modules/object-model/constant-objects.md similarity index 100% rename from object-model/constant-objects.md rename to sources/modules/object-model/constant-objects.md diff --git a/object-model/constructors.md b/sources/modules/object-model/constructors.md similarity index 100% rename from object-model/constructors.md rename to sources/modules/object-model/constructors.md diff --git a/object-model/copy-semantics.md b/sources/modules/object-model/copy-semantics.md similarity index 100% rename from object-model/copy-semantics.md rename to sources/modules/object-model/copy-semantics.md diff --git a/object-model/declarations.md b/sources/modules/object-model/declarations.md similarity index 100% rename from object-model/declarations.md rename to sources/modules/object-model/declarations.md diff --git a/object-model/move-semantics.md b/sources/modules/object-model/move-semantics.md similarity index 100% rename from object-model/move-semantics.md rename to sources/modules/object-model/move-semantics.md diff --git a/object-model/objects.md b/sources/modules/object-model/objects.md similarity index 100% rename from object-model/objects.md rename to sources/modules/object-model/objects.md diff --git a/object-model/rule-of-five.md b/sources/modules/object-model/rule-of-five.md similarity index 100% rename from object-model/rule-of-five.md rename to sources/modules/object-model/rule-of-five.md diff --git a/object-model/rule-of-zero.md b/sources/modules/object-model/rule-of-zero.md similarity index 100% rename from object-model/rule-of-zero.md rename to sources/modules/object-model/rule-of-zero.md diff --git a/object-model/special-member-functions.md b/sources/modules/object-model/special-member-functions.md similarity index 100% rename from object-model/special-member-functions.md rename to sources/modules/object-model/special-member-functions.md diff --git a/object-model/types.md b/sources/modules/object-model/types.md similarity index 100% rename from object-model/types.md rename to sources/modules/object-model/types.md diff --git a/program-design/concepts.md b/sources/modules/program-design/concepts.md similarity index 100% rename from program-design/concepts.md rename to sources/modules/program-design/concepts.md diff --git a/user-defined-types/user-defined-literals.md b/sources/modules/user-defined-types/user-defined-literals.md similarity index 100% rename from user-defined-types/user-defined-literals.md rename to sources/modules/user-defined-types/user-defined-literals.md diff --git a/gen_readme.py b/tools/mgmt_tools/gen_readme.py similarity index 99% rename from gen_readme.py rename to tools/mgmt_tools/gen_readme.py index 22a0cd7..bd31dc4 100755 --- a/gen_readme.py +++ b/tools/mgmt_tools/gen_readme.py @@ -190,7 +190,7 @@ def readme_generator_driver() -> None: Run the Readme.md generation process. """ readme_filename = "Readme.md" - repo_root = Path('.') + repo_root = Path('sources/modules/') teaching_modules: List[TeachingModule] = [] for directory in filter( diff --git a/topic_updater.py b/tools/mgmt_tools/topic_updater.py similarity index 99% rename from topic_updater.py rename to tools/mgmt_tools/topic_updater.py index de2b0f7..01757b8 100755 --- a/topic_updater.py +++ b/tools/mgmt_tools/topic_updater.py @@ -388,7 +388,7 @@ def exclude_non_topic_files(path: Path) -> bool: topic_paths = list( filter(exclude_non_topic_files, - Path(".").glob("**/*.md"))) + Path("sources/modules/").glob("**/*.md"))) else: topic_paths = args.topic_paths diff --git a/tools/requirements.txt b/tools/requirements.txt index 756549b..6f03bf7 100644 --- a/tools/requirements.txt +++ b/tools/requirements.txt @@ -1,2 +1,3 @@ pytest pytest-pythonpath +mock