Proposal: Sections #1748

Closed
opened 2026-02-05 01:46:27 +03:00 by OVERLORD · 4 comments
Owner

Originally created by @sburkett on GitHub (May 28, 2020).

Describe the feature you'd like

I've been reading feature requests for things like "sub-chapters" and the like. This concept is similar, but involves a layer above shelves.

Carrying forward the library metaphor used in Bookstack ... libraries do have shelves of books, but those shelves are arranged in "sections". Otherwise, it would take you forever to find what you were looking for.

  • History Section
    • Shelf A - American History
      • The Revolutionary War
      • History of American Presidents
      • JFK and Elvis: The Real Truth
    • Shelf B - European History
      • Charlemagne and his Lady Friends
      • Hitler and his Secret Obsession with Egg Coddlers
    • Shelf C - World History
      • What are Pymgies Anyway?
      • The Forgotten Pirates of the Antarctic
  • Fiction Section
  • Poetry Section
  • Children's Section
  • etc.

For a more realistic Bookstack-centric example, we currently have something like the following (with one shelf expanded a little here):

  • Shelf: Client Implementations
  • Shelf: Marketing
  • Shelf: Sales
  • Shelf: Technical
    • Book: Ansible Implementation
    • Book: Coding Standards
    • Book: System Administration
    • etc.

The books, of course, have chapters and pages in them. Now, the "Ansible Implementation" book (along with a lot of others) really should fall under some sort of "System Administration" category (currently would be a "shelf"). However, I don't want to have more than one shelf related to technology - I just want one shelf to rule them all.

What I'd like to be able to do, is something like this:

  • Section: Client Implementations
    • Shelf: Premier Accounts
      • Book: Acme Corporation
      • Book: Frobozz Inc.
      • etc.
    • Shelf B
    • Shelf C
  • Section: Technical
    • Shelf: Coding Standards
      • Book: PHP/Laravel
      • Book: Shell Scripts
      • etc.
    • Shelf: System Administration
      • Book: Ansible Implementation
      • Book: Disaster Recovery
      • Book: Scheduled Jobs
        • Chapter: Daily Jobs
        • Chapter: Hourly Jobs
        • Chapter: Laravel Jobs
        • etc.

Benefits of the Feature

These are probably somewhat obvious, but:

  • Directly provides a way to group all related content under a single umbrella at the top level
  • Enhances the current "library" metaphor
  • More ways to organize things in any data-centric application is generally better

Additional context

Currently, the app uses separate models/tables for bookshelves, books, chapters, and pages. Obviously, the easiest thing to do would be to add another model for Section that would parent shelves. However, a more robust approach would be to use the most excellent calebporzio/parental package to have a base BookstackContainer class (or whatever you wanted to call it), which could easily be extended by other classes (even user-defined ones) to provide whatever level of organization the user wanted.

Just a thought :)

