HugoGranstrom / nimiSlides

A Reveal.js theme for nimib for making slideshow presentations in Nim
https://hugogranstrom.com/nimiSlides
MIT License
80 stars 6 forks source link

Update 0.2 #11

Closed HugoGranstrom closed 2 years ago

HugoGranstrom commented 2 years ago

Here all changes for the v0.2 update will be added. It is planned to be released before NimConf 2022 (22 Oct).

Changes:

HugoGranstrom commented 2 years ago

@pietroppeter any features you are missing in nimiSlides that you would like in your NimConf slides?

pietroppeter commented 2 years ago
HugoGranstrom commented 2 years ago

Do we have a two columns format?

I'll try and hack together something with CSS Grid tomorrow.

And a way to add something in the corner (selecting which corner)? We could put the we links for the slides there

Oh, had forgotten about #7 :o I'll look into it again.

pietroppeter commented 2 years ago

Quarto has a section on multiple columns, not sure how they do it: https://quarto.org/docs/presentations/revealjs/

HugoGranstrom commented 2 years ago

Quarto has a section on multiple columns, not sure how they do it:

I had a similar idea in mind, the only difference right now is that you can't decide how wide each column is, they are equally wide:

slide:
  columns:
    column:
      nbText: "This is column left"
    column:
      nbText: "This is column right"
pietroppeter commented 2 years ago

I would guess equal width columns will likely be the most common use case, we probably we can start supporting just that.

Implementation looks very clean!

HugoGranstrom commented 2 years ago

I would guess equal width columns will likely be the most common use case, we probably we can start supporting just that.

Yeah, it's easy enough to fix in the future if someone requests it I guess.

Implementation looks very clean!

Yep, the beauty of nimib :sunglasses: It almost feels wasteful though, the way I define column as simply a div :rofl:

template column(bodyInner: untyped) =
  nbRawHtml: "<div>"
  bodyInner
  nbRawHtml: "</div>"
HugoGranstrom commented 2 years ago

I have got a footer working now, only problem is that it is shown on top of literally every slide including videos :rofl:

HugoGranstrom commented 2 years ago

The footer is now implemented, and it automatically hides when the background is set to some full-screen content. Unless you come with any other ideas, I will probably release a new version on Sunday.

pietroppeter commented 2 years ago

nice. I was looking at the footer where the string should be html. why not markdown (which in particular includes html)?

HugoGranstrom commented 2 years ago

No reason in particular I realize now 😅 the footer can't be implemented as a block so somehow I thought I couldn't use markdown then 🙃 but I could just run the nim-markdown on the text directly. I might add an option so you can pass in raw Html as well, if I recall correctly, the markdown library we use didn't support every html tag in the past

pietroppeter commented 2 years ago

Yes, you can use markdown directly (remember to use the GitHub version to see how we do it in nimib in renders.nim).

As far as I know markdown should support all html tags, I think it is kind of part of the spec.

What it does not support is if you put markdown inside html and expect to have your markdown transformed. There might be some cases where it works, but mostly I would expect it to not work.

HugoGranstrom commented 2 years ago

https://github.com/pietroppeter/nimib/issues/28#issuecomment-991797352

Found what was troubling me back then. It didn't handle <span> tags correctly. So it is either a bug or limitation in nim-markdown.

pietroppeter commented 2 years ago

Well, to be fair in that example it cannot parse </span> by itself correctly (which is indeed incorrect html by itself), if it had the opening span I would assume the closing one would be parsed correctly. It might still be a limitation of nim-markdown and other parsers might behave differently but I do not really see it as a limitation for footer handling only markdown (unlikely it will receive a fragment of invalid html).

pietroppeter commented 2 years ago

It is indeed weird though that span fails but div does not

pietroppeter commented 2 years ago

found a bug when using columns twice, see: https://github.com/pietroppeter/nimconf22-nimib/commit/37f6b10e4b16e287c19f245101009b68c7265a8b

HugoGranstrom commented 2 years ago

found a bug when using columns twice, see:

Good catch, I always forget that templates in templates aren't just available inside the code block 😅 should work if we just move it outside the columns template

And regarding the markdown html, I think I'll leave it as an option as it is now. So by default it treats it as markdown, but if the user had any similar problems, they can use the option to use raw html.

HugoGranstrom commented 2 years ago

On a different note, I find the footer quite distracting. 😅 I might turn down the text size and opacity a bit (and I might as well add those as options to the template as well then)

HugoGranstrom commented 2 years ago

it should be fixed now

HugoGranstrom commented 2 years ago

@pietroppeter if I understood you correctly, it was what Quarto calls a "Logo" that you wanted as well?

pietroppeter commented 2 years ago

Not really, a logo appears in all slides, I wanted a way to add something in one corner (like the logo, but I should be able to fix the corner) for a single slide

HugoGranstrom commented 2 years ago

Ok, then I get it :+1: Do we want to use it only for images or allow text as well?

pietroppeter commented 2 years ago

I guess it could be implemented using a div or similar that contains stuff, so in principle it could contain generic nimib blocks... the use case I had in mind though is about the QR code link to slides, so: image gets priority

HugoGranstrom commented 2 years ago

My main concern with allowing anything is size. We want to limit the content in the corner's size, and if we allow anything in there, that will be very hard to do. If we only allow images for now, we could have the size of the image as a parameter to the template as well. So I think I'll go with image-only for now (and will name it something with image to be clear). And then in the future we could perhaps add a template which allows anything in the corners

HugoGranstrom commented 2 years ago

cornerImage is now implemented. I think this will be it for this release. Unless someone finds anything urgent to add/fix, I will make a release this evening.

pietroppeter commented 2 years ago

the only thing that came up to me that is simple enough is adding a template animateCode*(highlightLines: string, body: untyped), see #12