Skip to content

Customized HEAD Content per book instead of global #5476

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

Closed
1 task done
DoctorRetromaker opened this issue Feb 7, 2025 · 5 comments
Closed
1 task done

Customized HEAD Content per book instead of global #5476

DoctorRetromaker opened this issue Feb 7, 2025 · 5 comments

Comments

@DoctorRetromaker
Copy link

DoctorRetromaker commented 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

@ssddanbrown
Copy link
Member

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.

@DoctorRetromaker
Copy link
Author

DoctorRetromaker commented 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
Copy link
Author

DoctorRetromaker commented 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

@ssddanbrown
Copy link
Member

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
Copy link
Member

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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants