datalorax/slidex

Possible edge case wonkiness

Closed this issue ยท 10 comments

pkq commented

As promised, here is a stripped down version of the file I tried slidex on, along with the issues I encountered. Happy to split these into separate issues, if that's easier.

  1. The first slide has a multi-line subtitle. slidex tries to concatenate these together, which results in an error when knitting, presumably because the YAML title is no longer formatted correctly, and has to be fixed before the html can be generated: Error in yaml::yaml.load(string, ...) : Parser error: while parsing a block mapping at line 1, column 1 did not find expected key at line 1, column 39
  2. The footer (in slide 2) gets parsed as a standard bullet
  3. There should be four bullets on the 3rd slide, but none of them are getting parsed
  4. The fourth slide originally had a centered content box and an icon in the lower right corner, which I would have expected to show up as two column content, but instead, both columns have the icon (as two separate images).

Thanks for taking a look!

slidex_edge_cases.pptx

Dude! These are all SO helpful! Thank you! I just tried rendering them and got exactly as you described. Immediately, I can only diagnose one of the issues (the first one which should be an easy fix).

Not sure I'll be able to address number 2.
I think I know what's going on in 3 but have to do more investigation.
I've no idea why 4 is happening.

Will get back to you. Thanks again!

pkq commented

Glad to hear it, and glad (at least for my sanity) that you're able to reproduce them. Let me know if there's any other information etc. that would be helpful to track down the others.

2 is pretty easy to fix after the fact, so not a huge deal. The other two seem more problematic, as content is actually getting lost somewhere along the way. The third one in particular looks like a perfectly normal title and content slide. Maybe it has something to do with the formatting?

Take a look now. Should be all fixed. The only thing that's not perfect is that the text for Slide 2 is getting bullet attached to it. This is an issue I've been struggling with for a bit and am not sure how to fix it at the moment, but I'll dig into it more later. Fairly minor annoyance overall though.

Also, the picture on the final slide is way too big, but I don't really have any way of automating the size of pics. Could be done after the conversion easy enough though,.

Closing this for now. But let me know if something doesn't end up working for you. Thanks again! Really, really helpful.

pkq commented

Thank you, I'm honestly blown away by this! This looks great. Do you think it's possible to control whether the bullet is included? That'd be neat, but as you said, it's a really minor detail, as is the image size.

Out of curiosity, what was preventing the body of the third slide from getting written to the Rmd? I tried looking at the code, but couldn't figure it out.

Thanks! I really need to refactor the code in extract_body and then it might be possible, but probably not until then. The problem with the third slide was basically that I was pulling the classes of the text boxes wrong (e.g., title versus whatever else). It was kind of funny because I made that fix to address the messed up title in the YAML and that fixed Slide 3 too! So yeah, the code to fix it was definitely not obvious.

I appreciate you putting a footnote in there too! I don't think I've used footnotes in Powerpoint before but that was a really easy one to address once I dug into the xml.

pkq commented

That's funny! You're welcome. I don't typically use footnotes either, but that presentation happened to be based off a slide deck that had one, so ๐Ÿ‘ . Glad it was an easy fix.

Following up on this - I've dug into the xml a lot more and I think I can mostly address bullets appearing/not appearing when they should. But the slide here with 4 bullets is going to go back to not producing them. I cannot for the life of me see the bullets in the xml code, and I've dug a lot at this point.

It appears the content from this slide was produced outside the normal "Content Placeholder" and is instead inside "Rectangle 3". Text boxes like that should generally, I think, not start with bullets, because that's not the default. If there are bullets in them, it should pick them up. For some reason in this particular case it's not and it has me completely stumped at the moment.

I have an experimental branch up that I think will overall improve bullets, but for this particular use-case it makes it worse. Essentially, anything that's in a "Content" box defaults to bullets (same as PowerPoint) and every other box defaults to not having them.

You would think this wouldn't be a big deal, but unfortunately, unless the bullets are nested (where you can then see the levels very clearly) the bullets are completely hidden (to me anyway) in the xml code.

If you want, I'd love for you to try out the new branch and see what you think. If it's mostly successful, I'll merge it with the master branch.

pkq commented

Thanks for continuing to poke at this. Separate defaults for "content" and "shape" boxes makes sense and seems like a good default that is consistent with the most common uses of each. I think the biggest thing is making sure all content always gets imported (which it seems to at this point).

For slides without bullets, one possible improvement/adjustment could be to insert another return between unbulleted lines, so they each get their own line and don't all run together (which is what happens now on slide 3 using the newbullets branch).

Also, it's probably a good idea to document somewhere the different default behavior for "content" and "shape" boxes, but I'm not sure where the best place to put that is.

I like the idea of documenting the behavior more clearly. I want to test it out a bit more but I'm thinking I may merge with master soon.