zurb/foundation-apps — pull request #338 by gakimball (2014-12-18 03:33:03+00:00)
Title: Automatic settings file generation

Maintaining the settings file is a hassle, because when a variable changes, you have to change it in the component's file, the settings file, and the documentation page all at once. This Gulp task (`gulp gen`) parses out the settings variables for each component and collects them in one file. If we can make this work, it could be used in the other Foundation frameworks as well.

The function takes all the code between two delimiters:

```scss
/// @Foundation.settings
// Grid
$container-width: rem-calc(900);
/* Moar Sass variables... */
///
```

And then collects all of the code it finds into one file. The title of each code chunk (in the above example, the title is "Grid") is used to generate the title of that section in the settings file, and could also be used to generate a table of contents at the beginning of the file.

**Issues:**
- [ ] Right now it just pipes to a settings file, and comments out each variable like you do. To make it fully-featured, it should output each component's variables as a separate HTML file into a `partials` folder as well, and then we can use Angular's `ng-include` to pull in the file and display it on the right docs page.
- [ ] The sets of variables are added to the settings file in the order the files come in your filesystem. So, they go in alphabetical order. Which mostly works, but we like to float a few key components to the top, like the grid and typography. The plugin should have a way to change the order the components are printed out.
- [ ] The function should generate a table of contents at the top of the file.
- [ ] If the parser goes through a file and doesn't find anything, when the file is concatenated into the settings file, it comes in as a newline. So if you happen to have a bunch of files with no settings variables, you get a bunch of random empty space between each section of the settings file. I don't know if this will be an issue or not once every file has proper annotation.