-
Notifications
You must be signed in to change notification settings - Fork 188
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
resolves #326 add grid layout #332
resolves #326 add grid layout #332
Conversation
@obilodeau I will fix the doctests but first I want to make sure that you are OK with the changes. |
I'm going to have to give this a serious try before I can conclude. With existing decks where I wish I had that. Try adding vertical slides to your example too, just to validate: == Languages
We will go over languages
=== Java
// TODO code snippet on the left, bullets saying why it's awesome on the right
=== Kotlin
// TODO code snippet on the left, bullets saying why it's awesome on the right |
I'm still testing decks with it |
examples/grid-layout.adoc
Outdated
[.column] | ||
-- | ||
* Lisp-like | ||
* Not sure why people like it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you trolling Clojure? 😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, you should probably change that. I didn't know what to say about Clojure and I wanted two bullets. I haven't done Java or any JVM-language for 10+ years.
Did you fix it?
Let me know if it looks fine, I will update the doctests to add the wrapping |
Yes I did in 275e91e. Sorry if it wasn't clear. |
Nice catch! |
After some messing around, it is clear that it is the
Note:
From past observation, I would say that it injects maximum width and height in pixels directly in the It is applied by default to videos because who would want a small video box in a slide. |
We should probably recreate this feature using CSS or workaround the "only direct descendant" limitation. |
Using flexbox "everywhere" could add more flexibility but it does require a few changes and probably a few breaking changes since stretch/grow need to be on the parent (if we want to use CSS and not JavaScript). Anyway, I will try to fix this issue with the least amount of work. We can then decide if we want to switch to flexbox/grid or stick with the absolute/center positioning. |
stretch element sizing is done in the layoutSlideContents function which is called in the But |
I'm surprised that this problem exists. I mean no one ever used two-columns layouts in reveal.js!? Can it be done as a plugin instead of monkey-patching? That would work as well. |
It can definitely be done without using a wrapping
Maybe. |
I'm not sure about going without it... While we are here shouldn't we get this right? Besides the Regarding the stretch issue, we control everything. Isn't there a way to maximize a single flex div? We put the stretch attribute on videos and we can even intercept the attribute and do something else. Even bolder, couldn't we add an |
Let me try to summarize. Let's take an example: Simplified HTML <body>
<div class="reveal slide">
<div class="slides" style="width: 960px; height: 700px; scale(1);">
<section> <!-- height:100% = 700px + 40px (padding) = OK -->
<h2>Stretched Callout</h2>
<div class="slide-content"> <!-- height:100% = 700px = KO -->
<div class="listingblock stretch"> <!-- height:100% = 700px = KO -->
</div>
<div class="colist arabic">
</div>
</div>
</section>
</div>
</div>
</body> Here, the element "slide-content" has a 100% height of 700px but it's wrong because it ignores the
Yes we can.
The main issue is that we need to use One limitation with this solution is that the listingblock has no maximum height anymore. So if the content is higher than the remaining height available it won't show a scrollbar but exceed the slide height: In this case, I think using JavaScript to set a |
Does it negatively affects?
I wonder why the |
Not sure but since we need JavaScript to compute the max height, I will try to workaround this limitation "Only direct descendants of a slide section can be stretched".
I believe that @mojavelinux added it to configure a flex display. The |
/me did a Oh my god, wow! This change really was introduced by @mojavelinux. Probably before he started using bespoke 😮 I didn't know. |
It's fairly easy to remove the limitation so my guess is that the decision was made for performance reasons. I'm asking upstream about a possible solution. |
3e2e9c8
to
7c7cb0d
Compare
Can you please give it a try @obilodeau? |
I'll try later tonight. Thanks! |
VideoOn the first load of the converted There's an empty space at the top. On other videos this pushes the video slightly out of the screen. I will add a test case in this deck where this is worse. Using the embedded reveal.js video player. If I manually resize the browser by dragging around the window then replacing it full screen the glitch is gone: I was able to confirm the same glitch on a stretched image in a private slide deck. Speaker NotesWere ok With Overview modeWorks fine MiscI noticed that YouTube embeds didn't autoplay but I had the same problem with master so we can ignore for the sake of this PR. ResultsBesides the above glitches, I tested several decks and they were fine! 👍 |
I thought it was unnecessary to resize the stretch elements when the slide changed but I guess I was wrong... |
Great! When testing, I thought I found a problem with PDF rendering on a large slide deck, so I attempted to make a simpler case where it is reproduced. However, in my simpler case, I couldn't reproduce. However, I found the problem. It boils down to the theme that I made. I still use this CSS from another theme: /* Ensure certain elements are never larger than the slide itself */
.reveal img,
.reveal video,
.reveal iframe {
max-width: 95%;
max-height: 95%;
} But if I maximize the height of an image (with To me this seems to be a 👍. How do you feel about this PR @Mogztter? |
It sounds like a limitation of the original
Should I rebase on master?
I'm not 100% satisfied because we still need to use JavaScript but I think it's the best we can do for now. In my opinion, the column definition is quite simple and will probably be enough in the majority of cases. So I think we should go for it! |
d97354d
to
3772787
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add doctest and this is good to go!
You can document the feature in the README if you are willing but if you don't I'll do it.
Thanks by the way! This is something I wanted for a while and I wasn't sure how to tackle it in a flexible manner. Pun intended. A very nice piece of work. Hopefully, upstream will be kind to us and we will be able to remove that JavaScript patch. |
Should I remove the
I found a few issues while updating doctests 😉
Ok!
😊
Yep, that would be nice 👍 |
Yes, replace it with this new stuff and drop its |
3772787
to
2474dc2
Compare
661ab0d
to
d56f553
Compare
d56f553
to
b99fc87
Compare
Let's go 🚀 🚀 🚀 |
resolves #326