-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initial work on documentation using typedoc from https://github.com/s…
- Loading branch information
1 parent
108472e
commit de92b69
Showing
21 changed files
with
364 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export var NAME:string = 'com.github.gregoranders.arts.docs'; | ||
|
||
export var SERVICE: string = NAME + '.service'; | ||
|
||
export var VERSION:string = '0.0.1'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import Arts = require("../arts/Arts"); | ||
|
||
import IndexController = require("./controller/IndexController"); | ||
import DocsService = require("./service/DocsService"); | ||
import Component = require("./Component"); | ||
|
||
class ModuleConfiguration extends Arts.BaseConfiguration { | ||
|
||
static NAME:string = Component.NAME + '.configuration'; | ||
|
||
static $inject:Array<string> = [ | ||
'$routeProvider', | ||
'$controllerProvider', | ||
'$provide', | ||
'$compileProvider', | ||
'$translateProvider', | ||
'$translatePartialLoaderProvider' | ||
]; | ||
|
||
constructor(protected $routeProvider:angular.route.IRouteProvider, | ||
protected $controllerProvider:angular.IControllerProvider, | ||
protected $provideService:ng.auto.IProvideService, | ||
protected $compileProvider:ng.ICompileProvider, | ||
protected $translateProvider:ng.translate.ITranslateProvider, | ||
protected $translatePartialLoaderProvider:ng.translate.ITranslatePartialLoaderService) { | ||
|
||
super($routeProvider, $controllerProvider, $provideService, $compileProvider, $translateProvider); | ||
|
||
var component:Arts.IApplication = <Arts.IApplication>Arts.Arts.getModule(DocsComponent.NAME) | ||
.initModule($routeProvider, $controllerProvider, $provideService, $compileProvider), | ||
basePath = component.getBaseURL(); | ||
|
||
// routing | ||
super.when('/docs', { | ||
name: 'docs', | ||
templateUrl: basePath + 'view/main.html', | ||
controller: IndexController | ||
}); | ||
|
||
$translatePartialLoaderProvider.addPart('docs'); | ||
|
||
component.service(<any>DocsService); | ||
} | ||
} | ||
|
||
class DocsComponent extends Arts.BaseModule { | ||
|
||
static NAME:string = Component.NAME; | ||
|
||
static DEPENDENCIES:Array<string> = ['pascalprecht.translate']; | ||
|
||
constructor(baseURL:string) { | ||
super(DocsComponent.NAME, baseURL, DocsComponent.DEPENDENCIES, ModuleConfiguration); | ||
Arts.Arts.registerModule(DocsComponent.NAME, this); | ||
} | ||
|
||
static initializeComponents(basePath:string):DocsComponent { | ||
return new DocsComponent(basePath); | ||
} | ||
} | ||
|
||
export = DocsComponent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
import Arts = require('../../arts/Arts'); | ||
import Component = require('../Component'); | ||
import IDocsService = require('../service/IDocsService'); | ||
import Model = require('../model/IDocsModel'); | ||
|
||
interface IScope extends Arts.IScope<IController> { | ||
|
||
} | ||
|
||
interface IController extends Arts.IController<IScope> { | ||
|
||
selectedTabIndex: number; | ||
docs: Model.IDocs; | ||
documentation: any; | ||
|
||
toggleSideBar(id:string): void; | ||
|
||
switchToTab(group:Model.IDocsGroup): void; | ||
} | ||
|
||
class IndexController extends Arts.BaseController<IScope> implements IController { | ||
|
||
static $inject:string[] = ['$scope', '$mdSidenav', '$mdToast', '$mdBottomSheet', Component.SERVICE]; | ||
|
||
selectedTabIndex:number = 0; | ||
|
||
bottomSheetPromise:ng.IPromise<void>; | ||
|
||
docs:Model.IDocs = null; | ||
|
||
documentation: any = { | ||
classes: null | ||
}; | ||
|
||
private baseURL:string; | ||
|
||
constructor(public $scope:IScope, private $mdSidenav:ng.material.MDSidenavService, | ||
private $mdToast:ng.material.MDToastService, | ||
private $mdBottomSheet:ng.material.MDBottomSheetService, | ||
private IDocsService:IDocsService) { | ||
super($scope); | ||
|
||
var component:Arts.IApplication = <Arts.IApplication>Arts.Arts.getModule(Component.NAME); | ||
|
||
this.baseURL = component.getBaseURL(); | ||
|
||
IDocsService.getDocs() | ||
.success((data:any):void => { | ||
this.docs = data; | ||
}) | ||
.error((data:any):void => { | ||
console.log(data); | ||
}) | ||
} | ||
|
||
toggleSideBar(id:string):void { | ||
this.$mdSidenav(id).toggle(); | ||
} | ||
|
||
switchToTab(group:Model.IDocsGroup):void { | ||
|
||
var obj: any = []; | ||
|
||
this.documentation = {}; | ||
|
||
angular.forEach(group.children, (element: number) => { | ||
var def = this.findObjectById(element, this.docs); | ||
|
||
if (def) { | ||
obj.push(def); | ||
} | ||
}); | ||
|
||
this.documentation.classes = obj; | ||
this.selectedTabIndex = this.docs.groups.indexOf(group); | ||
this.$mdSidenav('left').close(); | ||
} | ||
|
||
findObjectById(id: number, docs: Model.IDocs): Model.IDocBaseId { | ||
var retval: Model.IDocBaseId = null; | ||
angular.forEach(docs.children, (element: Model.IDocBaseId): void => { | ||
if (element.id === id) { | ||
retval = element; | ||
return; | ||
} | ||
}); | ||
|
||
return retval; | ||
} | ||
} | ||
|
||
export = IndexController; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"com": { | ||
"github": { | ||
"gregoranders": { | ||
"arts": { | ||
"docs": { | ||
"documentation": "Dokumentation" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"com": { | ||
"github": { | ||
"gregoranders": { | ||
"arts": { | ||
"docs": { | ||
"documentation": "Documentation" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"com": { | ||
"github": { | ||
"gregoranders": { | ||
"arts": { | ||
"docs": { | ||
"documentation": "Dokumentacja" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"com": { | ||
"github": { | ||
"gregoranders": { | ||
"arts": { | ||
"docs": { | ||
"documentation": "документация" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
export interface IDocBaseKind { | ||
kind: number; | ||
} | ||
|
||
export interface IDocBaseId extends IDocBaseKind { | ||
id: number; | ||
} | ||
|
||
export interface IDocBase extends IDocBaseId { | ||
name: string; | ||
} | ||
|
||
export interface IDocs extends IDocBase { | ||
groups: IDocsGroups; | ||
children: IDocsChildren; | ||
} | ||
|
||
export interface IDocsGroups extends Array<IDocsGroup> { | ||
[index: number]: IDocsGroup; | ||
} | ||
|
||
export interface IDocsChildren extends Array<IDocBaseId> { | ||
[index: number]: IDocBaseId; | ||
} | ||
|
||
export interface IDocsGroup extends IDocBaseKind { | ||
title: string; | ||
children: any; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import Arts = require('../../arts/Arts'); | ||
import IDocsService = require('./IDocsService'); | ||
import Component = require('../Component'); | ||
import Model = require('../model/IDocsModel'); | ||
|
||
class DocsService extends Arts.BaseService implements IDocsService { | ||
/** | ||
* Class name. | ||
* | ||
* @type {string} | ||
*/ | ||
static NAME:string = Component.SERVICE; | ||
|
||
static $inject:Array<string> = ['$http']; | ||
|
||
constructor(private $http:ng.IHttpService) { | ||
super(DocsService.NAME); | ||
} | ||
|
||
getDocs():ng.IHttpPromise<Model.IDocs> { | ||
var component:Arts.IApplication = <Arts.IApplication>Arts.Arts.getModule(Component.NAME), | ||
basePath = component.getBaseURL(); | ||
|
||
return this.$http.get(basePath + 'l10n/docs.json'); | ||
} | ||
} | ||
|
||
export = DocsService; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import Arts = require('../../arts/Arts'); | ||
import Component = require('../Component'); | ||
import Model = require('../model/IDocsModel'); | ||
|
||
interface IDocsService extends Arts.IService { | ||
getDocs(): ng.IHttpPromise<Model.IDocs>; | ||
} | ||
|
||
export = IDocsService; |
Oops, something went wrong.