1156 Commits

Author SHA1 Message Date
Matias Fontanini
4bf584e211
chore: move footer up depending on footer height (#476)
This otherwise causes footers with tall images that need `footer.height`
adjusted to have the text too far down.
2025-03-05 06:13:58 -08:00
Matias Fontanini
6f26928be3 chore: move footer up depending on footer height 2025-03-05 06:11:16 -08:00
Matias Fontanini
0419cf3e2e
feat: allow configuring alignment when max columns is hit (#475)
This introduces a new `defaults.max_columns_alignment` that can have
values `left`, `center`, and `right`. This works along with
`max_columns` and allows specifying how to align the presentation if the
terminal size is greater than it. Before this change, this would behave
like `max_columns_alignment: center` does now so that's the default if
not set.

e.g. setting this to `left` will cause look like this on a wide
terminal:


![image](https://github.com/user-attachments/assets/026b5943-6e22-4450-ae22-3e1e6af84058)
2025-03-03 05:35:48 -08:00
Matias Fontanini
24e6ea8386 feat: allow configuring alignment when max columns is hit 2025-03-03 05:32:48 -08:00
Matias Fontanini
ec1be93a06
fix: fail if --config-file points to non existent file (#474) 2025-03-03 05:14:35 -08:00
Matias Fontanini
6f12f893d0 fix: fail if --config-file points to non existent file 2025-03-03 05:11:27 -08:00
Matias Fontanini
a7973cccb3
chore: bump dependencies (#472) 2025-03-02 12:50:57 -08:00
Matias Fontanini
1f2bea4a67 chore: bump dependencies 2025-03-02 12:29:23 -08:00
Matias Fontanini
7af0e4a18b
chore: display nice error if footer variable not set (#471) 2025-03-02 12:15:45 -08:00
Matias Fontanini
f190910646 chore: display nice error if footer variable not set 2025-03-02 11:39:47 -08:00
Matias Fontanini
5c03cc9950
chore: allow overriding slide title font size (#470) 2025-03-01 15:35:34 -08:00
Matias Fontanini
967db854a2 chore: allow overriding slide title font size 2025-03-01 15:31:59 -08:00
Matias Fontanini
6587cc955d
fix: show meaningful error if footer is broken (#469)
After the change to allow images in footers, the error message when the
footer is malformed was useless. This implements a custom deserializer
to have proper error messages since the derive macro was getting
confused.
2025-03-01 15:30:58 -08:00
Matias Fontanini
ace1dfc18d fix: show meaningful error if footer is broken 2025-03-01 14:09:27 -08:00
Matias Fontanini
a3ef63208f
feat: introduce palette.classes and use span.class to reference it (#468)
This introduces a `palette.classes` entry in the theme that allows
defining a class (a background and foreground color pair). This can then
be referenced when using spans by using the `class` html attribute.

As an example. the following presentation:

~~~markdown
---
theme:
    override:
        palette:
            classes:
                bokita:
                    foreground: yellow
                    background: dark_blue
        footer:
            style: template
            left: "<span class=\"bokita\">hello</span>"
                
---

hi <span class="bokita">hello</span>
~~~

Renders liks:


![image](https://github.com/user-attachments/assets/40cdd57a-295d-4889-ab97-4618613eaf0f)
2025-03-01 13:21:16 -08:00
Matias Fontanini
dfe0e8160e feat: introduce palette.classes and use span.class to reference it 2025-03-01 13:16:08 -08:00
Matias Fontanini
4ceb07c6de
feat: allow escaped braces in footer (#467)
After #442 you could no longer use braces unless it was to refer to a
variable. This PR softens that restriction by letting you use double
braces as an "escaped brace" to let you use them anywhere.

e.g. this footer "{title} {{potato}}" will render as "<title>
{{potato}}"
2025-02-28 06:15:22 -08:00
Matias Fontanini
161110e763 feat: allow escaped braces in footer 2025-02-28 06:05:25 -08:00
Matias Fontanini
3a3c7e031e
feat: allow footer to be styled via markdown (#466)
This allows styling the template footer using markdown, including colors
from the theme palette. If the front matter contains the `title` entry
and that contains markdown, it is also rendered as expected.

Example:

~~~markdown
---
theme:
    override:
        footer:
            style: template
left: "_how_ to <span style=\"color: red\">chop</span> **onions**"
---
~~~


![image](https://github.com/user-attachments/assets/0e8807c5-6488-4ba0-956d-1837ec32ae63)
2025-02-23 14:53:36 -08:00
Matias Fontanini
350f692ed9 feat: allow footer to be styled via markdown 2025-02-23 14:45:53 -08:00
Matias Fontanini
2ef27f4313
chore: remove Result return type from builder fns that don't need it (#465) 2025-02-23 13:09:46 -08:00
Matias Fontanini
33619c3255 chore: remove Result return type from builder fns that don't need it 2025-02-23 13:04:10 -08:00
Matias Fontanini
2e198d2dbc
feat: allow markdown syntax in presentation title (#464)
This allows using markdown syntax in the presentation's title, meaning
you can use bold, italics, color, etc. This currently looks wrong if you
use the `{title}` formatted in the footer but this will be fixed in a
follow up PR that will allow footers to be styled the same way as well.

Example presentation:

~~~markdown
---
title: "**Hi** _mom_ <span style=\"color: red\">how are you</span>?"
---
~~~


![image](https://github.com/user-attachments/assets/c26cd48d-1fa8-4f25-b4ee-fea5324a08d7)
2025-02-23 12:55:32 -08:00
Matias Fontanini
b6459701f3 feat: allow markdown syntax in presentation title 2025-02-23 12:50:15 -08:00
Matias Fontanini
83e33d7709
chore: refactor theme code (#463)
This cleans up the way themes are handled and splits them into 2 sets of
types: types that are meant to define the .yaml themes and another one
that's used during rendering. This:

* Prevents us from dealing with `Option` and using `unwrap_or/_default`
all over the place since we run defaults once during the .yaml >
"runtime" theme types conversion.
* Allows fallible code where there shouldn't be: there's cases like
footer images that forced error checking in weird spots, like when
creating the footer render just to ensure images use a valid path.
* Allows us to not deal with color palette lookup errors since we can
resolve those once.
* Allows us to not have to be extra careful to resolve all palette
colors or face runtime errors and instead enforce this in compile time.
e.g. now a new `RawColor` type has a `Palette` variant, but the real
`Color` one doesn't. Markdown parsing deals with `RawColor` but we are
forced to resolve them into `Color` because we can't print `RawColor`s.
2025-02-22 14:16:12 -08:00
Matias Fontanini
3e11cbe6fd chore: make Margin and Alignment Copy 2025-02-22 14:13:12 -08:00
Matias Fontanini
e7dd8f7e86 chore: add PaddingRect clean theme type 2025-02-22 14:00:44 -08:00
Matias Fontanini
7f1e2cbdb4 chore: remove serde::* derives from Color 2025-02-22 13:38:00 -08:00
Matias Fontanini
fb4ca37746 chore: create RawColor to deal with unresolved palette colors 2025-02-21 06:35:00 -08:00
Matias Fontanini
fa4d862834 chore: use re-exports for clean theme types 2025-02-20 16:15:34 -08:00
Matias Fontanini
8a806d76a1 chore: restrict raw theme visibility as much as possible 2025-02-20 16:13:29 -08:00
Matias Fontanini
60eee62e84 chore: use a separate theme model for config / runtime 2025-02-20 06:43:30 -08:00
Matias Fontanini
0f6a8ec73f
fix: use right script name for kotlin files when executing (#462)
Fixes #461
2025-02-19 05:13:31 -08:00
Matias Fontanini
5a9c2d7a45 fix: use right script name for kotlin files when executing 2025-02-19 05:09:20 -08:00
Matias Fontanini
dc75f43ab3 chore: split up themes module 2025-02-18 16:54:56 -08:00
Matias Fontanini
430872846b
feat: set font size on code execution components (#460)
After #458 most components were allowed to have a font size except a
couple. This expands that list to include code execution components (the
separator bar and the output).

This code has turned quite gore after all these changes and will be
refactored soon. Markdown tables still don't respect the font size but
that should hopefully be easier after the refactor.
2025-02-18 16:42:56 -08:00
Matias Fontanini
fda4eeb108 feat: set font size on code execution components 2025-02-18 16:36:32 -08:00
Matias Fontanini
61cc8125ea
fix: respect lists that start at non 1 indexes (#459)
This makes ordered lists that don't start at 1 to respect the number
they're prefixed with. e.g.

```markdown
5. hi
6. mom
```

Will be now rendered as expected, whereas before it would show indexes
1. and 2. for each item.

Fixes #457
2025-02-16 14:39:14 -08:00
Matias Fontanini
49ab5690dd fix: respect lists that start at non 1 indexes 2025-02-16 14:35:01 -08:00
Matias Fontanini
7437422a0b
feat: allow specifying font size in comment command (#458)
This extends the font size capabilities introduced in #438 by allowing
the user to specify the font size in the form of a comment command
anywhere in the presentation. This command changes the size of the font
for the remainder of the slide.

Currently this doesn't work in cases like executable snippets, but I'll
fix that when I have more time.

Example presentation:

~~~markdown
test

> this is
> small

<!-- font_size: 2 -->

test

> this is
> large

```rust
fn greet() -> &'static str {
    "hi mom"
}
```
~~~


![image](https://github.com/user-attachments/assets/91b88b57-edd7-47b6-8b47-b5fa6ea3575e)
2025-02-16 14:24:37 -08:00
Matias Fontanini
d5c56d2523 feat: allow specifying font size in comment command 2025-02-16 14:18:08 -08:00
Matias Fontanini
0f80362558 docs: mention tmux passthrough in docs 2025-02-15 14:08:00 -08:00
Matias Fontanini
1aea867700
fix: don't get stuck if tmux doesn't passthrough (#456)
This fixes an issue where we're inside tmux but `allow-passthrough` is
disabled, which manifests in presenterm getting stuck on startup because
tmux never forwards the escape codes sent to query for terminal
capabilities to the terminal, hence we never get an answer. The fix here
is to spawn a thread that will wait a second and if after that time we
still haven't received an answer it will make a device status report
query without the passthrough prefix, meaning tmux (if under tmux) will
answer it, and will wake the main thread up.

Fixes #455
2025-02-15 14:03:20 -08:00
Matias Fontanini
73429b98bd fix: don't get stuck if tmux doesn't passthrough 2025-02-15 13:57:17 -08:00
Matias Fontanini
0c00558cd0 chore: add release notes for 0.10.1 2025-02-14 16:25:14 -08:00
Matias Fontanini
8e0bc18791
fix: don't err if auto_render_languages isn't set (#454)
Fixes #453
2025-02-14 16:20:41 -08:00
Matias Fontanini
b6e393cde1 fix: don't err if auto_render_languages isn't set 2025-02-14 16:18:47 -08:00
Matias Fontanini
5507ea4dfd
chore: bump sixel-rs version (#452)
Includes https://github.com/orhun/sixel-rs/pull/6 to fix build on
aarch64 and riscv64.

If possible, please make a new release so downstream maintainers like
Arch Linux RISC-V won't need to maintain this patch for an extended
period. :P
2025-02-13 17:43:03 -08:00
Xeonacid
54d4c0db74 chore: bump sixel-rs version
Includes https://github.com/orhun/sixel-rs/pull/6 to fix build on aarch64 and riscv64.
2025-02-14 02:10:07 +01:00
Matias Fontanini
46d283743f
Update introduction.md (#451)
Fix broken link to installation guide  in introduction.md
2025-02-13 17:02:51 -08:00