From a894105b9b8f953b0cd06706578f7b89110c36e9 Mon Sep 17 00:00:00 2001 From: Matias Fontanini Date: Fri, 25 Apr 2025 05:32:39 -0700 Subject: [PATCH 1/4] chore: add changelog entries for 0.13.0 --- CHANGELOG.md | 50 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c6c0d6..ab64b70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,51 @@ +# v0.13.0 - 2025-04-25 + +## Breaking changes + +* The CLI parameter to generate the JSON schema for the config file (`--generate-config-file-schema`) is now hidden behind a `json-schema` feature flag. The JSON schema file for the latest version is already publicly available at `https://github.com/mfontanini/presenterm/blob/${VERSION}/config-file-schema.json` already, so anyone can use it without having to generate it by hand. This allows cutting down the number of dependencies in this project quite a bit ([#563](https://github.com/mfontanini/presenterm/issues/563)). + +## New features + +* Support for [slide transitions](https://mfontanini.github.io/presenterm/features/slide-transitons.html) is now available ([#530](https://github.com/mfontanini/presenterm/issues/530)): + * Add fade slide transition ([#534](https://github.com/mfontanini/presenterm/issues/534)). + * Add slide horizontally slide transition animation ([#528](https://github.com/mfontanini/presenterm/issues/528)). + * Add `collapse_horizontal` slide transition ([#560](https://github.com/mfontanini/presenterm/issues/560)). +* Add `--output` option to specify the path where the output file is written to during an export ([#526](https://github.com/mfontanini/presenterm/issues/526)). +* Allow specifying [start/end lines](https://mfontanini.github.io/presenterm/features/code/highlighting.html#including-external-code-snippets) in file snippet type ([#565](https://github.com/mfontanini/presenterm/issues/565)) - thanks @marianozunino. +* Allow letting [pauses become new slides](https://mfontanini.github.io/presenterm/configuration/settings.html#pause-behavior) when exporting ([#557](https://github.com/mfontanini/presenterm/issues/557)). +* Allow [using images on right in footer](https://mfontanini.github.io/presenterm/features/themes/definition.html#footer-images) ([#554](https://github.com/mfontanini/presenterm/issues/554)). +* Add [`max_rows` configuration](https://mfontanini.github.io/presenterm/configuration/settings.html#maximum-presentation-height) to cap vertical size ([#531](https://github.com/mfontanini/presenterm/issues/531)). +* Add julia language highlighting and execution support ([#561](https://github.com/mfontanini/presenterm/issues/561)). + +## Fixes + +* Center overflow lines when using centered text ([#546](https://github.com/mfontanini/presenterm/issues/546)). +* Don't add extra space before heading if prefix in theme is empty ([#542](https://github.com/mfontanini/presenterm/issues/542)). +* Use no typst background in terminal-* built in themes ([#535](https://github.com/mfontanini/presenterm/issues/535)). +* Use `std::env::temp_dir` in the `external_snippet` test ([#533](https://github.com/mfontanini/presenterm/issues/533)) - thanks @Medovi. +* Respect `extends` in a theme set via `path` in front matter ([#532](https://github.com/mfontanini/presenterm/issues/532)). + +## Misc + +* Refactor async renders (e.g. mermaid/typst/latex `+render` blocks, `+exec` blocks, etc) to work truly asynchronously. This causes the output to be polled faster, and causes jumping to a slide that contains an async render to take a likely negligible (but maybe noticeable) amount of time to be jumped to. This was needed for slide transitions to work seemlessly ([#556](https://github.com/mfontanini/presenterm/issues/556)). +* Get rid of `textproperties` ([#529](https://github.com/mfontanini/presenterm/issues/529)). +* Add links to presentations using presenterm ([#544](https://github.com/mfontanini/presenterm/issues/544)) - thanks @orhun. + +## Performance improvements + +* A few performance improvements had to be done for slide transitions to work seemlessly: + * Pre-scale ASCII images when transitions are enabled ([#550](https://github.com/mfontanini/presenterm/issues/550)). + * Pre-scale generated images ([#553](https://github.com/mfontanini/presenterm/issues/553)). + * Cache resized ASCII images ([#547](https://github.com/mfontanini/presenterm/issues/547)). + +## ❤️ Sponsors + +Thanks to the following users who supported _presenterm_ via a [github sponsorship](https://github.com/sponsors/mfontanini) in this release: + +* [@0atman](https://github.com/0atman) +* [@orhun](https://github.com/orhun) +* [@fipoac](https://github.com/fipoac) + # v0.12.0 - 2025-03-24 ## Breaking changes @@ -41,7 +89,7 @@ It is now possible to sponsor this project via [github sponsors](https://github.com/sponsors/mfontanini). -Thanks to @0atman for being the first project sponsor! +Thanks to [@0atman](https://github.com/0atman) for being the first project sponsor! # v0.11.0 - 2025-03-08 From 232fc34fcefa3632cfe415c82059d4dea45bf46a Mon Sep 17 00:00:00 2001 From: Matias Fontanini Date: Fri, 25 Apr 2025 05:32:57 -0700 Subject: [PATCH 2/4] chore: update docs to include 0.13.0 changes --- docs/src/SUMMARY.md | 1 + docs/src/configuration/settings.md | 67 ++++++++++++++++++++++++-- docs/src/features/code/highlighting.md | 13 +++++ docs/src/features/pdf-export.md | 11 +++-- docs/src/features/slide-transitions.md | 24 +++++++++ docs/src/features/themes/definition.md | 5 +- 6 files changed, 112 insertions(+), 9 deletions(-) create mode 100644 docs/src/features/slide-transitions.md diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md index 2bb00c5..be70c4d 100644 --- a/docs/src/SUMMARY.md +++ b/docs/src/SUMMARY.md @@ -16,6 +16,7 @@ - [Themes](./features/themes/introduction.md) - [Definition](./features/themes/definition.md) - [PDF export](./features/pdf-export.md) + - [Slide transitions](./features/slide-transitions.md) - [Speaker notes](./features/speaker-notes.md) - [Configuration](./configuration/introduction.md) - [Options](./configuration/options.md) diff --git a/docs/src/configuration/settings.md b/docs/src/configuration/settings.md index 59628cd..8c7ceb2 100644 --- a/docs/src/configuration/settings.md +++ b/docs/src/configuration/settings.md @@ -61,13 +61,25 @@ defaults: If you would like your presentation to be left or right aligned instead of centered when the terminal is too wide, you can use the `max_columns_alignment` key: - ```yaml defaults: max_columns: 100 + # Valid values: left, center, right max_columns_alignment: left ``` +## Maximum presentation height + +The `max_rows` and `max_rows_alignment` properties are analogous to `max_columns*` to allow capping the maximum number +of rows: + +```yaml +defaults: + max_rows: 100 + # Valid values: top, center, bottom + max_rows_alignment: left +``` + ## Incremental lists behavior By default, [incremental lists](../features/commands.md) will pause before and after a list. If you would like to change @@ -81,6 +93,27 @@ defaults: pause_after: true ``` +# Slide transitions + +Slide transitions allow animating your presentation every time you move from a slide to the next/previous one. The +configuration for slide transitions is the following: + +```yaml +transition: + # how long the transition should last. + duration_millis: 750 + + # how many frames should be rendered during the transition + frames: 45 + + # the animation to use + animation: + style: +``` + +See the [slide transitions page](../features/slide-transitions.md) for more information on which animation styles are +supported. + # Key bindings Key bindings that _presenterm_ uses can be manually configured in the config file via the `bindings` key. The following @@ -94,6 +127,16 @@ bindings: # the keys that cause the presentation to move backwards. previous: ["h", "k", "", "", ""] + # the keys that cause the presentation to move "fast" to the next slide. this will ignore: + # + # * Pauses. + # * Dynamic code highlights. + # * Slide transitions, if enabled. + next_fast: ["n"] + + # same as `next_fast` but jumps fast to the previous slide. + previous_fast: ["p"] + # the key binding to jump to the first slide. first_slide: ["gg"] @@ -130,6 +173,8 @@ default won't apply anymore and only what you've defined will be used. # Snippet configurations +The configurations that affect code snippets in presentations. + ## Snippet execution [Snippet execution](../features/code/execution.md#executing-code-blocks) is disabled by default for security reasons. @@ -232,15 +277,29 @@ speaker_notes: always_publish: true ``` +# Presentation exports + +The configurations that affect PDF exports. + ## PDF export size The size of exported PDFs can be configured via the `export.dimensions` key: ```yaml export: - dimensions: - columns: 80 - rows: 30 + dimensions: + columns: 80 + rows: 30 ``` See [the PDF export page](../features/pdf-export.md) for more information. + +## Pause behavior + +By default pauses will be ignored in generated PDF files. If instead you'd like every pause to generate a new page in +the export, set the `export.pauses` attribute: + +```yaml +export: + pauses: new_slide +``` diff --git a/docs/src/features/code/highlighting.md b/docs/src/features/code/highlighting.md index 9ecc40b..08234dc 100644 --- a/docs/src/features/code/highlighting.md +++ b/docs/src/features/code/highlighting.md @@ -30,6 +30,7 @@ Code highlighting is supported for the following languages: | java | ✓ | | javascript | ✓ | | json | | +| julia | ✓ | | kotlin | ✓ | | latex | | | lua | ✓ | @@ -140,6 +141,18 @@ language: rust ``` ~~~ +If you'd like to include only a subset of the file, you can use the optional fields `start_line` and `end_line`: + +~~~markdown +```file +exec +line_numbers +path: snippet.rs +language: rust +# Only shot lines 5-10 +start_line: 5 +end_line: 10 +``` +~~~ + ## Showing a snippet without a background Using the `+no_background` flag will cause the snippet to have no background. This is useful when combining it with the diff --git a/docs/src/features/pdf-export.md b/docs/src/features/pdf-export.md index df3d007..c5d9308 100644 --- a/docs/src/features/pdf-export.md +++ b/docs/src/features/pdf-export.md @@ -5,8 +5,8 @@ Presentations can be converted into PDF by using [weasyprint](https://pypi.org/p to install extra dependencies for the tool to work. > [!note] -> If you were using _presenterm-export_ before, that tool already required _weasyprint_ so it is already installed in -> whatever virtual env you were using and there's nothing to be done. +> If you were using _presenterm-export_ before it was deprecated, that tool already required _weasyprint_ so it is +> already installed in whatever virtual env you were using and there's nothing to be done. After you've installed _weasyprint_, run _presenterm_ with the `--export-pdf` parameter to generate the output PDF: @@ -15,7 +15,8 @@ After you've installed _weasyprint_, run _presenterm_ with the `--export-pdf` pa presenterm --export-pdf examples/demo.md ``` -The output PDF will be placed in `examples/demo.pdf`. +The output PDF will be placed in `examples/demo.pdf`. Alternatively you can use the `--output` flag to specify where you +want the output file to be written to. > [!note] > If you're using a separate virtual env to install _weasyprint_ just make sure you activate it before running @@ -28,3 +29,7 @@ By default, the size of each page in the generated PDF will depend on the size o If you would like to instead configure the dimensions by hand, set the `export.dimensions` key in the configuration file as described in the [settings page](../configuration/settings.md#pdf-export-size). +## Pause behavior + +See the [settings page](../configuration/settings.md#pause-behavior) to learn how to configure the behavior of pauses in +generated PDFs. diff --git a/docs/src/features/slide-transitions.md b/docs/src/features/slide-transitions.md new file mode 100644 index 0000000..796b804 --- /dev/null +++ b/docs/src/features/slide-transitions.md @@ -0,0 +1,24 @@ +# Slide transitions + +Slide transitions allow animating your presentation every time you move from a slide to the next/previous one. See the +[configuration page](../configuration/settings.md) to learn how to configure transitions. + +The following animations are supported: + +## `fade` + +Fade the current slide into the next one. + +[![asciicast](https://asciinema.org/a/RvxLw0FHOopjdF4ixWbCkWuSw.svg)](https://asciinema.org/a/RvxLw0FHOopjdF4ixWbCkWuSw) + +## `slide_horizontal` + +Slide horizontally to the next/previous slide. + +[![asciicast](https://asciinema.org/a/T43ttxPWZ8TsM2auTqNZSWrmZ.svg)](https://asciinema.org/a/T43ttxPWZ8TsM2auTqNZSWrmZ) + +## `collapse_horizontal` + +Collapse the current slide into the center of the screen horizontally. + +[![asciicast](https://asciinema.org/a/VB8i3kGMvbkbiYYPpaZJUl2dW.svg)](https://asciinema.org/a/VB8i3kGMvbkbiYYPpaZJUl2dW) diff --git a/docs/src/features/themes/definition.md b/docs/src/features/themes/definition.md index b0ca38a..668e892 100644 --- a/docs/src/features/themes/definition.md +++ b/docs/src/features/themes/definition.md @@ -163,7 +163,7 @@ using another brace. e.g. `{{potato}} farms` will be displayed as `{potato} farm #### Footer images -Besides text, images can also be used in the left and center positions. This can be done by specifying an `image` key +Besides text, images can also be used in the left/center/right positions. This can be done by specifying an `image` key under each of those attributes: ```yaml @@ -173,7 +173,8 @@ footer: image: potato.png center: image: banana.png - right: "{current_slide} / {total_slides}" + right: + image: apple.png # The height of the footer to adjust image sizes height: 5 ``` From 0836c82f68d7436cf7a51da82162c016e9fe640b Mon Sep 17 00:00:00 2001 From: Matias Fontanini Date: Fri, 25 Apr 2025 05:53:50 -0700 Subject: [PATCH 3/4] chore: update README with 0.13.0 changes --- CHANGELOG.md | 2 +- README.md | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab64b70..13a40f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## Breaking changes -* The CLI parameter to generate the JSON schema for the config file (`--generate-config-file-schema`) is now hidden behind a `json-schema` feature flag. The JSON schema file for the latest version is already publicly available at `https://github.com/mfontanini/presenterm/blob/${VERSION}/config-file-schema.json` already, so anyone can use it without having to generate it by hand. This allows cutting down the number of dependencies in this project quite a bit ([#563](https://github.com/mfontanini/presenterm/issues/563)). +* The CLI parameter to generate the JSON schema for the config file (`--generate-config-file-schema`) is now hidden behind a `json-schema` feature flag. The JSON schema file for the latest version is already publicly available at `https://github.com/mfontanini/presenterm/blob/${VERSION}/config-file-schema.json`, so anyone can use it without having to generate it by hand. This allows cutting down the number of dependencies in this project quite a bit ([#563](https://github.com/mfontanini/presenterm/issues/563)). ## New features diff --git a/README.md b/README.md index b2bbd83..ed3f9f3 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,7 @@ Visit the [documentation][docs-introduction] to get started. * [Slide titles][docs-slide-titles]. * [Snippet execution][docs-code-execute] for various programming languages. * [Export presentations to PDF][docs-pdf-export]. +* [Slide transitions][docs-slide-transitions]. * [Pause][docs-pauses] portions of your slides. * [Custom key bindings][docs-key-bindings]. * [Automatically reload your presentation][docs-hot-reload] every time it changes for a fast development loop. @@ -52,7 +53,7 @@ Visit the [documentation][docs-introduction] to get started. See the [introduction page][docs-introduction] to learn more. -# Presenterm in Action +# Presenterm in action Here are some talks and demos that feature _presenterm_: @@ -76,6 +77,7 @@ Gave a talk using _presenterm_? We would love to feature it here! Open a PR or i [docs-code-highlight]: https://mfontanini.github.io/presenterm/features/code/highlighting.html [docs-code-execute]: https://mfontanini.github.io/presenterm/features/code/execution.html [docs-selective-highlight]: https://mfontanini.github.io/presenterm/features/code/highlighting.html#selective-highlighting +[docs-slide-transitions]: https://mfontanini.github.io/presenterm/features/slide-transitons.html [docs-layout]: https://mfontanini.github.io/presenterm/features/layout.html [docs-mermaid]: https://mfontanini.github.io/presenterm/features/code/mermaid.html [docs-latex]: https://mfontanini.github.io/presenterm/features/code/latex.html From c56190725905cb0f582193e8c48bb0a273f0b8c3 Mon Sep 17 00:00:00 2001 From: Matias Fontanini Date: Fri, 25 Apr 2025 05:55:07 -0700 Subject: [PATCH 4/4] chore: bump version to 0.13.0 --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fb5c663..a093854 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -655,7 +655,7 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "presenterm" -version = "0.12.0" +version = "0.13.0" dependencies = [ "anyhow", "base64", diff --git a/Cargo.toml b/Cargo.toml index 457b61b..14d6d6a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ authors = ["Matias Fontanini"] description = "A terminal slideshow presentation tool" repository = "https://github.com/mfontanini/presenterm" license = "BSD-2-Clause" -version = "0.12.0" +version = "0.13.0" edition = "2021" [dependencies]