Sen API
Sen Libraries
Loading...
Searching...
No Matches
typst.h
Go to the documentation of this file.
1// === typst.h =========================================================================================================
2// Sen Infrastructure
3// Released under the Apache License v2.0 (SPDX-License-Identifier Apache-2.0).
4// See the LICENSE.txt file for more information.
5// © Airbus SAS, Airbus Helicopters, and Airbus Defence and Space SAU/GmbH/SAS.
6// =====================================================================================================================
7
8#ifndef SEN_LIBS_GEN_INCLUDE_SEN_GEN_TYPST_H
9#define SEN_LIBS_GEN_INCLUDE_SEN_GEN_TYPST_H
10
13
14#include <filesystem>
15#include <map>
16#include <memory>
17#include <string>
18#include <vector>
19
20namespace sen::gen
21{
22
27{
29 std::string title {"Data model"};
30
32 std::vector<std::string> includePackages;
34 std::vector<std::string> excludePackages;
35
37 bool overview {true};
39 bool hierarchy {true};
41 bool summaries {true};
43 bool index {true};
45 bool usedBy {true};
47 bool flagLegend {true};
49 bool builtIns {true};
50
53 std::filesystem::path frontMatter;
54 std::filesystem::path beforeReference;
55 std::filesystem::path afterReference;
56
59 std::filesystem::path style;
60};
61
66{
67 SEN_NOCOPY_NOMOVE(TypstGenerator)
68
69public:
72
75 using FileContents = std::map<std::filesystem::path, std::string>;
76
80 [[nodiscard]] FileContents generate(const sen::lang::TypeSetContext& typeSets, const TypstOptions& options);
81
82private:
83 class Impl;
84 std::unique_ptr<Impl> pimpl_;
85};
86
87} // namespace sen::gen
88
89#endif // SEN_LIBS_GEN_INCLUDE_SEN_GEN_TYPST_H
FileContents generate(const sen::lang::TypeSetContext &typeSets, const TypstOptions &options)
Renders the document. The three files are separate because they have different owners: the skeleton a...
std::map< std::filesystem::path, std::string > FileContents
Map of relative output path -> file contents: the document skeleton, the style module it imports,...
Definition typst.h:75
The set of types used during resolution.
Definition stl_resolver.h:51
Definition cpp.h:21
std::filesystem::path afterReference
Definition typst.h:55
bool builtIns
The table of the built-in types the model names, at the back.
Definition typst.h:49
bool usedBy
The "used by" line on each type.
Definition typst.h:45
std::filesystem::path frontMatter
Typst files the document includes at named points. The generator never reads them: it emits #include ...
Definition typst.h:53
std::string title
Shown on the title page and in the running header.
Definition typst.h:29
std::vector< std::string > excludePackages
Packages to leave out, applied after includePackages.
Definition typst.h:34
std::filesystem::path style
Replaces the emitted style.typ. Every visual decision lives in that module, so a caller changing the ...
Definition typst.h:59
std::vector< std::string > includePackages
Packages to document. Empty means every package in the model.
Definition typst.h:32
bool index
The alphabetical index of every type, at the back.
Definition typst.h:43
std::filesystem::path beforeReference
Definition typst.h:54
bool hierarchy
The class hierarchy within the overview. Emitted only where classes inherit.
Definition typst.h:39
bool flagLegend
What the codes in the Flags column mean, before the first table that uses them.
Definition typst.h:47
bool summaries
The per-section table of every type with its description and page.
Definition typst.h:41
bool overview
The overview: the package table and the class hierarchy across all packages.
Definition typst.h:37
What the document contains and how it is put together. Every field defaults to the whole model and th...
Definition typst.h:27