Originally created by @sburkett on GitHub (May 28, 2020). ## Describe the feature you'd like I've been reading feature requests for things like "sub-chapters" and the like. This concept is similar, but involves a layer above shelves. Carrying forward the library metaphor used in Bookstack ... libraries do have shelves of books, but those shelves are arranged in "sections". Otherwise, it would take you forever to find what you were looking for. - History Section - Shelf A - American History - The Revolutionary War - History of American Presidents - JFK and Elvis: The Real Truth - Shelf B - European History - Charlemagne and his Lady Friends - Hitler and his Secret Obsession with Egg Coddlers - Shelf C - World History - What are Pymgies Anyway? - The Forgotten Pirates of the Antarctic - Fiction Section - Poetry Section - Children's Section - etc. For a more realistic Bookstack-centric example, we currently have something like the following (with one shelf expanded a little here): - Shelf: Client Implementations - Shelf: Marketing - Shelf: Sales - Shelf: Technical - Book: Ansible Implementation - Book: Coding Standards - Book: System Administration - etc. The books, of course, have chapters and pages in them. Now, the "Ansible Implementation" book (along with a lot of others) really should fall under some sort of "System Administration" category (currently would be a "shelf"). However, I don't want to have more than one shelf related to technology - I just want one shelf to rule them all. What I'd like to be able to do, is something like this: - Section: Client Implementations - Shelf: Premier Accounts - Book: Acme Corporation - Book: Frobozz Inc. - etc. - Shelf B - Shelf C - Section: Technical - Shelf: Coding Standards - Book: PHP/Laravel - Book: Shell Scripts - etc. - Shelf: System Administration - Book: Ansible Implementation - Book: Disaster Recovery - Book: Scheduled Jobs - Chapter: Daily Jobs - Chapter: Hourly Jobs - Chapter: Laravel Jobs - etc. ## Benefits of the Feature These are probably somewhat obvious, but: - Directly provides a way to group all related content under a single umbrella at the top level - Enhances the current "library" metaphor - More ways to organize things in any data-centric application is generally better ## Additional context Currently, the app uses separate models/tables for `bookshelves`, `books`, `chapters`, and `pages`. Obviously, the easiest thing to do would be to add another model for `Section` that would parent shelves. However, a more robust approach would be to use the most excellent [calebporzio/parental](https://github.com/calebporzio/parental) package to have a base `BookstackContainer` class (or whatever you wanted to call it), which could easily be extended by other classes (even user-defined ones) to provide whatever level of organization the user wanted. Just a thought :)
Author
Owner

@sburkett commented on GitHub (May 28, 2020):

After reviewing the code base, it would appear that adding a "Section" layer would be by far the easiest thing to do. Making it definable would require a complete overhaul of the application as quite a bit of functionality is tightly coupled with each of the existing layers.

@sburkett commented on GitHub (May 28, 2020): After reviewing the code base, it would appear that adding a "Section" layer would be by far the easiest thing to do. Making it definable would require a complete overhaul of the application as quite a bit of functionality is tightly coupled with each of the existing layers.
Author
Owner

@sburkett commented on GitHub (May 29, 2020):

I've been thinking about this a bit more. I've forked off the current master and soon may take on the effort I've described in the Additional Context section above. Would love anyone interested in having that capability react with a thumbs up or what not.

@sburkett commented on GitHub (May 29, 2020): I've been thinking about this a bit more. I've forked off the current master and soon may take on the effort I've described in the Additional Context section above. Would love anyone interested in having that capability react with a thumbs up or what not.
Author
Owner

@ssddanbrown commented on GitHub (May 29, 2020):

Hi @sburkett,
Thank you for the detailed thought-out suggestion.

Personally I'd prefer not to support another level in the hierarchy. My comment from 2016 here still represents how I'd feel about this; If anything I'm probably more strongly against this now than in 2016 since we now have shelves.

@ssddanbrown commented on GitHub (May 29, 2020): Hi @sburkett, Thank you for the detailed thought-out suggestion. Personally I'd prefer not to support another level in the hierarchy. My [comment from 2016 here](https://github.com/BookStackApp/BookStack/issues/95#issuecomment-206509825) still represents how I'd feel about this; If anything I'm probably more strongly against this now than in 2016 since we now have shelves.
Author
Owner

@sburkett commented on GitHub (May 29, 2020):

Sure, no problem. I do feel that a completely configurable hierarchy with a set of defaults of what is there now (shelf->book->etc) is the ideal scenario for everyone, though. No doubt it is a tremendous undertaking, since it almost becomes a rewrite, but I might take it on just for kicks lol. We'll see. Life will most assuredly get in the way!

@sburkett commented on GitHub (May 29, 2020): Sure, no problem. I do feel that a completely configurable hierarchy with a set of defaults of what is there now (shelf->book->etc) is the ideal scenario for everyone, though. No doubt it is a tremendous undertaking, since it almost becomes a rewrite, but I might take it on just for kicks lol. We'll see. Life will most assuredly get in the way!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#1748