datalorax / slidex

Convert PowerPoint Slides to xaringan (remark.js) Slides
Other
290 stars 39 forks source link

Google Slide Export Failing #16

Closed muschellij2 closed 6 years ago

muschellij2 commented 6 years ago

I'm getting some errors trying to convert over a Google slide deck (attached) or located at https://docs.google.com/presentation/d/1zn416oE89Tx9z_gLRVjKGIaf2_X0NBxMpPTajQonvo0/edit#slide=id.p . It seems to be a problem with the notes: 01_testclass_secondlecture.pptx

library(slidex)
res = convert_pptx("01_testclass_secondlecture.pptx", author = "Test")
#> Error in convert_pptx("01_testclass_secondlecture.pptx", author = "Test"): Result 1 is not a length 1 atomic vector

BTW - joining up (or using some of the functionality or pushing over) to officer package may be worthwhile: https://davidgohel.github.io/officer/. To be fair, this package has problems with the notes as well.

Also, when error happens in sink_rmd, then the sink() never gets called, I'll send a PR.

muschellij2 commented 6 years ago

It seems as though the schema is a bit different: For example, stepping through the code, you get:

cat(as.character(xml_find_all(sld_notes[[2]], "//p:txBody/a:p")))
<a:p>
  <a:pPr indent="-298450" lvl="0" marL="457200" rtl="0">
    <a:spcBef>
      <a:spcPts val="0"/>
    </a:spcBef>
    <a:spcAft>
      <a:spcPts val="0"/>
    </a:spcAft>
    <a:buSzPts val="1100"/>
    <a:buAutoNum type="arabicPeriod"/>
  </a:pPr>
  <a:r>
    <a:rPr lang="en"/>
    <a:t>Add images for course </a:t>
  </a:r>
  <a:endParaRPr/>
</a:p> <a:p>
  <a:pPr indent="-298450" lvl="0" marL="457200" rtl="0">
    <a:spcBef>
      <a:spcPts val="0"/>
    </a:spcBef>
    <a:spcAft>
      <a:spcPts val="0"/>
    </a:spcAft>
    <a:buSzPts val="1100"/>
    <a:buAutoNum type="arabicPeriod"/>
  </a:pPr>
  <a:r>
    <a:rPr lang="en"/>
    <a:t>Include link at bottom of the page as to where that image came from</a:t>
  </a:r>
  <a:endParaRPr/>
</a:p> <a:p>
  <a:pPr indent="-298450" lvl="0" marL="457200" rtl="0">
    <a:spcBef>
      <a:spcPts val="0"/>
    </a:spcBef>
    <a:spcAft>
      <a:spcPts val="0"/>
    </a:spcAft>
    <a:buSzPts val="1100"/>
    <a:buAutoNum type="arabicPeriod"/>
  </a:pPr>
  <a:r>
    <a:rPr lang="en"/>
    <a:t>Note: captions will show up in the picture of the course</a:t>
  </a:r>
  <a:endParaRPr/>
</a:p> <a:p>
  <a:pPr indent="-298450" lvl="0" marL="457200" rtl="0">
    <a:spcBef>
      <a:spcPts val="0"/>
    </a:spcBef>
    <a:spcAft>
      <a:spcPts val="0"/>
    </a:spcAft>
    <a:buSzPts val="1100"/>
    <a:buAutoNum type="arabicPeriod"/>
  </a:pPr>
  <a:r>
    <a:rPr lang="en"/>
    <a:t>Include date accessed along with your URL</a:t>
  </a:r>
  <a:endParaRPr/>
</a:p>

I'll push my changes after the first PR is accepted so to not make anything really conflict

datalorax commented 6 years ago

Thanks! I just commented on your fork but I'll merge this in if you want to submit a PR. Also, if you want to edit the DESCRIPTION file to add yourself as a contributor that would be great as well.

muschellij2 commented 6 years ago

Should be done and now in the newbullets branch on your repo (master on mine)