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

Dynamic stylesheet/script inclusion #73

Closed
Yago opened this issue Apr 20, 2014 · 10 comments
Closed

Dynamic stylesheet/script inclusion #73

Yago opened this issue Apr 20, 2014 · 10 comments

Comments

@Yago
Copy link

Yago commented Apr 20, 2014

Hi !

First, I want to say that your tool is really cool. We test so many styleguide generators, but yours seems to be one of the best for our needs.

Anyway, last week I create a nicer theme for Hologram called Cortana and I see something important is missing : the dynamic inclusion of used stylesheet and scripts into the build. In the config file we define the path of all the files which will be parse and use to build the doc, but we have always to include manually all those files in the theme to render our examples.

Can you do something to reuse the source config and dynamically include all the css/js files in the final doc build ?

@jdcantrell
Copy link
Contributor

Nice job! This looks pretty good.

Hmm, I'll have to think about this some. Right now we give you the most flexibility but you're right you have to include them in your header templates manually....hmm tradeoffs.

@gagarine
Copy link

Witch flexibility this bring? I think we should simply add an option in the hologram_config.yml file to include all the CSS and JS files.

@Yago
Copy link
Author

Yago commented Apr 23, 2014

Maybe not all, but a defined list of stylesheets and another for scripts that we can include with a loop inside our theme template.

@aflanagan
Copy link
Contributor

@Yago31, @gagarine - if i'm understanding correctly you can do that now. just use the documentation_assets and/or dependencies directories that can be defined in the yaml config.

@jdcantrell
Copy link
Contributor

I think what is being asked for is a way to automatically write <script> and <link> tags as well in the header. Right now I'd prefer this not be part of hologram's job. This would be useful for the theme @Yago31 and @gagarine created.

Might as easy as passing in the config to the _header.erb file and letting it be handled there if one so desired.

@aflanagan
Copy link
Contributor

Ah, got it.

@Yago
Copy link
Author

Yago commented Apr 25, 2014

@jdcantrell Exactly, it's a non sens to include all css/js without any control. The best way is as you said, list in 2 parameters inside the config file, all the css/js files that we want to use.

With that feature, we can easily use any Hologram theme as a dependency/bower package and not touch it inside the project anymore.

@gagarine
Copy link

@jdcantrell if you agree on the idea we can provide a pull request for this feature.

@jdcantrell
Copy link
Contributor

Yes feel free to submit a PR. My preference is that the changes in the PR only pass the config object to the header and footer erbs. Then your theme would have a custom _header.html that would write out whatever config values it needed.

@jdcantrell
Copy link
Contributor

This should be fixed now that the config values are passed to _header.html

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

No branches or pull requests

4 participants