Sen API
Sen Libraries
Loading...
Searching...
No Matches
sen::gen::HtmlGenerator Class Reference

Renders a browsable reference for a sen data model as a self-contained web page. The output needs no server, no network and no host site: it opens from a file path and carries its own navigation and search. More...

#include <html.h>

Public Types

using FileContents = std::map<std::filesystem::path, std::string>
 Map of relative output path -> rendered file contents: an index.html and the four files it names, which together are the application and the model it displays.

Public Member Functions

 HtmlGenerator ()
 ~HtmlGenerator ()
FileContents generate (const sen::lang::TypeSetContext &typeSets, const std::string &title)
 Renders the application and the model it displays. title names the model on screen. The model is written as a script assigning a global rather than as JSON read at run time, because a fetch fails outright from a file:// path.

Detailed Description

Renders a browsable reference for a sen data model as a self-contained web page. The output needs no server, no network and no host site: it opens from a file path and carries its own navigation and search.

Member Typedef Documentation

◆ FileContents

using sen::gen::HtmlGenerator::FileContents = std::map<std::filesystem::path, std::string>

Map of relative output path -> rendered file contents: an index.html and the four files it names, which together are the application and the model it displays.

Constructor & Destructor Documentation

◆ HtmlGenerator()

sen::gen::HtmlGenerator::HtmlGenerator ( )

◆ ~HtmlGenerator()

sen::gen::HtmlGenerator::~HtmlGenerator ( )

Member Function Documentation

◆ generate()

FileContents sen::gen::HtmlGenerator::generate ( const sen::lang::TypeSetContext & typeSets,
const std::string & title )
nodiscard

Renders the application and the model it displays. title names the model on screen. The model is written as a script assigning a global rather than as JSON read at run time, because a fetch fails outright from a file:// path.


The documentation for this class was generated from the following file: