1156 Commits

Author SHA1 Message Date
Matias Fontanini
a5e89eb5a3 perf: cache ascii images when doing slide transitions 2025-04-13 14:02:41 -07:00
Matias Fontanini
733786154b chore: move image cache to image printer 2025-04-13 13:38:09 -07:00
Matias Fontanini
4786c5a84c chore: unify image registering functions 2025-04-13 13:18:26 -07:00
Matias Fontanini
7f3d878410
docs: add links to presentations using presenterm (#544)
Some checks are pending
Deploy docs / build-and-deploy (push) Waiting to run
Merge checks / Checks (push) Waiting to run
Merge checks / Validate nix flake (push) Waiting to run
Merge checks / Validate bat assets (push) Waiting to run
Merge checks / Validate JSON schemas (push) Waiting to run
It turns out I'm a heavy user of _presenterm_!

I only added my presentations - let me know if you know of any others I
should add.

closes #538
2025-04-13 12:48:38 -07:00
Matias Fontanini
2b6864c215
fix: center overflow lines when using centered text (#546)
This fixes an issue where centered text that overflowed had the lines 2+
start at the same column as the first one rather than being centered.

Fixes #545
2025-04-13 12:45:22 -07:00
Matias Fontanini
02fcba89cc fix: center overflow lines when using centered text 2025-04-13 12:40:28 -07:00
Orhun Parmaksız
1eb7d9e995
docs: add links to presentations using presenterm 2025-04-12 12:37:42 +03:00
Matias Fontanini
913c5ed838
fix: don't add extra space before heading if prefix is empty (#542)
Some checks failed
Deploy docs / build-and-deploy (push) Has been cancelled
Merge checks / Checks (push) Has been cancelled
Merge checks / Validate nix flake (push) Has been cancelled
Merge checks / Validate bat assets (push) Has been cancelled
Merge checks / Validate JSON schemas (push) Has been cancelled
Headings were being added an extra space if they had an empty string
configured as the prefix. This worked correctly if the prefix was `null`
but not if it was "".

Fixes #541
2025-04-10 05:45:15 -07:00
Matias Fontanini
13ab57f7f6 fix: don't add extra space before heading if prefix is empty 2025-04-10 05:41:03 -07:00
Matias Fontanini
8c5cdf0a92
fix: use no typst background in terminal-* built in themes (#535)
Some checks failed
Deploy docs / build-and-deploy (push) Has been cancelled
Merge checks / Checks (push) Has been cancelled
Merge checks / Validate nix flake (push) Has been cancelled
Merge checks / Validate bat assets (push) Has been cancelled
Merge checks / Validate JSON schemas (push) Has been cancelled
This sets no background for typst renders in the terminal-light and
terminal-dark built in themes. This requires a reasonably recent version
of typst (probably 0.12+) as they changed the meaning of `none` as a
fill background at some point around then.
2025-04-03 16:38:56 -07:00
Matias Fontanini
a060afff7e fix: use no typst background in terminal-* built in themes 2025-04-03 16:34:40 -07:00
Matias Fontanini
58a3ea5b8d
feat: add fade slide transition (#534)
This adds another animation: `fade`. This essentially draws the new
slide on top of the current one by jumping to cells that have changed
between slides randomly and printing their contents.


https://github.com/user-attachments/assets/eb2d7d68-9967-4855-a06b-cbe208b21c6f

Fixes #364
2025-04-03 16:29:35 -07:00
Matias Fontanini
8b0677e418 feat: add fade cells slide transition 2025-04-03 16:26:38 -07:00
Matias Fontanini
e287624595
fix: fixing the external_snippet test error (#533)
Some checks are pending
Deploy docs / build-and-deploy (push) Waiting to run
Merge checks / Checks (push) Waiting to run
Merge checks / Validate nix flake (push) Waiting to run
Merge checks / Validate bat assets (push) Waiting to run
Merge checks / Validate JSON schemas (push) Waiting to run
The absolute path to the temporary directories has been replaced with
the path specified in the environment variables.
2025-04-02 17:34:23 -07:00
Sergey Savelev
e8901b2aa2 fix: fixing the external_snippet test error
The absolute path to the temporary directories has been
replaced with the path specified in the environment variables.
2025-04-02 19:06:27 +04:00
Matias Fontanini
81747f7f1d
fix: respect extends in a theme set via path in front matter (#532)
Some checks are pending
Deploy docs / build-and-deploy (push) Waiting to run
Merge checks / Checks (push) Waiting to run
Merge checks / Validate nix flake (push) Waiting to run
Merge checks / Validate bat assets (push) Waiting to run
Merge checks / Validate JSON schemas (push) Waiting to run
This fixes an issue where a presentation with a `theme.path` in the
front matter that pointed to a theme that contained an `extends`
wouldn't have its `extends` respected.
2025-04-01 17:44:44 -07:00
Matias Fontanini
8749daa537 fix: respect extends in a theme set via path in front matter 2025-04-01 17:06:37 -07:00
Matias Fontanini
33fd38313b
feat: add max_rows configuration to cap vertical size (#531)
Similar to `max_columns` this adds a `max_rows` and `max_rows_alignment`
(valid values are `top`, `center`, `bottom`, the default is `center`)
that cap the vertical presentation size and aligns it accordingly.
2025-04-01 16:52:34 -07:00
Matias Fontanini
4c00f7731f feat: add max_rows configuration to cap vertical size 2025-04-01 16:49:52 -07:00
Matias Fontanini
a30f78e2ed
feat: include images in slide transitions (#530)
Some checks failed
Deploy docs / build-and-deploy (push) Has been cancelled
Merge checks / Checks (push) Has been cancelled
Merge checks / Validate nix flake (push) Has been cancelled
Merge checks / Validate bat assets (push) Has been cancelled
Merge checks / Validate JSON schemas (push) Has been cancelled
This includes images when transitioning between slides; this was the one
detail remaining after #528. This could probably be made a bit more
efficient as it currently causes us to potentially read the image from
disk and decode it. In practice I don't know if it matters though so I'd
rather have this merged now and look at optimizations in the future if
needed.

In this implementation, images are turned into ascii via the ascii
printer and that is used during the transition. I don't think it's
viable/makes sense to print the actual image that many times just for
the transition.

Relates to #364


https://github.com/user-attachments/assets/1f5d13df-d928-4789-87ee-b73824728609
2025-03-30 13:29:48 -07:00
Matias Fontanini
0d9b4ded83 feat: include images in slide transitions 2025-03-30 13:26:51 -07:00
Matias Fontanini
cccfb76545 feat: use TerminalIo in image printers 2025-03-30 10:01:45 -07:00
Matias Fontanini
a239e395d7
chore: get rid of TextProperties (#529)
This was needed at some point because of how text styling worked but
it's no longer the case.
2025-03-30 09:12:11 -07:00
Matias Fontanini
1d7b7d9719 chore: get rid of TextProperties 2025-03-30 09:06:05 -07:00
Matias Fontanini
3a7f6ae661 docs: document speaker notes always on better
Some checks are pending
Deploy docs / build-and-deploy (push) Waiting to run
Merge checks / Checks (push) Waiting to run
Merge checks / Validate nix flake (push) Waiting to run
Merge checks / Validate bat assets (push) Waiting to run
Merge checks / Validate JSON schemas (push) Waiting to run
2025-03-29 15:43:28 -07:00
Matias Fontanini
9f3c53efdc
feat: add slide horizontally slide transition animation (#528)
This adds support for the first slide transition animation that swaps
between slides horizontally. This is still a work in progress; it's
functional but is missing a few things like dealing with images. The
configuration currently looks like the following, but it will likely be
changed slightly once another type of transition is supported (will
happen before next release).

```yaml
transition:
 duration_millis: 750
 animation:
   style: slide_horizontal
```

This looks like the following:


https://github.com/user-attachments/assets/9475caf9-0538-4ffd-8858-115aac348bd1




Relates to #364
2025-03-29 15:10:51 -07:00
Matias Fontanini
b3d386e9dd feat: add slide horizontally animation 2025-03-29 14:57:20 -07:00
Matias Fontanini
f477ba4551 chore: use an enum to represent terminal commands 2025-03-26 16:34:01 -07:00
Matias Fontanini
f2a3abe85d
feat: add --output option for PDF exports (#526)
Some checks failed
Deploy docs / build-and-deploy (push) Has been cancelled
Merge checks / Checks (push) Has been cancelled
Merge checks / Validate nix flake (push) Has been cancelled
Merge checks / Validate bat assets (push) Has been cancelled
Merge checks / Validate JSON schemas (push) Has been cancelled
## Summary
Adds a new command-line option (`--output`/`-o`) allowing users to
specify custom output paths when exporting presentations to PDF.
Previously, presenterm automatically generated PDFs in the same location
as the input file.

## Motivation
This feature simplifies multi-theme exports without requiring manual
file renaming or temporary copies. It enables clean parallel exports
with different themes (light/dark) to distinct output files.

### Before:
```bash
generate_pdf() {
  local dir="$1"
  local theme="$2"
  cd "$dir" || exit
  # Generate PDF then rename immediately
  "$PRESENTERM_PATH" -e -t "$theme" --export-temporary-path "$TEMP_DIR" slide.md
  mv slide.pdf "slide_${theme}.pdf"
  cd - >/dev/null || exit
}
```

### After:
```bash
generate_pdf() {
  local dir="$1"
  local theme="$2"
  cd "$dir" || exit
  # Directly specify output file with theme name
  "$PRESENTERM_PATH" -e -t "$theme" --output "slide_${theme}.pdf" slide.md
  cd - >/dev/null || exit
}
```

## Example Usage
```
presenterm --export-pdf --output my-slides.pdf presentation.md
```

@mfontanini my rust skills are literally nil, I just copy pasted base on
your code.
2025-03-24 20:06:07 -07:00
Mariano Z.
636cac33b9
feat: add --output option for PDF exports
This change adds a new command-line option (--output/-o) that allows users
to specify a custom output path when exporting presentations to PDF.

Previously, presenterm would automatically generate the PDF file at the same
location as the input presentation file with a .pdf extension. With this
change, users can now explicitly set the destination path.

- Added the export_output CLI option in main.rs
- Modified the export_pdf function to accept custom output path
- Updated the PDF export documentation to explain the new option

Example usage:
presenterm --export-pdf --output my-slides.pdf presentation.md
2025-03-24 23:47:51 -03:00
Matias Fontanini
238c85f849
chore: prepare for 0.12.0 changes (#523) v0.12.0 2025-03-24 18:27:16 -07:00
Matias Fontanini
f8e94a0016 chore: bump version to 0.12.0 2025-03-24 18:24:28 -07:00
Matias Fontanini
3715bfa4da chore: add docs for 0.12.0 2025-03-24 18:24:28 -07:00
Matias Fontanini
ca0a8b3453 chore: add changelog notes for 0.12.0 2025-03-24 18:20:28 -07:00
Matias Fontanini
8ec745a4f0
fix: show error if sixel mode is selected but disabled (#525)
Some checks are pending
Deploy docs / build-and-deploy (push) Waiting to run
Merge checks / Checks (push) Waiting to run
Merge checks / Validate nix flake (push) Waiting to run
Merge checks / Validate bat assets (push) Waiting to run
Merge checks / Validate JSON schemas (push) Waiting to run
Fixes #524
2025-03-24 06:20:57 -07:00
Matias Fontanini
ed7f50ef89 fix: show error if sixel mode is selected but disabled 2025-03-24 06:17:38 -07:00
Matias Fontanini
2d40544e58
fix: respect font size in lists (#522)
Regression introduced in #512. This + inline code needs something more
robust.

Fixes #521
2025-03-24 06:03:18 -07:00
Matias Fontanini
78d2695f7a fix: respect font size in lists 2025-03-23 08:47:10 -07:00
Matias Fontanini
74bbe9f8d5
fix: display inline code colors when in list (#520)
Some checks failed
Deploy docs / build-and-deploy (push) Has been cancelled
Merge checks / Checks (push) Has been cancelled
Merge checks / Validate nix flake (push) Has been cancelled
Merge checks / Validate bat assets (push) Has been cancelled
Merge checks / Validate JSON schemas (push) Has been cancelled
This is fragile and broke after #512, eventually it should be cleaned up
so this can't break as easily.
2025-03-22 13:27:25 -07:00
Matias Fontanini
24221f4538 fix: display inline code colors when in list 2025-03-22 13:22:27 -07:00
Matias Fontanini
d7c7dba34f
chore: cleanup text attributes (#519)
This cleans up the code around text attributes and adds more tests when
converting text to html.
2025-03-22 13:19:56 -07:00
Matias Fontanini
9f316abcf9 chore: cleanup text attributes 2025-03-22 13:13:25 -07:00
Matias Fontanini
b52fd4ce8f
chore: allow specifying path for temporary export files (#518)
Some checks are pending
Deploy docs / build-and-deploy (push) Waiting to run
Merge checks / Checks (push) Waiting to run
Merge checks / Validate nix flake (push) Waiting to run
Merge checks / Validate bat assets (push) Waiting to run
Merge checks / Validate JSON schemas (push) Waiting to run
This adds a `--export-temporary-path` that allows using some specific
path to store intermediate files used when exporting to pdf (currently
an html and a css file) rather than using a temporary path. This helps
debugging #516 but is also generally useful.
2025-03-22 09:11:12 -07:00
Matias Fontanini
3f3b66b52d chore: allow specifying path for temporary export files 2025-03-22 09:01:27 -07:00
Matias Fontanini
3ef9d75277
fix: respect line height when jumping lines when rendering PDF (#517)
Some checks are pending
Deploy docs / build-and-deploy (push) Waiting to run
Merge checks / Checks (push) Waiting to run
Merge checks / Validate nix flake (push) Waiting to run
Merge checks / Validate bat assets (push) Waiting to run
Merge checks / Validate JSON schemas (push) Waiting to run
Fixes #515
2025-03-21 16:06:44 -07:00
Matias Fontanini
d7216d2af5 fix: respect line height when jumping lines when rendering PDF 2025-03-21 16:03:09 -07:00
Matias Fontanini
3a7a967a1e
ci: revert build with sixel enabled (#514)
Some checks are pending
Deploy docs / build-and-deploy (push) Waiting to run
Merge checks / Checks (push) Waiting to run
Merge checks / Validate nix flake (push) Waiting to run
Merge checks / Validate bat assets (push) Waiting to run
Merge checks / Validate JSON schemas (push) Waiting to run
This causes builds to fail. This should maybe be moved to use some sixel
crate that's pure rust and not based on libsixel.
2025-03-20 19:04:15 -07:00
Matias Fontanini
146862f12b Revert "ci: build with sixel enabled"
This reverts commit 9dd4b2105c5abef78ea52e43ab3ba330f7b652ff.
2025-03-20 19:00:02 -07:00
Matias Fontanini
1d4e5b1c59
ci: build with sixel enabled (#513)
This changes the nightly and release builds to enable sixel support.
2025-03-20 16:52:52 -07:00
Matias Fontanini
59b96d718b
fix: center lists correctly (#512)
After #493 lists could be center/right aligned but they looked terrible.
This fixes that.
2025-03-20 16:52:40 -07:00