Skip to content

Commit

Permalink
diatypst:0.2.0 (#1225)
Browse files Browse the repository at this point in the history
  • Loading branch information
skriptum authored Nov 6, 2024
1 parent ba4f46b commit a387b67
Show file tree
Hide file tree
Showing 17 changed files with 494 additions and 0 deletions.
21 changes: 21 additions & 0 deletions packages/preview/diatypst/0.2.0/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Gaspard Lambrechts

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
76 changes: 76 additions & 0 deletions packages/preview/diatypst/0.2.0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Diatypst

*easy slides in typst*

Features:

- easy delimiter for slides and sections (just use headings)
- sensible styling
- dot counter in upper right corner (like LaTeX beamer)
- adjustable color-theme
- default show rules for terms, code, lists, ... that match color-theme

Example Presentation

| Title Slide | Section | Content | Outline |
| ----------------------------------------------- | --------------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- |
| ![Example-Title](screenshots/Example-Title.jpg) | ![Example-Section](screenshots/Example-Section.jpg) | ![Example-Slide](screenshots/Example-Slide.jpg) | ![Example-Section](screenshots/Example-TOC.jpg) |

can be found in `example/example.typ`in the GitHub Repo


## Usage

To start a presentation, initialize it in your typst document:

```typst
#import "@preview/diatypst:0.2.0": *
#show: slides.with(
title: "Diatypst", // Required
subtitle: "easy slides in typst",
date: "01.07.2024",
authors: ("John Doe"),
)
...
```

Then, insert your content.

- Level-one headings corresponds to new sections.
- Level-two headings corresponds to new slides.

```typst
...
= First Section
== First Slide
#lorem(20)
```

## Options

all available Options to initialize the template with

| Keyword | Description | Default |
| ------------- | ------------------------------------------------------------ | -------------------- |
| *title* | Title of your Presentation, visible also in footer | `none` but required! |
| *subtitle* | Subtitle, also visible in footer | `none` |
| *date* | a normal string presenting your date | `none` |
| *authors* | either string or array of strings | `none` |
| *layout* | one of "small", "medium", "large", adjusts sizing of the elements on the slides | `"medium"` |
| *ratio* | aspect ratio of the slides, e.g 16/9 | `4/3` |
| *title-color* | Color to base the Elements of the Presentation on | `blue.darken(50%)` |
| *count* | whether to display the dots for pages in upper right corner | `true` |
| *footer* | whether to display the footer at the bottom | `true` |
| *toc* | whether to display the table of contents | `true` |
| *code-styling*| whether to style code elements in the presentation | `true` |



## Inspiration

this template is inspired by [slydst](https://github.com/glambrechts/slydst), and takes part of the code from it. If you want simpler slides, look here!

The word *Diatypst* is inspired by the ease of use of a [**Dia**-projektor](https://de.wikipedia.org/wiki/Diaprojektor) (German for Slide Projector) and the [Diatype](https://en.wikipedia.org/wiki/Diatype_(machine))
4 changes: 4 additions & 0 deletions packages/preview/diatypst/0.2.0/diaquarto/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Diaquarto: Diatypst Extension for Quarto



Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
title: Diaquarto
author: martenwalksaway
version: 1.0.0
quarto-required: ">=1.5.0"
contributes:
formats:
typst:
template-partials:
- typst-show.typ
- typst-template.typ

Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Typst custom formats typically consist of a 'typst-template.typ' (which is
// the source code for a typst template) and a 'typst-show.typ' which calls the
// template's function (forwarding Pandoc metadata values as required)
//
// This is an example 'typst-show.typ' file (based on the default template
// that ships with Quarto). It calls the typst function named 'article' which
// is defined in the 'typst-template.typ' file.
//
// If you are creating or packaging a custom typst template you will likely
// want to replace this file and 'typst-template.typ' entirely. You can find
// documentation on creating typst templates here and some examples here:
// - https://typst.app/docs/tutorial/making-a-template/
// - https://github.com/typst/templates

#import "@preview/diatypst:0.1.0": slides

#show: slides.with(
$if(title)$
title: [$title$],
$endif$
$if(subtitle)$
subtitle: [$subtitle$],
$endif$
$if(date)$
date: [$date$],
$endif$
$if(author)$
authors: "$author$",
$endif$
$if(layout)$
layout: "$layout$",
$endif$
$if(ratio)$
ratio: float($ratio$),
$endif$
$if(title-color)$
title-color: rgb("#$title-color$"),
$endif$
$if(counter)$
counter: [$counter$],
$endif$
$if(footer)$
footer: [$footer$],
$endif$
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#let horizontalrule = [
#pagebreak()
]
34 changes: 34 additions & 0 deletions packages/preview/diatypst/0.2.0/diaquarto/template.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: Untitled
author: Author Name
date: 01.07.2024
subtitle: easy slides in typst
format:
diaquarto-typst:
layout: medium # small, medium, large
ratio: 16/9 # any ratio possible
title-color: "013220" # Hex code for the title color (without #)
---

# First Section

## First Slide

This is the first slide. After here comes a Term and its Definition.

Term
~ Definition

Now some code

```python
print("Hello World")
```

---

BUmmmmmm

## Second Slide

This is the second slide.
Binary file not shown.
35 changes: 35 additions & 0 deletions packages/preview/diatypst/0.2.0/example/example.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#import "../lib.typ": *

#show: slides.with(
title: "Diatypst", // Required
subtitle: "easy slides in typst",
date: "01.07.2024",
authors: ("Marten Walk"),
layout: "medium",
ratio: 16/9,
toc: true, // New Option
count: true, // Renamed from counter
)

= First Section

== First Slide

Terms created with ```typc / Term: Definition```

/ *Term*: Definition

A code block

```python
// Example Code
print("Hello World!")
```



= Second Section

== Summary

#align(center+horizon)[_Le Fin_]
Loading

0 comments on commit a387b67

Please sign in to comment.