go-shiori / go-epub

Go library for creating EPUB files
MIT License
44 stars 7 forks source link

Add partial support for sections properties #41

Closed neclepsio closed 3 weeks ago

neclepsio commented 2 months ago

Fixes #40.

fmartingr commented 2 months ago

Hey @neclepsio, thanks for the contribution! You need to fix all the references you included to your fork: github.com/neclepsio/go-epub. They should point to this repository, it should work on your development environment with that as well.

neclepsio commented 2 months ago

Sorry, I reverted the import path change.

neclepsio commented 1 month ago

Ok, done. I had to remove form because of a problem I had with epubcheck validation, maybe I'm not interpreting the specs correctly.

Monirzadeh commented 1 month ago

Ok, done. I had to remove form because of a problem I had with epubcheck validation, maybe I'm not interpreting the specs correctly.

I am running with uncomment form part and I don't get any error on epubcheck. can you please send a code snippet that not work for you.

neclepsio commented 1 month ago

I am running with uncomment form part and I don't get any error on epubcheck. can you please send a code snippet that not work for you.

You also have to uncomment the relative section 4 of the test.

Monirzadeh commented 1 month ago

i done that but all test pass. which version of epubcheck do you have?

epubcheck --version
EPUBCheck v5.1.0
                        case "SCRIPT":
                                prop["scripted"] = true
-                               // See the comment in TestSectionProperties
-                               //case "FORM":
-                               //      prop["scripted"] = true
+                       // See the comment in TestSectionProperties
+                       case "FORM":
+                               prop["scripted"] = true
-       /*
-               _, err = e.AddSection(`<h1>Section 4</h1><form></form>`, "Section 4", "section0004.xhtml", "")
-               if err != nil {
-                       t.Errorf("Error adding section: %s", err)
-               }
-       */
+
+       _, err = e.AddSection(`<h1>Section 4</h1><form></form>`, "Section 4", "section0004.xhtml", "")
+       if err != nil {
+               t.Errorf("Error adding section: %s", err)
+       }
go test  
../videos/testfromfile.mp4
../videos/sample_640x360.mp4
../audios/sample_audio.wav
../audios/audio0002.wav
can't add image to the epub: Error retrieving "https://example.com/fileNotExist.jpg" from source: Error retrieving "https://example.com/fileNotExist.jpg" from source: 
 cannot get file, bad return code
PASS
ok      github.com/go-shiori/go-epub    1.042s
neclepsio commented 1 month ago

I used version 4.2.5, as I think the README suggests. So, I think it's a bug of that version of epubcheck. I will commit a fix.

Monirzadeh commented 1 month ago

I used version 4.2.5, as I think the README suggests. So, I think it's a bug of that version of epubcheck. I will commit a fix.

oh, good point :+1: can you please update README too?

codecov-commenter commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 85.38%. Comparing base (9ed75d3) to head (34e4579).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #41 +/- ## ========================================== + Coverage 85.03% 85.38% +0.34% ========================================== Files 10 10 Lines 962 985 +23 ========================================== + Hits 818 841 +23 Misses 79 79 Partials 65 65 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

neclepsio commented 3 weeks ago

Is there a problem blocking this?

neclepsio commented 3 weeks ago

Closing and reopening on different branch.

Monirzadeh commented 2 weeks ago

Is there a problem blocking this?

i am not close that i will look at another PR you send.