Skip to content
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

FEATURE: Support a user-defined template for main xhtml content #31

Closed
timtribers opened this issue Oct 11, 2016 · 4 comments
Closed

FEATURE: Support a user-defined template for main xhtml content #31

timtribers opened this issue Oct 11, 2016 · 4 comments

Comments

@timtribers
Copy link

Hi guys,

From your documentation I can see that it is possible to specify a template to use when generating the OPF and TOC files. Any reason why it can't be made possible, please, to do the same for the main xhtml content?

Thx.

@pedrosanta
Copy link
Collaborator

pedrosanta commented Oct 11, 2016

Hi @timtribers, thanks for the suggestion. There isn't any strong special reason, we haven't just considered that yet. 🙂

In one of my usages I'm completely customising the contents of chapters, by setting to not append titles (options.appendChapterTitles as false, and not setting author, url of each content) and customising the contents myself (I'm also using EJS to compile the templates on my side).

This allows me to have different chapter 'templates' for book front matter, body and back matter.

Would this work for you?

Also, regarding the templates, how do you see it working? Through a template property on each content object, maybe?

Cheers.

@timtribers
Copy link
Author

timtribers commented Oct 12, 2016

Hi @pedrosanta,

Actually, the more I thought about this, the more I realised I don't need it!
The only thing I cannot control the way it works now, is the section. What I wanted to do was add in another linked css file.

Sure I can use the css: option, but that replaces style.css in all cases. It would be nice to be able to add a css file for each item - that would sort me out, I think.

(There are some other features I could also really use, but will raise those as separate issues.)

Many thanks

@pedrosanta
Copy link
Collaborator

@timtribers So, what you're saying is almost like having a way to define different styling for different contents/chapters, is it?

If yes, couldn't that be done through a custom CSS and nested styling like, .content-type-a p { /* style 1 */ } and .content-type-b p { /* style 2 */ } and add these classes on top level element of each chapter content?

@pedrosanta
Copy link
Collaborator

Closing this for inactivity. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants