MartinPacker / md2pptx

Markdown To PowerPoint converter
MIT License
206 stars 31 forks source link

Python 3.10 issue (Collections), CairoSVG Issue, DeleteFirstSlide directive #112

Closed McQuitty-Broadcom closed 2 years ago

McQuitty-Broadcom commented 2 years ago

Martin,

In python 3.10, we have to import the collections prior to importing Presentation.

This address that.

Also, there's a bug introduced in this version. I moved the import cairo helpers into the try block. Mine was failing.

I also added a new "deletefirstslide" global directive. If the directive is set, it will delete the first slide. It's in a try block, as the helper fails if it is not set. If it fails, the except block just passes the normal save operation.

MartinPacker commented 2 years ago

Thanks for this!

2 questions:

  1. How do you get over python-pptx having a problem with 3.10?
  2. How do you do the actual delete of the first slide?

I'm finishing something up that I hope will enable the merge.

MartinPacker commented 2 years ago

I've merged and pulled down onto my machine. I can't test 3.10 support yet.

But I will test deletefirstslide first.

Then I'll need to update the docs.

Please don't change the code until I push the code again or else signal you can. Thanks!

McQuitty-Broadcom commented 2 years ago

Not sure why the collections issue is there with python-pptx. But say this as a solution. It shouldn't affect other versions.

As for deleting the first slide, there's two parts. A directive at the top. SectionSlideLayout: 4 TitleOnlyLayout: 17 BlankLayout: 11 ContentSlideLayout: 11 DeleteFirstSlide: true

If that's there, there's a section of code that loops through to delete the slide. It uses the del function on the slide. Now that I think about it, it might impact your slide numbering. I don't use that feature, so I didn't think of it until now. If that's the case, the slide counting might need to be adjusted.

On Fri, Mar 18, 2022 at 12:20 PM Martin Packer @.***> wrote:

Merged #112 https://github.com/MartinPacker/md2pptx/pull/112 into master.

— Reply to this email directly, view it on GitHub https://github.com/MartinPacker/md2pptx/pull/112#event-6267684954, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANYYFHNHXKMMRRCG6MQE4GDVAS3ORANCNFSM5RCM6KWA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

--

Thomas McQuitty

Technical Consulting, Mainframe

Broadcom Software

Office: 972-302-3360

@.***

Twitter https://twitter.com/BroadcomSW | LinkedIn https://www.linkedin.com/company/broadcomsoftware

https://broadcom.com

-- This electronic communication and the information and any files transmitted with it, or attached to it, are confidential and are intended solely for the use of the individual or entity to whom it is addressed and may contain information that is confidential, legally privileged, protected by privacy laws, or otherwise restricted from disclosure to anyone else. If you are not the intended recipient or the person responsible for delivering the e-mail to the intended recipient, you are hereby notified that any use, copying, distributing, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited. If you received this e-mail in error, please return the e-mail to the sender, delete it from your computer, and destroy any printed copy of it.

McQuitty-Broadcom commented 2 years ago

Ok, no worries. I had some free time so I pushed that in. But I'll wait for any other changes.

On Fri, Mar 18, 2022 at 12:23 PM Martin Packer @.***> wrote:

I've merged and pulled down onto my machine. I can't test 3.10 support yet.

But I will test deletefirstslide first.

Then I'll need to update the docs.

Please don't change the code until I push the code again or else signal you can. Thanks!

— Reply to this email directly, view it on GitHub https://github.com/MartinPacker/md2pptx/pull/112#issuecomment-1072625624, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANYYFHPJEFKZUVMK7I3ER7LVAS3YLANCNFSM5RCM6KWA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

--

Thomas McQuitty

Technical Consulting, Mainframe

Broadcom Software

Office: 972-302-3360

@.***

Twitter https://twitter.com/BroadcomSW | LinkedIn https://www.linkedin.com/company/broadcomsoftware

https://broadcom.com

-- This electronic communication and the information and any files transmitted with it, or attached to it, are confidential and are intended solely for the use of the individual or entity to whom it is addressed and may contain information that is confidential, legally privileged, protected by privacy laws, or otherwise restricted from disclosure to anyone else. If you are not the intended recipient or the person responsible for delivering the e-mail to the intended recipient, you are hereby notified that any use, copying, distributing, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited. If you received this e-mail in error, please return the e-mail to the sender, delete it from your computer, and destroy any printed copy of it.

chipset commented 2 years ago

Here's the link from pptx: https://github.com/scanny/python-pptx/issues/762#issuecomment-964830416

As for my simple remove, I also found it in the comments. https://github.com/scanny/python-pptx/issues/67#issuecomment-991139717

On Fri, Mar 18, 2022 at 12:27 PM Thomas McQuitty @.***> wrote:

Ok, no worries. I had some free time so I pushed that in. But I'll wait for any other changes.

On Fri, Mar 18, 2022 at 12:23 PM Martin Packer @.***> wrote:

I've merged and pulled down onto my machine. I can't test 3.10 support yet.

But I will test deletefirstslide first.

Then I'll need to update the docs.

Please don't change the code until I push the code again or else signal you can. Thanks!

— Reply to this email directly, view it on GitHub < https://github.com/MartinPacker/md2pptx/pull/112#issuecomment-1072625624>, or unsubscribe < https://github.com/notifications/unsubscribe-auth/ANYYFHPJEFKZUVMK7I3ER7LVAS3YLANCNFSM5RCM6KWA

. Triage notifications on the go with GitHub Mobile for iOS < https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675

or Android < https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub .

You are receiving this because you authored the thread.Message ID: @.***>

--

Thomas McQuitty

Technical Consulting, Mainframe

Broadcom Software

Office: 972-302-3360

@.***

