Skip to content

Conversation

@bdudelsack
Copy link
Contributor

Hello,

i've implemented a basic asset manager for adding some static theme files (like CSS or JS). It can be used in a template like:

$this->assets->addFile("css/styles.css");

Could you please check if it's an acceptable implementation for you?

It lacks subdirectory functionality and unit tests yet.

@pmjones
Copy link
Contributor

pmjones commented Apr 18, 2016

(/me furrows brow)

I have to wonder if asset management isn't a little outside the scope of Bookdown here. Would not a designer's toolkit be in charge of the needed asset work?

@bdudelsack
Copy link
Contributor Author

Maybe there is some misunderstanding what i mean with asset management.

I wanted to create some advanced templates for bookdown (like one from mkdocs or read-the-docs) but i need to include some files like fonts, css and javascript into my template.

@bdudelsack
Copy link
Contributor Author

Here is an example how assets are used in the template to include some CSS and JS files.

https://github.com/bdudelsack/bookdown-template/tree/feature/assets

I think the best way would be to parse SCRIPT and LINK tags and add those files automaticaly and use explicit calls to asset manager only for resource like fonts which are included in CSS files.

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

Successfully merging this pull request may close these issues.

2 participants