Skip to content

support --output option ; generate both tutorials and example code fr…#53

Merged
iurimatias merged 1 commit into
masterfrom
generate_outputs
May 29, 2026
Merged

support --output option ; generate both tutorials and example code fr…#53
iurimatias merged 1 commit into
masterfrom
generate_outputs

Conversation

@iurimatias
Copy link
Copy Markdown
Member

…om test specs

Copilot AI review requested due to automatic review settings May 29, 2026 15:13
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 29, 2026

📊 Tutorial execution report

Rendered tutorial alongside the commands actually run and their output (updated each run, commit 0a0728d):

Pages can take a minute to update after the run finishes.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 DIR run mode: caller-owned, never auto-deleted; chained tutorials place each project under DIR/<project_name>/, standalone specs use DIR directly.
  • run.sh wrapper: runs Part 3 (chain), generates .md for every tests/*.test.yaml, and removes nested .git, nix out-links, modules/, and compiled *.dylib/*.so from outputs/.
  • Documentation and large generated-output trees added under outputs/ (tutorials and example source for logos-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.

Comment thread outputs/logos-calc-ui/ui-test.mjs Outdated
@@ -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";
Comment thread outputs/logos-calc-ui-cpp/ui-test.mjs Outdated
@@ -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
Comment thread tools/tutorial_runner.py
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
@iurimatias iurimatias merged commit 6799f76 into master May 29, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants