BookStackApp / BookStack

A platform to create documentation/wiki content built with PHP & Laravel
https://www.bookstackapp.com/
MIT License
15.43k stars 1.94k forks source link

Book/chapter classes similar to tag classes #5217

Open sws-noahdoersing opened 1 month ago

sws-noahdoersing commented 1 month ago

Describe the feature you'd like

As mentioned on https://www.bookstackapp.com/docs/admin/hacking-bookstack/, BookStack sets classes on a page's HTML <body> element depending on which tags are assigned to that page (for a tag "Priority: Critical", the classes tag-name-priority tag-value-critical tag-pair-priority-critical are added).

This is incredibly handy for styling and could be extended to encompass book and chapter (e.g. for a book "Servers" a class like book-servers).

Describe the benefits this would bring to existing BookStack users

Assigning different styles based on book and chapter would improve customization options.

Can the goal of this request already be achieved via other means?

Not that I'm aware of (except tagging everything with book/chapter titles, which isn't practical or maintainable).

Have you searched for an existing open/closed issue?

How long have you been using BookStack?

3 months to 1 year

Additional context

No response

ssddanbrown commented 1 month ago

Thanks @sws-noahdoersing, Personally I wouldn't be too keen on using book names for this, since they're likely to change and would only serve as one potential label/class to be used, but I'd be potentially open to having tag classes reflect parent book/chapter tags, so like book-tag-pair-priority-critical, chapter-tag-pair-priority-urgent.

That way you could tag multiple different books with a tag for specific tweaks/customization for all pages within those books, and it keeps the advanced customization functionality within the scope of tags.

sws-noahdoersing commented 1 month ago

That's a much better approach, I agree!