Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TOC entries with no href just title #60

Open
jccr opened this issue May 11, 2020 · 4 comments
Open

TOC entries with no href just title #60

jccr opened this issue May 11, 2020 · 4 comments

Comments

@jccr
Copy link
Member

jccr commented May 11, 2020

When looking at data from the EPUB context: The EPUB spec allows you to have navigation document headings be "link-less".

For example:

<ol><li>
    <span>Appendix</span>
    <ol>
      <li>
        <a href="appendix.xhtml#a.1-birds">A.1 Birds</a>
      </li>
      <li>
        <a href="appendix.xhtml#a.2-turtles">A.2 Turtles</a>
      </li>
    </ol>
  </li>
</ol>

How would someone represent this data as a RWPM ToC compact subcollection?
Given that the items are Link objects that require an href attribute.

My only idea right now is to have the href value be a blank string.

The resulting collection would look like this:

"toc": [
  {
    "href": "",
    "title": "Appendix",
    "children": [
      {
        "href": "appendix.xhtml#a.1-birds",
        "title": "A.1 Birds"
      },
      {
        "href": "appendix.xhtml#a.2-turtles",
        "title": "A.2 Turtles"
      }
    ]
  }
]
@jccr
Copy link
Member Author

jccr commented May 11, 2020

Another idea is that it takes the href without fragments.. somehow.. it's ambiguous...

The resulting collection would look like this:

"toc": [
  {
    "href": "appendix.xhtml",
    "title": "Appendix",
    "children": [
      {
        "href": "appendix.xhtml#a.1-birds",
        "title": "A.1 Birds"
      },
      {
        "href": "appendix.xhtml#a.2-turtles",
        "title": "A.2 Turtles"
      }
    ]
  }
]

@qnga
Copy link
Contributor

qnga commented May 12, 2020

My only idea right now is to have the href value be a blank string.

On mobile platforms, we arbitrarily use "#".

@mickael-menu
Copy link
Member

On mobile platforms, we arbitrarily use "#".

Yes, I felt somehow that at least it was a valid HREF, but it's not great. Maybe a blank string is better, I'm not sure.

Another idea is that it takes the href without fragments.. somehow.. it's ambiguous...

I don't think that we can guarantee that all children are in the same resource though.

@HadrienGardeur
Copy link
Collaborator

Another option would be to drop this requirement for Link Objects listed in toc.

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

No branches or pull requests

4 participants