lmparppei / Beat

Beat - a simple and elegant screenwriting app for macOS
Other
169 stars 29 forks source link

Suggestion to allow notes to print with script #93

Closed ftolsson closed 11 months ago

ftolsson commented 2 years ago

I know you hate settings, but IMO it is often valuable to print notes with scripts in certain situations. Here's my suggestion how to implement that with hopefully the least effort possible:

(As a side note, a similar scheme for synopsis would not be entirely bad either. :)

Here's hoping you agree!

lmparppei commented 2 years ago

There are multiple caveats to this, which would require a lot of discussion. I'll look into this, but I'm pretty sure this is not possible without major changes to both the parser and paginator.

ftolsson commented 2 years ago

Okidoke. I was just so thrilled at the thought that one could let the CSS make most of the heavy lifting. But I'm well aware that the paginator and parser are two quite mysterious creatures that I'm only able to make guesses about...

(Also: should I be less enthusiastic about CSS? Are you still deliberately moving away from CSS as I know you've mentioned, or was that just a result of the previous, less tamed styling that you inherited...?)

lmparppei commented 2 years ago

Okidoke. I was just so thrilled at the thought that one could let the CSS make most of the heavy lifting. But I'm well aware that the paginator and parser are two quite mysterious creatures that I'm only able to make guesses about...

Parser preprocesses lines for printing and pagination, which means removing everything that's invisible (including empty lines). It might be enough to pass the lines to paginator and handle them as actions.

(Also: should I be less enthusiastic about CSS? Are you still deliberately moving away from CSS as I know you've mentioned, or was that just a result of the previous, less tamed styling that you inherited...?)

If I'm able to use this code snippet to reliably print out WKWebView content to PDF, CSS will still be relevant. I really do hope so.

lmparppei commented 2 years ago

In 1.92.9 there is now an internal option to print out notes. Unfortunately, it's only notes, and not synopsis markers or sections, because allowing them would required a lot of work and code rewrites and redesign. There is no UI for this yet, but I'll add it when it's thoroughly tested.

On HTML level, notes are wrapped in <span class='note'>[[note]]</span>, so styling them should be quite easy.

lmparppei commented 11 months ago

Finally we're seeing some advancement regarding this. The new pagination and rendering system made stuff a bit more complicated, and I'm still struggling to find an elegant solution, but currently, section headings and synopsis markers can be printed out pretty reliably. I think # and = should be spared in front of them, though.

Next stop is notes, but it's a tad more complicated, because I've built the system completely around stripping away any invisible text.

image
lmparppei commented 11 months ago

And notes are now supported as well.

image
lmparppei commented 11 months ago

Implemented in 1.99.69 1541c01

image