Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion src/lib/output/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class Renderer extends ChildableComponent<Application, RendererComponent>
type: ParameterType.String,
defaultValue: 'default'
})
themeName:string
themeName:string;

@Option({
name: 'disableOutputCheck',
Expand All @@ -78,7 +78,32 @@ export class Renderer extends ChildableComponent<Application, RendererComponent>
})
disableOutputCheck:boolean;

@Option({
name: 'gaID',
help: 'Set the Google Analytics tracking ID and activate tracking code.'
})
gaID:string;

@Option({
name: 'gaSite',
help: 'Set the site name for Google Analytics. Defaults to `auto`.',
defaultValue: 'auto'
})
gaSite:string;

@Option({
name: 'hideGenerator',
help: 'Do not print the TypeDoc link at the end of the page.',
type: ParameterType.Boolean
})
hideGenerator:boolean;

@Option({
name: 'entryPoint',
help: 'Specifies the fully qualified name of the root symbol. Defaults to global namespace.',
type: ParameterType.String
})
entryPoint:string;

/**
* Create a new Renderer instance.
Expand Down
8 changes: 4 additions & 4 deletions src/lib/output/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import {ProjectReflection} from "../models/reflections/project";
import {UrlMapping} from "./models/UrlMapping";
import {NavigationItem} from "./models/NavigationItem";
import {RendererComponent} from "./components";
import {Component} from "../utils/component";
import {Component, Option} from "../utils/component";
import {Resources} from "./utils/resources";

import {ParameterType} from "../utils/options/declaration";

/**
* Base class of all themes.
Expand Down Expand Up @@ -50,15 +50,15 @@ import {Resources} from "./utils/resources";
* of TypeDoc. If this file is not present, an instance of [[DefaultTheme]] will be used to render
* this theme.
*/
@Component({name:"rendrer:theme", internal:true})
@Component({name:"theme", internal:true})
export class Theme extends RendererComponent
{
/**
* The base path of this theme.
*/
basePath:string;

resources:Resources;
resources:Resources;


/**
Expand Down
35 changes: 3 additions & 32 deletions src/lib/output/themes/DefaultTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ import {ReflectionGroup} from "../../models/ReflectionGroup";
import {UrlMapping} from "../models/UrlMapping";
import {NavigationItem} from "../models/NavigationItem";
import {RendererEvent} from "../events";
import {Option} from "../../utils/component";
import {ParameterType} from "../../utils/options/declaration";

import {Component} from "../../utils/component";

/**
* Defines a mapping of a [[Models.Kind]] to a template file.
Expand Down Expand Up @@ -47,34 +45,7 @@ export interface ITemplateMapping
* [[BaseTheme]] implementation, this theme class will be used.
*/
export class DefaultTheme extends Theme
{
@Option({
name: 'gaID',
help: 'Set the Google Analytics tracking ID and activate tracking code.'
})
gaID:string;

@Option({
name: 'gaSite',
help: 'Set the site name for Google Analytics. Defaults to `auto`.',
defaultValue: 'auto'
})
gaSite:string;

@Option({
name: 'hideGenerator',
help: 'Do not print the TypeDoc link at the end of the page.',
type: ParameterType.Boolean
})
hideGenerator:boolean;

@Option({
name: 'entryPoint',
help: 'Specifies the fully qualified name of the root symbol. Defaults to global namespace.',
type: ParameterType.String
})
entryPoint:string;

{
/**
* Mappings of reflections kinds to templates used by this theme.
*/
Expand Down Expand Up @@ -170,7 +141,7 @@ export class DefaultTheme extends Theme
* @returns The reflection that should be used as the entry point.
*/
getEntryPoint(project:ProjectReflection):ContainerReflection {
var entryPoint = this.entryPoint;
var entryPoint = this.owner.entryPoint;
if (entryPoint) {
var reflection = project.getChildByName(entryPoint);
if (reflection) {
Expand Down
3 changes: 2 additions & 1 deletion test/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,10 @@ describe('Renderer', function() {
it('constructs', function() {
app = new TypeDoc.Application({
mode: 'Modules',
logger: 'none',
logger: 'console',
target: 'ES5',
module: 'CommonJS',
gaSite: 'foo.com', // verify theme option without modifying output
noLib: true
});
});
Expand Down