Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

AddSection title cannot be empty #24

Open
bmaupin opened this issue Apr 15, 2021 · 0 comments
Open

AddSection title cannot be empty #24

bmaupin opened this issue Apr 15, 2021 · 0 comments

Comments

@bmaupin
Copy link
Owner

bmaupin commented Apr 15, 2021

As per #21, an empty title is invalid.

However, that's currently used as the mechanism to add a section to an EPUB without adding it to the table of contents:

The title is optional; if no title is provided, the section will not be added to the table of contents.

https://pkg.go.dev/github.com/bmaupin/go-epub?utm_source=godoc#Epub.AddSection

Two problems need to be solved:

  1. What should the appropriate behaviour be when an empty title is added?

    This seems to be related to the philosophy of how this library should handle errors... Should we

    1. Throw an error if an empty title is added?
    2. Generate a title if an empty title is added?
    3. Keep the current behaviour but make a note in the documentation that an empty title is invalid?
  2. How should we handle the ability to add a section to the EPUB without adding it to the table of contents? Some possibilities:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant