Commit graph

8 commits

Author SHA1 Message Date
Barrett Ruth
535d4cfd5e
docs: add FAQ entry for redirecting markdown output to /tmp (#56)
Problem: the `markdown` and `github` presets write `.html` output to the
working directory, which clutters the project.

Solution: add a FAQ entry to both `README.md` and `doc/preview.txt`
showing how to override the `output` field to redirect to `/tmp`.
2026-03-11 15:43:13 -04:00
Barrett Ruth
39406c559c
feat: compile notifications and long-running provider feedback (#55)
* feat(compiler): add compile start/complete notifications

Problem: No user-facing feedback when compilation starts or finishes.
Long-running compilers like pandoc with `--embed-resources` leave the
user staring at nothing for 15+ seconds.

Solution: Notify "compiling..." at compile start and "compilation
complete" on success. The initial `toggle` call uses a combined
"compiling with <name>..." message to avoid stacking two notifications.

* refactor(presets): use `--katex` instead of `--embed-resources --mathml`

Problem: `--embed-resources` with `--mathml` caused pandoc to inline all
assets at compile time, adding ~15s per save for KaTeX-heavy documents.

Solution: Default to `--katex`, which inserts a CDN `<script>` tag and
defers rendering to the browser. Users can opt into `--embed-resources`
or `--mathml` via `extra_args`.

* docs(presets): rewrite math rendering section for `--katex` default

* refactor(compiler): simplify notification flow, add failure notify

Problem: `compile()` used an `opts.silent` escape hatch so `toggle()`
could suppress duplicate notifications. Compilation failures had no
user-facing notification.

Solution: Remove `opts.silent` — `compile()` unconditionally notifies
on start, success, and failure. `toggle()` no longer emits its own
message.

* feat(compiler): add per-recompile notifications for long-running providers

Problem: long-running providers like `typst watch` had no per-recompile
feedback — the process stays alive and individual success/failure was
never reported.

Solution: add a persistent `output_watcher` fs_event that fires
"compilation complete" on every output mtime bump, and track
`has_errors` on `BufState` so stderr diagnostics trigger a one-shot
"compilation failed" notification. `diagnostic.set()` now returns the
diagnostic count to support this flow.

* ci: format

* chore: remove testing files
2026-03-06 14:58:10 -05:00
Barrett Ruth
aeea1bd8fa
doc: improve preview-math section phrasing (#54)
* fix(presets): add `--mathml` to `markdown` and `github` pandoc args

Problem: pandoc's default HTML math renderer cannot handle most TeX and
dumps raw LaTeX source into the output. `--mathjax` and `--katex` are
incompatible with `--embed-resources` because pandoc cannot inline
dynamically-loaded JavaScript modules and fonts.

Solution: add `--mathml` to both `markdown` and `github` preset args.
MathML is rendered natively by all modern browsers with no external
dependencies, making it the only math option compatible with
self-contained HTML output.

* docs(presets): add math rendering section with KaTeX recipe

Problem: the `markdown` and `github` presets now default to `--mathml`
but users may want KaTeX or MathJax rendering instead, and the
incompatibility with `--embed-resources` is non-obvious.

Solution: add a `preview-math` section to the presets docs explaining
the default, why `--katex`/`--mathjax` require dropping
`--embed-resources`, and a concrete recipe for KaTeX with `github`.

* test(presets): update `markdown` and `github` args assertions for `--mathml`

* doc: cleanup

* chore: remove debug files
2026-03-06 13:49:15 -05:00
Barrett Ruth
36e49cbd41
fix(presets): add --mathml to pandoc markdown args (#53)
* fix(presets): add `--mathml` to `markdown` and `github` pandoc args

Problem: pandoc's default HTML math renderer cannot handle most TeX and
dumps raw LaTeX source into the output. `--mathjax` and `--katex` are
incompatible with `--embed-resources` because pandoc cannot inline
dynamically-loaded JavaScript modules and fonts.

Solution: add `--mathml` to both `markdown` and `github` preset args.
MathML is rendered natively by all modern browsers with no external
dependencies, making it the only math option compatible with
self-contained HTML output.

* docs(presets): add math rendering section with KaTeX recipe

Problem: the `markdown` and `github` presets now default to `--mathml`
but users may want KaTeX or MathJax rendering instead, and the
incompatibility with `--embed-resources` is non-obvious.

Solution: add a `preview-math` section to the presets docs explaining
the default, why `--katex`/`--mathjax` require dropping
`--embed-resources`, and a concrete recipe for KaTeX with `github`.

* test(presets): update `markdown` and `github` args assertions for `--mathml`
2026-03-06 13:39:22 -05:00
Barrett Ruth
d102c9525b
docs: add SyncTeX section with viewer recipes (#50)
* docs: add SyncTeX section with viewer recipes

Problem: SyncTeX setup for forward/inverse search was undocumented,
forcing users to figure out viewer-specific CLI flags on their own.

Solution: Add `preview-synctex` vimdoc section with shared setup and
per-viewer recipes for Zathura, Sioyek, and Okular. Add FAQ entry
in README pointing to the new section.

* build: add `zathura` and `sioyek` to nix dev shell

* docs: fix Okular inverse search instructions

Problem: Okular settings path was incomplete and didn't mention the
trigger keybinding.

Solution: Update to full path (Settings -> Configure Okular -> Editor)
and note that Shift+click triggers inverse search.
2026-03-05 22:39:26 -05:00
Barrett Ruth
12cb20d154
feat: add extra_args provider field (#51)
* feat: add `extra_args` provider field

Problem: Overriding a single flag (e.g. `-outdir=build`) required
redefining the entire `args` function, duplicating all preset defaults.

Solution: Add `extra_args` field that appends to the resolved `args`
after evaluation. Accepts a static table or a context function.

* docs: document `extra_args` provider field
2026-03-05 22:26:28 -05:00
Barrett Ruth
9fe68dd159
docs: document plantuml and mermaid presets (#47)
Problem: the README and vimdoc presets list omitted `plantuml` and
`mermaid` after both were added.

Solution: add both presets to the vimdoc table and the README features
blurb.
2026-03-05 11:03:43 -05:00
Barrett Ruth
837c97cd09
docs: rewrite vimdoc to match pending.txt conventions (#44)
Problem: The vimdoc used `preview.nvim.txt` filename and
`*preview.nvim-xyz*` tags, inconsistent with other plugins.

Solution: Rename to `preview.txt`, normalize tags to `*preview-xyz*`,
add contents/install sections, and use `{field} (type)` formatting.
2026-03-05 01:38:29 -05:00