#pragma once #include #include #include namespace molo::example::app { // One row of the index page: a display name and the route that demonstrates it. struct FeatureRow { std::string name; std::string route; }; // A themed section of the index page. A route belongs to the first group that // lists its path prefix; routes matching no group fall into "Other". struct FeatureGroup { std::string id; std::string title; std::string blurb; std::string key_hint; // non-empty: the demos need these credentials std::vector prefixes; }; // Groups the feature rows and renders the index sections (SPEC.md, index). class IndexCatalog { public: IndexCatalog(); // Display name for a registered feature ("ai-openai" -> "AI OpenAI"). static std::string pretty_name(const std::string& feature); // HTML for the jump chips and one table per non-empty group. Everything // dynamic is escaped; the result is safe to insert unescaped. std::string render(const std::vector>& rows, std::size_t* feature_count, std::size_t* group_count) const; private: const FeatureGroup& group_for(const std::string& route) const; std::vector groups_; FeatureGroup other_; }; } // namespace molo::example::app