Skip to content
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

Update 0.2 #11

Merged
merged 31 commits into from
Sep 27, 2022
Merged

Update 0.2 #11

merged 31 commits into from
Sep 27, 2022

Conversation

HugoGranstrom
Copy link
Owner

@HugoGranstrom HugoGranstrom commented Sep 13, 2022

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

Changes:

  • useScrollWheel
  • fragmentThen
  • fragmentNext
  • align template
  • Update to nimib 0.3.1
    • nbJs...
    • nbRawHtml
  • fragmentList API
  • slideOptions
  • columns
  • footer
  • image in the corner (absolute position)

@HugoGranstrom
Copy link
Owner Author

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

@pietroppeter
Copy link
Contributor

pietroppeter commented Sep 22, 2022

  • Do we have a two columns format?
  • And a way to add something in the corner (selecting which corner)? We could put the QR code links for the slides there

@HugoGranstrom
Copy link
Owner Author

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
Copy link
Contributor

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

@HugoGranstrom
Copy link
Owner Author

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
Copy link
Contributor

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
Copy link
Owner Author

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 😎 It almost feels wasteful though, the way I define column as simply a div 🤣

template column(bodyInner: untyped) =
  nbRawHtml: "<div>"
  bodyInner
  nbRawHtml: "</div>"

@HugoGranstrom
Copy link
Owner Author

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

@HugoGranstrom
Copy link
Owner Author

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
Copy link
Contributor

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

@HugoGranstrom
Copy link
Owner Author

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
Copy link
Contributor

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
Copy link
Owner Author

pietroppeter/nimib#28 (comment)

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
Copy link
Contributor

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
Copy link
Contributor

pietroppeter commented Sep 24, 2022

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

@pietroppeter
Copy link
Contributor

found a bug when using columns twice, see: pietroppeter/nimconf22-nimib@37f6b10

@HugoGranstrom
Copy link
Owner Author

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
Copy link
Owner Author

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
Copy link
Owner Author

it should be fixed now

@HugoGranstrom
Copy link
Owner Author

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

@pietroppeter
Copy link
Contributor

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
Copy link
Owner Author

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

@pietroppeter
Copy link
Contributor

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
Copy link
Owner Author

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
Copy link
Owner Author

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
Copy link
Contributor

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

@HugoGranstrom HugoGranstrom merged commit 03fdbad into main Sep 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants