Lullabot / lb-ebook-poc

ISC License
0 stars 0 forks source link

Need a different hierarchy available #72

Closed jazzdrive3 closed 1 week ago

jazzdrive3 commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

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

sirkitree commented 2 months ago

@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 commented 2 months ago

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

sirkitree commented 1 month ago

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 commented 1 month ago

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 commented 3 weeks ago

@jazzdrive3 note that I'm still looking for the chapter breakdowns for

These currently don't have a TOC in the associated pull request #75