• OctoMY API
  • OctoMY API Reference
  • C++ Classes
  • OctoMY
  • WebExporter
  • WebExporter Class

    Exports widget catalog to markdown documentation for the website. More...

    Header: #include <WebExporter>
    Inherits: QObject

    Detailed Description

    Generates a hierarchical structure of markdown files from the WidgetRegistry, creating an index.md file for each widget, category, and overview page. The index.md is pure markdown. Its title, tags and sidebar links go into an index.meta.yaml sidecar next to it (in-app-docs-decoupling §MS-3), merged with the sidecar that is already there (see mergeOwnedMeta()). An export removes the pages it wrote before and does not write now (see pruneStalePages()).

    The output structure follows the website's routing convention where only index.md files are served:

    output/
    ├── index.md                    # Main widget reference page
    ├── by-category/
    │   ├── index.md               # Category listing
    │   ├── components/
    │   │   ├── index.md           # Category overview
    │   │   └── trust/
    │   │       ├── index.md       # Subcategory listing
    │   │       └── trust-icon-widget/
    │   │           ├── index.md   # Individual widget
    │   │           └── index.meta.yaml
    └── images/
        └── widget-slug-mode.png

    Usage:

    WebExporter exporter;
    exporter.setOutputDirectory("/path/to/content/doc/reference/widgets");
    exporter.setIncludeScreenshots(true);
    
    if (exporter.exportAll()) {
        qDebug() << "Exported" << exporter.exportedCount() << "pages";
    } else {
        qWarning() << "Export failed:" << exporter.lastError();
    }

    See also WidgetRegistry and WidgetScreenshotService.