trulia / hologram

A markdown based documentation system for style guides.
http://trulia.github.io/hologram
Other
2.16k stars 200 forks source link

Config param 'index' only accepts lowercase value despite uppercased category name match #217

Open scottyeck opened 9 years ago

scottyeck commented 9 years ago

In my docs...

/*doc

---
title: Home
name: home
category: Home

---
This is your style guide. Get used to it.
*/

Note that the category Home is uppercase above. I mirror this in my hologram_config.yaml...

source: ./sass
destination: ./docs
documentation_assets: ./doc_assets
dependencies:
  - ./build

# Note that this value is uppercased to match the category name listed in the docs above
index: Home

When attempting to build, I get the following warning:

scottyeck:styleguide scottyeck$ bundle exec hologram
Warning: Could not generate index.html, there was no content generated for the category Basics.
Adding renderer for haml examples
Adding renderer for html examples
Adding renderer for js examples
Adding renderer for jsx examples
Adding renderer for react examples
Adding renderer for slim examples
Warning: Could not copy dependency: ./build
Build completed. (-:

But, if I set index: home (value as lowercase) in my hologram_config.yaml, it builds fine without the warning. This is confusing. If nothing else, this should be included in the README.md. More preferable, obviously, would be the allowance of uppercase values for this field in hologram_config.yaml.

lifeiscontent commented 9 years ago

@scottyeck I think this has to do with how YAML works... I don't think this is a bug.

jmblog commented 9 years ago

I was faced with the same problem.

I think this line may be the cause of this problem. https://github.com/trulia/hologram/blob/master/lib/hologram/doc_builder.rb#L142

In @scottyeck's case, index is Home but @pages has a key not Home.html but home.html.