Sen API
Sen Libraries
Toggle main menu visibility
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
11
#include "
sen/core/base/compiler_macros.h
"
12
#include "
sen/core/lang/stl_resolver.h
"
13
14
#include <filesystem>
15
#include <map>
16
#include <memory>
17
#include <string>
18
#include <vector>
19
20
namespace
sen::gen
21
{
22
26
struct
TypstOptions
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
65
class
TypstGenerator
66
{
67
SEN_NOCOPY_NOMOVE(
TypstGenerator
)
68
69
public
:
70
TypstGenerator
();
71
~TypstGenerator
();
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
82
private
:
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
sen::gen::TypstGenerator::generate
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...
sen::gen::TypstGenerator::~TypstGenerator
~TypstGenerator()
sen::gen::TypstGenerator::TypstGenerator
TypstGenerator()
sen::gen::TypstGenerator::FileContents
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
sen::lang::TypeSetContext
The set of types used during resolution.
Definition
stl_resolver.h:51
compiler_macros.h
sen::gen
Definition
cpp.h:21
sen::gen::TypstOptions::afterReference
std::filesystem::path afterReference
Definition
typst.h:55
sen::gen::TypstOptions::builtIns
bool builtIns
The table of the built-in types the model names, at the back.
Definition
typst.h:49
sen::gen::TypstOptions::usedBy
bool usedBy
The "used by" line on each type.
Definition
typst.h:45
sen::gen::TypstOptions::frontMatter
std::filesystem::path frontMatter
Typst files the document includes at named points. The generator never reads them: it emits #include ...
Definition
typst.h:53
sen::gen::TypstOptions::title
std::string title
Shown on the title page and in the running header.
Definition
typst.h:29
sen::gen::TypstOptions::excludePackages
std::vector< std::string > excludePackages
Packages to leave out, applied after includePackages.
Definition
typst.h:34
sen::gen::TypstOptions::style
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
sen::gen::TypstOptions::includePackages
std::vector< std::string > includePackages
Packages to document. Empty means every package in the model.
Definition
typst.h:32
sen::gen::TypstOptions::index
bool index
The alphabetical index of every type, at the back.
Definition
typst.h:43
sen::gen::TypstOptions::beforeReference
std::filesystem::path beforeReference
Definition
typst.h:54
sen::gen::TypstOptions::hierarchy
bool hierarchy
The class hierarchy within the overview. Emitted only where classes inherit.
Definition
typst.h:39
sen::gen::TypstOptions::flagLegend
bool flagLegend
What the codes in the Flags column mean, before the first table that uses them.
Definition
typst.h:47
sen::gen::TypstOptions::summaries
bool summaries
The per-section table of every type with its description and page.
Definition
typst.h:41
sen::gen::TypstOptions::overview
bool overview
The overview: the package table and the class hierarchy across all packages.
Definition
typst.h:37
sen::gen::TypstOptions
What the document contains and how it is put together. Every field defaults to the whole model and th...
Definition
typst.h:27
stl_resolver.h
libs
gen
include
sen
gen
typst.h
Generated by
1.17.0