apptentive/DeveloperCenter — pull request #1 by zachgraves (2013-08-27 07:29:08+00:00)
Title: Developer Center Content

I've added rake script in `lib/tasks/developer_center_tasks.rake` that reads a `manifest.yml` file located at the root directory.

This file specifies all the markdown files, local and remote, that are to be cached and included in the navigation. Each item must specify a `title` and `img` icon. Optional attributes:
* `href`: A link to an existing page.
* `menu`: A list of sub navigation items. Each item in the menu can specify an URI pointing to a local or remote asset. If it is remote, a path may be specified as a cache location.

Sample `manifest.yml`:
```
- title: Dashboard
href: /status_good
img: /assets/dashboard.png
- title: Overview
uri: content/overview.md
img: /assets/overview.png
menu:
- title: Ratings Prompts
uri: content/overview/ratings.md
- title: Message Center
uri: content/overview/messages.md
- title: Surveys
uri: content/overview/surveys.md
```

The rake script will cache all the specified assets into a `public/content` directory. Additionally, it will store any linked assets from the markdown (eg: images) in the cache.

Next, the manifest will be used to generate a HAML file in `views/nav.haml` which is included as a partial in `layout.haml`. I used `nokogiri` and `html2haml` gem to create HTML and convert it to HAML before writing to the nav partial.

Running the app, the nav is being correctly rendered with the manifest data but based on the same layout that was previously in the project. However, I noticed the application.js file is missing, so I couldn't get the sub-menus to appear. Beyond that, I'm not sure how the views are intended to be rendered; perhaps that is outside the scope of this task.

To run the rake task: `rake developer_center:install:views`. Adding `--trace` will send progress status output to the console.

Z