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

Need a different hierarchy available #72

Open
jazzdrive3 opened this issue Sep 13, 2024 · 7 comments · May be fixed by #75
Open

Need a different hierarchy available #72

jazzdrive3 opened this issue Sep 13, 2024 · 7 comments · May be fixed by #75

Comments

@jazzdrive3
Copy link
Contributor

jazzdrive3 commented Sep 13, 2024

Right now, every single page is a "chapter" with a chapter title like "Chapter 4." But that's not how the content of most of these ebooks is organized.

For example on the "5 Signs You’ve Over-structured Your Content" ebook.

https://ebooks.lullabot.com/ebooks/over-structured-content/chapters/chapter-8/ This is something a full container of the following items. The H2 for the H3s.

The following pages fall under that container, and aren't really complete thoughts in and of themselves.

https://ebooks.lullabot.com/ebooks/over-structured-content/chapters/chapter-9/
https://ebooks.lullabot.com/ebooks/over-structured-content/chapters/chapter-10/
https://ebooks.lullabot.com/ebooks/over-structured-content/chapters/chapter-11/
https://ebooks.lullabot.com/ebooks/over-structured-content/chapters/chapter-12/
https://ebooks.lullabot.com/ebooks/over-structured-content/chapters/chapter-13/

So while those are pages, they shouldn't necessarily be full "chapters". Everything being flat sort of muddles things all together and you lose the natural hierarchy established by the headings in the original document.

This ebook, hierarchically, should only have 4 chapters.

  1. Introduction
  2. Signs of Overstructred Content
  3. How to Avoid Overstructuring Your Content
  4. Conclusion

Possible solution. A new layout instead of the chapter, where there is a new property in the metadata to set the parent so that it would appear above the heading for its children. I'm not sure what that would mean for the Table of Contents.

It would also be helpful to be able to hide the chapter heading altogether to avoid redundancies. For example, on the latest, we have numbers before the items, and it will be awkward to have

Chapter 3
Four: The project has an unrealistic timeline

@sirkitree
Copy link
Collaborator

Thinking we might just label the chapters. Everything is a 'page' but we also have 'chapters' and those are what the TOC looks for.

This might mean changing the URI to use page-n instead of chapter-n for everything. I don't think it'd be a big loss to lose the chapter-n in the URI altogether.

Would it be ok to have everything as /ebooks/over-structured-content/pages/page-9/ for example, even if it's a chapter? Then we could add 'chapter' to the pages designated as a chapter through the front-matter.

@sirkitree
Copy link
Collaborator

This would mean:

  1. renaming each books 'chapters' dir to 'pages'
  2. renaming each markdown file therein to 'pages-n.md'
  3. renaming chapter.liquid to page.liquid
  4. updating all references to 'chapters' to 'pages' (in code and within all the table-of-contents.md files
  5. update all pages that should be designated as a chapter with 'tags: chapter' (I think, have to test that)
  6. update table-of-contents.liquid to only find the pages that have 'chapter' in the front-matter
  7. update the COPYME_sample-ebook to reflect these changes to the new pages pattern

@jazzdrive3
Copy link
Contributor Author

That sounds like it would work well, and solve the ToC problem at the same time.

@sirkitree
Copy link
Collaborator

@pjudge also had some good suggestions when we were discussing this in Slack

  1. URL that would be really helpful and makes a lot of sense would be: https://ebooks.lullabot.com/ebooks/over-structured-content/chapter-3/page-9
  2. The navigation arrows could be structured like the nav buttons in Drupal Views. << and >> could take you back/forward through chapters while < and > could take you forward/back page by page. The buttons would need to have title attributes to describe the behavior.
  3. I’m loving the page number in the corner. It would be helpful to also have the Chapter information on every page as well, but only have it in red and prominent on the first page of the chapter. Then, on the subsequent pages inside the chapter, maybe have it gray, and place it somewhere else, like near the page number, near the bottom of the page content, or near the navigation.

@jazzdrive3
Copy link
Contributor Author

Whatever is simplest. I think the URLs and navigation would be nice-to-haves eventually, but not required.

@sirkitree
Copy link
Collaborator

Some progress here:
image

Questions:

  1. Is this how you'd like them listed in the TOC, with the page numbers? or should it by 01-04 (in this case).
  2. Should we also only list those with chapters in the sidebar dropdown?
    image
  3. Can you tell me which pages in the other books should have a chapter tag?

@jazzdrive3
Copy link
Contributor Author

Nice!

Yes, I think the sidebar ToC should match the main ToC.

I don't think we need page numbers in ToC, just the chapter numbers. Since they're all clickable, page numbers aren't that useful in this context.

I'll get the chapter breakdowns for the others soon.

@sirkitree sirkitree linked a pull request Sep 26, 2024 that will close this issue
2 tasks
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

Successfully merging a pull request may close this issue.

2 participants