Skip to content

Commit

Permalink
Added GitHubHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastian-lenz committed Aug 31, 2014
1 parent 14e5783 commit a35ee65
Show file tree
Hide file tree
Showing 10 changed files with 736 additions and 26 deletions.
6 changes: 5 additions & 1 deletion bin/themes/default/partials/member.sources.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
{{#if sources}}
<ul>
{{#each sources}}
<li>Defined in {{fileName}}:{{line}}</li>
{{#if url}}
<li>Defined in <a href="{{url}}">{{fileName}}:{{line}}</a></li>
{{else}}
<li>Defined in {{fileName}}:{{line}}</li>
{{/if}}
{{/each}}
</ul>
{{/if}}
Expand Down
132 changes: 126 additions & 6 deletions bin/typedoc.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ declare var Util: any;
declare var VM: any;
declare var Path: any;
declare var FS: any;
declare var ShellJS: any;
declare var typeScriptPath: any;
declare module TypeScript {
class SourceFile {
Expand Down Expand Up @@ -1073,6 +1074,41 @@ declare module TypeDoc.Factories {
private onEndDeclaration(state);
}
}
declare module TypeDoc.Factories {
/**
* A handler that watches for repositories with GitHub origin and links
* their source files to the related GitHub pages.
*/
class GitHubHandler extends BaseHandler {
/**
* List of known repositories.
*/
private repositories;
/**
* List of paths known to be not under git control.
*/
private ignoredPaths;
/**
* Create a new GitHubHandler instance.
*
* @param dispatcher The dispatcher this handler should be attached to.
*/
constructor(dispatcher: Dispatcher);
/**
* Check whether the given file is placed inside a repository.
*
* @param fileName The name of the file a repository should be looked for.
* @returns The found repository info or NULL.
*/
private getRepository(fileName);
/**
* Triggered when the dispatcher leaves the resolving phase.
*
* @param event An event object containing the related project and compiler instance.
*/
private onEndResolve(event);
}
}
declare module TypeDoc.Factories {
/**
* A handler that sorts and groups the found reflections in the resolving phase.
Expand Down Expand Up @@ -1922,6 +1958,10 @@ declare module TypeDoc.Models {
* The number of the line that emitted the declaration.
*/
line: number;
/**
* URL for displaying the source file.
*/
url?: string;
}
/**
* A reflection that represents a single declaration emitted by the TypeScript compiler.
Expand Down Expand Up @@ -2182,30 +2222,110 @@ declare module TypeDoc.Models {
}
}
declare module TypeDoc.Models {
/**
* Exposes information about a directory containing source files.
*
* One my access the root directory of a project through the [[ProjectReflection.directory]]
* property. Traverse through directories by utilizing the [[SourceDirectory.parent]] or
* [[SourceDirectory.directories]] properties.
*/
class SourceDirectory {
public name: string;
public dirName: string;
public url: string;
/**
* The parent directory or NULL if this is a root directory.
*/
public parent: SourceDirectory;
/**
* A list of all subdirectories.
*/
public directories: {
[name: string]: SourceDirectory;
};
/**
* A list of all files in this directory.
*/
public files: SourceFile[];
public groups: ReflectionGroup[];
/**
* The name of this directory.
*/
public name: string;
/**
* The relative path from the root directory to this directory.
*/
public dirName: string;
/**
* The url of the page displaying the directory contents.
*/
public url: string;
/**
* Create a new SourceDirectory instance.
*
* @param name The new of directory.
* @param parent The parent directory instance.
*/
constructor(name?: string, parent?: SourceDirectory);
/**
* Return a string describing this directory and its contents.
*
* @param indent Used internally for indention.
* @returns A string representing this directory and all of its children.
*/
public toString(indent?: string): string;
/**
* Return a list of all reflections exposed by the files within this directory.
*
* @returns An aggregated list of all [[DeclarationReflection]] defined in the
* files of this directory.
*/
public getAllReflections(): DeclarationReflection[];
}
}
declare module TypeDoc.Models {
/**
* Exposes information about a source file.
*
* One my access a list of all source files through the [[ProjectReflection.files]] property or as
* a tree structure through the [[ProjectReflection.directory]] property.
*
* Furthermore each reflection carries references to the related SourceFile with their
* [[DeclarationReflection.sources]] property. It is an array of of [[IDeclarationSource]] instances
* containing the reference in their [[IDeclarationSource.file]] field.
*/
class SourceFile {
public name: string;
/**
* The original full system file name.
*/
public fullFileName: string;
/**
* A trimmed version of the file name. Contains only the path relative to the
* determined base path.
*/
public fileName: string;
/**
* The base name of the file.
*/
public name: string;
/**
* A url pointing to a page displaying the contents of this file.
*/
public url: string;
/**
* The representation of the parent directory of this source file.
*/
public parent: SourceDirectory;
/**
* A list of all reflections that are declared in this file.
*/
public reflections: DeclarationReflection[];
/**
* A grouped list of the reflections declared in this file.
*/
public groups: ReflectionGroup[];
constructor(fileName: string);
/**
* Create a new SourceFile instance.
*
* @param fullFileName The full file name.
*/
constructor(fullFileName: string);
}
}
declare module TypeDoc.Models {
Expand Down
Loading

0 comments on commit a35ee65

Please sign in to comment.