Describe your presentation slides with Swift.
TruffautSupport contains data types for describing presentation slides.
It provides the vocabulary for the manifest file.
The top-level data type that holds all necessary information about the slides.
It is also a crucial part of the manifest file interpreting process, as its designated initializer is responsible for printing out its JSON representation so that the manifest can be passed from the swiftc interpreter to Truffaut.app.
- Reserved for future use.
- Reserved for future use.
- An array of
Pages that needs to be presented in the slides.
- Designated initializer for
Presentation. title: optional, reserved for future use, default value is an empty string.authors: optional, reserved for future use, default value is an empty array of strings.pages: required, an array ofPages that needs to be presented in the slides.
A Page describes what should be displayed in a single slide.
Currently there are two types of pages: cover and normal.
- A cover page is a page that only displayes its
titleandsubtitle, and all the contents are vertically and horizontally centered. - A normal page is a page that can display a
titleand a tree ofcontents. The title is aligned to the top-left corner.
The detection of page types is implicit: if contents is nil the page will be recognized as a cover, otherwise it will be recognized as a normal page.
- The title of the page.
- Subtitle of the page.
- This value is ignored if the page is a normal page.
- An array of
Contentto be displayed in the page. - If this value is
nil, the page will be recognized as a cover, otherwise it will be recognized as a normal page.
- Designated initializer for
Page. title: optional, the title of the page, default value isnil.subtitle: optional, the subtitle of the page, default value isnil.contents: optional, an array ofContent, default value isnil.
A Content describes an entry in the slide.
It can be a text (.text), a monospaced text with optional syntax highlighting (.sourceCode), or an image (.image).
To make it more flexible to layout the entries, it is also possible to wrap contents with indentations (.indent). All contents can be wrapped in a .indent, including the .indent itself.
- Reserved for future use.
- A text entry rendered with system font.
- The associated
Stringwill be used to render the text entry.
- A image entry.
- The associated
Stringwill be used as the image's relative file path based on the manifest file's path.
- A text entry rendered with monospaced font.
- The first associated
FileTypevalue will be used to determine the syntax highlighting type. - The second associated
Stringwill be used to render the text entry.
- An indent entry to make its content visually indented by one level.
- The associated
Contentarray will be indented.
A Content.FileType will be mapped to rouge's syntax highlighting lexers.
- The content is plain text, no lexer will be applied (no syntax highlighting).
- The content is C source code,
Rouge::Lexers::Cwill be applied.
- The content is C++ source code,
Rouge::Lexers::Cppwill be applied.
- The content is JavaScript source code,
Rouge::Lexers::Javascriptwill be applied.
- The content is Objective-C source code,
Rouge::Lexers::ObjectiveCwill be applied.
- The content is Rust source code,
Rouge::Lexers::Rustwill be applied.
- The content is shell script,
Rouge::Lexers::Shellwill be applied.
- The content is Swift source code,
Rouge::Lexers::Swiftwill be applied.