Skip to content
This repository has been archived by the owner on May 8, 2020. It is now read-only.

Commit

Permalink
feat(documentation): Further documentation tweaks to layouts
Browse files Browse the repository at this point in the history
  • Loading branch information
zakhenry committed Jun 1, 2016
1 parent b2d6c6b commit 9340646
Show file tree
Hide file tree
Showing 13 changed files with 140 additions and 14 deletions.
4 changes: 2 additions & 2 deletions docs/404.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
layout: basic.html
layout: basic.hbs
------------------

# OOPS! Can't find that page
# OOPS! Can't find that page
8 changes: 8 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: API
date: 2016-05-29
collection: main
layout: api-container.hbs
-------------------------

This contains the api output from typedoc
8 changes: 8 additions & 0 deletions docs/guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: Developer Guide
date: 2016-05-29
collection: main
layout: guide-listing.hbs
-------------------------

Here is the guide document
54 changes: 54 additions & 0 deletions docs/guide/controllers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
title: Controllers
date: 2016-06-01
collection: guide
layout: guide.hbs
-----------------

### Example controller

```typescript
import { Injectable } from '@angular/core';
import {
Server,
RouteBase,
AbstractController,
Logger,
Request,
RouteParamMap,
Action
} from '@ubiquits/core/server';
import { AbstractModel, ModelStore } from '@ubiquits/core/common';
import { User } from '../../common/models/user.model';
import { UserStore } from '../stores/user.store';
@Injectable()
@RouteBase('test')
export class TestController extends AbstractController {
constructor(server: Server, logger: Logger, protected userStore:UserStore) {
super(server, logger);
logger.info(`route base is ${this.routeBase}`);

}


@Action('GET', '/test-route')
public test() {
return 'hello world';
}

protected getOneById(request: Request, routeParams: RouteParamMap): User {

let user = this.userStore.findOne(routeParams.get('id'));
this.logger.debug(user, user.getIdentifier());

return user;

}

}
```
29 changes: 29 additions & 0 deletions docs/guide/database.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: Database
date: 2016-06-01
collection: guide
layout: guide.hbs
-----------------

### Example database query

```typescript
import { Injectable } from '@angular/core';
import {
Database,
} from '@ubiquits/core/server';
@Injectable()
export class ExampleUtil {
constructor(database: Database, logger:Logger) {
database.query('SELECT * FROM users').then((result) => {
logger.debug(result);
}):
}
}
```
9 changes: 3 additions & 6 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
---
layout: home.html
-----------------
layout: home.hbs
----------------

## Test post listing!

- [Test post](/posts/test-post/)
- [@todo items for docs](/posts/documentation-todo/)
## Welcome...
8 changes: 8 additions & 0 deletions docs/news.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: News
date: 2016-06-01
collection: main
layout: news-listing.hbs
------------------------

Here is the news listing
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
title: Documentation Todos
date: 2016-05-29
layout: post.html
collection: news
layout: post.hbs
-----------------
These are the items I would like to integrate into the documentation

- integrate into toolchain so all projects can use it.
- add logo
- complete homepage
- add logo.
- complete homepage.
- typedoc integration (use same templates??)
- travis ci auto deployments
- custom domain hosting from [ubiquits.com](http://ubiquits.com)
Expand All @@ -17,6 +17,5 @@ These are the items I would like to integrate into the documentation
- [gists](https://github.com/expalmer/metalsmith-gist)
- [headings](https://github.com/segmentio/metalsmith-headings)
- [navigation](https://github.com/unstoppablecarl/metalsmith-navigation)
- [rho](https://github.com/inca/metalsmith-rho)
- [less](https://github.com/christophercliff/metalsmith-less)
- [wordcount](https://github.com/majodev/metalsmith-word-count)
8 changes: 8 additions & 0 deletions docs/news/local-layout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: Test Local layout post
date: 2016-05-31
collection: news
layout: test.hbs
-----------------

This tests the local layout option
3 changes: 2 additions & 1 deletion docs/posts/test-post.md → docs/news/test-post.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
title: Test Post
date: 2016-05-29
layout: post.html
collection: news
layout: post.hbs
-----------------

### Example controller
Expand Down
1 change: 1 addition & 0 deletions docs/templates/partials/test.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<section><h3>This is a partial</h3></section>
7 changes: 7 additions & 0 deletions docs/templates/test.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{{> header }}

{{> test }}

{{{ contents }}}

{{> footer }}
6 changes: 6 additions & 0 deletions src/server/services/database.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Logger } from './logger.service';
import { Injectable } from '@angular/core';
import * as Sequelize from 'sequelize';
import { QueryOptions } from 'sequelize';

@Injectable()
export class Database {
Expand Down Expand Up @@ -43,6 +44,7 @@ export class Database {
});

});

}

public createSchema(schemaName: string): Promise<any> {
Expand All @@ -54,4 +56,8 @@ export class Database {

}

public query(sql:string, options:QueryOptions): Promise<any> {
return this.driver.query(sql, options);
}

}

0 comments on commit 9340646

Please sign in to comment.