<commit_before># Vista

Really easy, CSS-based, location-driven display control for your elements.

## Getting Started
Download the [production version][min] or the [development version][max]. [![Build Status](https://travis-ci.org/esha/vista.png?branch=master)](https://travis-ci.org/esha/vista)  
[Bower][bower]: `bower install vista`  
[NPM][npm]: `npm install vista`   
[Component][component]: `component install esha/vista`  

[min]: https://raw.github.com/esha/vista/master/dist/vista.min.js
[max]: https://raw.github.com/esha/vista/master/dist/vista.js
[npm]: https://npmjs.org/package/vista
[bower]: http://bower.io/
[component]: http://component.io/

## Documentation

### Define

Programatic:  

`Vista.define(name[, test])`  

or declarative:  

`<meta name="vista" content="{name}={test}">`  

The name will be used to generate the CSS display rules. The test will be turned into a regular expression that is tested against the current URL of the page. Or, if you are using `Vista.define(name, test)`, the test may be a RegExp instance or Function. If, via either definition method, the test is omitted, then the name itself will be used as the test expression (which is often sufficient). Here are some definition examples:

```javascript
Vista.define('reports');
Vista.define('hasChart', /#.*(pie|bar|line)/);
Vista.define('special', function(url) {
    // here you can 
    return url.indexOf('special=true') > 0 || user.settings('special');
});
```

```html
<head>
  <meta name="vista" content="reports hasChart=#(pie|bar|line) query=\?q=.+"/>
  <script src="../bower_components/vista/dist/vista.min.js"></script><commit_msg>finish comment in doc<commit_after># Vista

Really easy, CSS-based, location-driven display control for your elements.

## Getting Started
Download the [production version][min] or the [development version][max]. [![Build Status](https://travis-ci.org/esha/vista.png?branch=master)](https://travis-ci.org/esha/vista)  
[Bower][bower]: `bower install vista`  
[NPM][npm]: `npm install vista`   
[Component][component]: `component install esha/vista`  

[min]: https://raw.github.com/esha/vista/master/dist/vista.min.js
[max]: https://raw.github.com/esha/vista/master/dist/vista.js
[npm]: https://npmjs.org/package/vista
[bower]: http://bower.io/
[component]: http://component.io/

## Documentation

### Define

Programatic:  

`Vista.define(name[, test])`  

or declarative:  

`<meta name="vista" content="{name}={test}">`  

The name will be used to generate the CSS display rules. The test will be turned into a regular expression that is tested against the current URL of the page. Or, if you are using `Vista.define(name, test)`, the test may be a RegExp instance or Function. If, via either definition method, the test is omitted, then the name itself will be used as the test expression (which is often sufficient). Here are some definition examples:

```javascript
Vista.define('reports');
Vista.define('hasChart', /#.*(pie|bar|line)/);
Vista.define('special', function(url) {
    // return a truthy value to pass the test or falsey to fail
    return url.indexOf('special=true') > 0 || user.settings('special');
});
```

```html
<head>
  <meta name="vista" content="reports hasChart=#(pie|bar|line) query=\?q=.+"/>
  <script src="../bower_components/vista/dist/vista.min.js"></script>
{'fraction_non_alphanumeric': 0.16081608160816083, 'fraction_numerical': 0.0006000600060006001, 'mean_word_length': 4.788194444444445, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 15, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '696457', 'n_tokens_mistral': 1091, 'n_tokens_neox': 1052, 'n_words': 315}