support --output option ; generate both tutorials and example code fr…#53
Merged
Conversation
📊 Tutorial execution reportRendered tutorial alongside the commands actually run and their output (updated each run, commit Pages can take a minute to update after the run finishes. |
There was a problem hiding this comment.
Pull request overview
Adds a persistent --output-dir mode to tools/tutorial_runner.py, introduces a top-level run.sh that executes the full tutorial chain plus markdown generation into ./outputs/ and strips build artifacts, updates README/spec docs accordingly, and checks in the resulting generated tutorial markdown and example source trees under outputs/.
Changes:
- New
--output-dir DIRrun mode: caller-owned, never auto-deleted; chained tutorials place each project underDIR/<project_name>/, standalone specs useDIRdirectly. run.shwrapper: runs Part 3 (chain), generates.mdfor everytests/*.test.yaml, and removes nested.git, nix out-links,modules/, and compiled*.dylib/*.sofromoutputs/.- Documentation and large generated-output trees added under
outputs/(tutorials and example source forlogos-calc-module,logos-calc-ui,logos-calc-ui-cpp).
Reviewed changes
Copilot reviewed 23 out of 49 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
tools/tutorial_runner.py |
Adds --output-dir, chain-aware subdir layout, skips cleanup, updates summary line and CLI help. |
run.sh |
New wrapper: run chain into ./outputs/, generate all tutorial markdown, prune build artifacts. |
README.md |
Reorients examples around --output-dir/--report, adds “Where the results go” and report sections, marks dev-boost tutorial experimental. |
docs/spec.md |
Documents fourth workdir mode and the HTML report behavior; updates usage examples. |
outputs/tutorial-*.md |
Generated tutorial markdown checked in. |
outputs/logos-calc-module/** |
Generated Part 1 example source tree (includes leftover external_lib_* template files). |
outputs/logos-calc-ui/** |
Generated Part 2 QML UI tree; top-level ui-test.mjs contains a machine-specific absolute path. |
outputs/logos-calc-ui-cpp/** |
Generated Part 3 C++/QML tree; top-level ui-test.mjs contains a machine-specific absolute path. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -0,0 +1,16 @@ | |||
| import { resolve } from "node:path"; | |||
| const qtMcpRoot = "/Users/iurimatias/Projects/Logos/logos-workspace/repos/logos-tutorial/outputs/logos-calc-ui/result-mcp"; | |||
| @@ -0,0 +1,31 @@ | |||
| import { resolve } from "node:path"; | |||
| const qtMcpRoot = "/Users/iurimatias/Projects/Logos/logos-workspace/repos/logos-tutorial/outputs/logos-calc-ui-cpp/result-mcp"; | |||
Comment on lines
+1
to
+49
| #ifndef EXTERNAL_LIB_PLUGIN_H | ||
| #define EXTERNAL_LIB_PLUGIN_H | ||
|
|
||
| #include <QObject> | ||
| #include <QString> | ||
| #include "external_lib_interface.h" | ||
| #include "module_config.h" | ||
|
|
||
| // Include the external library header | ||
| // This would be the actual C header from the external library | ||
| // #include "lib/libexample.h" | ||
|
|
||
| class LogosAPI; | ||
|
|
||
| /** | ||
| * @brief Plugin implementation wrapping an external library | ||
| * | ||
| * This demonstrates how to wrap a C library in a Logos module. | ||
| */ | ||
| class ExternalLibPlugin : public QObject, public ExternalLibInterface | ||
| { | ||
| Q_OBJECT | ||
| Q_PLUGIN_METADATA(IID ExternalLibInterface_iid FILE "metadata.json") | ||
| Q_INTERFACES(ExternalLibInterface PluginInterface) | ||
|
|
||
| public: | ||
| explicit ExternalLibPlugin(QObject* parent = nullptr); | ||
| ~ExternalLibPlugin() override; | ||
|
|
||
| // PluginInterface implementation | ||
| QString name() const override { return MODULE_NAME; } | ||
| QString version() const override { return MODULE_VERSION; } | ||
| void initLogos(LogosAPI* api) override; | ||
|
|
||
| // ExternalLibInterface implementation | ||
| Q_INVOKABLE bool initLibrary(const QString& config) override; | ||
| Q_INVOKABLE QString processData(const QString& input) override; | ||
| Q_INVOKABLE void cleanup() override; | ||
|
|
||
| signals: | ||
| void eventResponse(const QString& eventName, const QVariantList& args); | ||
|
|
||
| private: | ||
| LogosAPI* m_logosAPI = nullptr; | ||
| void* m_libHandle = nullptr; // Handle to external library context | ||
| bool m_initialized = false; | ||
| }; | ||
|
|
||
| #endif // EXTERNAL_LIB_PLUGIN_H |
| if requires: | ||
| project_name = spec.get("project_name") | ||
| if not project_name: | ||
| print(f"ERROR: spec with requires: must also have project_name", file=sys.stderr) |
…om test specs support --output option ; generate both tutorials and example code from test specs delete old code files add to readme instructions about run.sh update run.sh to avoid logs and hardcoded paths
f71fc62 to
d17fce1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…om test specs