Skip to content

Commit

Permalink
docs: code annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
D-Sketon committed Apr 30, 2024
1 parent f2e2326 commit fa58a32
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/extend/console.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ interface Alias {
[abbreviation: string]: string
}

/**
* The console forms the bridge between Hexo and its users. It registers and describes the available console commands.
*/
class Console {
public store: Store;
public alias: Alias;
Expand Down
3 changes: 3 additions & 0 deletions lib/extend/deployer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ interface Store {
[key: string]: StoreFunction
}

/**
* A deployer helps users quickly deploy their site to a remote server without complicated commands.
*/
class Deployer {
public store: Store;

Expand Down
4 changes: 4 additions & 0 deletions lib/extend/filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ interface Store {
[key: string]: StoreFunction[]
}

/**
* A filter is used to modify some specified data. Hexo passes data to filters in sequence and the filters then modify the data one after the other.
* This concept was borrowed from WordPress.
*/
class Filter {
public store: Store;

Expand Down
3 changes: 3 additions & 0 deletions lib/extend/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ interface Store {
[key: string]: StoreFunction
}

/**
* A generator builds routes based on processed files.
*/
class Generator {
public id: number;
public store: Store;
Expand Down
4 changes: 3 additions & 1 deletion lib/extend/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ interface Store {
[key: string]: StoreFunction
}


/**
* A helper makes it easy to quickly add snippets to your templates. We recommend using helpers instead of templates when you’re dealing with more complicated code.
*/
class Helper {
public store: Store;

Expand Down
4 changes: 4 additions & 0 deletions lib/extend/injector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ type Store = {
};
};

/**
* An injector is used to add static code snippet to the `<head>` or/and `<body>` of generated HTML files.
* Hexo run injector before `after_render:html` filter is executed.
*/
class Injector {
public store: Store;
public cache: any;
Expand Down
3 changes: 3 additions & 0 deletions lib/extend/migrator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ interface Store {
[key: string]: StoreFunction
}

/**
* A migrator helps users migrate from other systems to Hexo.
*/
class Migrator {
public store: Store;

Expand Down
4 changes: 4 additions & 0 deletions lib/extend/processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ type Store = {
}[];

type patternType = Exclude<ConstructorParameters<typeof Pattern>[0], ((str: string) => string)>;

/**
* A processor is used to process source files in the `source` folder.
*/
class Processor {
public store: Store;

Expand Down
3 changes: 3 additions & 0 deletions lib/extend/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ interface Store {
[key: string]: StoreFunction;
}

/**
* A renderer is used to render content.
*/
class Renderer {
public store: Store;
public storeSync: SyncStore;
Expand Down
3 changes: 3 additions & 0 deletions lib/extend/tag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,9 @@ type RegisterOptions = {
ends?: boolean;
}

/**
* A tag allows users to quickly and easily insert snippets into their posts.
*/
class Tag {
public env: Environment;
public source: string;
Expand Down

0 comments on commit fa58a32

Please sign in to comment.