Customized HEAD Content per book instead of global #5173

Closed
opened 2026-02-05 09:45:57 +03:00 by OVERLORD · 5 comments
Owner

Originally created by @DoctorRetromaker on GitHub (Feb 7, 2025).

Describe the feature you'd like

Same as there is a GLOBAL HEAD Content Customization, could be of interest to have a second customization level.
As easy as if there isn't any content in the BOOK HEAD CUSTOMIZATION, the GLOBAL HEAD CUSTOMIZATION is applied, other way, the BOOK HEAD CUST override the GLOBAL HEAD CUST

Describe the benefits this would bring to existing BookStack users

Not all books use same styles or even JS libraries; I use MathJS in some books and of course, different <code> styles depending if book I'm writing is about programming or is about other matter. Same for headings and other HTML elements.

As long time programmer, I know it's a very easy to add feature, and could help writers to customize styles according the books the writer is writing.

Thanks for your good job.
Regards

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

No, I don't think so

Have you searched for an existing open/closed issue?

  • I have searched for existing issues and none cover my fundamental request

How long have you been using BookStack?

3 months to 1 year

Additional context

No response

Originally created by @DoctorRetromaker on GitHub (Feb 7, 2025). ### Describe the feature you'd like Same as there is a GLOBAL HEAD Content Customization, could be of interest to have a second customization level. As easy as if there isn't any content in the BOOK HEAD CUSTOMIZATION, the GLOBAL HEAD CUSTOMIZATION is applied, other way, the BOOK HEAD CUST override the GLOBAL HEAD CUST ### Describe the benefits this would bring to existing BookStack users Not all books use same styles or even JS libraries; I use MathJS in some books and of course, different \<code\> styles depending if book I'm writing is about programming or is about other matter. Same for headings and other HTML elements. As long time programmer, I know it's a very easy to add feature, and could help writers to customize styles according the books the writer is writing. Thanks for your good job. Regards ### Can the goal of this request already be achieved via other means? No, I don't think so ### Have you searched for an existing open/closed issue? - [x] I have searched for existing issues and none cover my fundamental request ### How long have you been using BookStack? 3 months to 1 year ### Additional context _No response_
OVERLORD added the 🔨 Feature Request label 2026-02-05 09:45:57 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Feb 7, 2025):

Thanks for the request @DoctorRetromaker, but I wouldn't be keen on expanding the scope of such controls/inputs beyond the scope of the settings area.

I think the underlying desire would be best achieved via #5217, since specific tags could be placed on books, then those could be used to target via custom code to run on all child pages/chapters.

Can the goal of this request already be achieved via other means?
No, I don't think so

  • You could maybe make use of tag classes to target custom code/logic to specific pages.
  • Via custom code logic, if confident with understanding the codebase, you could use the visual theme system to add code targeted for specific books.
@ssddanbrown commented on GitHub (Feb 7, 2025): Thanks for the request @DoctorRetromaker, but I wouldn't be keen on expanding the scope of such controls/inputs beyond the scope of the settings area. I think the underlying desire would be best achieved via #5217, since specific tags could be placed on books, then those could be used to target via custom code to run on all child pages/chapters. > Can the goal of this request already be achieved via other means? > No, I don't think so - You could maybe make use of [tag classes](https://www.bookstackapp.com/docs/admin/hacking-bookstack/#tag-classes) to target custom code/logic to specific pages. - Via custom code logic, if confident with understanding the codebase, you could use the [visual theme system](https://www.bookstackapp.com/hacks/applying/#visual-theme-system) to add code targeted for specific books.
Author
Owner

@DoctorRetromaker commented on GitHub (Feb 7, 2025):

Ok, I'll explore the «tags way» and the «visual theme system», although I honestly think that managing a CSS for each book is an easy-to-implement solution and very useful for customizing the styles of each publication without resorting to hacking.

However, think twice before you rule it out completely.

@DoctorRetromaker commented on GitHub (Feb 7, 2025): Ok, I'll explore the «tags way» and the «visual theme system», although I honestly think that managing a CSS for each book is an easy-to-implement solution and very useful for customizing the styles of each publication without resorting to hacking. However, think twice before you rule it out completely.
Author
Owner

@DoctorRetromaker commented on GitHub (Feb 7, 2025):

@ssddanbrown, the fact that «tags» don't expanded to the export "Contained Web File" is a error or is the correct way?

If it's the correct way, the result isn't coherent with the "hacking by tags" suggestion

@DoctorRetromaker commented on GitHub (Feb 7, 2025): @ssddanbrown, the fact that «tags» don't expanded to the export "Contained Web File" is a error or is the correct way? If it's the correct way, the result isn't coherent with the "hacking by tags" suggestion
Author
Owner

@ssddanbrown commented on GitHub (Feb 8, 2025):

the fact that «tags» don't expanded to the export "Contained Web File" is a error or is the correct way?

Neither really, just something which hasn't been requested before.
It's something reasonable that I'd consider in scope though if you wanted to raise an issue and/or PR for it.

@ssddanbrown commented on GitHub (Feb 8, 2025): > the fact that «tags» don't expanded to the export "Contained Web File" is a error or is the correct way? Neither really, just something which hasn't been requested before. It's something reasonable that I'd consider in scope though if you wanted to raise an issue and/or PR for it.
Author
Owner

@ssddanbrown commented on GitHub (Feb 9, 2025):

I'm going to go ahead and close this off in favour of #5217 and the #5479 which you've opened to support your goal, since those options would be my preferred approach to support the fundamental desire here rather than the addition of extra settings.

@ssddanbrown commented on GitHub (Feb 9, 2025): I'm going to go ahead and close this off in favour of #5217 and the #5479 which you've opened to support your goal, since those options would be my preferred approach to support the fundamental desire here rather than the addition of extra settings.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#5173