Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
thepian committed Jun 14, 2015
1 parent e7beea4 commit 9181ca7
Show file tree
Hide file tree
Showing 28 changed files with 124 additions and 76 deletions.
25 changes: 23 additions & 2 deletions docs/css/docs.css
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ img.AngularJS-small {
font-weight: bold;
font-size: 13px;
color: black;
overflow: hidden;
text-overflow: ellipsis;
}

.form-search > ul.nav > li > a {
Expand Down Expand Up @@ -138,8 +140,27 @@ img.AngularJS-small {
/* Content */
/* =============================== */

.improve-docs {
.edit-example {
margin-top: 9px;
}

.improve-docs, .view-source, .edit-example {
float: right;
margin-left: 35px;
position: relative;
}

.improve-docs i, .view-source i, .edit-example i {
position: absolute;
left: -20px;
top: 50%;
margin-top: -.5em;
text-decoration: none !important;
}

.methods .view-source {
margin: -0.5em 0 0 0;
text-decoration: none !important;
}

.hint {
Expand Down Expand Up @@ -216,7 +237,7 @@ ul.methods > li > h3,
ul.properties > li > h3,
ul.events > li > h3 {
margin: -19px -19px 1em -19px;
padding: .25em 19px;
padding: .25em 39px .25em 19px;
background-color: #d3d3d3;
font-family: monospace;
}
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
<ul class="nav nav-list well" ng-repeat="module in modules track by module.url" class="api-list-item">
<li class="nav-header module">
<a class="guide">module</a>
<a class="code" href="{{module.url}}">{{module.name}}</a>
<a class="code" href="{{module.url}}" title="{{module.name}}">{{module.name}}</a>
</li>

<li ng-repeat="page in module.others track by page.url" ng-class="navClass(page)" class="api-list-item expand">
Expand Down
21 changes: 18 additions & 3 deletions docs/js/angular-bootstrap-prettify.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ directive.ngEvalJavascript = ['getEmbeddedTemplate', function(getEmbeddedTemplat
}];


directive.ngEmbedApp = ['$templateCache', '$browser', '$rootScope', '$location', '$sniffer', '$animate',
function($templateCache, $browser, docsRootScope, $location, $sniffer, $animate) {
directive.ngEmbedApp = ['$templateCache', '$browser', '$rootScope', '$location', '$sniffer', '$animate', '$exceptionHandler',
function($templateCache, $browser, docsRootScope, $location, $sniffer, $animate, $exceptionHandler) {
return {
terminal: true,
link: function(scope, element, attrs) {
Expand All @@ -214,14 +214,29 @@ directive.ngEmbedApp = ['$templateCache', '$browser', '$rootScope', '$location',
return $location;
}];
this.html5Mode = angular.noop;
this.hashPrefix = function () {
return '';
};
});

$provide.decorator('$rootScope', ['$delegate', function($delegate) {
embedRootScope = $delegate;

// Since we are teleporting the $animate service, which relies on the $$postDigestQueue
// we need the embedded scope to use the same $$postDigestQueue as the outer scope
embedRootScope.$$postDigestQueue = docsRootScope.$$postDigestQueue;
function docsRootDigest() {
var postDigestQueue = docsRootScope.$$postDigestQueue;
while (postDigestQueue.length) {
try {
postDigestQueue.shift()();
} catch (e) {
$exceptionHandler(e);
}
}
}
embedRootScope.$watch(function () {
embedRootScope.$$postDigest(docsRootDigest);
})

deregisterEmbedRootScope = docsRootScope.$watch(function embedRootScopeDigestWatch() {
embedRootScope.$digest();
Expand Down
18 changes: 15 additions & 3 deletions docs/js/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ docsApp.directive.code = function() {

docsApp.directive.sourceEdit = function(getEmbeddedTemplate) {
return NG_DOCS.editExample ? {
template: '<a class="btn pull-right" ng-click="plunkr($event)" href>' +
'<i class="icon-pencil"></i> Edit in Plunkr</a>',
template: '<a class="edit-example pull-right" ng-click="plunkr($event)" href>' +
'<i class="icon-edit"></i> Edit in Plunkr</a>',
scope: true,
controller: function($scope, $attrs, openPlunkr) {
var sources = {
Expand Down Expand Up @@ -518,7 +518,19 @@ docsApp.controller.DocsController = function($scope, $location, $window, section
}
};

angular.module('docsApp', ['ngAnimate', 'bootstrap', 'bootstrapPrettify']).
function module(name, modules, optional) {
if (optional) {
angular.forEach(optional, function(name) {
try {
angular.module(name);
modules.push(name);
} catch(e) {}
});
}
return angular.module(name, modules);
}

module('docsApp', ['bootstrap', 'bootstrapPrettify'], ['ngAnimate']).
config(function($locationProvider) {
if (NG_DOCS.html5Mode) {
$locationProvider.html5Mode(true).hashPrefix('!');
Expand Down
18 changes: 9 additions & 9 deletions docs/partials/api/bundler.default.default.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h1><code ng:non-bindable="">default</code>
<a href="https://github.com/socketstream/socketstream/edit/master/lib/client/bundler/default.js" class="improve-docs"><i class="icon-edit"> </i>Improve this doc</a><a href="https://github.com/socketstream/socketstream/blob/e7beea4/lib/client/bundler/default.js#L33" class="view-source"><i class="icon-eye-open"> </i>View source</a><h1><code ng:non-bindable="">default</code>
<div><span class="hint">service in module <code ng:non-bindable="">bundler</code>
</span>
</div>
Expand All @@ -7,7 +7,7 @@ <h1><code ng:non-bindable="">default</code>
<div class="description"><div class="bundler-default-page bundler-default-default-page"><p>The default bundler of HTML, CSS &amp; JS</p>
</div></div>
<div class="member method"><h2 id="methods">Methods</h2>
<ul class="methods"><li><h3 id="methods_entries">entries(assetType, systemAssets)</h3>
<ul class="methods"><li><a href="https://github.com/socketstream/socketstream/blob/e7beea4/lib/client/bundler/proto.js#L151" class="view-source icon-eye-open"> </a><h3 id="methods_entries">entries(assetType, systemAssets)</h3>
<div class="entries"><div class="bundler-default-page bundler-default-default-entries-page"><p>Provides the view and the pack functions with a
list of entries for an asset type relative to the client directory.
The default implementation is used.</p>
Expand All @@ -26,41 +26,41 @@ <h1><code ng:non-bindable="">default</code>
</div></td></tr></tbody></table><h5 id="methods_entries_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-object">[AssetEntry]</a></td><td><div class="bundler-default-page bundler-default-default-entries-page"><p>List of output entries</p>
</div></td></tr></table></div>
</li>
<li><h3 id="methods_htmltags">htmlTags(type, pack)</h3>
<li><a href="https://github.com/socketstream/socketstream/blob/e7beea4/lib/client/bundler/proto.js#L256" class="view-source icon-eye-open"> </a><h3 id="methods_htmltags">htmlTags(type, pack)</h3>
<div class="htmltags"><div class="bundler-default-page bundler-default-default-htmltags-page"><p>Function called by view.js to build the view HTML</p>
</div><h5 id="methods_htmltags_parameters">Parameters</h5><table class="variables-matrix table table-bordered table-striped"><thead><tr><th>Param</th><th>Type</th><th>Details</th></tr></thead><tbody><tr><td>type</td><td><a href="" class="label type-hint type-hint-string">String</a></td><td><div class="bundler-default-page bundler-default-default-htmltags-page"><p>Either start/js/css</p>
</div></td></tr><tr><td>pack</td><td><a href="" class="label type-hint type-hint-boolean">Boolean</a></td><td><div class="bundler-default-page bundler-default-default-htmltags-page"><p>Pack with resolveAssetLink ?</p>
</div></td></tr></tbody></table><h5 id="methods_htmltags_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-object">[String]</a></td><td><div class="bundler-default-page bundler-default-default-htmltags-page"><p>List of script tag strings</p>
</div></td></tr></table></div>
</li>
<li><h3 id="methods_load">load()</h3>
<li><a href="https://github.com/socketstream/socketstream/blob/e7beea4/lib/client/bundler/proto.js#L50" class="view-source icon-eye-open"> </a><h3 id="methods_load">load()</h3>
<div class="load"><div class="bundler-default-page bundler-default-default-load-page"><p>Called when the server is started. Does nothing.</p>
</div></div>
</li>
<li><h3 id="methods_system">system()</h3>
<li><a href="https://github.com/socketstream/socketstream/blob/e7beea4/lib/client/bundler/proto.js#L171" class="view-source icon-eye-open"> </a><h3 id="methods_system">system()</h3>
<div class="system"><div class="bundler-default-page bundler-default-default-system-page"><p>Return entries for the loader/start/module depending on includes.system client config and system assets.
Multiple arguments will attempt to add module for the name.
Special module names are &#39;loader&#39; and &#39;start&#39;.</p>
</div><h5 id="methods_system_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-assetentry">AssetEntry</a></td><td><div class="bundler-default-page bundler-default-default-system-page"><p>Resource entries array</p>
</div></td></tr></table></div>
</li>
<li><h3 id="methods_tominifiedcss">toMinifiedCSS(files)</h3>
<li><a href="https://github.com/socketstream/socketstream/blob/e7beea4/lib/client/bundler/proto.js#L359" class="view-source icon-eye-open"> </a><h3 id="methods_tominifiedcss">toMinifiedCSS(files)</h3>
<div class="tominifiedcss"><div class="bundler-default-page bundler-default-default-tominifiedcss-page"><p>Minify JavaScript using CleanCSS</p>
</div><h5 id="methods_tominifiedcss_parameters">Parameters</h5><table class="variables-matrix table table-bordered table-striped"><thead><tr><th>Param</th><th>Type</th><th>Details</th></tr></thead><tbody><tr><td>files</td><td><a href="" class="label type-hint type-hint-array">Array</a></td><td><div class="bundler-default-page bundler-default-default-tominifiedcss-page"><p>Entries with file path and content to be minified</p>
</div></td></tr></tbody></table><h5 id="methods_tominifiedcss_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-string">String</a></td><td><div class="bundler-default-page bundler-default-default-tominifiedcss-page"><p>Minified content</p>
</div></td></tr></table></div>
</li>
<li><h3 id="methods_tominifiedjs">toMinifiedJS(files)</h3>
<li><a href="https://github.com/socketstream/socketstream/blob/e7beea4/lib/client/bundler/proto.js#L374" class="view-source icon-eye-open"> </a><h3 id="methods_tominifiedjs">toMinifiedJS(files)</h3>
<div class="tominifiedjs"><div class="bundler-default-page bundler-default-default-tominifiedjs-page"><p>Minify JavaScript using Uglify</p>
</div><h5 id="methods_tominifiedjs_parameters">Parameters</h5><table class="variables-matrix table table-bordered table-striped"><thead><tr><th>Param</th><th>Type</th><th>Details</th></tr></thead><tbody><tr><td>files</td><td><a href="" class="label type-hint type-hint-array">Array</a></td><td><div class="bundler-default-page bundler-default-default-tominifiedjs-page"><p>Entries with file path and content to be minified</p>
</div></td></tr></tbody></table><h5 id="methods_tominifiedjs_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-string">String</a></td><td><div class="bundler-default-page bundler-default-default-tominifiedjs-page"><p>Minified content</p>
</div></td></tr></table></div>
</li>
<li><h3 id="methods_unload">unload()</h3>
<li><a href="https://github.com/socketstream/socketstream/blob/e7beea4/lib/client/bundler/proto.js#L60" class="view-source icon-eye-open"> </a><h3 id="methods_unload">unload()</h3>
<div class="unload"><div class="bundler-default-page bundler-default-default-unload-page"><p>Called when the server is stopped. Does nothing.</p>
</div></div>
</li>
<li><h3 id="methods_wrapcode">wrapCode(assetType, systemAssets)</h3>
<li><a href="https://github.com/socketstream/socketstream/blob/e7beea4/lib/client/bundler/proto.js#L294" class="view-source icon-eye-open"> </a><h3 id="methods_wrapcode">wrapCode(assetType, systemAssets)</h3>
<div class="wrapcode"><div class="bundler-default-page bundler-default-default-wrapcode-page"><p>Before client-side code is sent to the browser any file which is NOT a library (e.g. /client/code/libs)
is wrapped in a module wrapper (to keep vars local and allow you to require() one file in another).</p>
<p>The &#39;system&#39; directory is a special case - any module placed in this dir will not have a leading slash</p>
Expand Down
2 changes: 1 addition & 1 deletion docs/partials/api/bundler.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h1><code ng:non-bindable="">bundler</code>
<a href="https://github.com/socketstream/socketstream/edit/master/lib/client/bundler/index.js" class="improve-docs"><i class="icon-edit"> </i>Improve this doc</a><a href="https://github.com/socketstream/socketstream/blob/e7beea4/lib/client/bundler/index.js#L64" class="view-source"><i class="icon-eye-open"> </i>View source</a><h1><code ng:non-bindable="">bundler</code>
<div><span class="hint"></span>
</div>
</h1>
Expand Down
4 changes: 2 additions & 2 deletions docs/partials/api/bundler.webpack.webpack.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h1><code ng:non-bindable="">webpack</code>
<a href="https://github.com/socketstream/socketstream/edit/master/lib/client/bundler/webpack.js" class="improve-docs"><i class="icon-edit"> </i>Improve this doc</a><a href="https://github.com/socketstream/socketstream/blob/e7beea4/lib/client/bundler/webpack.js#L22" class="view-source"><i class="icon-eye-open"> </i>View source</a><h1><code ng:non-bindable="">webpack</code>
<div><span class="hint">service in module <code ng:non-bindable="">bundler</code>
</span>
</div>
Expand All @@ -8,7 +8,7 @@ <h1><code ng:non-bindable="">webpack</code>
<p>This is just for demonstration purposes and to validate the custom bundler concept. It can be improved.</p>
</div></div>
<div class="member method"><h2 id="methods">Methods</h2>
<ul class="methods"><li><h3 id="methods_entries">entries(assetType, systemAssets)</h3>
<ul class="methods"><li><a href="https://github.com/socketstream/socketstream/blob/e7beea4/lib/client/bundler/webpack.js#L73" class="view-source icon-eye-open"> </a><h3 id="methods_entries">entries(assetType, systemAssets)</h3>
<div class="entries"><div class="bundler-webpack-page bundler-webpack-default-entries-page"><p>Provides the view and the pack functions with a
list of entries for an asset type relative to the client directory.</p>
</div><h5 id="methods_entries_parameters">Parameters</h5><table class="variables-matrix table table-bordered table-striped"><thead><tr><th>Param</th><th>Type</th><th>Details</th></tr></thead><tbody><tr><td>assetType</td><td><a href="" class="label type-hint type-hint-string">String</a></td><td><div class="bundler-webpack-page bundler-webpack-default-entries-page"><p>js/css/tmpl</p>
Expand Down
2 changes: 1 addition & 1 deletion docs/partials/api/client.define.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h1><code ng:non-bindable="">define</code>
<a href="https://github.com/socketstream/socketstream/edit/master/lib/client/index.js" class="improve-docs"><i class="icon-edit"> </i>Improve this doc</a><a href="https://github.com/socketstream/socketstream/blob/e7beea4/lib/client/index.js#L197" class="view-source"><i class="icon-eye-open"> </i>View source</a><h1><code ng:non-bindable="">define</code>
<div><span class="hint">service in module <code ng:non-bindable="">client</code>
</span>
</div>
Expand Down
4 changes: 2 additions & 2 deletions docs/partials/api/client.formatters.formatters.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h1><code ng:non-bindable="">formatters</code>
<a href="https://github.com/socketstream/socketstream/edit/master/lib/client/index.js" class="improve-docs"><i class="icon-edit"> </i>Improve this doc</a><a href="https://github.com/socketstream/socketstream/blob/e7beea4/lib/client/index.js#L117" class="view-source"><i class="icon-eye-open"> </i>View source</a><h1><code ng:non-bindable="">formatters</code>
<div><span class="hint">service in module <code ng:non-bindable="">client</code>
</span>
</div>
Expand All @@ -7,7 +7,7 @@ <h1><code ng:non-bindable="">formatters</code>
<div class="description"><div class="client-formatters-page client-formatters-formatters-page"><p>This is for the module returned by <code>require(&#39;socketstream&#39;).client.formatters</code>.</p>
</div></div>
<div class="member method"><h2 id="methods">Methods</h2>
<ul class="methods"><li><h3 id="methods_add">add(nameOrModule, config)</h3>
<ul class="methods"><li><a href="https://github.com/socketstream/socketstream/blob/e7beea4/lib/client/formatters.js#L25" class="view-source icon-eye-open"> </a><h3 id="methods_add">add(nameOrModule, config)</h3>
<div class="add"><h5 id="methods_add_parameters">Parameters</h5><table class="variables-matrix table table-bordered table-striped"><thead><tr><th>Param</th><th>Type</th><th>Details</th></tr></thead><tbody><tr><td>nameOrModule</td><td><a href="" class="label type-hint type-hint-string">string</a><a href="" class="label type-hint type-hint-object">object</a></td><td><div class="client-formatters-page client-formatters-formatters-add-page"><p>the formatter object or name</p>
</div></td></tr><tr><td>config</td><td><a href="" class="label type-hint type-hint-object">object</a></td><td><div class="client-formatters-page client-formatters-formatters-add-page"><p>parameters configuring the formatter</p>
</div></td></tr></tbody></table></div>
Expand Down
2 changes: 1 addition & 1 deletion docs/partials/api/client.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h1><code ng:non-bindable="">client</code>
<a href="https://github.com/socketstream/socketstream/edit/master/lib/client/index.js" class="improve-docs"><i class="icon-edit"> </i>Improve this doc</a><a href="https://github.com/socketstream/socketstream/blob/e7beea4/lib/client/index.js#L63" class="view-source"><i class="icon-eye-open"> </i>View source</a><h1><code ng:non-bindable="">client</code>
<div><span class="hint"></span>
</div>
</h1>
Expand Down
6 changes: 3 additions & 3 deletions docs/partials/api/client.templateEngine.templateEngine.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h1><code ng:non-bindable="">templateEngine</code>
<a href="https://github.com/socketstream/socketstream/edit/master/lib/client/index.js" class="improve-docs"><i class="icon-edit"> </i>Improve this doc</a><a href="https://github.com/socketstream/socketstream/blob/e7beea4/lib/client/index.js#L125" class="view-source"><i class="icon-eye-open"> </i>View source</a><h1><code ng:non-bindable="">templateEngine</code>
<div><span class="hint">service in module <code ng:non-bindable="">client</code>
</span>
</div>
Expand All @@ -7,7 +7,7 @@ <h1><code ng:non-bindable="">templateEngine</code>
<div class="description"><div class="client-templateengine-page client-templateengine-templateengine-page"><p>This is for the module returned by <code>require(&#39;socketstream&#39;).client.templateEngine</code>.</p>
</div></div>
<div class="member method"><h2 id="methods">Methods</h2>
<ul class="methods"><li><h3 id="methods_generate">generate(bundler, files, cb)</h3>
<ul class="methods"><li><a href="https://github.com/socketstream/socketstream/blob/e7beea4/lib/client/template_engine.js#L140" class="view-source icon-eye-open"> </a><h3 id="methods_generate">generate(bundler, files, cb)</h3>
<div class="generate"><div class="client-templateengine-page client-templateengine-templateengine-generate-page"><p>Generate output (as a string) from Template Engines</p>
<pre><code>function(out) {
if (typeof out === &#39;string&#39;) {
Expand All @@ -26,7 +26,7 @@ <h1><code ng:non-bindable="">templateEngine</code>
</ul>
</div></td></tr></tbody></table></div>
</li>
<li><h3 id="methods_use">use(name, dirs, config)</h3>
<li><a href="https://github.com/socketstream/socketstream/blob/e7beea4/lib/client/template_engine.js#L58" class="view-source icon-eye-open"> </a><h3 id="methods_use">use(name, dirs, config)</h3>
<div class="use"><div class="client-templateengine-page client-templateengine-templateengine-use-page"><p>Use a template engine for the &#39;dirs&#39; indicated (will use it on all &#39;/&#39; dirs within /client/templates by default)</p>
<p>To make templates in <code>/client/ember-view</code> available in Ember.</p>
<pre><code>ss.client.templateEngine.use(&#39;ember&#39;,&#39;./ember-view&#39;);
Expand Down
2 changes: 1 addition & 1 deletion docs/partials/api/events.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h1><code ng:non-bindable="">events</code>
<a href="https://github.com/socketstream/socketstream/edit/master/lib/socketstream.js" class="improve-docs"><i class="icon-edit"> </i>Improve this doc</a><a href="https://github.com/socketstream/socketstream/blob/e7beea4/lib/socketstream.js#L106" class="view-source"><i class="icon-eye-open"> </i>View source</a><h1><code ng:non-bindable="">events</code>
<div><span class="hint"></span>
</div>
</h1>
Expand Down
Loading

0 comments on commit 9181ca7

Please sign in to comment.