1
0
mirror of https://github.com/mfontanini/presenterm.git synced 2026-09-01 23:33:21 -06:00

1504 Commits

Author SHA1 Message Date
Matias Fontanini
5f8add11a2
feat: add exec support for ocaml (#895) 2026-05-22 08:43:12 -07:00
Kevin Schweikert
0bc99b4493
feat: add exec support for ocaml 2026-05-21 10:34:40 +02:00
Matias Fontanini
3326cf7be6
feat: add exec support for scala 3 (#887)
Adds support for executing Scala code snippets. Note that it works with
Scala 3, not Scala 2.

I spent some time trying to add an alternative executor for Scala 2,
doing a `scalac` to compile and a `scala` to execute. I could get it to
work if the class in the snippet was called `Snippet`, which seems like
an esoteric restriction. So I gave up on Scala 2.
2026-05-02 15:04:11 -07:00
Rob Warner
3e9802249d feat: add exec support for scala 3 2026-04-30 16:30:21 -04:00
Matias Fontanini
3bc5e91945
feat: allow passing in env file to snippet (#885)
This adds a `+env:<path>` snippet attribute that allows passing in an
env file to a snippet. This can be used both for the script itself _and_
the executor. e.g. this:

~~~markdown
```bash +exec +env:my_env
echo "$FOO"
```
~~~

With an `my_env` file in the presentation's directory with:

```
FOO=42
```

Will print "42". The env file can contain empty lines and lines starting
with "#" which will be ignored, otherwise any other lines must have a
format like `<VAR_NAME>=<VALUE>`.

Relates to #882
2026-04-25 16:04:22 -07:00
Matias Fontanini
894ce397da feat: allow passing in env file to snippet 2026-04-25 15:56:05 -07:00
Matias Fontanini
874cea8c70
feat: add mobile device support to HTML export (#875)
I noticed that if you open a HTML slide export on a mobile device, you
can't progress the slide content, because there's no tap/touch and swipe
support.

I've updated the script to do this, and also updated the export code to
not require a TTY to run, choosing some defaults targeted towards a 13"
laptop display, but that work well in landscape mode on mobile devices.

I also fixed a bug where you might get an error like this in the browser
console when trying to load the slide content from a file on disk
instead of from a web server:

```
presenterm-demo.html#slide-2:1 Unsafe attempt to load URL file:///private/tmp/presenterm-demo.html#slide-2 from frame with URL file:///private/tmp/presenterm-demo.html#slide-2. 'file:' URLs are treated as unique security origins.
```

1600x900

<img width="3200" height="1800" alt="1600_900"
src="https://github.com/user-attachments/assets/198c5a82-cdc3-4ba7-bc06-29b4232f7aa1"
/>

iPhone 12 Pro

<img width="2532" height="1170" alt="iphone_12_pro"
src="https://github.com/user-attachments/assets/94cb3b09-49d5-4a3f-941d-9934793e5d2b"
/>

Pixel 7

<img width="2402" height="1081" alt="pixel_7"
src="https://github.com/user-attachments/assets/84e9ef49-19c5-477f-aa0e-dda370b5bc31"
/>
2026-04-25 13:34:08 -07:00
Adrian Hesketh
d4c293360d
chore: revert assumptions about size 2026-04-24 21:09:46 +01:00
Matias Fontanini
da86e4d36b
docs: list all supported languages in highlighting table (#878)
## Summary
- Adds missing languages to the code highlighting table in
`docs/src/features/code/highlighting.md`: `dart`, `gdscript`, `graphql`,
`jsonnet`, `powershell`, `racket`, `rust-script`, `typst`, `verilog`,
and `wsl`. These are all already registered in `SnippetLanguage` and
recognized by the parser but were absent from the docs.
- Updates stale execution-support columns for `elixir`, `cmd`,
`typescript`, and `tsx`, which all have entries in `executors.yaml` but
were not marked as supporting execution.
- Renames the `batchfile` row to `cmd` since the parser only accepts
`bat`/`cmd`, and adds a `tsx` row alongside `typescript`.

## Test plan
- [x] `git diff` review of the updated table
- [x] Verified rendered table via GitHub's markdown preview of
`docs/src/features/code/highlighting.md` (equivalent to mdBook's
rendering for a pure-table edit)

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-04-19 20:51:58 -07:00
Trent Blackburn
cbc063088f
docs: drop rust-script row from highlighting table
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 16:44:48 -04:00
Matias Fontanini
d95bec1106
feat: respect markdown table alignments (#881)
This makes presenterm respect alignments in tables (e.g. by using
`:-----` or `:-----:` or `-----:` in markdown tables). Since now we
support alignment, the table headings are now center aligned because it
looks better. Rows are still left aligned by default which seems to be
the default.

Closes #854
2026-04-18 15:55:42 -07:00
Matias Fontanini
8fd8f534c0 feat: respect markdown table alignments 2026-04-18 15:50:58 -07:00
Matias Fontanini
29092d397d
fix: allow selective highlighting on exports if groups == 1 (#880)
This allows selective highlighting to work on exports as long as there's
a single group. e.g. using `{3}` works, but not if using `{3|5}`. This
should have been the intended behavior so I'm considering this a fix.

Fixes #874
2026-04-18 15:04:17 -07:00
Matias Fontanini
72be41942e fix: allow selective highlighting on exports if groups == 1 2026-04-18 14:55:00 -07:00
Matias Fontanini
3334f3f6b2
fix: fail export gracefully if async tasks fail (#877) 2026-04-18 14:39:50 -07:00
Matias Fontanini
1f4226c4b1
fix: don't blow up if exec is disabled and snippet_output is used (#879)
Fixes #870
2026-04-18 14:31:03 -07:00
Matias Fontanini
f034560a76 fix: don't blow up if exec is disabled and snippet_output is used 2026-04-18 14:27:23 -07:00
Trent Blackburn
ad38f0c1e7
docs: drop typst row since it is not syntax-highlighted
Typst blocks fall through to the `txt` extension in
`highlighting.rs`, so listing typst under the highlighted-languages
table is misleading. Properly highlighting typst would require a
source change and is out of scope for this docs refresh.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 16:12:15 -07:00
Trent Blackburn
c94e2036a1
docs: use parser-accepted identifier for cmd and add tsx row
Addresses review feedback on #878:
- Rename the `batchfile` row to `cmd`, since `SnippetLanguage::from_str`
  only accepts `bat`/`cmd`, not `batchfile`.
- Add a `tsx` row alongside `typescript` — `TypeScriptReact` has both a
  highlighter and an executor entry.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 15:41:31 -07:00
Trent Blackburn
701ceffad8
docs: list all supported languages in highlighting table
The highlighting docs table was missing several languages that are
already wired up in the code (dart, gdscript, graphql, jsonnet,
powershell, racket, rust-script, typst, verilog, wsl) and had stale
execution-support columns for elixir, batchfile, and typescript.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 15:23:16 -07:00
Adrian Hesketh
ed98477af8
fix: fail gracefully if async tasks fail 2026-04-15 08:59:51 +01:00
Matias Fontanini
f24b4bdcfd
docs: add more talks by @orhun (#876)
I just love presenterm!
2026-04-08 07:57:02 -07:00
Orhun Parmaksız
aef8d01890
docs: add more talks by @orhun 2026-04-08 17:33:20 +03:00
Adrian Hesketh
cb9e16eaf2
feat: add mobile device support to HTML export 2026-04-07 21:29:11 +01:00
Matias Fontanini
4744d85615
feat: update URL hash to retain slide position in HTML export (#868)
Closes #867
2026-03-24 05:34:21 -07:00
Matias Fontanini
fba135d783
feat: allow configuring mermaid cli tool (#869)
This allows configuring the mermaid tool to use since some users are
having issues with `mmdc` in the latest chrome version. I've verified
using https://github.com/coolamit/mermaid-cli/ works at least for a
couple of basic diagrams. Config is:

```yaml
mermaid:
  cli: mmd-cli
```

Closes #865
2026-03-24 05:29:52 -07:00
Matias Fontanini
1edb436b35 feat: allow configuring mermaid cli tool 2026-03-24 05:23:43 -07:00
Adrian Hesketh
b2a2306b8c
feat: update URL hash to retain slide position in HTML export, fixes #867 2026-03-17 12:08:19 +00:00
Matias Fontanini
952061abec
feat: add theme support for column layout margin (#860)
This adds support for margins in between columns for column layouts via
the `column_layout.margin` property. This uses the `fixed` and `percent`
subkeys like other margins and indicates the number of empty (terminal)
columns to add in between columns in a layout.

Closes #859
2026-03-04 18:25:35 -08:00
Matias Fontanini
0a15d502dc feat: add theme support for column layout margin 2026-03-04 18:15:27 -08:00
Matias Fontanini
f7eff2c869
feat: add incremental table support (#858)
This adds support for incremental tables just like `incremental_lists`
works: using an `incremental_tables` comment
command or a `options.incremental_tables` parameter. 

Just like incremental lists, the default is to add a pause by default
before and after the table, but this can be
configured via the `incremental_tables.pause_before` and `.pause_after`
parameters.

Closes #855
2026-03-04 18:13:43 -08:00
Matias Fontanini
b2fbe59cdf feat: add incremental table support 2026-03-03 16:29:51 -08:00
Matias Fontanini
244210bf9a
fix: add newlines in included files (#856)
Fixes #853
2026-02-28 08:23:44 -08:00
Matias Fontanini
df2cc36998 fix: add newlines in included files 2026-02-28 08:19:20 -08:00
Matias Fontanini
ef78256177
chore: prepare for 0.16.1 version (#850) v0.16.1 2026-02-19 17:49:19 -08:00
Matias Fontanini
328506576f chore: prepare for 0.16.1 version 2026-02-19 17:45:31 -08:00
Matias Fontanini
b743bf89f0
fix: render modals at the center of the screen (#848)
This is a pretty 💩 fix but it works. In the future the way
margins are handled should be changed so we can say "draw this at the
top level", providing the operations we want to run there. The current
push/pop margin strategy is not great and leads to repetition and
issues.

Fixes #844
2026-02-19 17:41:40 -08:00
Matias Fontanini
5fb55687ff fix: render modals at the center of the screen 2026-02-18 16:44:46 -08:00
Matias Fontanini
21d583ece0
feat: allow italic to be used as well as italics in theme (#847)
This allows any place where `italics` was used in the theme to also be
`italic`.
2026-02-18 10:40:30 -08:00
Matias Fontanini
2ea3f0d513 feat: allow italic to be used as well as italics in theme 2026-02-18 09:43:14 -08:00
Matias Fontanini
22a386a54d
docs: describe slide titles and headings better (#846) 2026-02-18 09:33:47 -08:00
Matias Fontanini
dc31f7997d docs: describe slide titles and headings better 2026-02-18 09:33:08 -08:00
Matias Fontanini
82fdf577cb
Add styling docs to slide_title (#845)
Out of interest, I tried to style the title, and it worked! I've updated
the docs to reflect this.

Interestingly, I couldn't get `italic: true` to work, though bold and
underline were fine.
2026-02-17 15:52:42 -08:00
Tristram Oaten
33e889b51b
Add styling docs to slide_title
Out of interest, I tried to style the title, and it worked! I've updated the docs to reflect this.

Interestingly, I couldn't get `italic: true` to work, though bold and underline were fine.
2026-02-16 11:47:13 +00:00
Matias Fontanini
2fa6878663
docs: readme->caveman-- 2026-02-15 18:35:14 -08:00
Matias Fontanini
e0348c5b36
chore: prepare for 0.16.0 release (#843) v0.16.0 2026-02-15 15:59:48 -08:00
Matias Fontanini
7a00f8cadf chore: prepare for 0.16.0 release 2026-02-15 15:55:32 -08:00
Matias Fontanini
14a6d02c4b
chore!: rename puppeteer config parameter (#842)
This renames the parameter introduced in #830 since it had a typo.
Before `pupeteer_config_path`, now `puppeteer_config_path`.
2026-02-15 13:25:09 -08:00
Matias Fontanini
81197ec28a chore!: rename puppeteer config parameter 2026-02-15 13:12:51 -08:00
Matias Fontanini
31f939f424
feat: add support for user comments in presentation rendering (#773)
I've found the function `should_ignore_comment` and have been relying on
it to add user comments inside presentations by abusing the `<!-- vim:
comment here -->` since I don't use vim for this anyways.

This isn't clean and a dedicated way to comment should be added IMO.
Also, there is an issue with the hacky vim solution above, it adds a
newline where the comment should be ignored; fixed by using
`self.slide_state.ignore_element_line_break = true` on ignored comments.

Current comments:
<img width="770" height="465" alt="image"
src="https://github.com/user-attachments/assets/f0a3aa41-1b90-463f-917b-416731b8a207"
/>


PR with ignore line breaks:
<img width="751" height="414" alt="image"
src="https://github.com/user-attachments/assets/f242463e-51f2-45f1-a5a1-69b014175d41"
/>
2026-02-07 14:02:53 -08:00