Twitter https://twitter.com/BroadcomSW | LinkedIn https://www.linkedin.com/company/broadcomsoftware

https://broadcom.com

-- This electronic communication and the information and any files transmitted with it, or attached to it, are confidential and are intended solely for the use of the individual or entity to whom it is addressed and may contain information that is confidential, legally privileged, protected by privacy laws, or otherwise restricted from disclosure to anyone else. If you are not the intended recipient or the person responsible for delivering the e-mail to the intended recipient, you are hereby notified that any use, copying, distributing, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited. If you received this e-mail in error, please return the e-mail to the sender, delete it from your computer, and destroy any printed copy of it.

— Reply to this email directly, view it on GitHub https://github.com/MartinPacker/md2pptx/pull/112#issuecomment-1072630044, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACPS2PJUJRPWOISJQJHVBTVAS4FRANCNFSM5RCM6KWA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you are subscribed to this thread.Message ID: @.***>

--

Thomas McQuitty

Technical Consulting, Mainframe

Broadcom Software

Office: 972-302-3360

@.***

Twitter https://twitter.com/BroadcomSW | LinkedIn https://www.linkedin.com/company/broadcomsoftware

https://broadcom.com

-- This electronic communication and the information and any files transmitted with it, or attached to it, are confidential and are intended solely for the use of the individual or entity to whom it is addressed and may contain information that is confidential, legally privileged, protected by privacy laws, or otherwise restricted from disclosure to anyone else. If you are not the intended recipient or the person responsible for delivering the e-mail to the intended recipient, you are hereby notified that any use, copying, distributing, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited. If you received this e-mail in error, please return the e-mail to the sender, delete it from your computer, and destroy any printed copy of it.

MartinPacker commented 2 years ago

I'm having to work on the deletefirstslide code a bit...

Syntax will be:

deleteFirstSlide: yes

for consistency.

MartinPacker commented 2 years ago

OK. Just pushed a "fiddled with" :-) version that works with the above syntax. The default will be no , by the way.

pls pull this version.

Will be documenting tonight - alongside the documentation for https://github.com/MartinPacker/md2pptx/pull/111.

Then I can release v2.6.

Thanks for your help!

McQuitty-Broadcom commented 2 years ago

Of course. Thank you for putting this out there.

When you get to Dallas, we can talk about how I use it as part of a pipeline. And I have something for you to take back.

Are you a pint or tea guy? Or both?

On Fri, Mar 18, 2022 at 12:44 PM Martin Packer @.***> wrote:

OK. Just pushed a "fiddled with" :-) version that works with the above syntax. The default will be no , by the way.

pls pull this version.

Will be documenting tonight - alongside the documentation for #111 https://github.com/MartinPacker/md2pptx/issues/111.

Then I can release v2.6.

Thanks for your help!

— Reply to this email directly, view it on GitHub https://github.com/MartinPacker/md2pptx/pull/112#issuecomment-1072645882, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANYYFHKIJ3NNNNDQGC2S7ETVAS6G3ANCNFSM5RCM6KWA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

--

Thomas McQuitty

Technical Consulting, Mainframe

Broadcom Software

Office: 972-302-3360

@.***

Twitter https://twitter.com/BroadcomSW | LinkedIn https://www.linkedin.com/company/broadcomsoftware

https://broadcom.com

-- This electronic communication and the information and any files transmitted with it, or attached to it, are confidential and are intended solely for the use of the individual or entity to whom it is addressed and may contain information that is confidential, legally privileged, protected by privacy laws, or otherwise restricted from disclosure to anyone else. If you are not the intended recipient or the person responsible for delivering the e-mail to the intended recipient, you are hereby notified that any use, copying, distributing, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited. If you received this e-mail in error, please return the e-mail to the sender, delete it from your computer, and destroy any printed copy of it.

MartinPacker commented 2 years ago

It would be greedy to say "both". But tea works better for me in terms of kitchen real estate. :-)

Looking forward to meeting you.

BTW I'm going to move the code to delete a slide into a function. In case @scanny gives us official support. And thanks to @chipset.

McQuitty-Broadcom commented 2 years ago

Ok. Thanks for letting me know about the tea/pint issue.

And yes, it would be nice to have official support.

On Fri, Mar 18, 2022 at 12:49 PM Martin Packer @.***> wrote:

It would be greedy to say "both". But tea works better for me in terms of kitchen real estate. :-)

Looking forward to meeting you.

BTW I'm going to move the code to delete a slide into a function. In case @scanny https://github.com/scanny gives us official support. And thanks to @chipset https://github.com/chipset.

— Reply to this email directly, view it on GitHub https://github.com/MartinPacker/md2pptx/pull/112#issuecomment-1072650885, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANYYFHMVCMBWMK34RRUZ7DDVAS62HANCNFSM5RCM6KWA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

--

Thomas McQuitty

Technical Consulting, Mainframe

Broadcom Software

Office: 972-302-3360

@.***

Twitter https://twitter.com/BroadcomSW | LinkedIn https://www.linkedin.com/company/broadcomsoftware

https://broadcom.com

-- This electronic communication and the information and any files transmitted with it, or attached to it, are confidential and are intended solely for the use of the individual or entity to whom it is addressed and may contain information that is confidential, legally privileged, protected by privacy laws, or otherwise restricted from disclosure to anyone else. If you are not the intended recipient or the person responsible for delivering the e-mail to the intended recipient, you are hereby notified that any use, copying, distributing, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited. If you received this e-mail in error, please return the e-mail to the sender, delete it from your computer, and destroy any printed copy of it.

MartinPacker commented 2 years ago

So all that's left to do before I close this is document DeleteFirstSlide.

MartinPacker commented 2 years ago

Docs pushed.