-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: custom renderers #52
Comments
I would still like to have something like this but I haven't yet decided on a clean format. One design decision to make is if we want to support a long-running process (like the https://github.com/gibiansky/IHaskell kernel) or if we just evaluate the command before displaying the slide and assume it exits. |
+1 on the idea. I would love for Patat to support AsciiArt, or some sort of UTF-8 graphics. |
I support this because I had to inline my ascii schematics inside a block for it to render properly |
I'd like to pick this up now. I am leaning towards a design where an evaluator is set at the top level, e.g.:
Whenever a code block is highlighted as
This means that this presentation:
Is equivalent to the following presentation:
Some questions / concerns around the design:
|
Fragments deal with how content is shown piece by piece. For example, if we have the slide: Foo . . . Bar There are two fragments. First, only `Foo` is visible. When the user goes to the next fragment, `Foo` and `Bar` are both visible. The first implementation of fragments in patat would compute the state of all the visible items. In this case, that would be: 1. `[Foo]` 2. `[Foo, Bar]` This does not work elegantly if you want another pass to add further fragments: you now need to split `Foo` in multiple places (and the thunk is no longer shared). This PR refactors this to use "instructions" over the slide content. For the example, these instructions would be: 1. `Append [Foo]` 2. `Pause` 3. `Append [Bar]` The `Pause`s are explicit, and indicate how many fragments are present. There are more constructors, for manipulation of lists which is necessary if nested lists are shown incrementally. This all for allows much nicer manipulation of the fragments, which in turn is useful for #52.
Fragments deal with how content is shown piece by piece. For example, if we have the slide: Foo . . . Bar There are two fragments. First, only `Foo` is visible. When the user goes to the next fragment, `Foo` and `Bar` are both visible. The first implementation of fragments in patat would compute the state of all the visible items. In this case, that would be: 1. `[Foo]` 2. `[Foo, Bar]` This does not work elegantly if you want another pass to add further fragments: you now need to split `Foo` in multiple places (and the thunk is no longer shared). This PR refactors this to use "instructions" over the slide content. For the example, these instructions would be: 1. `Append [Foo]` 2. `Pause` 3. `Append [Bar]` The `Pause`s are explicit, and indicate how many fragments are present. There are more constructors, for manipulation of lists which is necessary if nested lists are shown incrementally. This all for allows much nicer manipulation of the fragments, which in turn is useful for #52.
It's kind of a crazy idea, but after thinking for a while about how to manage this in the settings, I think I got a simple solution in the end.
It's a bit long to explain so I'll let the images do the talking:
What do you think? It would make it much easier for including diagrams. The alternative, inlining all diagrams and ASCII art, would take a lot of space in the markdown file, and make it harder to maintain: lots compiling, copy-pasting, and escaping special characters.
Here's in text format the config format I showed in the screenshots above:
(Instead of regexes, it could be just lists of strings containing the relevant extensions)
Edit: something I forgot! When using the markdown image syntax (or HTML), the text/alt part could be rendered underneath the rendered image like so:
The text was updated successfully, but these errors were encountered: